IntelliJ Macro for external tool (compass) - intellij-idea

I am trying to integrate the use of the compass scss framework in intellij. For that I created a new external tool in a group named "My Tools".
Under "Program" I entered the path to the compass.bat file, "Parameters" is "watch". For "Working directory I entered
$ProjectFileDir$\$ModuleName$\src\main\webapp
at first, but this is kind of ugly because the folder with the config.rb is not always in the same directory-structure... Is there any way to enter a Macro for a selected folder in the project tree of IntelliJ so I can start "compass watch" via context menu in the selected folder?
I changed the "Working directory" to "$FilePrompt$" now which is a better solution than the first one, but I still have to point to the directory with the config.rb and I want it to be selected via right click in the Project Tree...

$FileDir$ should do the thing
You can also try configuring a file watcher for compass - see this thread for details

Related

How to add custom directory to "Tests" scope in Intellij IDEA?

I'm working with Ant project, where I've added "test" directory near "src" directory. IDEA does not understand, that all classes in this directory are test classes. I want to make IDEA understand this, so it will propose to generate "Test Method", in respective "Generate" menu, for example, like it does in Maven's test directory. So, how can I make it happen?
Found out how to make it. The user has to open File -> Project structure -> Modules -> Sources Tab, select the directory he wants to make test directory and mark it as test directory using "Tests" button above directory tree.
It works in Intellij IDEA 2016.

Force IntelliJ to use another Home Directory?

I have read this... it does not answer the question.
I would like to have IntelliJ use another location for all of my project files. Currently, it goes to c:\users\ as a default project location.
I want to change that to c:\git.
I tried to change the "Start in" link properties, to no avail.
I don't want to force all of the configuration (ie: the .IdeaIC15 folder) to be relocated, I just want it to go to c:\git when I click "Open project".
To change the directory where project files are located to C:\git:
Select Help->Edit Custom VM Options...
Add the following line to the end of the file that comes up in the editor (*):
-Duser.home=C:\git
Restart IntelliJ.
(*) The file that comes up in the editor will either be idea64.exe.vmoptions or idea.exe.vmoptions.
Notes:
This will update/create a .vmoptions file in your config directory. It does not modify the vmoptions file in your install directory.
The above steps do not change the default directory that is used
when cloning git repositories. This is the directory that is used in
the File->New->Project from Version Control->Git window. You
still need to set that directory to C:\git and clone one remote repo
into C:\git. Once you have done that IntelliJ remembers the directory and
uses it for subsequent clones.
https://intellij-support.jetbrains.com/hc/en-us/articles/207240985-Changing-IDE-default-directories-used-for-config-plugins-and-caches-storage
Locations can be changed by editing the following file:
IDE_HOME\bin\idea.properties
Follow the comments in idea.properties file to change the defaults, make sure to un-comment the lines defining these properties:
idea.config.path
idea.system.path
idea.plugins.path
idea.log.path

Can't see project folders in IntelliJ IDEA

Every once in a while, I open an old project and I can't see any of the folders in the intelliJ project viewer. I can see all the files at the root.. but no folders. Yes I can delete the .iml file and .idea folder and re-create the project, but come on.. there's gotta be an easier way to fix this.
Is there?
If you look in project settings (ctrl-shift-alt-s), you should see a module structure. If you instead see "Nothing to see", do the following:
In Project Structure -> Modules, press the + button,
press enter (since, for some weird reason, it won't let me click on "New Module")
In the window that pops up, click on the "..." next to Content root, find your root folder, and select it
Press ok
ignore any warning that says the name is already in use (or to that effect)
the simplest solution worked from me, just delete the .idea folder
keep in mind this will delete all of idea's current project configuration, it'll create the folder with default settings when reload the project again... but all other configuration will be lost if not properly backed-up
It might be because the project didn't have any modules defined. Try adding existing source code by hitting File > New > Module from Existing Sources and select the parent directory of the project for source code
Go to pom.xml file -> right click -> maven -> generate source and update folders. You will see your files and folder structures in left hand side.
All the project-specific settings for a project opened through Intellij IDE are stored in the .idea folder.
The .idea folder (hidden on OS X) in the solution root contains
IntelliJ’s project-specific settings files. These include per-project
details such as VCS mapping and run and debug configurations, as well
as per-user details, such as currently open files, navigation history
and currently selected configuration.
So, if you are not able to see the project file structure in your Intellij IDE, just delete the .idea folder,
rm -rf .idea
and reload the project, then after reload you'll be easily able to get your project structure displayed.
Thank you very much. I just remove the .idea folder and works in my case.
rm -rf .idea
For me, the java folder was not showing up. I went into File->Project Structure. In the second column, I selected on _main. In the third column, I selected the tab "sources". In what I call the fourth column, where the "+Add Content Root" is shown, I verified, the java source/folder was present. In my case, there was an extra source folder, which was the current location. I removed this, applied and the java folder immediately showed up.
Right click on the Project name -> Open Module Setting -> Check the application context path set it up at your project location.
Check your idea.log -- it may have some details explaining why or what is happening (Help | Reveal log in Explorer). Possibly one of the config files got corrupted.
You can always backup and delete .idea subfolder (project settings) and re-create project from scratch. When it's wroking again (after basic configuration) you may copy some of the files from that folder back to recover some of your settings (if there were many).
This happened to me on a new computer when I opened up a Java project in the newly installed Intellij.
The problem was that I had not installed any JDK on the machine.
I had to install a JDK and then go into the settings at ctrl-shift-alt-s and add a JDK by specifying the folder where I installed it. It's possible that IntelliJ would have found it if I closed it and reopened it.
In my case the solution was to create a new project, specifying the project type and creating it within the same directory path as the project that does not load the project files correctly.
PhpStorm automatically detects that the directory exists and gives you the option to create project from existing sources.
This can be found under:
File --> New project...
For gradle users: "Reload All Gradle Projects" option should help.

IDEA: How do I see subdirectories in an empty project?

I wish to use IDEA to edit a directory full of files of no particular type. So, I create a new project of type Empty Project and point it at my directory.
The project view now shows the files in the directory itself. But, it doesn't show any subdirectories. This is very strange.
Even more strangely, I can still use New -> Directory to create a new directory. From the command line I can see that the directory has been created; but, from within IDEA, it's still not appearing.
What's going on here? And, more importantly, how can I actually get it to show me my subdirectories?
This is IntelliJ IDEA 12.1.1. I did find IntelliJ does not show project folders, which sounds similar. But, it is referring to a different version of IDEA and they're not using an Empty Project. So, I don't think it's relevant.
In IntelliJ, you have to create at least one module. As CrazyCoder said in the comments, adding a module sets the root folder of what to display in the Project pane.
Here are steps that I took to show empty folders.
In a terminal window
mkdir one
mkdir one/two
mkdir one/two/three
mkdir one/two/three/four
In Intellij 15.0.2, I created a new project, selected Empty Project and set the Project Location to the one folder.
After creating the project, IntelliJ prompts me with a Project Structure dialog with Modules selected in the navigation tree. I clicked the '+' button in the middle pane to add a module. I chose Static Web as the module type to prevent creation of an additional src folder. I set the Content root and the Module file location of the module to the same one folder.
I clicked Finish and then Ok. This gave me this structure

intellij usability question - how to add a button that opens working folder

There's a small feature I have been yearning about in intellij idea and I will give it a try in this forum, maybe it is already possible.
In brief: I want a button that opens the working folder of the project I am working on.
Since this is the folder I put my settings files I am doing the following operation dozens of times a day -
open the run/debug configuration.
go to my activbe project tab.
copy the working directory.
open run (win+r).
paste the folder path and press enter.
X dozens of times.
Is there a way to add a button somewhere that opens my working folder?
BTW: I know that in the project settings - External tools - I can add actions. but there is no workingFolder in the macros. is there a way to add the working folder? (eventhough a button would be better)
Thanks a lot.
If you need to manage files, why not do it right from IntelliJ? If you have to go to explorer, right click any file or folder in the project panel, and there's a "Show in Explorer" option in Windows (no default key mapping). There's also "Show Path" (ctrl+alt+F12), which lets you open Explorer to any parent directory of the selected file all the way up to the drive. Finally, "Copy Path" (ctrl+shift+C) will copy the absolute path to the clipboard. (This is in IDEA 10.5, but I know Copy Path has been there a long time.)