How to run custom IntelliJ inspections from terminal - intellij-idea

so I'm currently trying to run IntelliJ's code inspector from the command line, but I can find where to put in a custom scope. There is an option for custom directories to scan, but nothing for plugging into their custom scope language. Has anyone else dealt with this before? IntelliJ's Documentation

Add the idea.analyze.scope=SCOPE_NAME[1] to your custom properties using the Help | Edit Custom Properties... menu item. Replace SCOPE_NAME with the name of the scope you want to use. This scope you will have to define inside your IDE. If the scope cannot be found, the entire project is inspected. [2]

Related

Filter by scopes in the project tool window?

In IntelliJ 2017.1.2
I defined a scope with the intention to filter files with specific file endings in the project tool window. Yet I don't see a way to make this happen.
How can I filter by scope in the project tool window?
I'm not sure if it's the same under 2017.1.2, but in IntelliJ 2018.1.6 you just need to click the Project dropdown menu, and select the Scope you want to see.
PS. I found this here.

List of all errors in project in CLion

CLion 2016.2 helpfully detects potential errors in the file you're editing, which can be seen in the validation bar to the right of the code.
That's just a single file though, is there a way (like a tool window) to get a list of all such warnings in the whole project, or specific parts of it?
Bonus points if it also lists warnings and errors from the compiler, though that's less important, because the compiler output already includes any it found.
Yes, it is possible. The feature you are looking for is called the Inspector.
Do: Find Action... | Inspect Code. It will show a pop-up that will allow you to select the scope: file, whole project, custom, and the Inspection profile (you can choose the type of errors you want to see):
After clicking OK, this is an example of the output, that you can navigate with the mouse or with keyboard shortcuts:
In version 2017.2, I have it under Code | Inspect Code....
You can also right click a folder in Project view and select Inspect Code... there to be able to check only that folder.

Eclipse "Go Into" with Intellij

In Eclipse if you right-click on a project folder, you have the option to "Go Into". Is there something similar in IntelliJ?
In large projects it can be useful to narrow your working space down to a single module or directory.
The easiest option is to use the "Add to Favorites" action to add a module or directory to a favorites list. Then the Favorites list will show only that module/directory and its children.
Another option is to set up a scope in Settings | Appearance and Behavior | Scopes and to switch to the view of that scope in the Project view. This is more difficult to set up than Favorites, but also more flexible and less cluttered.

How to debug custom ASP.NET MVC Text Templates?

How do you go about debugging the T4 process when you are customizing the template?
I've followed the procedure in Hanselman's post to add the templates to my project so that is uses them when using the Tooling Dialog but how to I debug that template when it uses it? The documentation here and here is not really helpful since I've cleared out the Custom Tool property.
For example, I'm trying to customize the List.tt and I'd like to loop through the properties of the Model inside the Index method. I'd like to have a look at what's hanging off the Model object, etc.
My current process is edit the List.tt, right-click on controllers folder, add Controllers, enter the name, select my model, choose 'Overwrite xxxController.cs' and then check to see if what I did worked. This is extremely tedious.
Why not put the custom tool property back in to be able to rapidly test it? then take it out when you are happy?
another option is to write a .tt file that consumes/includes that .tt to operate as your REPL harness

Is there a way in Intellij IDEA to see the name of the method the current line belongs to?

In our code base there are a few very long methods (several pages worth of code). When reading the code, it would sometimes be good to be able to see the name of the method the current line belongs to, without paging up to the beginning of the method. Is this possible in Intellij IDEA? I am using Intellij IDEA 7.0.3.
You can use View | Context Info (Alt+Q, Ctrl+Shift+Q on Macs). It will display a pop-up on the top of the editor with the current context information (class/method signature).
IntelliJ 2018
This is shown by default at the bottom.
Unfortunately, the method is shown only by name (not including the parameters). If a method is overloaded you won't know for sure where you are.
If you want to move it from bottom to top, go to File > Settings... > Editor > General > Breadcrumbs > check Top:
In the structure panel select the "Autoscroll from source" option.
This way when you place the cursor inside any method the structure panel will show which method you're in.
Intellij now has support for breadcrumbs. Go to settings > appearance and tick "Show breadcrumbs". In this way you can view class/method name without Alt+Q.
For some reason (Alt-Q) wasn't consistent in Android Studio for me. I find (Ctrl-F12) to be pretty satisfactory for this purpose (Navigate|File Structure) though it can be a little laggy in larger files. And by pressing the hotkey again it will populate the list with all the inherited methods as well.