Is there any way to exclude folders in PhpStorm through regular expressions?
I have multiple "subproject" folders in my main project folder and every subproject has its own vendor folder I want to exclude from indexing.
So far I've been excluding those folders manually but since every week or so more subprojects are added the maintenance is annoying. If I decided to exclude another subproject folder, I'd have repeat that action for 30+ subprojects.
This question suggests ignoring folders (which can use file masks to select files/folders), but I need to be able to see the folders in my project window and ignoring the folders hides them.
This question suggests ignoring folders (which uses regex to select files/folders)
It does not uses regex. It excludes by exact name or ordinary file masks (e.g. standard * char that means any).
Back to the subject -- it's not possible.
https://youtrack.jetbrains.com/issue/IDEA-127753
https://youtrack.jetbrains.com/issue/IDEA-150784
Watch those and related tickets (star/vote/comment) to get notified on any progress.
Related
I have a gradle multi-module-project with lots of modules.
When searching (Ctrl+Shift+F) the whole project, then hits are listed twice, under e.g. src/test/kotlin/... and bin/test/.... Hits under bin, since generated, are considered false positives.
I know, that I can exclude a single project's bin folder from search with Mark directory as excluded, but it'd be tedious to repeat that for all modules:
Question: Is there a way to exclude all the bin folders from search?
When I do a find all (Ctrl-Shift-F) it takes very long, because I have some autogenerated js files in my project that are quite large.
How can I exclude those files from my searches?
Obviously I don't want to exclude all js files.
IntelliJ let's you pick one or more file types to search, but is there any way to search everything except 2 or 3 known files.
I tried marking them as ignored, but they still show up in searches.
The help is here https://www.jetbrains.com/help/idea/2018.3/finding-and-replacing-text-in-project.html#limit_search
It recommends restricting to a directory, or a module, but there are quite a few directories and it's all in the same module, so that does not work for me.
In the File Mask you can use ! oparand to exclude the files for example for not in js file then the file mask would be !*.js. You can use , to add multiple conditions to exclude or select the file types you are interested into.
!*.json, !*.txt,!*.js,!*Test*.java,*.java
In IntelliJ 2021, you can include specific file type by .ext1 separated with commas and to exclude !.ext2
Refer image, I need only .java file and not !.js
you can also exclude !Test.java as well.
Is it possible to use the CMake INCLUDE command the same way as in C++.
In all my projects I have to make the same includes:
Example: CMakeLists.txt for "MyApplication"
INCLUDE("FindMyBase")
INCLUDE("FindMyGtk")
In this example FindMyGtk already has "FindMyBase" in it.
So why do I need to include FindMyBase in MyApplication?
Is there a way once one .cmake file has been included that it stays available for all other projects in the chain below?
Update 1: The idea is to avoid searching every time for MyBase if it was already found once.
Update 2: The objective is also to reduce the number of includes. In my example from 2 to 1, but if you have 10 includes then you can reduce them to just 2 if these 2 depend on the other 8.
It pretty much does do that. I visualise include as if you'd pasted the contents of the include file directly into the CMakeLists.txt file where you called it.
In your case, "FindMyBase" is called twice. This often doesn't matter - e.g. if the include file only defines functions or macros it's safe to include multiple times.
If the included file searches for components using CMake's collection of find_XXX functions, then these already do what you want. The result of the search is cached. On subsequent invocations, if this cached result shows that the component has already been found, no further searching is done.
If you want (or have) to avoid including the same file multiple times, you can add include guards to the top of the file in a similar way to C++ include guards:
if(FindMyBaseIncluded)
return()
endif()
set(FindMyBaseIncluded TRUE)
That way, including the file multiple times is almost cost-free.
in my previous question on how to avoid merging specific files i received an answer
see
Bazaar merge questions
the solution is running a resolve command that takes the .THIS files for specific files that i dont want to merge. (like *.hex, *.s19...)
My question is how i make resolve command to run on all the files in all directories without making batch file that contains all the directoreis names. (what will work but needs modifications every project)
P.S i know what * is stand for , what is the meaning of ** ?
thanks
If I understand correctly, it means "subtree". In other words, subdirectories and their subdirectories, and their subdirectories, etc. So, "*/.hex" would match all files with the "hex" extension in the current directory and anywhere in the subtree under that.
In the lower left corner of LINQPad, there is an area for display queries. One tab is My Queries and another one for Samples. I could not find a way to add more than one folder like in My Queries, just like one in Samples tab. I tried right click and checked all the menu items.
I'm not sure if I can change XML settings to include more than one folders in My Queries to organize my codes.
How can I have multiple query folders in LINQPad?
The answer I am adding here does not resolve the implicit question of, "how does one have multiple root level folders in LINQPad." However, I think it provides a solution to the question of, how "to include more than one folders [sic] in My Queries to organize my codes?"
Technique 1 - Just add folders (arguably worse than Technique 2)
You can have multiple sub folders under the My Queries folder, and they will all show up. This adds the benefit of being able to organize your queries a bit, with the downside being the fact that you will probably include a lot more files and folders than you intend to:
To add folders, just navigate to your My Queries folder in File Explorer, and add a new folder. Refreshing your My Queries pane will the display the new folder.
Technique 2 - Symbolic Links
You can achieve a similar result as Technique 1 by using symbolic links. The benefit to this approach is that you can link just the folders that you want (e.g. folders that contain scripts), while leaving everything else alone:
Please note that creating symbolic links typically requires administrative privileges on a computer.
Creating symbolic links is easy with Powershell:
# By not changing the value for "Path," this will create a symbolic link in the current folder
# that is named whatever value is given for "Name," and it will be pointed to whatever value
# "Value" is set to.
new-item -ItemType SymbolicLink -Path . -Name "ExampleSharedScripts" -Value "Path to actual folder"
The difference between the two techniques
To explain what is really different between the two techniques, I'll explain the folder structure from the pictures a bit more:
In technique 1, an entire repository is shown due to the fact that the entire repository is kept under the My Queries folder. In technique 2, my repository is stored somewhere else entirely, but I have added a symbolic link in my My Queries folder that points to the queries contained within the repository itself. Technique 2 allows me to store my repositories in a more appropriate place, while still allowing for the convenience of having scripts show up in the My Queries pane of LINQPad.
Other reading
A couple of blog posts have been put out on the internet with some tips and tricks around LINQPad. This blog post from Dan Clarke talks about how he creates symbolic links to manage his scripts (he also lists some other tricks).
There's no way to display more than one root folder in 'My Queries' at present. If you like, add a suggestion at linqpad.uservoice.com so we can guage demand.
LinqPad does not show empty folders in the tree so if you only created a folder you will also need to add a query for this to show in the tree. This has been something that has tripped me a couple of times.