fix(lsp): walk to enabled nested workspaces#34654
Conversation
bd2a1a0 to
3e9533e
Compare
Co-Authored-By: Divy Srivastava <[email protected]>
3e9533e to
cd1f829
Compare
|
@divybot Update PR desc, how does this fix the issue? |
|
Updated the PR description with a summary, the mechanism of the fix, and the regression tests covering it. |
|
Have you looked at the discussion in the issue? Can you try to reproduce it |
|
Yes. I read through #28681 and cloned the linked repro (
I verified the command-line part matches the issue: from I pushed e65233b to make the regression tests mirror that repro shape more closely: |
|
Have you tried e2e using lsp? I wanna see perf numbers before and after |
|
I ran an e2e LSP measurement against the linked repro (
Method:
Results, medians from 5 warm runs:
Interpretation: before is faster to ready because it is wrong for this repro: it preloads zero server docs and never reaches the enabled backend workspace through the disabled root. After loads the expected backend workspace files ( Caveat: in this isolated e2e run the diagnostic request reports npm-install-related diagnostics for |
Closes denoland/divybot#390
Fixes #28681
Summary
This fixes LSP workspace preloading when a workspace root is disabled but a nested workspace folder is explicitly enabled.
How this fixes the issue
The bug happened because
Inner::walk_workspace()asksSettings::path_enabled()before descending into each directory. Withdeno.enabledisabled at the root and enabled only for a nested workspace, the walk would skip disabled ancestor directories likeapps/before it could ever reach the enabled folder, so the LSP never discovered that nested workspace'sdeno.jsonor source files.This change keeps those ancestor directories walkable when they contain a separately enabled workspace folder, while preserving the disabled result for unrelated root files and sibling directories. That lets the preload walk reach the enabled nested workspace without re-enabling the rest of the disabled root.
Tests
config_path_enabled_for_nested_workspace_foldercovers theSettings::path_enabled()behavior for disabled roots and enabled nested workspaces.test_walk_workspace_reaches_enabled_nested_workspaceverifies the actual workspace walk reaches the nested workspace files and excludes disabled siblings/root files.