Repository navigation
Announce only the workspace root as workspace folder to the CLS - #504
Dietrich Travkin (travkin79) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Integration validation is needed to confirm startup improvement, initialization and folder-change behavior, and acceptable handling of external projects and large workspace directories.
No open issues 🎉
What changed in this PR
Restores workspace-root-only folder reporting to the Copilot language client to reduce startup delays in workspaces with many projects, addressing the regression described in #408 after #373.
Changes:
- Overrides
workspaceFolders()to return only the Eclipse workspace root. - Adds a test verifying that an open project does not appear as a separate workspace folder.
| File | Description |
|---|---|
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageClient.java |
Restores workspace-root-only folder reporting. |
com.microsoft.copilot.eclipse.core.test/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageClientTests.java |
Tests folder reporting with an open project. |
Review effort: Balanced
|
All my projects reside outside of the Eclipse workspace. |
Yes, that's one option.. With this PR we announce only the Eclipse workspace root, exactly as 0.20 did (#136 until #373). Chat, custom Announcing the common git root instead would also reduce the number of folders, but that root is a huge tree (in The proper fix is in the CLS: it calls Andrey Loskutov (@iloveeclipse), it would be great if you could find some time to test this PR with some of your workspaces. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Related to microsoft#408 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
05ed922 to
f8331c7
Compare
Related to #408, #373
Since #373 removed the
CopilotLanguageClient.workspaceFolders()override, LSP4E announces every open project as aworkspace folder in
initializeandworkspace/didChangeWorkspaceFolders. With ~400 projects, the CLS isCPU-bound for 8 – 13 minutes after startup; with ~60 projects, for a few seconds (see analysis in #408).
Changes
Risks
Verification
Verified on RHEL 9.6 with ~400 projects: the CLS is no longer CPU-bound for minutes after starting Eclipse. The
custom instructions listed in the preferences are the same as before. Not yet verified: whether custom
instructions are applied in chat responses, and the other Copilot features.
This is a workaround; the root cause is in the CLS (see #408). Feel free to reject it in favour of a CLS fix.