Skip to content

Conversation

@csacca
Copy link

@csacca csacca commented Nov 2, 2025

Summary

  • Prevent server crashes when a client claims workspaceFolders capability but returns error/null for workspace/workspaceFolders.
  • Treat request error/null as no folders; prefer InitializeParams.workspaceFolders when present; log a warning.
  • Start PathSynchronizer only after a successful folders fetch.

Repro

Changes

  • Defensive handling around getWorkspaceFolders at call sites:
    • src/lifecycle/MatlabSession.ts
    • src/lifecycle/PathSynchronizer.ts
    • src/indexing/WorkspaceIndexer.ts
  • Cache folders from InitializeParams for later use.
  • Tests covering: capability=false, success path, error path.

Notes

  • Developed against a release tag; changes rebased/cherry‑picked onto main for this PR.
  • No breaking API changes.

…s but fail workspace/workspaceFolders; cache InitializeParams folders; gate PathSynchronizer; add tests (fixes mathworks#70)
@dklilley dklilley self-assigned this Nov 3, 2025
@dklilley
Copy link
Member

dklilley commented Nov 3, 2025

Thanks for reporting and working to resolving this!

I will review this as soon as I can, but it may not be until next week due to current commitments. Thanks for your patience!

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.

2 participants