Search "Files to Include" behaves incorrectly when workspace root and nested file patterns are specified together
@osortega is already working on this.
Since Jun 29, 2026.
Assessment
This issue has not been assessed yet.
Description
When a workspace root pattern and nested file patterns are specified together in files to include, the search scope is narrowed to the more specific patterns.
For example, searching with ./ searches the entire workspace.
However, searching with ./, ./folder/file searches only ./folder/file.
This may be considered an unusual pattern combination, but when include patterns are generated programmatically by an extension, the current behavior requires manual deduplication.
Also, semantically, adding an include pattern should not reduce the search scope. In this case, adding a pattern that is already contained within another include pattern changes the search results.
The issue appears to be specific to workspace root patterns. Similar combinations using ordinary folder paths work as expected (2.c vs 2.d test).
Reproduction tests for the attached zip file.
-
Open
singleFolderProjectand search forcontent
a)./works correctly
b)./, ./folder1/file_1_1.txt(or, ./folder1/file_1_1.txt) incorrectly narrows the search scope
c)./folder1, ./folder1/file_1_1.txtworks correctly -
Open
multiRootProject/workspace.code-workspaceto test in multi-root workspace
a)./works correctly
b)./, ./wsFolder1/folder1incorrectly narrows the search scope
c)./wsFolder1, ./wsFolder1/folder1/wsf1_1.txtincorrectly narrows the search scope
d)./wsFolder1/folder1, ./wsFolder1/folder1/wsf1_1.txtworks correctly
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·