Add option to ignore files outside the workspace - #2227
Open
QinXi (QinXi-ai) wants to merge 3 commits into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@microsoft-github-policy-service agree |
Dirk Bäumer (dbaeumer)
requested changes
Sep 1, 2026
Author
|
Addressed both review points in 70c63af:
Validation: client TypeScript compile passed, all 9 client tests passed, and client/server lint passed. |
There was a problem hiding this comment.
🟡 Changes recommended
Virtual documents are incorrectly excluded, and workspace-folder transitions leave document synchronization state inconsistent.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds opt-in workspace-boundary filtering for ESLint validation while preserving standalone-file behavior.
Changes:
- Adds and documents
eslint.ignoreOutsideWorkspace. - Extracts validation logic into an injectable, tested validator.
- Refreshes document synchronization when workspace folders change.
File summaries
| File | Description |
|---|---|
$shared/settings.ts |
Adds the shared setting type. |
package.json |
Declares the resource setting. |
README.md |
Documents the option. |
client/src/validator.ts |
Implements workspace-boundary validation. |
client/src/tests/validator.test.ts |
Tests boundary behavior. |
client/src/extension.ts |
Uses the validator during activation. |
client/src/client.ts |
Refreshes synchronization and sends settings. |
server/src/eslint.ts |
Adds the server-side default. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Problem
Opening a local file outside the current workspace can make the extension load and run an unrelated ESLint configuration. The existing behavior is useful for single-file workflows, so changing it unconditionally would break compatibility.
Design
eslint.ignoreOutsideWorkspaceresource setting, defaulting tofalse.file:documents that do not belong to any workspace folder.eslint.validaterules so the option consistently blocks external files.Tests
npm run compilenpm run lintnpm test(client: 7 passed; server: 5 passed)Fixes #1805