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.
Related
When I use the "Project Pane -> Project" view in IntelliJ, my Java package paths are collapsed based on the Modules in my Project Structure (e.g. com.company.project). I would like to use IntelliJ for code reviews, so I've checked out the changes locally and am looking at the "Project Pane -> Changed Files" view, but this doesn't pick up the project structure, so each folder takes an extra line. Can I get the best of both worlds here?
I figured this out with the help of this answer about expanding the folders (which I also wanted to do) How to expand folded package chain in Intellij IDEA?
Right click on "1:Project" to see the options for the project pane and then check "Flatten Packages".
Everyday I work with a lot of different projects in IntelliJ IDEA.
When I click on File -> Open Recent I see a long long list of projects that I worked on.
Is there any plugin or solution that allows me quickly search and find relevant project?
File | Open Recent | Manage Projects ..., start typing the name for the quick search/filter.
Help | Find Action (Ctrl+Shift+A), Manage Projects, start typing the project name.
Related usability issue for the Manage Projects menu being at the bottom of the list and hard to select/discover.
Note that you can customize Menus and Toolbars to make Manage Projects item at the top of the Open Recent list:
Or add a copy of this action where you want, even at the top of the File menu:
Or add a direct shortcut to open the Manage Projects dialog in the IDE Keymap settings:
In Java source files, when I select a class or a method, then click the right button of mouse, in the pop up context menu, and run Find Usages, the files that use the class or methods are searched out.
But I would like to exclude certain files (e.g. JUnit test files) from the search results.
Where could I configure this?
From the docs; you can confgure the Find Usages scope by clicking on the tools icon in the top left hand corner of the Find Usages results.
Here are some screenshots:
Click on the tools icon here:
Click on the build button (... next to the Scope field) to create a Scope and define it like so (in this examples I have included production classes and excluded test classes):
Choose that scope in the Find Usages dialog:
Notes:
You can also chose the precanned scope named Project Production Files from the Scope dropdown
All subsequent searches will use this scope by default until you choose a different scope.
Is there a way to disable inspection for one file opened in the editor? I occasionally open large library file in the editor to inspect its source code, and don't want IDEA to run inspections on this particular file.
Use Hector the Inspector guy. You can access it by clicking on "guy in a hat" icon in Status Bar or via Code | Configure Current File Analysis... from the main menu.
Once there you can move the "Highlighting Level" slider from "Inspections" to "Syntax" .. or even "None" in case of a large or complex file.
Notes:
Settings here affect current file only (excludes "Power Save Mode" option)
Depending on a file, you may have multiple sliders (e.g. in .php file you will see separate sliders for HTML and PHP languages: this may change depending on some other settings):
P.S.
If your file is actually part of the library (PHP or JavaScript; "Library" in terms of IDE, of course) then they by default should not have inspections enabled in them:
UPDATE 2021-06-11:
Hector the Inspector has been removed from the status bar since 2020.2 version or so. You can get it back by installing Hector the Inspector plugin from Settings/Preferences | Plugins
You can set scope for your project and run inspections only for selected scopes.
#see Inspection severity and scopes
I'm quite confused when it comes to file templates in IntelliJ. Basically, when I right click anything and hover my mouse over to New, I can see the usual file templates like Java Class, HTML File and so on. I downloaded Scala plugin and I can see Scala templates (Scala Class, Scala Object, etc.) if I go to Edit File Templates, but I can't actually use/see them in the New menu. Is there a way to modify what I see in the New menu? I'd like to be able to create Scala classes.
Go to Settings -> Menus and Toolbars
There you will see many type of menus. You need edit the menu you want the files to be displayed. Most Probably "Project View Popup Menu".
Click on "Add After" button on right. There you choose the file form plug-ins or other category to be displayed.
I added "Show Bytecode" to meny well it does not make sense here. You can add files from scala plugin like that.
You can restore to Defaults if you mess up easily by clicking on
"Restore All Defaults" button.