正式なドキュメントは英語版であり、この日本語訳はAI支援翻訳により作成された参考用のものです。日本語訳の一部の内容は人間によるレビューがまだ行われていないため、翻訳のタイミングにより英語版との間に差異が生じることがあります。最新かつ正確な情報については、英語版をご参照ください。

サポートされる拡張機能と言語

  • プラン: Premium、Ultimate
  • アドオン: GitLab Duo Core、Pro、またはEnterprise、GitLab Duo with Amazon Q
  • 提供形態: GitLab.com、GitLab Self-Managed、GitLab Dedicated

コード提案は、以下のエディタ拡張機能と言語で利用できます。

サポートされているエディタ拡張機能

コード提案を使用するには、次のいずれかのエディタ拡張機能を使用します:

IDE拡張機能
Visual Studio Code(VS Code)VS Code用GitLab Workflow拡張機能
GitLab Web IDE(クラウド上のVS Code)必要な設定はありません。
Microsoft Visual Studio(Windows版2022)Visual Studio GitLab extension
JetBrains IDEGitLab Duo Plugin for JetBrains
Neovimgitlab.vimプラグイン
EclipseGitLab for Eclipse

GitLab言語サーバーが、VS Code、Visual Studio、Eclipse、Neovimで使用されています。この言語サーバーは、より多くのプラットフォームでより高速なイテレーションをサポートします。公式サポートがGitLabから提供されていないIDEでコード提案をサポートするように設定することもできます。

他のIDE拡張機能のサポートについては、このイシューで関心を示すことができます。

IDE別のサポート対象言語

次の表では、コード提案がデフォルトでサポートする言語とIDEについて詳しく説明します。

コード提案は他の言語でも動作しますが、手動でサポートを追加する必要があります。

言語Web IDEVS CodeJetBrains IDEVisual Studio 2022 for WindowsNeovimEclipse
Ccheck-circle-filled 対応check-circle-filled 対応dash-circle 非対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
C++check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
C#check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
CSScheck-circle-filled 対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応
Gocheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Google SQLcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応dash-circle 非対応
HAMLcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
```htmlcheck-circle-filled 対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応
Javacheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
JavaScriptcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Kotlindash-circle 非対応check-circle-filled 対応

(Kotlinサポートを提供するサードパーティ製拡張機能が必要です)
check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Markdowncheck-circle-filled 対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応dash-circle 非対応
PHPcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Pythoncheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Rubycheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Rustcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Scaladash-circle 非対応check-circle-filled 対応

(Scalaサポートを提供するサードパーティ製拡張機能が必要です)
check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
シェルスクリプト(bashのみ)check-circle-filled 対応dash-circle 非対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Sveltecheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Swiftcheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
TypeScript(.tsおよび.tsxファイル)check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応
Terraformdash-circle 非対応check-circle-filled 対応

(Terraformサポートを提供するサードパーティ製拡張機能が必要です)
check-circle-filled 対応dash-circle 非対応check-circle-filled 対応

terraformファイルタイプを提供するサードパーティ製拡張機能が必要です)
check-circle-filled 対応
Vuecheck-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応check-circle-filled 対応

一部の言語は、すべてのJetBrains IDEでサポートされていません。または、追加のプラグインサポートが必要な場合があります。お使いのIDEの具体的な内容については、JetBrainsのドキュメントを参照してください。

Infrastructure as Code(IaC)のサポート

コード提案は、次のものを含むInfrastructure as Codeのインターフェースで動作します:

  • Kubernetesリソースモデル(KRM)
  • Google Cloud CLI
  • Terraform

コード提案の言語を管理する

特定のサポートされている言語に対してコード提案を有効または無効にすることで、VS Codeでのコーディングエクスペリエンスをカスタマイズできます。これは、settings.jsonファイルを直接編集するか、VS Codeユーザーインターフェースから行うことができます:

  1. VS Codeで、GitLab Workflowの拡張機能設定を開きます:
    1. 上部のバーで、コード > 設定 > Extensions(拡張機能)に移動します。
    2. リストでGitLab Workflowを検索し、管理 ( settings ) を選択します。
    3. Extension Settingsを選択します。
  2. ユーザーの設定で、AIアシストコード提案: サポートされている言語を有効にするというセクションを見つけます。
  3. 言語のコード提案を有効にするには、そのチェックボックスをオンにします。
  4. 言語のコード提案を無効にするには、そのチェックボックスをオフにします。
  5. 変更は自動的に保存され、すぐに有効になります。

言語のコード提案を無効にすると、Duoアイコンが変わり、この言語では提案が無効になっていることが示されます。カーソルを合わせると、Code Suggestions are disabled for this language(この言語ではコード提案が無効になっている)と表示されます。

より多くの言語のサポートを追加

目的の言語でコード提案がデフォルトで使用できない場合は、ローカルで言語のサポートを追加できます。ただし、コード提案が期待どおりに機能しない可能性があります。

前提要件:

これを行うには、次の手順を実行します:

  1. 言語識別子のリストで、目的の言語を見つけます。後の手順で言語の識別子が必要です。
  2. VS Codeで、GitLab Workflowの拡張機能設定を開きます:
    1. 上部のバーで、コード > 設定 > Extensions(拡張機能)に移動します。
    2. リストでGitLab Workflowを検索し、管理 ( settings ) を選択します。
    3. Extension Settingsを選択します。
    4. ユーザーの設定で、GitLab › AIアシストコード提案を見つけます: 追加の言語を選択し、Add Item(項目の追加)を選択します。
  3. Item(項目)」で、サポートする各言語の識別子を追加します。識別子は、htmlpowershellのように小文字にする必要があります。各識別子にファイルサフィックスから先頭のピリオドを追加しないでください。
  4. OKを選択します。

前提要件:

これを行うには、次の手順を実行します:

  1. 言語識別子のリストで、目的の言語を見つけます。後の手順で言語の識別子が必要です。
  2. IDEの上部バーでIDE名を選択し、次に設定を選択します。
  3. 左側のサイドバーで、ツール > GitLab Duoを選択します。
  4. Code Suggestions Enabled Languages(コード提案が有効になっている言語) > Additional languages(追加の言語)で、サポートする各言語の識別子を追加します。識別子は、htmlのように小文字にする必要があります。複数の識別子をコンマで区切ります(html,powershell,latexなど)。また、各識別子に先頭のピリオドを追加しないでください。
  5. OKを選択します。

前提要件:

これを行うには、次の手順を実行します:

  1. Eclipseの下部メニューで、GitLabアイコンを選択します。
  2. Show Settings(設定を表示)を選択します。
  3. Code Suggestions Enabled Languages(コード提案が有効になっている言語)セクションまでスクロールダウンします。
  4. Additional Languages(追加の言語)で、言語識別子のコンマ区切りリストを追加します。識別子に先頭のピリオドを追加しないでください。たとえば、htmlmd、およびpowershellを使用します。