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

Auto search (Search in Files) doesn't start automatically #162531

Closed
burekas7 opened this issue Oct 2, 2022 · 17 comments
Closed

Auto search (Search in Files) doesn't start automatically #162531

burekas7 opened this issue Oct 2, 2022 · 17 comments
Assignees
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster search Search widget and operation issues

Comments

@burekas7
Copy link

burekas7 commented Oct 2, 2022

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

  • VS Code Version: 1.71.2
  • OS Version: Windows 10

Steps to Reproduce:

The correct behavior:

  1. Set the left tab to be on "Search in Files" tab.
  2. Open a file in the editor.
  3. Press Ctrl + Shift + F
  4. The search process start automatically and immediatly.

The bug:

  1. Set the left tab to be on any other tab which is not the "Search in Files" tab.
  2. Open a file in the editor.
  3. Press Ctrl + Shift + F
  4. The "Search in Files" tab is shown, but it forces me to press the "Enter" key in order to start the search which is very annoying.

Why the search doesn't start automatically as it does when the "Search in Files" tab is already opened?

Thanks.

@gjsjohnmurray
Copy link
Contributor

Maybe explained in #91901

@burekas7
Copy link
Author

burekas7 commented Oct 3, 2022

Maybe explained in #91901

Thanks.
They talked about it and mentioned it, but it seems that this feature that I mentioned here doesn't exist when the side view is not focused on the 'Search' view. The serach is auto triggered only when the 'Search' view is active, when you are on another view the Ctrl+Shift+F only take the word and put it in the serach field, but not trigger it.

@andreamah
Copy link
Contributor

@burekas7
I believe that the issue that was mentioned above (#91901) talked about the conditions that would trigger a search automatically. But from what I see, you would like a setting that allows you to always trigger a search whenever toggling to the search tab?

@andreamah andreamah added search Search widget and operation issues info-needed Issue requires more information from poster labels Oct 28, 2022
@burekas7
Copy link
Author

@andreamah
Yes

@andreamah andreamah added this to the Backlog Candidates milestone Oct 31, 2022
@andreamah andreamah added feature-request Request for new features or functionality and removed info-needed Issue requires more information from poster labels Oct 31, 2022
@andreamah andreamah removed this from the Backlog Candidates milestone Oct 31, 2022
@burekas7
Copy link
Author

burekas7 commented Nov 4, 2022

@andreamah
By the way, I have noticed that when I'm using vscode version in Mac Pro it's acting as I described here so the search is triggered automatically no matter on which tab I was of the side menu, it seems that the problem is with the Windows version of vscode or some specific configuration that I have in my Windows version.
Why is that?

@andreamah
Copy link
Contributor

it seems that the problem is with the Windows version of vscode or some specific configuration that I have in my Windows version

Do you have "search.seedWithNearestWord": true set on your Mac? Taking a closer look at this, it seems that it's like behavior for running CTRL+SHIFT+F is:

  • Focusing on the search tab and performing a search when you have new text (by default, this only sets new text when you have something highlighted)
  • Only focusing on the search tab if you're not introducing any new text.

Setting "search.seedWithNearestWord": true causes search to always run because it sets the search text with the nearest word, even when you don't have something highlighted.

@andreamah andreamah added the info-needed Issue requires more information from poster label Dec 6, 2022
@burekas7
Copy link
Author

burekas7 commented Dec 6, 2022

@andreamah
So it seems that in Windows the "search.seedWithNearestWord": true option doesn't cause search to run, it only sets the search text without triggering when the search tab isn't activated.

Windows and Mac have the same settings.json file, and both have this setting enabled:
"search.seedWithNearestWord": true

On Windows when doing the CTRL+SHIFT+F command

  • When the search bar is not selected: It only set the search text without triggering. (Forces me to press the Enter key for triggering)
  • When the search bar is selected before: It set the search text and triggering.

On Mac when doing the CMD+SHIFT+F command:

  • When the search bar is not selected: It set the search text and triggering. (As desired)
  • When the search bar is selected before: It set the search text and triggering.

These are the settings which related to the search in my settings.json:

  //=================================================
  //Search settings
  //=================================================
  "search.seedWithNearestWord": true,
  "search.seedOnFocus": true,
  "search.smartCase": true,
  //"search.useIgnoreFiles": true,
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/*.code-search": true
  },

@andreamah
Copy link
Contributor

What other search settings do you have on your windows machine? I can't seem to repro that. Also, which version of vscode are you running?

@burekas7
Copy link
Author

burekas7 commented Dec 6, 2022

What other search settings do you have on your windows machine? I can't seem to repro that. Also, which version of vscode are you running?

These are the settings which are related to the search in my settings.json:
(Same on both Windows and Mac)

  //=================================================
  //Search settings
  //=================================================
  "search.seedWithNearestWord": true,
  "search.seedOnFocus": true,
  "search.smartCase": true,
  //"search.useIgnoreFiles": true,
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/*.code-search": true
  },

Windows version:

Version: 1.73.1 (system setup)
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T04:27:29.066Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Mac version:

Version: 1.72.2 (Universal)
Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
Date: 2022-10-12T22:16:30.254Z (1 mo ago)
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 22.1.0
Sandboxed: No

@andreamah
Copy link
Contributor

When you say "when the search bar is not selected", what do you mean? Does this mean that it's not on the search tab?
image

@burekas7
Copy link
Author

burekas7 commented Dec 6, 2022

@andreamah
Exactly.
While the search bar is already opened the search start automatically,
While it isn't, it changes to the search bar with the correct text for searching that I stand on it, but unless I press the Enter key the search doesn't start.

@andreamah
Copy link
Contributor

What is an example of when the search bar is not opened? can you take a screenshot or screen gif of the issue? I think I'm having trouble understanding the exact situation where the search doesn't start automatically.

@burekas7
Copy link
Author

burekas7 commented Dec 6, 2022

@andreamah

I recorded a short video that describes the issue:
https://www.veed.io/view/f35d1b08-3b92-422a-bae3-ec261acf4d16?panel=share

In the video you can see the side bar on each case as I described above.
You can see when the side bar is on any other tab which is not the search itself, the search isn't triggered automatically (Only by pressing Enter), the search do starts automatically only when the search tab is opened and selecting a different text for searching.
Hope it will be more clear now.

@andreamah
Copy link
Contributor

I'm trying out the same flow as you and am getting different results (I also pasted in the settings that you shared):
Recording 2022-12-06 at 17 01 16

Am I taking the right steps to try to replicate the bug?

@burekas7
Copy link
Author

burekas7 commented Dec 7, 2022

@andreamah
Yes, it seems so.
Is there any other guess what kind of other settings or keybinding that can interrupt this on my Windows version?

Look at this:
I have also an external KeysShortcut extension:
ccwq.window-webstorm-keybindins
You can see a duplicate with "Ctrl Shift F"
image

@burekas7
Copy link
Author

burekas7 commented Dec 7, 2022

@andreamah

Yes.
This was the problem, I updated the "When" of the extension to be the same as default and now it works.

  • I don't know why they set it with this condition: && !searchViewletVisible and what is the meaning of the default addition && neverMatch =~ /doesNotMatch/

image

@andreamah
Copy link
Contributor

Yeah, these should be the detaul ones:
image

You can use the "Start Extension Bisect" command to show which extension set that keybinding, but I think that was the issue. Glad you were able to find that!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 21, 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 info-needed Issue requires more information from poster search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

4 participants