A pattern for All Changed Files scope in Intellij IDEA - intellij-idea

Prior to changes introduced in IDEA 2020.1 or so, there was a convenient scope in Project overview. The scope was called All Changed Files and it contained a view of a VCS Default Changelist.
After recent changes the scope was removed. Default Changelist it accessible through Alt + 9, but it's not as convenient as it had been.
My question is, how to recreate All Changed Files scope using a pattern? I have tried to fetch it from a previous version of IDEA, but it's not listed in Scopes menu, so it is impossible copy the expression.

Related

How to enforce/apply dart linter rules in IntelliJ IDEA

As an example, when using the "extract variable" feature, the variable is declared "var" rather than "final", although the latter is what I usually end up assigning.
The "analysis_options.yaml" file seems to know a linter flag "prefer_final_locals" (and prefer_final_fields).
Is there a way to make the IDE make use of these?
The analysis_options.yaml located in the flutter installation directory is NOT used by IDEA as default. In order for these configurations to be applied, the file has to be copied to the root of a dart/flutter project (so, next to the pubspec.yaml). The mentioned flags regarding finals and much more then get applied without any further action required.

Is it possible to configure IntelliJ to not index specific files?

Scripts and styles for the project I'm working on get compiled and minified into single (enormous) files when the project is built. When IntelliJ goes to index everything, it spends a significant amount of time indexing the minified files, which are all but useless for the purpose of searching.
Is there a way to ignore specifically these files, and not just a directory?
I'm taking mostly a guess here, IntelliJ docs are notorious for being not-so-helpful on some topics.
Try marking the files as plain text:
When a file is marked as plain text, IntelliJ IDEA does not use it anymore for code completion and navigation...The reverse action is also available: you can return a file to its original type, using the Mark as action
Edit: After hearing that your files are dynamically created, I think I may have figured out a solution.
IntelliJ allows for the creation of Scopes, which allow you to exclude certain files from the project. You can then go to Editor -> Inspections and change the scope of each inspection from All Scopes to your new scope

How to maintain different file headers per project in IntelliJ?

IntelliJ allows you to configure the "File and Code Templates" in Settings.
This is a global setting, however I want different templates depending on which project I am working on (for example there will be different #author tags if its commercial / open source work, and version information varies by project).
Eclipse manages this on a per-workspace basis; how can I achieve the same thing in IntelliJ IDEA?
Unfortunately per project templates are not supported in IntelliJ IDEA. I recommend you comment-on/vote-for/track the feature request Make file templates per-project. (See UPDATE about this feature request below)
A few workarounds you can try...
Create a File Template for each project. Then when you create a new class, use the project's template rather than the standard "Java class" template. It will clutter up your template list a bit, and you have to remember to change from the default template when creating a new class (remember than inline search is available in the new class dialog when setting the type). But it is workable.
The copyright settings are done on a per project basis. Sometimes a need for a specific header can be met using the copyright utility (even if it is not an actual copyright statement). The options are pretty good for determining where it gets placed. The one shortcoming will be that while you can configure it to be a comment just before the class declaration, you can only configure to be a block comment or inline comment, not a javadoc comment.
Finally, a last option would be to write a live template for each project with the header information. Then after you create a class use the proper one to place the header information.
Hopefully those things will help while we wait for the feature to get implemented.
UPDATE
The above mentioned feature request to allow for file templates to be saved on a per project basis has been implemented in IDEA v14.1. It is currently (Feb 2015) available as an EAP (i.e. beta). It is scheduled for release at the end of Q1 2015.

IntelliJ updating a Path Variable

This is the first time that I'm giving a chance to IntelliJ, and to be honest it's not going quite well...
I have imported my Eclipse subprojects. They use external .jar dependencies and they are specified as with a variable, ie: $EXTERNAL_LIBS/derby.jar
When I have imported my projects, IntelliJ recognize the variable and ask me to give it a value, which I misspointed to a wrong path. Now I see on the subproject properties all the module dependencies pointing to a wrong path.
I go to File - Settings and change the value of my EXTERNAL_LIBS to the right path, but all the current dependencies doesn't seem to reflect the change. They still pointing to the first and wrong path.
Am I suppose to go one by one? I do not understand how IntelliJ manages Path Variables... When I try to add a new module dependency it forces me to choose it from the hard drive, and doesn't give the change to use any of these variables.... The documentation is quite poor as well....
Path variables can be changed in File | Settings | Path Variables.
They are handled transparently by the IDE on project load and on project save.
When project loads and contains path variables, IDE will substitute them with the actual paths defined in Settings. If no path variable is defined yet, IDE will ask you to define it.
When the project files are saved on disk, IDE will transparently and silently replace all the paths matching defined variables with the variable name.
It works fully automatically and user doesn't have to define variables explicitly in any IDE settings, just use the actual paths in your libraries, they will be replaced with the corresponding variables on project save so that your project files are portable and other users can define different values for the path variables when opening this project for the first time.

Logical file groups/folders in IntelliJ

I just created a project, and I notice immediately that I can't seem to right-click on my src folder and create a logical file group/folder within the project view.
In many IDEs, I can arbitrarily organize source files in groups/folders. These grouping help me organize my business process and data access layers appropriately.
How do I do the same in IntelliJ?
I'm not sure what the exact equivalent to what you're thinking is, or if there even is one.
IntelliJ has a notion of "scopes". Under the Project/navigation view, click the configure dropdown and choose "Edit Scopes...". From this window, you can define a pattern to include certain files from your project.
For instance, all of my DAOs are in packages called my.company.<feature>.persistence. I create a scope called "DAOs" with the pattern src[myProject]:my.company.*.persistence.*. Now when I choose "DAOs" from the Project view dropdown, I see a filtered view of the project. I haven't found a way to show that filtered view alongside other scopes at the same time, however.
These scopes can also be shared, and they can be used to narrow down searches. They are similar in many ways to Eclipse's working sets.
Many scopes are defined implicitly, like Test and Production, Changed Files, VCS changesets, etc.