Can I use the module structure (collapse Java package paths) for the Project Pane -> Changed Files view in IntelliJ? - intellij-idea

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".

Related

How to show arbitrary project in IntelliJ?

I have very custom project (including Matlab and other languages, including java maven projects soemewhere deep below) under Git control and would like to use IntelliJ as editor and version control UI. I have created "empty" project and fed root directory to wizard.
Now I see only top-level files in Project pane with no subdirectories shown.
Is it possible to show everything?
You will need to add a module for the files to be visible:
Select File > Project Structure > Modules
Use the + symbol and select Import Module
Navigate to the root you wish to view and then OK
Select Create module from existing sources then Next
Next you will see a screen telling you source files have been found and their associated paths, simply select Next
Lastly you will see a screen listing any frameworks which were found, select Finish
You will now have your project with subdirectories visible.
EDIT
If you wish to add files which are read only and not intended to be built alongside your source code then:
Go to Project Structure
Go to the Modules menu item and select your new module
Find the Mark as menu and deselect all items
More info here
Intellij will now ignore these files when compiling etc
You could also investigate adding different content roots

Using file templates in IntelliJ

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.

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.

IntelliJ IDEA: Show containing folder in 'project' sidebar.

I'm using IntelliJ IDEA 12.1.6., and I'm trying to figure out how to make a file's parent folder show in the 'project' sidebar when I open it. I'm pretty sure I had it set up that way in the past, but I can't find the relevant setting. I've tried googling to no avail. Any ideas?
Autoscroll from source option can be enabled under the gear icon in the Project tool window.
Doesn't the Projects sidebar show the project's entire directory structure?
As an alternative, if you go to View -> Navigation Bar, you can see the selected file's path on the top left.
For those reading now, the suggestions here don't seem to be in the current version of intellij.
I had to go Right click on the folder -> Open Module Settings -> remove the obviously incorrect content root -> re-add the obviously correct content root.

intellij find usages behaving strangely

Is there a way to search a project for all uses of some text, without highlighting that text first. I.e. bring up a search interface, and then type in the text I want to find? I'm not seeing how to do this in the Intellij docs.
Note, when I select some text in a file and I do a Search->Find Usages, it responds by giving a little popup "Cannot find usages. Position to an element which usages you wish to find and try again". I get this whether I search on a variable name in a groovy file, or some text in a comment. So for some strange reason, this isn't working at all.
I'm using Intellij Ultimate 10.5 (version 10.5.1)
Thanks for any help or workarounds.
Is Search->Find in Path what you're looking for? (Ctrl-Shift-F on Windows) You can find text in the whole project, a certain directory, or a custom scope.
I was having the exact same problem searching strings in strings.xml but the project wasn't compiled against that file.
So make sure you have compiled against that build variant, module, flavour, etc.
make sure project configuration is allright
File -> Project Structure -> Project -> set correct SDK
File -> Project Structure -> Projects Settings -> Modules -> + -> Import Module -> import your gradle or maven projects
now clear all existing cache
File -> Invalidate Caches
restart Intellij and wait until the indexes are rebuild. Worked for me :)