Repository navigation
Make autoTestDiscoverOnSavePattern mergeable across settings scopes - #26291
Open
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Open
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Conversation
Change the setting to an object of glob patterns mapped to booleans so VS Code merges entries the same way it merges files.exclude. A saved string glob is still honored. Co-authored-by: Mohammad Malik <mohammad-malik@users.noreply.github.com>
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.
Fixes #24848
Summary
python.testing.autoTestDiscoverOnSavePatternis now an object of glob patterns mapped to booleans. VS Code merges that object across default, user, workspace, and folder settings the same way it mergesfiles.excludeandsearch.exclude, so a pattern set in user settings and another set in workspace settings both apply. Set a pattern tofalseto turn off that one pattern from a broader scope, including the default**/*.py.A saved file triggers discovery when it matches any enabled pattern. Patterns are matched against the workspace-relative path and the absolute path, and Windows separators are normalized before matching.
A previously saved string glob is still honored at runtime, so existing settings keep working. A string replaces the whole value and is not merged across scopes. The setting contribution is now an object, matching the
files.excludeeditor, so a saved string can show a schema warning until it is switched to the object form.How I tested
With Node 22.21.1:
npx tsc -p ./(one-shot equivalent ofnpm run compile, which istsc -watch)npm run lintnpm run format-checknpm run test:unittests— 5289 passing, 38 pending