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

Search limited to open files #174507

Closed
mforkel opened this issue Feb 15, 2023 · 15 comments
Closed

Search limited to open files #174507

mforkel opened this issue Feb 15, 2023 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@mforkel
Copy link

mforkel commented Feb 15, 2023

Type: Bug

Only files open in the editor are searched.

I checked all potential pitfalls described in Missing search results. E.g., Search only in Open Editors is not activated and the files don't use CR as end-of-line characters.

The problem occurs on a remote host running Raspbian Stretch, and was discovered after an upgrade of the server to version 1.75.1. Since the host wasn't used for a while, it is not possible to tell whether the search worked before the upgrade. The problem occurs for all folders tested and for two users.

The problem does not occur on the host running VS Code itself and not with VS Code server on an x64 host with Debian Bullseye.

VS Code version: Code 1.75.1 (441438a, 2023-02-08T21:32:34.589Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Sandboxed: No
Remote OS version: Linux arm 4.19.66-v7+

System Info
Item Value
CPUs Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz (4 x 2594)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: unavailable_off
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) undefined
Memory (System) 15.81GB (6.98GB free)
Process Argv --folder-uri vscode-remote://ssh-remote%2B7b22686f73744e616d65223a227365727669222c2275736572223a22726f6f74227d/var/www/wiki/dokuwiki
Screen Reader no
VM 0%
Item Value
Remote SSH: servi
OS Linux arm 4.19.66-v7+
CPUs ARMv7 Processor rev 5 (v7l) (4 x 900)
Memory (System) 0.90GB (0.12GB free)
VM 0%
Extensions (31)
Extension Author (truncated) Version
debian-vscode daw 0.1.2
remotehub Git 0.50.0
l13-diff L13 1.0.3
autoconf mae 0.1.0
vscode-apache mrm 1.2.0
vscode-language-pack-de MS- 1.75.2023021509
jupyter-keymap ms- 1.0.0
remote-ssh ms- 0.96.0
remote-ssh-edit ms- 0.84.0
remote-wsl ms- 0.75.3
azure-repos ms- 0.26.0
remote-explorer ms- 0.2.0
remote-repositories ms- 0.28.0
vscode-intelephense-client bme 1.9.5
vscode-eslint dba 2.4.0
svn-scm joh 2.15.7
l13-diff L13 1.0.3
vscode-language-pack-de MS- 1.75.2023021509
isort ms- 2022.8.0
python ms- 2023.2.0
vscode-pylance ms- 2023.2.20
jupyter ms- 2023.1.2010391206
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.14
vscode-jupyter-cell-tags ms- 0.1.6
vscode-jupyter-slideshow ms- 0.1.5
vscode-commons red 0.0.6
vscode-xml red 0.24.0
vsregex Ste 0.1.0
shellcheck tim 0.29.4
php-debug xde 1.31.1
@andreamah
Copy link
Contributor

Do you have a workspace open when you perform your search?

@andreamah andreamah added the info-needed Issue requires more information from poster label Feb 21, 2023
@mforkel
Copy link
Author

mforkel commented Feb 22, 2023

Yes, its a workspace for one directory on the remote host. In the integrated terminal, a grep -slr ABC * returns 61 hits for files containing ABC (and even more in a subdirectory excluded by files.exclude, files.watcherExclude, and search.exclude in the workspace settings).

I noticed something else: In order to compile the above answer, I had to open VS Code for the workspace. A search returned no hits, even though one of the files containing the search term was among the (re)opened ones. But it was not the front one (i.e. the file contents was not visible). Once I had selected the tab, another search would return hits for the search terms in the file.

@vscodenpa
Copy link

Hey @andreamah, this issue might need further attention.

@mforkel, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@andreamah
Copy link
Contributor

Sorry for replying so late, I seemed to have missed this. If you do the following, what logs do you get?

  1. run Developer: Set Log Level in the command palette and set Trace
  2. do a search
  3. In the bottom panel, check logs in the Extension Host channel in the Outputs tab

@mforkel
Copy link
Author

mforkel commented May 20, 2023

Thanks for looking into this, @andreamah. Unfortunately, I can't open the integrated terminal anymore due to #180798. Is there any other way to access the extension host channel output?

@andreamah
Copy link
Contributor

You can open the command palette and run Developer: Open Logs Folder. Then, the extension host log should be in the window# directory, as exthost.log.

@mforkel
Copy link
Author

mforkel commented May 24, 2023

VS Code version: 1.78.2 (system setup)
Commit: b3e4e68
Date: 2023-05-10T14:39:26.248Z
OS version: Windows 10 Pro 22H2 19045.2965
Remote OS version: Linux 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux

The problem still exists. My test setup:

test_search/
├── dir1
│   ├── file1.1
│   └── file1.2
├── dir2
│   ├── file2.1
│   └── file2.2
├── file1
└── file2

2 directories, 6 files

Three of the files contain the string ABC:

test_search $ grep -slr ABC *
dir1/file1.1
dir2/file2.1
file1

A search finds those and only those files that are currently open.

A search does not create any log entries in window#\exthost\exthost.log nor any other file in window#\exthost. Here is the file exthost.log that was created when I opened the editor:

exthost.log

@andreamah
Copy link
Contributor

Oh right, you're on a remote. If you try to invoke ripgrep directly on your remote machine, what happens?
The path to my ripgrep executable on my WSL is /home/andrea/.vscode-server-insiders/bin/f6be5461f8bc69013a605f5baea834651c6589fb/node_modules/@vscode/ripgrep/bin/rg so it should look a little like that I believe.

@mforkel
Copy link
Author

mforkel commented May 24, 2023

I found ripgrep at ~/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/node_modules/@vscode/ripgrep/bin/rg. But I'm afraid I don't know how to invoke it directly. I tried this:

~/.vscode-server/bin/b3e4e68a0bc097f0ae7907b217c1119af9e03435/node_modules/@vscode/ripgrep/bin $ ./rg -h
./rg: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by ./rg)

But that is just #180798 once more.

@andreamah
Copy link
Contributor

Hmm ok, I see that you're getting the issue about minimum GLIBC, sort of like with microsoft/vscode-ripgrep#34. I'm going to try to stabilize the GLIBC version for this build for this anyways in microsoft/ripgrep-prebuilt#24 to match vscode's minimum version anyways, but I'll keep this issue here to link the upstream issue.

@andreamah andreamah added upstream-issue-linked This is an upstream issue that has been reported upstream bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels May 24, 2023
@andreamah andreamah added this to the On Deck milestone May 24, 2023
@mforkel
Copy link
Author

mforkel commented May 25, 2023

I'm not sure I understand the GLIBC conflict. The search extension in the editor does not trigger it. And I discovered the incomplete search results before 1.78. So if there's any other information I can provide, I'll be happy to do that.

@andreamah
Copy link
Contributor

It's because workspace-wide search relies on ripgrep, which requires GLIBC. During cross-compilation of the executable that we created for vscode, it must have enforced a new minimum GLIBC.

@mforkel
Copy link
Author

mforkel commented May 26, 2023

I'm sorry, I'm still confused :-). If ripgrep is required for the search and if ripgrep requires GLIBC 2.8 (as does the integrated terminal) which is not available in Stretch on ARM, why can I still perform a search in VS Code (even if the results are wrong)?

@andreamah andreamah added the search Search widget and operation issues label Dec 4, 2023
@andreamah
Copy link
Contributor

I'm sorry, I'm still confused :-). If ripgrep is required for the search and if ripgrep requires GLIBC 2.8 (as does the integrated terminal) which is not available in Stretch on ARM, why can I still perform a search in VS Code (even if the results are wrong)?

Apologies for the super late reply. The reason that you could search in open files was because we don't uses ripgrep there. For more info, it might help to take a look at https://github.com/microsoft/vscode/wiki/Search-Issues#notes-on-regular-expression-support

@andreamah
Copy link
Contributor

This should have been resolved with microsoft/vscode-ripgrep#40, please let me know if you still run into it.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

4 participants