Repository navigation
Support per-folder enable/disable for the singleton server in multi-root workspaces - #62
Draft
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 4 commits into
Draft
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 4 commits into
Eduardo Villalpando Mello (edvilme) with Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
[WIP] Add support for singleton server instance in multi-root workspaces
Support per-folder enable/disable for the singleton server in multi-root workspaces
Jun 17, 2026
…eton-server-instance # Conflicts: # typescript/src/settings.ts Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Eduardo Villalpando Mello (edvilme)
requested a balanced review from Copilot
September 14, 2026 17:04
There was a problem hiding this comment.
🟡 Changes recommended
Omitted folders still receive enabled server defaults, and a duplicate import prevents test compilation.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds per-folder tool enablement for singleton LSP servers in multi-root workspaces.
Changes:
- Adds enablement helpers and workspace filtering.
- Exports and documents the new APIs.
- Adds multi-root tests.
File summaries
| File | Description |
|---|---|
typescript/src/settings.ts |
Implements enablement filtering. |
typescript/src/index.ts |
Exports new helpers. |
typescript/tests/settingsWorkspace.test.ts |
Adds enablement tests. |
README.md |
Documents multi-root behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+346
to
+347
| workspaces.filter((w) => isToolEnabledForWorkspace(namespace, w)).map((w) => | ||
| getWorkspaceSettings(namespace, w, toolConfig, resolveInterpreter), |
Comment on lines
+75
to
+77
| - `getExtensionSettings(namespace, toolConfig, resolveInterpreter)` automatically | ||
| omits folders where the tool is disabled, so the shared server never lints | ||
| opted-out folders. |
Merge current main and retain disabled workspace settings for explicit participation checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 85ef72cc-9e26-4bc4-b1c3-55256d9bef91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refresh this existing draft onto current main after the S1–S9 refactoring. Keep the existing singleton language client/server; provide explicit opt-in per-folder participation mechanics related to #49, without changing consumer execution policy or adopting them in any extension.
The earlier draft's disabled-folder omission was unsafe: Python could route an omitted root's documents to enabled fallback settings. This revision removes the folder-filter helpers and retains settings and routing identities for every enabled and disabled root.
Supported contract
ToolConfig.workspaceEnablementSetting?: string, also available throughToolDefinition<TSettings>, maps a contributed resource-scoped boolean key such asenabled,enable, orrunTools._toolEnabledboolean in workspace/global settings. Only literal booleanfalsedisables; missing or other wire values stay enabled. Existing consumer-owned settings such as Pylint'senabledare not replaced.getWorkspaceSettings,getExtensionSettings, andgetGlobalSettingsagree on this wire contract. Common activation subscriptions automatically track the configured key and restart the singleton with refreshed settings; manually composed lifecycles must arrange their own refresh.ToolServer.is_document_enabled(document)supplies the participation decision throughget_settings_by_document. A handler must consult it before tool work. The unchanged legacyget_settings_by_pathlookup is not enablement-aware and must not be used to infer participation. This does not automatically gateexecute_tool, register handlers, clear diagnostics, or change existing/manual consumers.See the supported opt-in contract.
Validation
npm run build;npm test -- --reporter dot— 207 passing, including settings and real activation/restart paths with and without per-project environments.python -m pytest tests -q— 364 passed, 2 skipped before the independent-review follow-up. Follow-up validation:python -m pytest tests\test_server.py tests\test_server_stdio.py -q— 138 passed, including the Windows-only casing regression; changed-file Python linters pass. Full suites and TypeScript were not rerun for this Python-only follow-up.vscodeapi.ts.npm run format-checkstill reports the same 15/15 source-file failures independently reproduced from untouched current main; no unrelated formatting cleanup.enabled:false, all-disabled and mixed roots, nested re-enablement, global/absent-document fallbacks, notebook filesystem paths, live settings updates, consumer-owned execution gating, relative-document/CWD fallback, Windows case-differing paths and adjacent-prefix nonmatching, and false-like wire values.No VS Code extension-host/Pylint smoke test, consumer updates, package-version changes, PR merge, or draft-state change is included. This is shared participation plumbing, not a claim that all of #49 or consumer adoption is complete.