redhat-developer / redhat-developer/vscode-java
Reloading a window apprently clears Java project settings due to different workspace storage chosen
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Environment
- Operating System: macOS (local host) + Linux (SSH remote host)
- JDK version: 17.0.9
- Visual Studio Code version: 1.89.1
- Java extension version: 1.31.0
Steps To Reproduce
- Open a large Java project on a remote machine with SSH remote development
- Configure the Java project, e.g. add some source paths
- Reload the window
Current Result
Configuration added in the step 2 is apparently lost.
Expected Result
Configuration added in the step 2 is kept.
Additional Informations
I found that the -data directory passed to jdt.ls differs before/after the reload.
- Before:
-data /usr/local/google/home/nya/.vscode-server/data/User/workspaceStorage/4f53a3d603ab9ba87f981c0821b0dc62/redhat.java/jdt_ws - After:
-data /usr/local/google/home/nya/.vscode-server/data/User/workspaceStorage/4f53a3d603ab9ba87f981c0821b0dc62-1/redhat.java/jdt_ws
Notice the -1 suffix added to the workspace storage directory.
In fact, a VSCode extension may receive different context.storageUri for the identical workspace when multiple instances of VSCode opens the workspace concurrently (c.f. https://github.com/microsoft/vscode/issues/128234). This can happen even on a window reload because a storage directory lock is released only on the VSCode process exit (https://github.com/microsoft/vscode/blob/5f646b8e67a869ef33061085ffe0e377d5ba040c/src/vs/workbench/api/node/extHostStoragePaths.ts#L52).
I guess this problem happens only in remote development because VSCode skips obtaining locks for local extension hosts (https://github.com/microsoft/vscode/issues/128528).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まずリモート SSH の再読み込みフローを再現し、再読み込みの前後で、拡張機能の context.storageUri と jdt.ls -data パスを比較します。参照されている VS Code extHostStoragePaths.ts の動作と、拡張機能による jdt.ls の起動処理を確認します。再読み込み後も Java プロジェクトの設定が利用可能なままとなり、-1 ワークスペースストレージディレクトリに移動されなければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100