Default Configurations in Run Dashboard in IntelliJ - intellij-idea

Whenever I create a new workspace in IntelliJ, I need to add the default types for enabling "Run Dashboard" in the workspace. This is very cumbersome for me as I have certain types of configurations which I want to be available in Run Dashboard of every workspace.
I would like to configure the defaults for Run Dashboard which I would want to be available in any new workspaces I create so that I do not have to enable the run dashboard individually for every new workspace I create. Is this possible in IntelliJ?
I am using version 2019.1 now (the same problem exists in older versions as well)

Related

Separate IntelliJ settings for projects

I'm working on multiple projects at the moment and the fact that IntelliJ automatically synchronizes all settings makes life quite difficult for me.
For example, for project A I need to use a specific version of Maven with specific settings, for project B another version with other settings and for project C another version. This however isn't possible, when I set the Maven folder to something, it automatically syncs when I open a new IntelliJ.
This was just an example, there are more settings that I would like not to be shared.
Is there a way to resolve this?

How to import more projects into existed workspace in Intellji

I am using Intellji 2016 for maven and gradle products. The problem I am facing is that I can't import other maven or gradle projects into my existed workspace. When doing the project import, Intellji will prompt a window to allow me to choose either replace the existed workspace or launch a new workspace window. Is there any way to import them into existed workspace?
You can have multiple projects in the same window in Intellij, you need to have each as a separate module.
Create a new "empty project", then when prompted choose "Import module":
This is not possible in Intellij IDEA. Each project will be in its own window as explained in the user guide:
https://www.jetbrains.com/help/idea/2016.2/opening-multiple-projects.html

ResourcesPlugin.getWorkspace() is not taking the currently opened workspace

I am a novice in Plugin development and I am facing this issue in opening my current workspace:
ResourcesPlugin.getWorkspace() is not taking the currently opened workspace which is D:/ABCDWoekspace, instead it is returning the workspace of eclipse that is created in the eclipse installaction directory d:/eclipse/workspace as my eclipse in installed in D:eclipse
When you run your plugin from within Eclipse a new Eclipse is started with a new workspace in which to run the test. A new workspace is necessary because only one Eclipse instance can access a workspace at a time.
If you open 'Run > Run Configurations' and find your plugin in the 'Eclipse Application' section you can see the workspace location in the 'Location' field on the 'Main' tab. You can change this location to point to another existing workspace location.
You will need to set up this new workspace with whatever projects you need for testing.

How to import and run existing plugins from intellij community edition repo

I'm trying to import and run the IntelliJ git4idea (Git Integration) plugin in order to play around and contribute some of my own code.
I've pulled the Intellij community edition from the github repo, and imported the git4idea plugin as a project. I'm running the Intellij community edition
My main issue is this:
After importing all the modules, the git4idea module comes up as a general module type, and not a plugin module type.
This means that when trying to create a new run\debug configuration, I get [none] under "Use classpath of module", instead of of the ability to select the git4idea plugin. This obviously results in a "Run configuration error: no plugin module specified for configuration".
So the question is -
How can I change the general type of imported "git4idea" to plugin type?
Or better yet, what are the steps required in order to import and build/debug/run a plugin from the Intellij community edition repo?
I was able to solve this by manually reordering file directories, sorting out dependencies and editing the .iml file. The type of plugin is defined by changing type="JAVA_MODULE" to type="PLUGIN_MODULE".
...
This is the answer given by Dmitry Jemerov on the official Jetbrains plugin development forum:
The easiest answer to this is "don't". The IntelliJ IDEA Community
Edition project is set up to be developed as a whole, and the
dependencies are set up accordingly. If you want to hack on the Git
plugin, you simply run IDEA using the provided run configuration, it
runs with all plugins enabled, and you simply make whatever changes
you need and test them using the main run configuration.
If you really want, you can set up a new plugin module and point it to
the source code of the git4idea plugin inside the IntelliJ IDEA
Community Edition Git checkout. This is not too hard, but it's
something you'll need to do from scratch, and you can't use the
existing .iml file.
I had the same no plugin module specified for configuration issue. To work around it, instead of importing, I created a new plugin project and used the existing code directory.
when you import the intelij plugin projects
You should run the 'runIde' task in gradle.
Step-by-step instruction
Build your IDEA plugin (usually done with gradle build).
Start Intellij IDEA.
If you have any project opened, go to menu "File->Close all projects" to return to Intellij IDEA startup screen.
Install the plugin you've just built: on the left side of the "Welcome to Intellij IDEA" startup screen go to "Plugins", then click "gear" icon on the right side, it's located to the right of "Marketplace" and "Installed". From the pop-up menu select "Install Plugin from Disk...", navigate to plugin file (usually in build folder) and click "Ignore and continue" when you see the warning message saying something about signature.
Restart Intellij IDEA.
Open the folder with your IDEA plugin.
Wait until IDEA imported your Gradle project.
Put breakpoints inside your plugin code so you can debug it.
Go to menu "Run->Edit configurations".
In the "Run/Debug Configurations" window on the left side click "+".
Select "Gradle" from the pop-up menu.
On the right side change "Name" to "gradle-run-ide" (without quotes).
On the right side under "Run", inside "Tasks and arguments" field enter runIde ("i" must be capital, other letters small).
Click "OK" to save changes.
Go to menu "Run->Debug 'gradle-run-ide'".
A new, black-colored IDEA window should appear.
In this black-colored IDEA window do whatever you need to do in order to invoke methods of your plugin. When you invoke them, the first IDEA window should stop you on breakpoints you set previously.
Happy debugging.
After changing type="JAVA_MODULE" to type="PLUGIN_MODULE" in *.iml file I was getting following error -
Error running 'IdeaPlugin': Wrong SDK type for plugin module
To fix this go to -
Module Settings -> Platform settings -> SDKs.
Click on Add new SDK
Select Intellij Platform plugin SDK
For home directory select your Inetllij installation dir
Select JAVA SDK you want to use with it.
Once this is added got to Module Settings again
Module Settings -> Project settings -> project.
In Project SDK change the JAVA sdk to the SDK we just added in the above steps.
Run/Debug you plugin now.

Share IntelliJ inspection profile between different projects

I have an inspection profile configured for one of my IntelliJ projects and have "Share profile" checked. When I'm in another project, the inspection profile I created is not available (doesn't appears in the dropdown combobox). Is there a way to create an inspection profile just once and use it across many projects?
I'm running IntelliJ 10.5.4.
Shared profile option means that it will be stored in the project and is shared with other developers via the project files. If you disable this option, inspections profile will be stored in IntelliJ IDEA configuration directory on your machine and you'll be able to use the same profile in multiple projects.
See also Inspections help section:
Share profile - Select this check box to make the selected profile available for your team, i.e to make it the project-level profile. If
you create IDE-level profile for your own purposes, clear this check
box.