It should be quite simple, but sometimes I found that searches in VSCode do not work as expected.
In this below example, I just want to search the string stat
in all the JavaScript
files in the folder ./ocean-data-qc/ocean_data_qc_js
. But, in the search results, I get files of all kind of types:
I also want to search in the subfolders files.
Am I doing anything wrong?
With the expression ./ocean-data-qc/ocean_data_qc_js,*.js
it will search across all the files of the path ./ocean-data-qc/ocean_data_qc_js
and then it will search on all the js files of the project. The result will be the union of both searches
Instead, the pattern should be ./ocean-data-qc/ocean_data_qc_js/**/*.js
to make just one search in all the js files in the folder and subfolders. But it is not working as expected because the files in the .gitignore
are included in the search. So, in some way, the pattern in the include section is overriding the excluded paths.
I have found an issue to answer why the .gitignore
is not taken into account in that case. As I am working in multiroot mode, I found two solutions that work:
./ocean-data-qc/**/*.js
. Like this .gitignore
is taken into account.search.exclude
attribute in the VScode settings.Note: The important sections in the VSCode docs: Multiroot search. Advanced search options