How to search a string in a specific file type in VSCode? - search

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:
Just using the root folder of the project where I am searching: ./ocean-data-qc/**/*.js. Like this .gitignore is taken into account.
The other alternative is to use the search.exclude attribute in the VScode settings.
Note: The important sections in the VSCode docs: Multiroot search. Advanced search options

Related

Search for files in folders that have a dot in their name

1st, I want to cover what this question is not about. There are 100's of articles that talk about how to search for folders with dots within their names. This is not the question. This is about searching for files within a folder that has dots in its name.
Say I have a folder
c:\public\dev\process.ui.help\
I have another folder
c:\public\processuihelp\
I have exact copies of the same files in each folder
help.csproj
help.cs
help.cs has a line in it like
//find this - SearchForMe
if in explorer and I search "SearchForMe", then explorer only returns help.cs from the 2nd folder but not the first. It may be treating the dotted folder names as extensions.
Edit: in the index options, any folders with extensions are automatically being de-selected. If I reselect them and save, they are de-selected again.
Is there any work-around or alternative search?
Why? : In this large development project (10's of projects, 1000's of folders), I am using dotted folder names to organise namespaces without creating a deep hierarchy of folders. Windows allows dotted folder names.
I haven't searched with built-in windows searches for a long time.
I just replicated your situation and tried searching with "Search My Files" and with "Everything", two tools I use frequently and both found both files immediately. Maybe give either or both of them a try and see if they do what you are looking for.
Edit: Everything is by voidtools, search my files by nirsoft, both are freeware.

What is the "include" folder used for in a Katalon Studio project

Similarly to what is being asked in this question, which is yet without answer, I'm struggling to understand how should I properly use folders in a Katalon Studio project.
In particular, so far I wasn't able to trigger creation of any file in the Include subfolders.
Which files should I expect to find there? Depending on the answer, I can decide wether to put them under version control or go and default .gitignore to exclude Include.
I watched the available tutorials, but so far I couldn't grasp it (unless I missed something).
It is pretty un-intuitevly named, but Include folder is used for BDD integration.
Include folder should include two subfolders: one for feature files and the other for step definition files.

How to search a string in files partially matching "name"

I'm looking for a class which is defined in a Koin module file somewhere in my project. The filenames of all those Koin modules are "*Module.kt".
I could do cmd+shift+F to search for "TheClass" everywhere, but that gives me too many results and I don't want to go through all of them manually. I'd like to only search in files with the above mentioned filename pattern.
Another thing I could do is to use alt+F7 or cmd+B on the TheClass itself to see its usages, but again that leads to too many results.
Is there a way (using Android Studio) to search smarter for this?
I found out that when using "Find in Path" with cmd+shift+F you can put more in the file mask than just "*.kt". I've changed the file mask to "*Module.kt" and got the desired result.

IntelliJ File mask not working on simple excluding file pattern! Why?

Follows this page https://www.jetbrains.com/help/pycharm/2016.1/find-and-replace-in-path.html?origin=old_help#mask , it should be able to exclude many files using "!" symbol in front of the regular pattern like: *.java, when doing text search inside IntelliJ projects.
On my project, when I fired Ctrl + Shift + F to do text search for string xyz. There's over 100+ results return in both *.ftl and *.java files. I tried to reduce the results on only ftl files by changing the "File mask(s)"-Option to "!*.java" . But it did not work! The result list is empty!
Googling on the excluding file pattern results in creating custom file filters for each particular search, which I don't want to maintain!
Do I miss something here or IntelliJ is just bad on this function (I'm using IntelliJ 15)? With Eclipse, the "File mask" was amazing!
You have to use
!*.java instead of !.java
As for IDEA 2019.1 Ultimate, it works for me(exclude with !*.yml or anything else).
If it does not in yours, as you only as .ftl file to exclude, why not add mask as *.java?
PS: what does not work is exclude some path, like "all files under out/ folder". With !out/* or anything ales it does not work.
Forget about File Mask and use Scope:
In Scope the options are unlimited where you can select folder include/exclude files or folders.
Excluding file paths in the Find in Path dialogue was not added until IntelliJ 2016.1 per this IntelliJ forum response.

vim: netrw to skip searching directory

When use :Ex to search files under a current project, I would like to search to skip certain directories. The netrm document says that "g:netrm_list_hide" option can be used to achieve this, but my experiments with the options shows it only applies to the filename but not the directory name.
The google search also yields no solution to this. Does anyone know a workaround?
Taken from http://vim.1045645.n5.nabble.com/Hiding-Subversion-directories-within-netrw-td1167827.html
To hide directory names just add a trailing slash when you list them. For example to hide the directory .git/ use the following.
let g:netrw_list_hide='^\.git/$'

Resources