microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.66k stars 28.68k forks source link

folder starting with ./ is not found in search #209936

Closed ttodua closed 4 months ago

ttodua commented 5 months ago

Type: Bug

I have recorded the 1-minute video to show the bug: https://streamable.com/7ga23a

VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 5800H with Radeon Graphics (16 x 3194)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.41GB (13.35GB free)| |Process Argv|C:\\Users\\iuzeri\\Desktop\\New folder\\app\\myws.code-workspace --crash-reporter-id 882bc285-0263-4033-b4e8-7c8dfd94e0d3| |Screen Reader|no| |VM|0%|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- vscode-intelephense-client|bme|1.10.4 vscode-eslint|dba|2.4.4 gitlens|eam|14.9.0 prettier-vscode|esb|10.4.0 copilot|Git|1.178.0 remotehub|Git|0.62.0 vscode-favorites|how|1.11.0 vscode-docker|ms-|1.29.0 csdevkit|ms-|1.4.29 csharp|ms-|2.23.15 vscode-dotnet-runtime|ms-|2.0.3 vscodeintellicode-csharp|ms-|2.0.25 debugpy|ms-|2024.4.0 isort|ms-|2023.10.1 python|ms-|2024.4.0 vscode-pylance|ms-|2024.4.1 remote-ssh|ms-|0.110.1 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.88.0 vscode-remote-extensionpack|ms-|0.25.0 remote-explorer|ms-|0.4.3 remote-repositories|ms-|0.40.0 remote-server|ms-|1.5.1 vscode-typescript-next|ms-|5.5.20240408 tortoisegit-buttons-in-vscode|Puv|0.1.37 action-buttons|seu|1.2.2 vscode-stylelint|sty|1.4.0 intellicode-api-usage-examples|Vis|0.2.8 vscodeintellicode|Vis|1.3.1 volar|Vue|2.0.10 php-debug|xde|1.34.0 php-pack|xde|1.0.3
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp2r3:30993541 dsvsc020:30976470 pythonait:31006305 gee8j676:31009558 dsvsc021:30996838 gd77d436:30999572 ```
andreamah commented 5 months ago

I cannot access the link that you provided. Does the filename itself include ./? We use this to indicate that you're searching in a particular root in a multi-root workspace. What is the use case in having these characters in the files to include (if that's what you're doing)?

ttodua commented 5 months ago

dang, streamable deletes files quickly if not registered. here uploaded again: https://www.dropbox.com/scl/fi/zufy5opdzopewfuywfx4x/Code_g3hTVTnuke.mp4?rlkey=rmwwtzf4udh4iokx0zbpxop1t&dl=0

andreamah commented 4 months ago

When you save as a workspace, searches should be prefixed by the workspace name. In your case, it would be ./app/src. This is because there could be multiple workspaces open.

ttodua commented 4 months ago

but it is very unintuitive, how could user guess that they need to prefix with workspace name? in error message, it might be added, or even vscode automatically understand that by ./src user means that folder (if vscode doesnt find "multiple workspaces" there)

andreamah commented 4 months ago

Unfortunately, we approach this situation using the same logic as a multi-root scenario. In the case where somebody adds/removes workspace roots, we want consistent behavior.

ttodua commented 4 months ago

at least, there could have been some hint or whatever, so users could know that they need to input workspace name. at least, VScode could detect if only one workspace is open, and if user enters some dir there, popup/hint could be shown like "Hey, we found ./src folder but probably you missed to input workspace name in front" (just imitation, you can sentence it better) instead of "./src directory not found" so many users like me wont search for this. from now I know, but i say just for the sake of other users