Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"files to include" doesn't work with folder names containing glob characters #82415

Closed
cilerler opened this issue Oct 12, 2019 · 9 comments · Fixed by #166318
Closed

"files to include" doesn't work with folder names containing glob characters #82415

cilerler opened this issue Oct 12, 2019 · 9 comments · Fixed by #166318
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders search Search widget and operation issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@cilerler
Copy link

Issue Type: Bug

  1. Create a workspace add the following folder, plus couple of other folders
//...
    {
      "path": "C:\\Users\\...\\folder1",
    },
    {
      "path": "C:\\Users\\...\\folderNamed",
      "name": "folderNamed (Special Folder)"
    },
    {
      "path": "C:\\Users\\...\\folder2",
    }
//...
  1. go to explorer view tab
  2. create same file with lorem-ipsum text in all the folders
  3. right click on the folderNamed (Special Folder)
  4. click on File in Folder...
  5. ensure that files to include set as ./folderNamed (Special Folder)
  6. type lorem in the folder into the Search box
  7. you will see that it retrieves from folder1 and folder2 too

where it should only retrieve from folderNamed (Special Folder).
behaviour works fine on folder1 and folder2 since they are not named.

VS Code version: Code 1.39.1 (88f15d1, 2019-10-10T23:31:28.683Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.81GB (39.06GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (86)
Extension Author (truncated) Version
better-comments aar 2.0.5
markdown-imsize amo 0.0.2
azds azu 1.0.120191007
emojisense bie 0.5.3
markdown-mermaid bie 1.3.0
path-intellisense chr 1.4.2
vscode-markdownlint Dav 0.31.0
vscode-eslint dba 1.9.1
githistory don 0.4.6
xml Dot 2.5.0
gitlens eam 10.1.1
EditorConfig Edi 0.14.1
prettier-vscode esb 2.3.0
auto-close-tag for 0.5.6
auto-rename-tag for 0.1.0
dotnet-test-explorer for 0.7.1
vscode-pull-request-github Git 0.12.0
mdmath goe 2.4.0
cloudcode goo 0.0.12
asciidecorator hel 0.2.0
rest-client hum 0.22.2
ftp-simple hum 0.7.4
reg ion 1.0.1
markdown-extended jeb 1.0.13
markdown-extension-pack jeb 0.0.3
plantuml jeb 2.12.1
super-replace jeb 0.3.1
sharppad jma 1.1.0
vscode-peacock joh 3.1.5
vscodeilviewer jos 0.0.1
jq-syntax-highlighting jq- 0.0.2
docomment k-- 0.1.8
wordcounter kir 1.9.3
rainbow-csv mec 1.3.1
azure-pipelines ms- 1.157.4
vscode-apimanagement ms- 0.1.1
vscode-azureappservice ms- 0.16.0
vscode-azureeventgrid ms- 0.1.1
vscode-azurefunctions ms- 0.18.1
vscode-azurestorage ms- 0.7.2
vscode-cosmosdb ms- 0.11.0
vscode-docker ms- 0.8.1
vscode-logicapps ms- 0.2.18
vscode-kubernetes-tools ms- 1.0.4
mssql ms- 1.6.0
sqlops-debug ms- 1.3.0
vscode-postgresql ms- 0.2.0
remote-containers ms- 0.81.0
remote-ssh ms- 0.47.1
remote-ssh-edit ms- 0.47.1
remote-ssh-explorer ms- 0.47.1
remote-wsl ms- 0.39.9
vscode-remote-extensionpack ms- 0.17.0
autorest ms- 2.0.1
azure-account ms- 0.8.6
azurecli ms- 0.4.6
csharp ms- 1.21.4
github-issues-prs ms- 0.9.1
Go ms- 0.11.7
mono-debug ms- 0.15.8
powershell ms- 2019.9.0
vscode-node-azure-pack ms- 0.0.9
vscode-typescript-tslint-plugin ms- 1.2.2
vsliveshare ms- 1.0.950
vsliveshare-audio ms- 0.1.66
team ms- 1.149.2
azurerm-vscode-tools msa 0.7.0
debugger-for-chrome msj 4.12.0
color-highlight nau 2.3.0
vscode-versionlens pfl 0.24.0
material-icon-theme PKi 3.9.1
quicktype qui 12.0.46
vscode-yaml red 0.5.3
elastic ria 0.13.3
vscode-odata sta 0.1.0
vscode-markdown-paste-image tel 0.12.3
usql-vscode-ext usq 0.2.15
vscodeintellicode Vis 1.1.9
application-insights Vis 0.4.2
vscode-redis vit 1.2.0
azure-iot-edge vsc 1.17.0
azure-iot-toolkit vsc 2.10.0
vscode-ansible vsc 0.5.2
WebTemplateStudio-dev-nightly WAS 0.0.1925201
vscode-todo-highlight way 1.0.4
t4-support zbe 0.4.3
@roblourens
Copy link
Member

Currently this doesn't work for folders with glob characters in their name...

@roblourens roblourens added feature-request Request for new features or functionality search Search widget and operation issues labels Oct 16, 2019
@roblourens roblourens added this to the Backlog milestone Oct 27, 2019
@roblourens roblourens changed the title Find in Folder includes all folders upon search on named folder in workspace "files to include" doesn't work with folder names containing glob characters Jul 28, 2020
@diego-mazzaro
Copy link

Just to clarify.. if this may help for something to be done.. It is not that "it doesn't work with glob characters".. ..since glob characters have a meaning they just need to be escaped in the search pattern. (see #111677 )
So the bug is in the pre-filled value when using "Find in Folder" not being escaped and not in the "files to include".
Maybe in the "files to include" side we may ask a feature request to enable/disable glob.. ..but is not a bug there.

@my-lalex
Copy link

Just to clarify.. if this may help for something to be done.. It is not that "it doesn't work with glob characters".. ..since glob characters have a meaning they just need to be escaped in the search pattern. (see #111677 ) So the bug is in the pre-filled value when using "Find in Folder" not being escaped and not in the "files to include". Maybe in the "files to include" side we may ask a feature request to enable/disable glob.. ..but is not a bug there.

I agree there. When you input "by hand" a folder or pattern, the better idea would be to enter the path and not the folder's name... or escape its name.
But on the side of the "Find in folder" contextual menu option, it's definitively a bug: the pre-filled "files to include" field should contain either the escaped folder's name or its path...

@shmdhussain
Copy link

This is very important feature to search the files in NextJS Projects, which is using [ ] in the folder name.

currently I am unable to search in any folder in nextjs contains the character [ or ]

@jinnS
Copy link

jinnS commented Aug 28, 2022

This BUG prevents searching in properly named next.js projects, where square brackets in folder names are used for REST API pathing such as api/collection/[id] by putting an actual folder named '[id]', see official documentation https://nextjs.org/docs/routing/dynamic-routes . Next.js is one of the most popular react frameworks, maintained by Vercel. Please fix this ! It works fine in Intellij, and I'll have to switch back if you don't.

Please consider re-categorizing this as a bug ticket (and a critical one at that), not a feature request.

@vczh
Copy link

vczh commented Sep 6, 2022

Disappointing to see maintainers keep resolving bugs to this one bug no progress has been made. It has been making trouble to view logs for a long time.

@m1no
Copy link

m1no commented Sep 23, 2022

@roblourens Why is this a feature request? When it is clearly a bug, let me explain: The search is broken, it pretends to search in all folders, when it clearly doesn't. For a "search" feature not searching in all elements because of special characters in a folder name, is a clear "false-negative" (it does find something, that it should find when it exists) and as such a bug. Those special characters are allowed characters in any operating system for folder names that VSCode supports (e.g., Microsoft Windows). Aka VSCode does currently not support them same file path character sets that the underlying OS supports. For a file editor/IDE a pretty bad starting point, not considering this as a bug.

@vczh
Copy link

vczh commented Sep 23, 2022

@m1no Theoretically this is the same kind of problem compared to SQL injection, but these "new programmers" just don't want to admit it.

@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jan 31, 2023
@rzhao271 rzhao271 modified the milestones: Backlog, February 2023 Feb 21, 2023
@andreamah andreamah added the verification-needed Verification of issue is requested label Feb 22, 2023
@andreamah
Copy link
Contributor

andreamah commented Feb 22, 2023

verif steps:

  1. Name a folder using square brackets (ie: [test])
  2. From the explorer, Find in Folder...
  3. The brackets should be escaped with other square brackets and you should be able to search the contents.

@rzhao271 rzhao271 added the verified Verification succeeded label Feb 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders search Search widget and operation issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.