microsoft / vscode

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

search error #224248

Open 1684838553 opened 2 months ago

1684838553 commented 2 months ago

Does this issue occur when all extensions are disabled?: Yes/No

This problem occurs on the vscode server. Here is the version information.

Version: 1.91.1 Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:08:03.155Z Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Question one.

Steps to Reproduce:

  1. Open https://vscode.dev/
  2. Open any project
  3. Open a file that is not in the current workspace
  4. Open the search view and select Search only in open Editors button
  5. Search Keyword

Bug:

  1. Select Search only in open Editors. No query result of other files, that is, the opened files are not queried.
  2. Nothing Happens When the View as List and View as Tree Buttons Are Clicked

search-1

Question two.

  1. Open https://vscode.dev/
  2. Open any project
  3. Open a file that is not in the current workspace
  4. Open the search view and select Search only in open Editors button
  5. The edit area opens only other files, that is, other files are opened, but the files in the current work area are not opened.
  6. Search Keyword

Bug: No search result is displayed in the search box and an error is reported.

search-2

1684838553 commented 2 months ago
  1. The edit area opens only other files, that is, other files are opened, but the files in the current work area are not opened.

This means that you open a file in the editing area that is not in the current workspace. You can refer to the file opened using the Open File... menu in the gif image.

andreamah commented 2 months ago

Yes, I can reproduce both of these bugs. I'll need to see what's going on with these open files...

andreamah commented 2 months ago

This might be fixed via https://github.com/microsoft/vscode/pull/224631. I will need to check once another insider's build is out.

andreamah commented 2 months ago

It actually isn't solved via the above commit, it seems. Will need to investigate further.

andreamah commented 5 days ago

Looking into this more, this happens because the opened file returns as !exists via the fileService.

@joyceerhl do you happen to know why this is happening?

Should this return false for out-of-workspace files in vscode.dev? https://github.com/microsoft/vscode/blob/1f263631accb5a7edf51cfa220ae2f65d8feade2/src/vs/platform/files/common/fileService.ts#L320