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

Find in files suddenly broken #45200

Closed
severak opened this issue Mar 7, 2018 · 12 comments
Closed

Find in files suddenly broken #45200

severak opened this issue Mar 7, 2018 · 12 comments
Assignees
Labels
info-needed Issue requires more information from poster search Search widget and operation issues

Comments

@severak
Copy link

severak commented Mar 7, 2018

Issue Type

Bug

Description

  1. open editor with files
  2. search for «something» in these files
  3. close all editors
  4. try to «something» find it again
  5. have headache, because «something» was not found now

Probably related to #22704.

BTW - is there any way how to destroy find in files search index? To me it looks like the search index is broken.

VS Code Info

VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:34:36.336Z)
OS version: Windows_NT x64 6.1.7601

System Info
Item Value
CPUs Intel(R) Pentium(R) CPU G630 @ 2.70GHz (2 x 2693)
Memory (System) 7.85GB (2.39GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
vscode-intelephense-client bme 0.8.8
githistory don 0.4.0
intellij-idea-keybindings k-- 0.2.21

(1 theme extensions excluded)

Reproduces without extensions
@vscodebot vscodebot bot added the search Search widget and operation issues label Mar 7, 2018
@roblourens
Copy link
Member

There is no index, but it works differently for open files vs files that are not open.

Does it never find results in files that are not open? Does it work in other folders?

@roblourens roblourens added the info-needed Issue requires more information from poster label Mar 7, 2018
@severak
Copy link
Author

severak commented Mar 7, 2018

It find in files which are open.
Files which are not open are practically unsearchable.
It's somewhat mysterious - this weird behavior began today, yesterday it was fine.

@roblourens
Copy link
Member

roblourens commented Mar 8, 2018

Have you upgraded to 1.21, just released? See if it's any different there.

If not, please do the following

  • Run the command "Set log level" and change it to "Trace"
  • Run the search again
  • Show all the search-related messages or errors in the "Log (Window)" output panel

image

@severak
Copy link
Author

severak commented Mar 8, 2018

Even more weird. Yesterday search was completely broken. Today it works fine and I am still on 1.20. 😕

I will log search trace if it went wrong again.

@severak
Copy link
Author

severak commented Mar 8, 2018

Suddenly, search broken again.

Here is the log:

[2018-03-08 12:06:02.448] [renderer1] [trace] SearchService#search {"type":2,"folderQueries":[{"folder":{"$mid":1,"fsPath":"c:\\Users\\Admin\\Projects\\irest","external":"file:///c%3A/Users/Admin/Projects/irest","path":"/c:/Users/Admin/Projects/irest","scheme":"file"},"fileEncoding":"utf8"}],"usingSearchPaths":true,"maxResults":10000,"contentPattern":{"pattern":"$__POST","isRegExp":false,"isCaseSensitive":false,"isWordMatch":false,"wordSeparators":"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?","isSmartCase":false},"useRipgrep":true,"disregardIgnoreFiles":true,"disregardExcludeSettings":true,"ignoreSymlinks":false}
[2018-03-08 12:06:02.505] [renderer1] [debug] SearchService#search rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case --max-filesize '17179869184' --no-ignore --follow --fixed-strings -- '$__POST' 'c:\Users\Admin\Projects\irest'
 - cwd: c:/
 - Sibling clauses: {}

(Opened VSCode with no editors and searched for $__POST variable.)

@roblourens
Copy link
Member

Does it work in other folders? Any pattern to where it works or doesn't?

Have you tried 1.21?

@vscodebot vscodebot bot closed this as completed Mar 16, 2018
@vscodebot
Copy link

vscodebot bot commented Mar 16, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@krasi-georgiev
Copy link

Still an issue with 1.21

it is quite random so can't give more info how to replicate.

@krasi-georgiev
Copy link

@roblourens this is still an issue on

Version 1.21.1
Commit 79b44aa
Date 2018-03-14T14:46:30.761Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

drone/autoscaler
Search for Verfiy - Match Case , Match Word
Finds a match only in license.go

doing grep -R Verify ./ shows many other matches
If I open any of the other files that have a match and running the search again will add it to the search result.

for example here is the log for such example

before I open the file ./vendor/github.com/o1egl/paseto/v2.go

[2018-03-21 07:03:14.709] [renderer1] [trace] CommandService#executeCommand workbench.action.closeActiveEditor
[2018-03-21 07:03:20.227] [renderer1] [trace] SearchService#search {"type":2,"folderQueries":[{"folder":{"$mid":1,"fsPath":"/home/krasi/src/github.com/drone/autoscaler","external":"file:///home/krasi/src/github.com/drone/autoscaler","path":"/home/krasi/src/github.com/drone/autoscaler","scheme":"file"},"excludePattern":{"**/.git":true,"**/.svn":true,"**/.hg":true,"**/CVS":true,"**/.DS_Store":true,"**/node_modules":true,"**/bower_components":true},"fileEncoding":"utf8"}],"usingSearchPaths":false,"maxResults":10000,"contentPattern":{"pattern":"Verify","isRegExp":false,"isCaseSensitive":false,"isWordMatch":true,"wordSeparators":"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?","isSmartCase":false},"useRipgrep":true,"disregardIgnoreFiles":false,"disregardExcludeSettings":false,"ignoreSymlinks":false}
[2018-03-21 07:03:20.237] [renderer1] [debug] SearchService#search rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case -g '!/home/krasi/src/github.com/drone/autoscaler/**/.git' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.svn' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.hg' -g '!/home/krasi/src/github.com/drone/autoscaler/**/CVS' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.DS_Store' -g '!/home/krasi/src/github.com/drone/autoscaler/**/node_modules' -g '!/home/krasi/src/github.com/drone/autoscaler/**/bower_components' --max-filesize '17179869184' --no-ignore-parent --follow --regexp '\bVerify\b' -- '/home/krasi/src/github.com/drone/autoscaler'
 - cwd: /
 - Sibling clauses: {}

After I open ./vendor/github.com/o1egl/paseto/v2.go which has a match which has a match for Verify and gets added to the search after I opened it.

[2018-03-21 07:04:02.899] [renderer1] [trace] SearchService#search {"type":2,"folderQueries":[{"folder":{"$mid":1,"fsPath":"/home/krasi/src/github.com/drone/autoscaler","external":"file:///home/krasi/src/github.com/drone/autoscaler","path":"/home/krasi/src/github.com/drone/autoscaler","scheme":"file"},"excludePattern":{"**/.git":true,"**/.svn":true,"**/.hg":true,"**/CVS":true,"**/.DS_Store":true,"**/node_modules":true,"**/bower_components":true},"fileEncoding":"utf8"}],"usingSearchPaths":false,"maxResults":10000,"contentPattern":{"pattern":"Verify","isRegExp":false,"isCaseSensitive":false,"isWordMatch":true,"wordSeparators":"`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?","isSmartCase":false},"useRipgrep":true,"disregardIgnoreFiles":false,"disregardExcludeSettings":false,"ignoreSymlinks":false}
[2018-03-21 07:04:02.920] [renderer1] [debug] SearchService#search rg --hidden --heading --line-number --color 'ansi' --colors 'path:none' --colors 'line:none' --colors 'match:fg:red' --colors 'match:style:nobold' --ignore-case -g '!/home/krasi/src/github.com/drone/autoscaler/**/.git' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.svn' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.hg' -g '!/home/krasi/src/github.com/drone/autoscaler/**/CVS' -g '!/home/krasi/src/github.com/drone/autoscaler/**/.DS_Store' -g '!/home/krasi/src/github.com/drone/autoscaler/**/node_modules' -g '!/home/krasi/src/github.com/drone/autoscaler/**/bower_components' --max-filesize '17179869184' --no-ignore-parent --follow --regexp '\bVerify\b' -- '/home/krasi/src/github.com/drone/autoscaler'
 - cwd: /
 - Sibling clauses: {}

@roblourens
Copy link
Member

@krasi-georgiev please open a new issue

Make sure that the file with the match isn't covered by your gitignore file or an exclude setting.

@krasi-georgiev
Copy link

krasi-georgiev commented Mar 21, 2018

Thanks @roblourens
Disabling Use Exclude settings and ingored Files was the culprit in my case.
I think it all works as expected now.
I didn't expect that .gitignore should affect the search.

@roblourens
Copy link
Member

You can also set "search.useIgnoreFiles": false

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster search Search widget and operation issues
Projects
None yet
Development

No branches or pull requests

3 participants