Skip to content

Add multi-root workspace support#275

Closed
mattmasson wants to merge 5 commits intomasterfrom
multiworkspace
Closed

Add multi-root workspace support#275
mattmasson wants to merge 5 commits intomasterfrom
multiworkspace

Conversation

@mattmasson
Copy link
Copy Markdown
Member

Summary

Enables VS Code multi-root workspace support. The main gap was to ensure that library symbol configurations in different workspace folders don't overwrite each other.

Changes

Server

  • Enabled workspace folder support in LSP capabilities (workspaceFolders: { supported: true, changeNotifications: true })

Client — Per-folder symbol management

  • LibrarySymbolManager: Replaced global registeredSymbolModules: string[] with per-folder Map<string, string[]>. Module names namespaced as folderKey::moduleName to prevent
    cross-folder collisions (e.g., two folders both having MyLib.json).
    • refreshSymbolDirectoriesForFolder(folderKey, directories) — only clears/reloads symbols for the specified folder
    • removeSymbolsForFolder(folderKey) — removes only that folder's symbols
    • removeAllSymbols() — clears all folders
    • refreshSymbolDirectories() — retained as convenience for single-folder/no-folder workspaces
  • extension.ts: Reads additionalSymbolsDirectories config scoped to each workspace folder URI. Handles onDidChangeWorkspaceFolders to register/unregister symbols when folders are
    added or removed. Falls back to global config when no workspace folders exist.

Configuration

  • Changed additionalSymbolsDirectories scope from machine-overridable to resource so different workspace folders can have different values

Tests

  • 6 mock-based unit tests in librarySymbolManager.test.ts: per-folder namespacing, cross-folder isolation, folder removal, re-refresh behavior
  • 6 multi-root integration tests in multiRootWorkspace.test.ts: runs in a separate VS Code instance with a .code-workspace file pointing to two fixture folders with different
    symbol libraries. Verifies extension activation, per-folder symbol loading, folder removal, and scoped config reading.
  • Separate test run entry in .vscode-test.js for multi-root workspace tests (required — VS Code can only open one workspace type per instance)

Other

  • Added .github/copilot-instructions.md (properly named) with build/test commands, architecture overview, and code conventions
  • Removed old .github/.copilot.instructions.md (incorrect dotfile format)
  • Ran npm audit fix across all packages

@mattmasson mattmasson enabled auto-merge (squash) April 3, 2026 16:42
@mattmasson
Copy link
Copy Markdown
Member Author

closing this in favor of #276

@mattmasson mattmasson closed this Apr 3, 2026
auto-merge was automatically disabled April 3, 2026 16:49

Pull request was closed

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