I added Foo.scala as a new Scala class within my IntelliJ 14.1 project:
class Foo
object Foo
When I click on this file once in IntelliJ, it expands the Class and Object:
I find it to be a hassle to have to click the file (Foo.scala), and then double-click the Object/Class to view the source.
How can I configure IntelliJ to open the source file once I double-click on the file name, i.e. Foo.scala per this example?
You can't. Please file an issue at JetBrains if you want to have this improved.
Related
How to show class file (not java file) in explorer in IDEA?
When I select a java file, I want to position it in the explorer, I know in Eclipse it is easy, but what I should do in IDEA?
You can do it with the External Tool like this:
This answer describes what parameters to use for the explorer.exe to select the file.
Using IntelliJ IDEA macros the Arguments field will look like this:
/select,"$OutputPath$\$FileDirRelativeToSourcepath$\$FileNameWithoutExtension$.class"
It will open Explorer with the output file selected:
For the source file located in C:\work\attaches\hotswap-bug\src\foo\bazz\Another.java the tool will select C:\work\attaches\hotswap-bug\out\production\hotswap-bug\foo\bazz\Another.class file.
This tool can be invoked from the editor right click menu while inside the source .java file:
You can also assign a keyboard shortcut to this tool or make an action in the toolbar for easier access.
Final result:
Just curious, what's the real world use case for this?
There is this feature that IDEA IntelliJ has: when a new file is opened the Project tree (view) automatically jump to the file opened (handy when you follow a function defined in some other file).
I'd like to know if qtcreator provide this option
Surprised how hard it is to find the answer, since the button isn't hugely obvious.
The button you want is at the top of the Project pane, between "filter" and "split". Tooltip says "synchronize with editor".
When I do a file new in my IntelliJ idea. I see a menu like this one
I want to see classes from Java and Scala on the top. I don't want to uninstall plugins for ruby etc. But these should not be on the top. I mostly code in java and scala and therefore want these classes to be one top.
When I want to create a new Java class, I activate the "Project" view. Then I select the package to which the new class shall belong to. Then press Alt+Insert. This popup menu is shown:
Please ensure that the directory you're creating a class in is under a module source root. You can navigate to it in Project View, right-click on it or any its parent and choose Mark As... | Source Root
Can we set AppCode to open a file with one click? The default is two click like on non-macOSÂ systems.
It would be more natural for those used to opening files with one click in Xcode.
In the gear menu for your project, select 'Autoscroll to source'. From the documentation:
If this option is on, AppCode automatically navigates from a file (or a class member) selected in the Project tool window to the corresponding source file (or its fragment) in the editor. If the corresponding file is not currently open, it will open automatically.
I'm trying to create a set of custom file templates for IntelliJ.
I basically want to go right-click, "New > My File Template" similar to the "New > Java Class" bundled with IntelliJ.
I've added my own custom file template via "Settings > File Templates", but they don't appear in my "New" context menu.
This is a Java project, and my templates extension is java. Am I missing something?
All help greatly appreciated.
No My Template >>>
If you select Java Class you can then choose the template for your new class. This is a new feature, it used to be available when selecting New.
Actually you can, sort of.
I don't know know how to do it for Java files. but
if you set the extension to txt you it will show up in the right click menu.
and here it is in the menu:
the only issue is if you're creating a java class you'll have to rename the file after creation to ${name}.java