Skip to content

fix(lsp): never scan the filesystem root for an opened document's siblings - #489

Merged
HuiJun merged 1 commit into
developfrom
fix/lsp-no-root-sibling-scan
Sep 21, 2026
Merged

HuiJun merged 1 commit into
developfrom
fix/lsp-no-root-sibling-scan

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What and why

Since sibling-import indexing landed (#467), Server.indexOpenedDirectory scans the directory of any document opened outside every workspace folder. The cmd/sysml-lsp tests open documents at file:///m.sysml, so the server walked / with its 2000-directory budget. On CircleCI that walk reaches /home/circleci/project/examples and parses thousands of corpus models before the budget runs out: TestStrictFlagServesStrictDiagnostics took over 17 minutes per subtest, and every develop build since #467 has failed Go race tests (no output for 30 min) and Go coverage profile (cmd/sysml-lsp hit the 30 min go test timeout).

indexOpenedDirectory now returns before taking the lock when filepath.Dir(name) is the volume root (/, C:\). A document at the root has no workspace and no plausible sibling set, and the walk from there is unbounded in work even when bounded in directories.

How it was verified

  • New TestOpeningFileAtFilesystemRootIndexesNothing in internal/frontend/lsp: opening /m.sysml records no openDirs and publishes no diagnostics.
  • go test -count=1 -race -run TestStrictFlagServesStrictDiagnostics ./cmd/sysml-lsp now completes in under 2 s.
  • gofmt -l, go vet, go test ./internal/frontend/lsp, python3 scripts/changelog.py check clean.

Checklist

  • make test and make lint pass locally (targeted packages; the full suite runs in CI)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

…lings

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review September 21, 2026 07:45

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit bd59ac7 into develop Sep 21, 2026
15 checks passed
@HuiJun
HuiJun deleted the fix/lsp-no-root-sibling-scan branch September 21, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant