Repository navigation
Announce only the workspace root as workspace folder to the CLS - #504
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 <[email protected]>
Related to microsoft#408 Co-authored-by: Copilot App <[email protected]>
05ed922 to
f8331c7
Compare
|
If we announce only the Eclipse workspace root, will CLS still finds all skills and are .md under each IProject? I remember it is not. |
I tested this with a skill in Announcing only the workspace root doesn't affect discovery. According to Copilot's analysis, the CLS takes the folders to search for skills, instructions, prompts and agents from each request's |
|
Dietrich Travkin (@travkin79) just for a double confirm, in your case, if we choose report git root + latest CLS, the performance issue will still occur, is it correct? |
|
Hello Sheng Chen (@jdneo),
Yes, exactly. I took this PR which only send the workspace root to CLS, adapted the CLS version in |
|
Ok, one potentially issue with the workspace root approach is that those md files in the project level will not auto updated (requires a ide restart). But that seems to be acceptable. |
|
So can we get this merged? |
|
Merged, the nightly release should available tomorrow |
|
Thank you Dietrich Travkin (@travkin79) for contribution. |
|
Andrey Loskutov (@iloveeclipse) Is everything ok with the new nightly? I'm about to bump versions. |
So far yes. Latest nightly fixes 3 major issues for us (some were fixed before) :
So in sum, these fixes together would qualify for 0.22 version bump :-) |
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.