Setting string intentions to filepath - intellij-idea

I love intelliLang in jetbrains, but one thing I would like to know is what option do I choose to make it see my intention as a file path.
For example, you can change intention from css and scss and the like. How do you give it the intention that, this is a file path?

Related

PhpStorm Search Everywhere is not working, do you know the solution?

I don't know this is off topic or not, I'm using general channels. Is there a solution for Search Anywhere in PhpStorm. I work with Laravel but when I use the feature I can't find the file even though it exists.
Looking at your screenshot: based on the fact that ALL files in the project tree have that sort of "dirty yellow" background color... it looks like ALL of your files are considered excluded / outside of the project for some reason.
Most likely a user error of some kind. E.g. you may have opened it from a different path (i.e. when symlink is involved), may have c=misconfigured it later somehow (marked folder as Excluded by mistake or whatnot) or maybe even some sort of config file corruption (pretty unlikely).
Anyway, please do this:
Close your project
Go to the project root folder and delete your .idea subfolder (that's where your project settings are stored).
If you have that project still visible in the IDE (Recent Projects on the Welcome screen) -- you may remove it there as well (to avoid any possible confusion).
Now create a new project in PhpStorm from scratch using existing files: just use "Open" and point to the folder with your project.
Please check filter option. If you are doing file search then click on Files tab.

How to exclude a file extension from IntelliJ IDEA search?

Is there a way to exclude particular file extension from the results in IntelliJ IDEA's "Find in Path" dialog (invoked by CTRL + SHIFT + F)? I want to exclude all .css files.
In intellij 16 there is a section "File name Filter" to exclude an extension use !*.java. You can give more detailed patterns as well for example I use the pattern below to only return .java files except those with a name starting or ending with test.
Pattern: !*test.java,*.java,!Test*.java
In recent versions of Intellij the GUI has been updated a bit but the same still applies see the "File mask" on the top right hand corner see image below:
In "Find in Path" and "Find in Files" (Ctrl+Shift+F) you can use the "File mask" input.
For example, this would exclude all js, css and twig:
!*.js, !*.css, !*.twig
It's handy cause it also keeps a list of previous inputs, but it gets messy easily when you add a lot of extensions. If it gets too crowded, consider excluding some folders as well (right-click -> "Mark directory as" -> "Excluded")
You can create custom scope there:
In 'Find in Path' dialog you can check radio button 'Custom' and open scopes window.
There you can customize path and search pattern.
Examples of Patterns for Pattern field:
!file:*.css - exclude CSS files
file[MyMod]:src/main/java/com/example/my_package//* - include files from the directory in a project.
src[MyMod]:com.example.my_package..* - recursively include all files in a package.
file:*.js||file:*.coffee - include all JavaScript and CoffeeScript files.
file:*js&&!file:*.min.* - include all JavaScript files except those that were generated through minification, which is indicated by the min extension.
Or check the official documentation.
Good luck!
If you are like me that don't want to use the File Mask option or create a custom scope, etc. but just wanted to be able to add it to project settings one time and be done with it, then here's a solution for you.
I wanted my Find in Path to not search in lock files (auto-generated manifest file by package managers), here's what I had to do for that:
Goto File >> Project Structure (or just press Command+;)
Select Modules under Project Settings
Add a pattern or file names to the Exclude files text-box, in this case: *.lock;package-lock.json and hit Apply, and then ok.
Note The above option is available in IntelliJ 2019 and versions after that, not sure about older versions. For more info, https://www.jetbrains.com/help/phpstorm/excluding-files-from-project.html
WebStorm 2021
CTRL+SHIFT+F and follow the pictures
For 2019.2, the pattern is not set in scope but in the right top windows "File mask" in Find in path dialog. You must tick it.
The syntax I tested are:
exclude files with extension css: !*.css
exclude all under out dir: !out/*
Patterns are separated by comma.
Reference: https://www.jetbrains.com/help/idea/finding-and-replacing-text-in-project.html
For 2021.3.2, just right-click to the folder and Mark Directory as -> Excluded. This will work for logs etc but be careful about source folders.

Passing files selected in project views to external tools

Is it possible to pass paths to all files currently selected in the project view to an external tool?
I know you can use the $FilePath$ macro but it only seems to pass the path to the first selected file ignoring the rest and no other macro seems suitable. A workaround would also be using all the files from the parent directory, but that's not feasible in my case.
It's not possible right now, please vote for this feature request.

Is it possible to filter out files from the file dialog in IntelliJ?

My specific use case is with an Android project, but this isn't Android specific. I have an IntelliJ-IDEA project with several Android modules which have been localized. If I want to open the file strings.xml, I will pretty much always want the non-localized one (in res/values rather than res/values-fr or whatever). But when I hit <ctrl><shift><n> and type strings.xml, it shows all the 30-zillion localized files and in fact shows them before the non-localized one. I would like to figure out a way to give IntelliJ a hint as to which one I would want, or a way to filter out files from that dialog. Any ideas?
Seems there is a kind of workaround with directory exclusion
http://devnet.jetbrains.com/thread/283525

Is it possible to exclude a file from the content root in IntelliJ?

I want to exclude individual .java files from a Content Root in IntelliJ. The documentation on "Excluding Files from Project" suggests that this is not possible (it explicitly says This action is not applicable to Java files and binaries.)
Being incredulous to such a limitation, I have tried editing my .iml file, optimistically inserting XML elements such as <excludeFile> under the <content> element, but nothing seems to take.
Does anyone know a way to do this (documented or otherwise)? Or have any clue why this feature is not supported? By comparison, Eclipse allows for an arbitrary including pattern for a <classpathentry> element in its .classpath file.
You can exclude files from compilation and classpath. As far as I understand it will have the same effect as manipulating with <classpathentry> in Eclipse.
To exclude files/folders by pattern and globally use Ignore files and folders option in the File Types dialog. This way the files will be completely ignored and not visible in the Project View, but it's probably not what you want.