Project Search/Replace with RegExp with \n only searches in currently open file
felixfbecker opened this issue ยท 8 comments
- VSCode Version: 1.5 and 1.6.0-insiders
Steps to Reproduce:
-
Open project-wide search/replace
-
Enable regexp searching
-
Type in a search that includes a new line, like
<\?php\n\nnamespace
-
Hit enter => no results
-
Open a file where the pattern occurs, like
<?php namespace Whatever;
-
Hit enter again => one result only in this open file
-
Remove
\n\n
from query -
Hit enter again => all results (files) show up
@felixfbecker Currently search works as follows with different code paths.
- when a file is opened it searches using the same search implementation as the editor find widget (where multi-line search is supported)
- when a file is not opened it searches in a separate process with a different implementation ((where multi-line search is NOT supported)
Hence you are seeing different results when files are open. I think ideal solution here would be is to support multi-line search in Search view completely #13155
Until then we should not be showing any results for multi line search. More over current shown results for multi line search in Search view are also not good because the matches representations are not correct.
3 months and no fix? Please see #18198 for a very simple use case. It actually is misleading that it says "no results found" whereas the problem is I don't have the files open currently. Either say the feature is not supported, or just implement it please.
@ahmetalpbalkan the vscode team is working very hard and there are plenty tickets I would consider higher priority.
@felixfbecker Thanks for responding.
@ahmetalpbalkan We will try to fix this gap in Find in Files and Editor Find very soon. Thanks for mentioning its importance.
@sandy081 "....very soon. ..."
@quickEscape Sorry for that. There were other higher priorities.
@roblourens Please consider this while implementing #13155
The most likely path to a fix involves #47058, although the UI still would need updates.
I think can be considered a dupe of #13155, sorry if there's something I'm missing