「Visual Studio Code」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(同期)
 
(3人の利用者による、間の46版が非表示)
1行目: 1行目:
[[Category:開発]]
 
 
[[Category:テキストエディタ]]
 
[[Category:テキストエディタ]]
 
[[en:Visual Studio Code]]
 
[[en:Visual Studio Code]]
  +
[[pt:Visual Studio Code]]
  +
[[ru:Visual Studio Code]]
 
[[zh-hans:Visual Studio Code]]
 
[[zh-hans:Visual Studio Code]]
[https://code.visualstudio.com/ Visual Studio Code] は Microsoft によって開発されているクロスプラットフォームのプロプライエタリテキストエディタ (End-User License Agreement に基づくライセンス) です。JavaScript TypeScript で書かれた、Codium というフソースプロジェクト(MIT License に基づくライセンス)上に構築されています。Codium と Visual Studio Code 関係は、Chromium と Google Chrome の関係とほぼ同じです。混合ライセンスの説明ついては、[https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 この GitHub コメント]を参照してください。Visual Studio Code Electron フレムワーク上に構築されており、エクスンションによる拡張がきます。拡張は [https://marketplace.visualstudio.com/VSCode web上] またはキスエディタの中 から参照ます。
+
[https://code.visualstudio.com/ Code] Microsoft によって開発されているクロスプラットフォームのテキストエディタで、Electron フレームワーク上でビルドされています。''Visual Studio Code'' は、MIT ライセンス [https://github.com/microsoft/vscode/ Code - OSS]ポジトリ1つのバイナリディストリビュショで、Microsoft 特有のカタマイズがなされており、[https://code.visualstudio.com/license プロプライエタリライセンス]もとでリリースされています。の混合ライセンスに関する詳細は、[https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005 この GitHub コメント]をてください。また、MIT ライセンスの [https://vscodium.com/ VSCodium] というバイナリリリスもあり、これはコミュニ運営されていて、[https://code.visualstudio.com/docs/getstarted/telemetryレメリ] がデフォルト無効化されています。
   
 
== インストール ==
 
== インストール ==
   
VSCode は以下のフレーバが提供されています
+
Visual Studio Code は以下のフレーバが提供されています:
   
* {{App|Code - OSS|code-oss リポジトリからビルドされたオープンソースリリース 。|https://github.com/microsoft/vscode|{{Pkg|code}}, {{AUR|code-git}}}}
+
* {{App|Code - OSS|公式の Arch Linux オープンソースリリース。[https://open-vsx.org/ Open VSX] を有効化する設定が同梱されています。|https://github.com/microsoft/vscode|{{Pkg|code}}}}
* {{App|Visual Studio Code|Microsoft ブランドのバイナリリリース。|https://code.visualstudio.com/|{{AUR|visual-studio-code-bin}}, {{AUR|visual-studio-code-insiders-bin}}}}
+
* {{App|Visual Studio Code|プロプライエタリな Microsoft ブランドのリリース。|https://code.visualstudio.com/|{{AUR|visual-studio-code-bin}}}}
* {{App|VSCodium|コミュニティ主導 MIT ランセンスのバイナリリリース。|https://vscodium.com/|{{AUR|vscodium}}, {{AUR|vscodium-bin}}, {{AUR|vscodium-git}}}}
+
* {{App|VSCodium|コミュニティのオープソースリリース。ソースコード内でテレメトリが無効化されており [https://github.com/VSCodium/vscodium/issues/267#issuecomment-542462446]、Open VSX の設定も同梱されています。|https://vscodium.com/|{{AUR|vscodium}}}}
   
"Code - OSS"(オープソーと "Visual Studio Code"(マイクロソフトクロズドソースビルドの違いについては、[https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code こちら]をご覧ください。
+
これらの異なるフレーバはすべて [https://github.com/VSCodium/vscodium/blob/master/README.md Code - OSS リポジトリ]からビルドされていますが、ライセンスとデフォルトの設定が異なっています。特に、プロプライエタリなビルドだけが、Microsoft の marketplace 使用と ([https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger.md OmniSharp C# Debugger] などの) Microsoft のプロプライエタリな拡張機能の使用を許可されています。後者はハンドシェイク機構によって強制されており、迂回することはできません。"Visual Studio Code" ブランドプンソースビルドとプロプライエタリビルドの違いに関する詳細は、[https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code Code - OSS GitHub wiki] 見てください。
   
=== 機能拡張のサポート ===
+
=== 拡張機能のサポート ===
機能拡張のための [https://marketplace.visualstudio.com/vscode Microsoft marketplace] の使用は、Visual Studio Code ファミリーの製品に制限されています。したがって、Code-OSS では使用できません。( {{Bug|67780}} を参照).
 
   
  +
Code の主な強みの1つとして、柔軟な API と [https://marketplace.visualstudio.com/vscode Visual Studio Marketplace] 上でホストされていますリッチな拡張エコシステムがあります。しかし、[https://aka.ms/vsmarketplace-ToU marketpace の利用規約] は Microsoft ブランドのリリースのみでの使用を許可しています。そのため、Code - OSS source には、設定済みの marketplace が含まれていません。上記のオープンソースのリリースは、Open VSIX 拡張レジストリを追加しますが、拡張機能の数は劣ります。この制限を回避することは可能です。
The {{Pkg|code}} and {{AUR|vscodium-bin}}/{{AUR|vscodium}}/{{AUR|vscodium-git}} packages are configured to use the [https://open-vsx.org/ Open VSX registry], maintained by the Eclipse Foundation. This explains why Code-OSS seems to be unable to find certain extensions.
 
   
  +
{{Warning|Microsoft は[https://github.com/Microsoft/vscode/issues/31168 この問題に直接コメントしてはいません] が、ノンブランドの Code ビルドは、利用規約で定められている "対象範囲内の製品およびサービス" に含まれないと合理的に結論づけることができます。つまり、この行為は marketplace によって許可されていません。{{Bug|67780}} も参照してください。}}
{{Pkg|code}} と {{AUR|vscodium-bin}}/{{AUR|vscodium}}/{{AUR|vscodium-git}} パッケージは、Eclipse Foundation が保守する [https://open-vsx.org/ Open VSX レジストリ]を使用するよう設定されています。これは、Code-OSS が特定の拡張機能を見つけられないように見える理由を説明しています。
 
   
既知の回避策は次の通りです。
+
既知の回避策は:
* manually install the extension from its {{ic|.vsix}} file, which can be obtained from the [https://marketplace.visualstudio.com/ Microsoft Visual Studio Code Marketplace];
+
* {{ic|.vsix}} ファイルから手動で拡張機能をインストールする。{{ic|.vsix}} ファイルは [https://marketplace.visualstudio.com/ Microsoft Visual Studio Code Marketplace] から入手できます。
* ask the maintainer to upload its extension to the [https://open-vsx.org/ Open VSX registry];
+
* 拡張機能のメンテナに拡張機能を [https://open-vsx.org/ Open VSX registry] にアップロードするように依頼する。
* add the Microsoft Visual Studio Code Marketplace by using the one of the following packages relative to the build you are using: {{AUR|code-marketplace}}/{{AUR|vscodium-bin-marketplace}}/{{AUR|vscodium-marketplace}}. Those packages installs a [[Pacman#Hooks|Pacman hook]] that patches the file {{ic|product.json}} as shown in [https://github.com/VSCodium/vscodium/issues/418#issuecomment-643664182 this Github comment] after every package update. Note that using the Microsoft Marketplace in this way would not comply with the its [https://docs.microsoft.com/en-us/legal/marketplace/marketplace-terms terms of use].
+
* 次のパッケージのうち、あなたが使用しているビルドと関連するものを使って、Microsoft Visual Studio Code Marketplace を追加する: {{AUR|code-marketplace}}/{{AUR|vscodium-bin-marketplace}}/{{AUR|vscodium-marketplace}}/{{AUR|code-oss-marketplace}}。これらのパッケージは、パッケージ更新のたびにこの [https://github.com/VSCodium/vscodium/issues/418#issuecomment-643664182 Github コメント]にあるように {{ic|product.json}} ファイルにパッチを適用する [[Pacman フック]] をインストールします。
   
  +
{{Tip|{{ic|product.json}} の変更を実験する際に[https://stackoverflow.com/a/69985500 IDE をリロードするキーボードショートカット] を有効化すると便利です。}}
== 使用方法 ==
 
   
  +
== 使用方法 ==
{{ic|code}} を実行してください。
 
   
  +
{{ic|code}} を実行して、アプリケーションを起動します (または、他のリリースを使用している場合、{{AUR|code-git}} は {{ic|code-git}} を、{{AUR|vscodium-bin}}/{{AUR|vscodium}}/{{AUR|vscodium-git}} は {{ic|codium}} を実行します)。
何らかの理由で Visual Studio Code のインスタンスを複数起動したい場合、{{ic|-n}} フラグを使ってください。
 
   
  +
何らかの理由で Visual Studio Code の複数のインスタンスを起動した場合、{{ic|-n}} フラグを使用できます。
==設定==
 
   
  +
== 設定 ==
{{Pkg|code}} の設定は {{ic|~/.config/Code - OSS/User/settings.json}} に保存されます。
 
   
{{AUR|visual-studio-code-bin}} 設定 {{ic|~/.config/Code/User/settings.json}} に保存されます。
+
{{Pkg|code}} 設定 {{ic|~/.config/Code - OSS/User/settings.json}} に保存ます。
   
{{AUR|vscodium}} 及びその他 Codium の設定 {{ic|~/.config/VSCodium/User/settings.json}} に保存されます。
+
{{AUR|visual-studio-code-bin}} 設定 {{ic|~/.config/Code/User/settings.json}} に保存ます。
   
  +
{{AUR|vscodium}} や関連するパッケージは設定を {{ic|~/.config/VSCodium/User/settings.json}} に保存します。
   
Code から Codium (またはその逆) へ設定を移行する場合、設定ディレクトリはコピーまたは移動できます。殆どのコードベースを共有しているため設定には互換性があります。
+
Code から Codium (またはその逆) 移行する場合、設定ディレクトリはコピー/移動することができます。設定はコードベースの殆どを共有しているので、互換性があります。
   
===統合ターミナル===
+
=== 統合ターミナル ===
   
{{ic|View > Integrated Terminal}} や {{ic|Ctrl + `}} で統合されたターミナルが開きます。デフォルトでは、何も引数が指定されないと [[Bash]] が使われますが、使用されるシェルは変更できます。{{ic|terminal.integrated.shell.linux}} は使用するデフォルトシェルを設定し、{{ic|terminal.integrated.shellArgs.linux}} はシェルに渡される引数を設定します。
+
''View > Integrated Terminal'' や {{ic|Ctrl + `}} で統合ターミナルが開きます。
  +
デフォルトでは追加の引数がない場合に [[Bash]] が使用されますが、この挙動は変更できます。
  +
{{ic|terminal.integrated.shell.linux}} はデフォルトのシェルを設定し、{{ic|terminal.integrated.shellArgs.linux}} はそのシェルに渡される引数を設定します。
   
 
例:
 
例:
55行目: 58行目:
 
}}
 
}}
   
  +
外部ターミナルで統合シェルの引数を設定するとプロンプトがおかしくなる場合があります。その行を削除してこの問題を解決するか、外部ターミナルを使用してください。
===外部ターミナル===
 
   
  +
=== 外部ターミナル ===
Arch のデフォルトターミナルとして [[Terminator]] を使っている場合、Visual Studio Code で次のようなエラーが発生します: {{ic|Unable to launch debugger worker process (vsdbg) through the terminal. spawn truecolor ENOENT}}。Visual Studio で使用するターミナルを別のターミナルに変更することで解決します (例: gnome-terminal)。
 
   
  +
Arch のデフォルトターミナルとして [[Terminator]] を使っている場合、Visual Studio Code で次のようなエラーが発生します: {{ic|Unable to launch debugger worker process (vsdbg) through the terminal. spawn truecolor ENOENT}}。Visual Studio で使用するターミナルを別のターミナルに変更することで解決します (例: {{Pkg|gnome-terminal}})。
{{ic|"terminal.external.linuxExec": "Yours alternative terminal"}} で実行・デバッグのときに使用するデフォルトのターミナルを設定します。
 
  +
  +
{{ic|"terminal.external.linuxExec": "Your alternative terminal"}} で実行デバッグのときに使用するデフォルトのターミナルを設定します。
   
 
例:
 
例:
67行目: 72行目:
 
}}
 
}}
   
=== Wayland でネイティブ実行 ===
+
=== Wayland でネイティブ実行する ===
  +
{{Accuracy|The flags in standard electron-flags.conf are ignored|section=Enabling wayland through electron-flags.conf}}
 
  +
Visual Studio Code は Electron を使います。VSCode を Wayland 上でネイティブに動かす方法についての詳細は [[Wayland#Electron]] を見てください。しかし、一部のアプリケーションはシステムの electron を使用せず、独自のものを使用します。そのようなアプリケーションは標準の Electron フラグファイルを読み込みません。
  +
  +
ユーザ毎の設定ファイルを使用する場合、{{AUR|visual-studio-code-bin}} と {{Pkg|code}} は両方 {{ic|~/.config/code-flags.conf}} を読み込みます。これらのパッケージは、これらのオプションを読み込む[https://aur.archlinux.org/cgit/aur.git/tree/visual-studio-code-bin.sh?h=visual-studio-code-bin パッチを当てたローダスクリプト]を使用するので、この挙動はこれらのパッケージ固有のものであることに注意してください。
  +
  +
{{AUR|vscodium-bin}} を使用する場合、{{ic|~/.config/codium-flags.conf}} ファイルを使用してください。ターミナルから実行する場合、({{ic|vscodium}} ではなく) {{ic|codium}} で実行してください。さもないと、ネイティブな Wayland ウィンドウが使用されません。
   
  +
{{AUR|vscodium}} は設定ファイルを読み込みません (パッチを当てたローダスクリプトを使用しないからです)。
[[Wayland]] ベースの WM や DE を使用している場合、コマンドラインオプションに、{{ic|1=--enable-features=UseOzonePlatform --ozone-platform=wayland|2==}} を追加することで、Visual Studio Code を XWayland ではなく、Wayland でネイティブに実行させることができます。例えば、次のようにして、VSCode を起動してみてください。
 
   
  +
=== ネイティブなファイル選択ダイアログ ===
$ code --enable-features=UseOzonePlatform --ozone-platform=wayland
 
   
  +
KDE を使用している場合、デフォルトでは VS Codium は GTK のファイル選択ダイアログを開きます。これを修正するには、[[環境変数]] {{ic|1=GTK_USE_PORTAL=1}} を設定してください。
これらのオプションは、{{ic|${XDG_CONFIG_HOME}/electron-flags.conf}} ファイルに追加することで、Visual Studio Code が起動するたびに自動的に適用されます。現在の vscode バイナリがビルドされている electron のバージョンによっては正確な electron バージョン用の別の設定ファイル (例: {{ic|${XDG_CONFIG_HOME}/electron13-flags.conf}}) が必要になることがあります。([[Wayland#Electron]] を参照)。
 
   
 
== トラブルシューティング ==
 
== トラブルシューティング ==
80行目: 90行目:
 
=== KDE/Plasma でグローバルメニューが機能しない ===
 
=== KDE/Plasma でグローバルメニューが機能しない ===
   
Visual Studio Code は DBus を使用してメニューを Plasma に渡します。{{Pkg|libdbusmenu-glib}} をインストールしてみてください。
+
Visual Studio Code は DBus を使用してメニューを Plasma に渡します。{{Pkg|libdbusmenu-glib}} をインストールしてみてください。[https://github.com/microsoft/vscode/issues/34510#issuecomment-364896975]
   
  +
=== アイテムをゴミ箱に移動できない ===
=== Unable to move items to trash ===
 
   
By default, [https://electron.atom.io/ Electron] apps use {{ic|gio}} to delete files. {{ic|kioclient5}} is automatically selected instead if [[Plasma]] is detected. Different trash implementations can be used by setting the {{ic|ELECTRON_TRASH}} [[environment variable]].
+
デフォルトでは、[https://electron.atom.io/ Electron] アプリは {{ic|gio}} を使用してファイルを削除します。[[Plasma]] が検出されると、代わりに {{ic|kioclient5}} が自動的に選択されます。[[環境変数]] {{ic|ELECTRON_TRASH}} を設定することにより、異なるゴミ箱の実装を使用できます。
   
  +
例えば、{{Pkg|trash-cli}} を使ってファイルを削除する場合:
For example, for deleting files using {{Pkg|trash-cli}}:
 
   
 
$ ELECTRON_TRASH=trash-cli code
 
$ ELECTRON_TRASH=trash-cli code
   
At the time of writing, Electron supports {{ic|kioclient5}}, {{ic|kioclient}}, {{ic|trash-cli}}, {{ic|gio}} (default) and {{ic|gvfs-trash}} (deprecated). More info is available at this [https://github.com/electron/electron/blob/master/docs/api/environment-variables.md#electron_trash-linux documentation page].
+
本稿執筆時点で、Electron {{ic|kioclient5}}{{ic|kioclient}}{{ic|trash-cli}}{{ic|gio}} (デフォルト){{ic|gvfs-trash}} (非推奨) をサポートしています。詳細はこちらの [https://github.com/electron/electron/blob/master/docs/api/environment-variables.md#electron_trash-linux ドキュメントページ]
  +
で確認できます。
   
  +
=== C# をデバッグできない ===
=== Unable to debug C# ===
 
   
If you want to debug C#[[.NET_Core|.NET]] (using the [https://www.omnisharp.net OmniSharp extension]) then you need to install the Microsoft branded release (from the AUR). This is apparently because the .NET Core debugger is only licensed to be used with official Microsoft products - see [https://github.com/OmniSharp/omnisharp-vscode/issues/1431#issuecomment-297578930 this github discussion].
+
C#[[.NET]] ([https://www.omnisharp.net OmniSharp 拡張機能]を使って) デバッグしたい場合、Microsoft ブランドの .NET リリースを (AUR から) インストールする必要があります。これは、.NET Core デバッガーが公式の Microsoft 製品でのみ使用できるようにライセンスされているからだと思われます。[https://github.com/OmniSharp/omnisharp-vscode/issues/1431#issuecomment-297578930 GitHub のディスカッション]を見てください。
   
  +
オープンソース版のパッケージを利用している場合は、デバッグは静かなメッセージで失敗します。デバッグコンソールは最初のメッセージが出力されるだけです:
When using the open-source package, debugging fails fairly quietly. The debug console will just show the initial message:
 
   
 
{{bc|You may only use the Microsoft .NET Core Debugger (vsdbg) with
 
{{bc|You may only use the Microsoft .NET Core Debugger (vsdbg) with
102行目: 113行目:
 
to help you develop and test your applications.}}
 
to help you develop and test your applications.}}
   
  +
オープンソース版のパッケージでデバッグする場合、{{AUR|netcoredbg}} を利用できます。VS Code で実行するには、以下の設定をこのプロジェクトの .NET Core launch 設定に追加してください:
For debugging with the open-source package {{AUR|netcoredbg}} can be used. To run it in VS Code, add this configuration to .NET Core launch configuration of the project:
 
   
 
{{hc|./.vscode/launch.json|
 
{{hc|./.vscode/launch.json|
119行目: 130行目:
 
=== Unable to open .csproj with OmniSharp server, invalid Microsoft.Common.props location ===
 
=== Unable to open .csproj with OmniSharp server, invalid Microsoft.Common.props location ===
   
  +
mono から適切な SDK バージョンの props に変更する必要があります。
You have to switch from mono to proper SDK version props.
 
   
 
{{hc|/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props|
 
{{hc|/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props|
125行目: 136行目:
 
}}
 
}}
   
  +
インポートを次のように変更します。
Modify import to look like this:
 
   
 
{{hc|/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props|
 
{{hc|/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props|
131行目: 142行目:
 
}}
 
}}
   
=== Error from OmniSharp that MSBuild cannot be located ===
+
=== MSBuild が見つからないと OmniSharp でエラーが発生する ===
   
It is noted in the [https://github.com/OmniSharp/omnisharp-roslyn#introduction OmniSharp introduction] that Arch Linux users should install the {{Pkg|mono-msbuild}} package. Without it, you might get an error like:
+
[https://github.com/OmniSharp/omnisharp-roslyn#introduction OmniSharp introduction] で説明されている通り、Arch Linux ユーザは {{Pkg|mono-msbuild}} パッケージをインストールする必要があります。それがないと、以下のようなエラーが発生するかもしれません:
   
 
{{hc|1=OmniSharp Log|2=
 
{{hc|1=OmniSharp Log|2=
147行目: 158行目:
 
...}}
 
...}}
   
  +
もしかするとビルドできるかもしれません (おそらく、{{Pkg|mono}} がインストールされているかどうかにも依存しているのでしょう)
You might be able to build anyway (possibly depending whether you have {{Pkg|mono}} installed too).
 
   
  +
Omnisharp には独自の mono バージョンが同梱されています。Omnisharp がインストール済みの mono を見つけられない場合で、マシンにインストールされている "グローバルな" mono を検索するよう omnisharp を設定したい場合、以下を settings.json に追加してください:
Omnisharp ships with its own mono version, so, if it is unable to locate the installed one, if you want to tell omnisharp to look for a "global" mono installed in your machine, put this in your settings.json:
 
 
{{hc|1=settings.json|2="omnisharp.useGlobalMono:"always"}}
 
{{hc|1=settings.json|2="omnisharp.useGlobalMono:"always"}}
   
=== Saving with "Retry as Sudo" does not work ===
+
=== "Retry as Sudo" での保存がうまくいかない ===
   
  +
Microsoft は Arch パッケージのパッケージング方法 (バンドルされた Electron ではなくネイティブ) をサポートしていないため、この機能は {{Pkg|code}} パッケージでは動きません。詳しくは {{Bug|61516}} と[https://github.com/Microsoft/vscode/issues/70403 上流のバグレポート]をご確認ください。
This feature does not work in the {{Pkg|code}} package, because Microsoft does not support the way the Arch package is packaged (native instead of bundled Electron). See {{Bug|61516}} and the [https://github.com/Microsoft/vscode/issues/70403 upstream bug report] for more information.
 
   
The binary release {{AUR|visual-studio-code-bin}} does not have this issue, and the feature works there.
+
バイナリリリースの {{AUR|visual-studio-code-bin}} にはこの問題はなく、この機能は動作します。
   
  +
=== キーボードのバリアントやキーマッピングがマッピングされない ===
=== Keyboard variants or keymappings do not map ===
 
   
As per the [https://github.com/Microsoft/vscode/wiki/Keybinding-Issues#troubleshoot-linux-keybindings wiki on GitHub]:
+
[https://github.com/Microsoft/vscode/wiki/Keybinding-Issues#troubleshoot-linux-keybindings GitHub wiki] によると、
   
  +
: 一部の Linux ウィンドウマネージャでキーボードレイアウトを切り替えても、VS Code が現在のキーボードレイアウトを読み取るために使用する低レベルの X ウィンドウ API に変更が生じません。このため、VS Code は、現在アクティブなキーボードレイアウトではなく、他の設定されたキーボードレイアウトの 1 つを読み取ることになる場合があることを意味します。PR 歓迎...
: Switching keyboard layouts under some Linux window managers does not result in a change in the low level X window APIs VS Code uses to read the current keyboard layout. This means that VS Code ends up sometimes reading one of the other configured keyboard layouts and not the current active one. PR welcome...
 
   
  +
wiki によると、2 つの可能な解決策があります。
Per the wiki, there are two possible solutions:
 
   
  +
# {{ic|setxkbmap -query}} が最初のキーボードレイアウトとして、VS Codeで作業したいものを返すことを確認する。
# make sure {{ic|setxkbmap -query}} returns as the first keyboard layout the one you want to work with in VS Code.
 
# use {{ic|"keyboard.dispatch": "keyCode"}} in your settings and restart VS Code. This will prevent VS Code from trying to determine your keyboard layout whatsoever.
+
# {{ic|"keyboard.dispatch": "keyCode"}} を使用し、VS Codeを再起動します。これで、VS Code がキーボードレイアウトを決定しようとするのを防ぐことができます。
   
 
=== Command "..." not found ===
 
=== Command "..." not found ===
   
  +
Microsoft ブランドのリリースでは、拡張機能によってアクセスされる提案された特定の API の使用を許可されている拡張機能が {{ic|product.json}} ファイルにリストアップされています。Code - OSS と VSCodium にはこれらの値が存在しません (しかし、これはライセンスの問題というわけではないようです)。Marketplace の強制的な有効化とは異なり、以下の回避策は Microsoft によって推奨されています [https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#vs-code-oss-issues]。
In the official build of VS Code, a {{ic|product.json}} file lists the extensions that are allowed to use certain proposed APIs accessed by extensions. However, the {{ic|product.json}} is absent in the OSS build {{Pkg|code}}. [https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#vs-code-oss-issues]
 
   
  +
この問題は、パッケージアップデートの時にそのファイルにパッチを当てる Pacman フックを導入することで解決できます:
In the related issues below, some flags may be required to enable certain APIs. [https://github.com/Microsoft/vscode-pull-request-github/wiki#3-why-isnt-the-extension-starting] You may either run {{Pkg|code}} with these flags, or you can add the relevant entries to the {{ic|extensionAllowedProposedApi}} section in the {{ic|product.json}} file ({{Pkg|code}} installs this to {{ic|/usr/lib/code/product.json}}).
 
   
  +
* {{Pkg|code}} の場合、{{AUR|code-features}} を[[インストール]]してください
{{bc|"extensionAllowedProposedApi": [
 
  +
* {{AUR|vscodium}} の場合、{{AUR|vscodium-features}} をインストールしてください
  +
* {{AUR|vscodium-bin}} の場合、{{AUR|vscodium-bin-features}} をインストールしてください
  +
  +
また、関連するエントリを {{ic|product.json}} ファイルの {{ic|extensionAllowedProposedApi}} セクションに手動で追加することもできます:
  +
  +
* {{Pkg|code}} の場合、{{ic|/usr/lib/code/product.json}} を編集してください
  +
* {{AUR|vscodium}} の場合、{{ic|/usr/share/vscodium/resources/app/product.json}} を編集してください
  +
* {{AUR|vscodium-bin}} の場合、{{ic|/opt/vscodium-bin/resources/app/product.json}} を編集してください
  +
  +
Live Share を機能させる手動設定の例は [https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#vs-code-oss-issues]:
  +
  +
{{hc|product.json|
  +
...
  +
"extensionAllowedProposedApi": [
 
"ms-vsliveshare.vsliveshare",
 
"ms-vsliveshare.vsliveshare",
 
"ms-vscode.node-debug",
 
"ms-vscode.node-debug",
 
"ms-vscode.node-debug2"
 
"ms-vscode.node-debug2"
  +
]
]}}
 
  +
...
  +
}}
   
  +
最後に、[https://github.com/Microsoft/vscode-pull-request-github/wiki#3-why-isnt-the-extension-starting GitHub のプルリクエスト拡張で説明されているように]、コマンドラインフラグを使ってこれらのオプションを有効化することもできます。
This can also be resolved by installing the {{AUR|code-features}} package, which installs a pacman hook that patches the file on every package update. Alternatively, you may also consider installing the Microsoft branded packages: {{AUR|visual-studio-code-bin}}, {{AUR|visual-studio-code-insiders-bin}}.
 
   
==== VS Live Share missing API ====
+
==== VS Live Share API が欠けている ====
   
  +
{{ic|product.json}} を編集して上記の解決策を試すか、以下のオプションで VS Code を開いてください:
Use either the solution above by editing the {{ic|product.json}}, or open VS Code with:
 
   
 
$ code --enable-proposed-api ms-vsliveshare.vsliveshare
 
$ code --enable-proposed-api ms-vsliveshare.vsliveshare
  +
  +
また、この拡張機能を機能させるには、[https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#tips-for-community-supported-distros] にリストアップされている依存関係をインストールする必要があります。
   
 
==== Command 'remote-containers.openFolder' not found ====
 
==== Command 'remote-containers.openFolder' not found ====
   
  +
{{bug|63374}} でコメントされているように、remote-containers API を有効化して VS Code を開いてください:
Open VS Code enabling remote-containers API as commented in {{bug|63374}}:
 
   
 
$ code-oss --enable-proposed-api ms-vscode-remote.remote-containers
 
$ code-oss --enable-proposed-api ms-vscode-remote.remote-containers
197行目: 226行目:
 
==== Command 'GitHub Pull Requests: Configure Remotes...' resulted in an error (command 'pr.configureRemotes' not found) ====
 
==== Command 'GitHub Pull Requests: Configure Remotes...' resulted in an error (command 'pr.configureRemotes' not found) ====
   
  +
VS Code を以下のオプションで開いてください:
Open VS Code with:
 
   
 
$ code --enable-proposed-api GitHub.vscode-pull-request-github
 
$ code --enable-proposed-api GitHub.vscode-pull-request-github
203行目: 232行目:
 
=== Git: ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory ===
 
=== Git: ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory ===
   
  +
このエラーは、ssh-key が暗号化されていて ssh エージェントを使用できないため発生します。[https://github.com/microsoft/vscode/issues/57488 バグレポート]を見てください。この問題は、[[SSH 鍵#x11-ssh-askpass]] のようなダイアログプロバイダか、代替品 (例えば、KDE の {{Pkg|ksshaskpass}}) をインストールすることで解決できます。
This error is a result of an encrypted ssh-key, and can be solved by installing a dialogue provider like [[SSH keys#x11-ssh-askpass]] or the alternatives listed there like {{Pkg|ksshaskpass}} for KDE.
 
   
One thing to note is that for e.g. ksshaskpass you would need to link it from {{ic|/usr/lib/ssh/ssh-askpass}} to get VSCode to find it:
+
注意点としては、''ksshaskpass'' の場合、{{ic|/usr/lib/ssh/ssh-askpass}} からリンクを貼って VSCode がそれを見つけられるようにする必要があります:
   
 
# ln /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass
 
# ln /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass
   
  +
または、以下の[[環境変数]]をシェルで設定してください ([https://github.com/microsoft/vscode/issues/57488#issuecomment-1413903793] を参照):
=== No extensions found ===
 
   
  +
GIT_ASKPASS=ksshaskpass
There exist several differences between "vscode" (open-source) and "Visual Studio Code" (Microsoft product based on vscode), see: [https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code Differences between the repository and Visual Studio Code]. The usage of [https://marketplace.visualstudio.com/vscode Microsoft marketplace] for extensions is restricted to products of the Visual Studio Code's family. Consequently, it cannot be used by vscode (see {{Bug|67780}}). The {{Pkg|code}} and {{AUR|vscodium-bin}}/{{AUR|vscodium}}/{{AUR|vscodium-git}} packages are configured to use [https://open-vsx.org/ the Open VSX registry] instead of the Microsoft one. This explains why some extensions are missing from the vscode explorer while they appear to be listed online.
 
  +
SSH_ASKPASS=ksshaskpass
  +
SSH_ASKPASS_REQUIRE=prefer
   
  +
VSCode の内部 ''git-askpass'' を無効化するには、以下を追加してください:
The workaround is to either install the {{AUR|visual-studio-code-bin}} package instead, manually download and install the {{ic|.vsix}} file from the web marketplace page, or ask the maintainer to upload its extension to OpenVSX.
 
   
  +
{{hc|~/.config/Code - OSS/User/settings.json|2=
Technically, one could also edit the {{ic|product.json}} as shown in [https://github.com/VSCodium/vscodium/issues/418#issuecomment-643664182 this Github comment], but that would not comply with the Microsoft Marketplace Terms of Use. Additionally, the changes would be overwritten during package update. This can be overcome by installing {{AUR|code-marketplace}} package, which installs a pacman hook that patches the file on every package update.
 
  +
{
  +
"git.useIntegratedAskPass": false
  +
}
  +
}}
   
  +
=== 統合ターミナルで文字が切れる ===
=== Cutoff characters in integrated Terminal ===
 
   
  +
幅が大きすぎる文字は、切れてしまう場合があります。例えば、Deno stack-traces のイタリック太文字テキストなどです。
Characters that are too wide can end up clipping. For example the italic bold text of Deno stack-traces.
 
   
This can be avoided by setting "terminal.integrated.rendererType" to "experimentalWebgl".
+
この問題は、"terminal.integrated.rendererType" "experimentalWebgl" に設定することで回避できます。
   
  +
=== Wayland でテキストがぼやける ===
=== Blurry text under Wayland ===
 
   
  +
Visual Studio Code はデフォルトで Xwayland 下で実行されます。そのせいで、HiDPI スクリーンを使用している場合にテキストがぼやける場合があります。この問題を修正するには、Electron を Wayland 下で実行するように強制してみてください。[[#Wayland でネイティブに実行する]] を見てください。
Visual Studio Code defaults to run under XWayland, which may cause blurry text if you are using HiDPI screens. To fix this issue, try forcing Electron to run under Wayland—see [[#Running natively under Wayland]].
 
  +
  +
あるいは、あなたの Wayland 環境が Xwayland アプリケーションをスケーリングせずに実行するオプションを提供している場合、この問題を回避できます。この場合、Visual Studio Code を {{ic|1=--force-device-scale-factor=}} オプション付きで実行して画面に合う適切なスケールを使用してください。
  +
  +
例えば、スケールファクタ 2 の場合は:
  +
  +
$ code --force-device-scale-factor=2
   
 
=== No such interface“org.freedesktop.Secret.Collection” ===
 
=== No such interface“org.freedesktop.Secret.Collection” ===
   
See [https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues settings-sync#_troubleshooting-keychain-issues]
+
[https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues settings-sync#_troubleshooting-keychain-issues] を参照してください。
  +
  +
=== VSCodium 使用時に Github との認証に失敗する ===
  +
  +
Github アカウントに接続する場合、[https://github.com/VSCodium/vscodium/issues/401#issuecomment-631502370 このコメント]にあるように URLの "vscodium" を "vscode" に変更します。次に、識別トークンを VSCodium にコピーします。それでも失敗する場合は、[https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues Visual Studio Code docs] や [https://github.com/microsoft/vscode/issues/92972#issuecomment-625751232 Github] で説明されているように、{{pkg|gnome-keyring}} のようなキーリングをインストールするか、新しいキーリングを作成してください。
  +
  +
=== An OS keyring couldn't be identified ===
  +
  +
i3 などの一部のデスクトップ環境では、VSCode がキーリングの検出に失敗します。gnome-keyring を使用している場合、以下の設定を追加することで VSCode に gnome-keyring を強制的に使用させることができます:
  +
  +
{{hc|~/.vscode-oss/argv.json|2=
  +
{
  +
...
  +
"password-store": "gnome",
  +
}
  +
}}
  +
  +
上記の設定ファイルのパスは {{pkg|code}} パッケージの場合です。別の VSCode フレーバを使用している場合は、{{ic|.vscode-oss}} の部分を書き換える必要があります。
   
  +
{{TranslationStatus|Visual Studio Code|2023-10-05|787498}}
=== Authentification with Github failed while using VSCodium ===
 
When connecting a Github account, change "vscodium" to "vscode" in the URL as seen in [https://github.com/VSCodium/vscodium/issues/401#issuecomment-631502370 this comment]. Then copy the identification token into VSCodium. Should it still fail, install a keyring like {{pkg|gnome-keyring}} or create a new keyring as mentioned here [https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues in the Visual Studio Code docs] and here [https://github.com/microsoft/vscode/issues/92972#issuecomment-625751232 on Github].
 

2023年10月5日 (木) 23:30時点における最新版

Code とは、Microsoft によって開発されているクロスプラットフォームのテキストエディタで、Electron フレームワーク上でビルドされています。Visual Studio Code は、MIT ライセンス Code - OSS リポジトリの1つのバイナリディストリビューションで、Microsoft 特有のカスタマイズがなされており、プロプライエタリライセンスのもとでリリースされています。この混合ライセンスに関する詳細は、この GitHub コメントを見てください。また、MIT ライセンスの VSCodium というバイナリリリースもあり、これはコミュニティで運営されていて、テレメトリ がデフォルトで無効化されています。

インストール

Visual Studio Code は以下のフレーバが提供されています:

  • Code - OSS — 公式の Arch Linux オープンソースリリース。Open VSX を有効化する設定が同梱されています。
https://github.com/microsoft/vscode || code
  • Visual Studio Code — プロプライエタリな Microsoft ブランドのリリース。
https://code.visualstudio.com/ || visual-studio-code-binAUR
  • VSCodium — コミュニティのオープンソースリリース。ソースコード内でテレメトリが無効化されており [1]、Open VSX の設定も同梱されています。
https://vscodium.com/ || vscodiumAUR

これらの異なるフレーバはすべて Code - OSS リポジトリからビルドされていますが、ライセンスとデフォルトの設定が異なっています。特に、プロプライエタリなビルドだけが、Microsoft の marketplace 使用と (OmniSharp C# Debugger などの) Microsoft のプロプライエタリな拡張機能の使用を許可されています。後者はハンドシェイク機構によって強制されており、迂回することはできません。"Visual Studio Code" ブランドのオープンソースビルドとプロプライエタリビルドの違いに関する詳細は、Code - OSS GitHub wiki を見てください。

拡張機能のサポート

Code の主な強みの1つとして、柔軟な API と Visual Studio Marketplace 上でホストされていますリッチな拡張エコシステムがあります。しかし、marketpace の利用規約 は Microsoft ブランドのリリースのみでの使用を許可しています。そのため、Code - OSS source には、設定済みの marketplace が含まれていません。上記のオープンソースのリリースは、Open VSIX 拡張レジストリを追加しますが、拡張機能の数は劣ります。この制限を回避することは可能です。

警告: Microsoft はこの問題に直接コメントしてはいません が、ノンブランドの Code ビルドは、利用規約で定められている "対象範囲内の製品およびサービス" に含まれないと合理的に結論づけることができます。つまり、この行為は marketplace によって許可されていません。FS#67780 も参照してください。

既知の回避策は:

ヒント: product.json の変更を実験する際にIDE をリロードするキーボードショートカット を有効化すると便利です。

使用方法

code を実行して、アプリケーションを起動します (または、他のリリースを使用している場合、code-gitAURcode-git を、vscodium-binAUR/vscodiumAUR/vscodium-gitAURcodium を実行します)。

何らかの理由で Visual Studio Code の複数のインスタンスを起動した場合、-n フラグを使用できます。

設定

code は設定を ~/.config/Code - OSS/User/settings.json に保存します。

visual-studio-code-binAUR は設定を ~/.config/Code/User/settings.json に保存します。

vscodiumAUR や関連するパッケージは設定を ~/.config/VSCodium/User/settings.json に保存します。

Code から Codium に (またはその逆) 移行する場合、設定ディレクトリはコピー/移動することができます。設定はコードベースの殆どを共有しているので、互換性があります。

統合ターミナル

View > Integrated TerminalCtrl + ` で統合ターミナルが開きます。 デフォルトでは追加の引数がない場合に Bash が使用されますが、この挙動は変更できます。 terminal.integrated.shell.linux はデフォルトのシェルを設定し、terminal.integrated.shellArgs.linux はそのシェルに渡される引数を設定します。

例:

~/.config/Code/User/settings.json
"terminal.integrated.shell.linux": "/usr/bin/fish",
"terminal.integrated.shellArgs.linux": ["-l","-d 3"]

外部ターミナルで統合シェルの引数を設定するとプロンプトがおかしくなる場合があります。その行を削除してこの問題を解決するか、外部ターミナルを使用してください。

外部ターミナル

Arch のデフォルトターミナルとして Terminator を使っている場合、Visual Studio Code で次のようなエラーが発生します: Unable to launch debugger worker process (vsdbg) through the terminal. spawn truecolor ENOENT。Visual Studio で使用するターミナルを別のターミナルに変更することで解決します (例: gnome-terminal)。

"terminal.external.linuxExec": "Your alternative terminal" で実行デバッグのときに使用するデフォルトのターミナルを設定します。

例:

~/.config/Code/User/settings.json
"terminal.external.linuxExec": "gnome-terminal"

Wayland でネイティブに実行する

Visual Studio Code は Electron を使います。VSCode を Wayland 上でネイティブに動かす方法についての詳細は Wayland#Electron を見てください。しかし、一部のアプリケーションはシステムの electron を使用せず、独自のものを使用します。そのようなアプリケーションは標準の Electron フラグファイルを読み込みません。

ユーザ毎の設定ファイルを使用する場合、visual-studio-code-binAURcode は両方 ~/.config/code-flags.conf を読み込みます。これらのパッケージは、これらのオプションを読み込むパッチを当てたローダスクリプトを使用するので、この挙動はこれらのパッケージ固有のものであることに注意してください。

vscodium-binAUR を使用する場合、~/.config/codium-flags.conf ファイルを使用してください。ターミナルから実行する場合、(vscodium ではなく) codium で実行してください。さもないと、ネイティブな Wayland ウィンドウが使用されません。

vscodiumAUR は設定ファイルを読み込みません (パッチを当てたローダスクリプトを使用しないからです)。

ネイティブなファイル選択ダイアログ

KDE を使用している場合、デフォルトでは VS Codium は GTK のファイル選択ダイアログを開きます。これを修正するには、環境変数 GTK_USE_PORTAL=1 を設定してください。

トラブルシューティング

KDE/Plasma でグローバルメニューが機能しない

Visual Studio Code は DBus を使用してメニューを Plasma に渡します。libdbusmenu-glib をインストールしてみてください。[2]

アイテムをゴミ箱に移動できない

デフォルトでは、Electron アプリは gio を使用してファイルを削除します。Plasma が検出されると、代わりに kioclient5 が自動的に選択されます。環境変数 ELECTRON_TRASH を設定することにより、異なるゴミ箱の実装を使用できます。

例えば、trash-cli を使ってファイルを削除する場合:

$ ELECTRON_TRASH=trash-cli code

本稿執筆時点で、Electron は kioclient5kioclienttrash-cligio (デフォルト)、gvfs-trash (非推奨) をサポートしています。詳細はこちらの ドキュメントページ で確認できます。

C# をデバッグできない

C#.NET を (OmniSharp 拡張機能を使って) デバッグしたい場合、Microsoft ブランドの .NET リリースを (AUR から) インストールする必要があります。これは、.NET Core デバッガーが公式の Microsoft 製品でのみ使用できるようにライセンスされているからだと思われます。GitHub のディスカッションを見てください。

オープンソース版のパッケージを利用している場合は、デバッグは静かなメッセージで失敗します。デバッグコンソールは最初のメッセージが出力されるだけです:

You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.

オープンソース版のパッケージでデバッグする場合、netcoredbgAUR を利用できます。VS Code で実行するには、以下の設定をこのプロジェクトの .NET Core launch 設定に追加してください:

./.vscode/launch.json
"configurations": [
    {
...
    "pipeTransport": {
        "pipeCwd": "${workspaceFolder}",
        "pipeProgram": "/usr/bin/bash",
        "pipeArgs": ["-c"],
        "debuggerPath": "/usr/bin/netcoredbg"
    }
...

Unable to open .csproj with OmniSharp server, invalid Microsoft.Common.props location

mono から適切な SDK バージョンの props に変更する必要があります。

/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props
$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props

インポートを次のように変更します。

/opt/dotnet/sdk/{VERSION}/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props
/opt/dotnet/sdk/{VERSION}/Current/Microsoft.Common.props

MSBuild が見つからないと OmniSharp でエラーが発生する

OmniSharp introduction で説明されている通り、Arch Linux ユーザは mono-msbuild パッケージをインストールする必要があります。それがないと、以下のようなエラーが発生するかもしれません:

OmniSharp Log
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "~/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /usr/lib/mono/xbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = ~/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = ~/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
System.TypeLoadException: Could not load type of field 'OmniSharp.MSBuild.ProjectManager:_queue' (13) due to: Could not load file or assembly 'System.Threading.Tasks.Dataflow, Version=4.5.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
...

もしかするとビルドできるかもしれません (おそらく、mono がインストールされているかどうかにも依存しているのでしょう)

Omnisharp には独自の mono バージョンが同梱されています。Omnisharp がインストール済みの mono を見つけられない場合で、マシンにインストールされている "グローバルな" mono を検索するよう omnisharp を設定したい場合、以下を settings.json に追加してください:

settings.json
"omnisharp.useGlobalMono:"always"

"Retry as Sudo" での保存がうまくいかない

Microsoft は Arch パッケージのパッケージング方法 (バンドルされた Electron ではなくネイティブ) をサポートしていないため、この機能は code パッケージでは動きません。詳しくは FS#61516上流のバグレポートをご確認ください。

バイナリリリースの visual-studio-code-binAUR にはこの問題はなく、この機能は動作します。

キーボードのバリアントやキーマッピングがマッピングされない

GitHub の wiki によると、

一部の Linux ウィンドウマネージャでキーボードレイアウトを切り替えても、VS Code が現在のキーボードレイアウトを読み取るために使用する低レベルの X ウィンドウ API に変更が生じません。このため、VS Code は、現在アクティブなキーボードレイアウトではなく、他の設定されたキーボードレイアウトの 1 つを読み取ることになる場合があることを意味します。PR 歓迎...

wiki によると、2 つの可能な解決策があります。

  1. setxkbmap -query が最初のキーボードレイアウトとして、VS Codeで作業したいものを返すことを確認する。
  2. "keyboard.dispatch": "keyCode" を使用し、VS Codeを再起動します。これで、VS Code がキーボードレイアウトを決定しようとするのを防ぐことができます。

Command "..." not found

Microsoft ブランドのリリースでは、拡張機能によってアクセスされる提案された特定の API の使用を許可されている拡張機能が product.json ファイルにリストアップされています。Code - OSS と VSCodium にはこれらの値が存在しません (しかし、これはライセンスの問題というわけではないようです)。Marketplace の強制的な有効化とは異なり、以下の回避策は Microsoft によって推奨されています [3]

この問題は、パッケージアップデートの時にそのファイルにパッチを当てる Pacman フックを導入することで解決できます:

また、関連するエントリを product.json ファイルの extensionAllowedProposedApi セクションに手動で追加することもできます:

  • code の場合、/usr/lib/code/product.json を編集してください
  • vscodiumAUR の場合、/usr/share/vscodium/resources/app/product.json を編集してください
  • vscodium-binAUR の場合、/opt/vscodium-bin/resources/app/product.json を編集してください

Live Share を機能させる手動設定の例は [4]:

product.json
...
  "extensionAllowedProposedApi": [
    "ms-vsliveshare.vsliveshare",
    "ms-vscode.node-debug",
    "ms-vscode.node-debug2"
  ]
...

最後に、GitHub のプルリクエスト拡張で説明されているように、コマンドラインフラグを使ってこれらのオプションを有効化することもできます。

VS Live Share で API が欠けている

product.json を編集して上記の解決策を試すか、以下のオプションで VS Code を開いてください:

$ code --enable-proposed-api ms-vsliveshare.vsliveshare

また、この拡張機能を機能させるには、[5] にリストアップされている依存関係をインストールする必要があります。

Command 'remote-containers.openFolder' not found

FS#63374 でコメントされているように、remote-containers API を有効化して VS Code を開いてください:

$ code-oss --enable-proposed-api ms-vscode-remote.remote-containers

Command 'GitHub Pull Requests: Configure Remotes...' resulted in an error (command 'pr.configureRemotes' not found)

VS Code を以下のオプションで開いてください:

$ code --enable-proposed-api GitHub.vscode-pull-request-github

Git: ssh_askpass: exec(/usr/lib/ssh/ssh-askpass): No such file or directory

このエラーは、ssh-key が暗号化されていて ssh エージェントを使用できないため発生します。バグレポートを見てください。この問題は、SSH 鍵#x11-ssh-askpass のようなダイアログプロバイダか、代替品 (例えば、KDE の ksshaskpass) をインストールすることで解決できます。

注意点としては、ksshaskpass の場合、/usr/lib/ssh/ssh-askpass からリンクを貼って VSCode がそれを見つけられるようにする必要があります:

# ln /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass

または、以下の環境変数をシェルで設定してください ([6] を参照):

GIT_ASKPASS=ksshaskpass
SSH_ASKPASS=ksshaskpass
SSH_ASKPASS_REQUIRE=prefer

VSCode の内部 git-askpass を無効化するには、以下を追加してください:

~/.config/Code - OSS/User/settings.json
{
    "git.useIntegratedAskPass": false
}

統合ターミナルで文字が切れる

幅が大きすぎる文字は、切れてしまう場合があります。例えば、Deno stack-traces のイタリック太文字テキストなどです。

この問題は、"terminal.integrated.rendererType" を "experimentalWebgl" に設定することで回避できます。

Wayland でテキストがぼやける

Visual Studio Code はデフォルトで Xwayland 下で実行されます。そのせいで、HiDPI スクリーンを使用している場合にテキストがぼやける場合があります。この問題を修正するには、Electron を Wayland 下で実行するように強制してみてください。#Wayland でネイティブに実行する を見てください。

あるいは、あなたの Wayland 環境が Xwayland アプリケーションをスケーリングせずに実行するオプションを提供している場合、この問題を回避できます。この場合、Visual Studio Code を --force-device-scale-factor= オプション付きで実行して画面に合う適切なスケールを使用してください。

例えば、スケールファクタ 2 の場合は:

$ code --force-device-scale-factor=2

No such interface“org.freedesktop.Secret.Collection”

settings-sync#_troubleshooting-keychain-issues を参照してください。

VSCodium 使用時に Github との認証に失敗する

Github アカウントに接続する場合、このコメントにあるように URLの "vscodium" を "vscode" に変更します。次に、識別トークンを VSCodium にコピーします。それでも失敗する場合は、Visual Studio Code docsGithub で説明されているように、gnome-keyring のようなキーリングをインストールするか、新しいキーリングを作成してください。

An OS keyring couldn't be identified

i3 などの一部のデスクトップ環境では、VSCode がキーリングの検出に失敗します。gnome-keyring を使用している場合、以下の設定を追加することで VSCode に gnome-keyring を強制的に使用させることができます:

~/.vscode-oss/argv.json
{
    ...
    "password-store": "gnome",
}

上記の設定ファイルのパスは code パッケージの場合です。別の VSCode フレーバを使用している場合は、.vscode-oss の部分を書き換える必要があります。

翻訳ステータス: このページは en:Visual Studio Code の翻訳バージョンです。最後の翻訳日は 2023-10-05 です。もし英語版に 変更 があれば、翻訳の同期を手伝うことができます。