How to export Required Plugins functionality in IntelliJ? - intellij-idea

There is a function in ItelliJ which is Required Plugins.
I want to make plugin X required in our project, so our team will be prompted to install it.
Is there a way to do that?

Required plug-ins are saved in the project inside .idea/externalDependencies.xml file which can be shared via the version control.

Related

Intellij Elixir - auto complete is not working

I’m using IntelliJ Community version 2022.2.2 on Windows 11, I also have the Elixir plugin installed (https://plugins.jetbrains.com/plugin/7522-elixir)
But when I try an auto-complete for a native module like Enum, String and so on I get a “No suggestions” message like this:
Does anyone know how to fix that?
Go to File -> Project Structure
Check the Project tab and then you have SDK, make sure you point to correct one
Again in the Project tab go to Modules, and then Dependencies. Here again check the Module SDK whether it points to the correct location

How do I backup my IntelliJ plugins and automatically install them again?

I was backing up my dotfiles and selected parts of my .idea directory. I recklessly removed a symlink in such a way that it deleted my plugins directory.
I didn't know all the plugins I had installed and I couldn't find a file containing a list of those plugins. Does such a file exist?
Essentially my goal is to:
backup my plugins in case .idea or plugins is accidentally deleted, or if I want to re-install IntelliJ and forgot the plugins I had installed.
have IntelliJ install the plugins automatically when I choose to restore them.
There are a few solutions I can think of:
If a file containing a complete list of plugins exists then place it under version control.
Place the entire plugins directory (which includes binaries) into version control. This I want to avoid.
Instead of placing it under version control, place it under a backup directory. This should work as I just need to copy the files across into the plugins directory. The only problem I have is that it separates my files and directories unless I choose to place the entire selection of the .idea directory there.
Export and Import settings from IntelliJ although I believe that the plugins need to be installed already as they are merely settings. The .zip file will give me an indication of the plugins I have installed but I'd have to manually export my settings on every installation.
Keep a manual copy of my plugins and update it every time a new plugin is added. This could work because I don't install a lot of plugins but I'd prefer to have it automated.
You can use the Settings Sync feature which synchronizes your settings between different systems and stores the backup of the settings and the list of installed plug-ins in your JetBrains account.
.idea project directory should not have any relation to the plug-ins directory that is stored under the user profile.
Another option is to use the Required Plugins feature to store the list of the the plug-ins you need together with your project. Certain project files can be put into the version control.
I believe that you can use the functionality of IDE settings sync plugin.
This plugin is built into IntelliJ IDEA and allows you to bing your settings (like themes, keymaps, plugins, etc.) to your JetBrains account.
Another option is to store your plugins through a settings repository (same link). It allows you to configure repository, where all your setting will be saved and automatically synchronized.

Save Actions plug-in for JetBrains PhpStorm

There is a plug-in called "Save Actions" available for IntelliJ IDEA. Now I want to know if there is a plugin with the same functionality for PhpStorm? I want to add the this, final and PHPDoc declarations at the save Action.
There is an open request to make Save Actions plug-in available for all IntelliJ platform based IDEs.
Developer has shared an experimental version that should work with PhpStorm:
save-actions.zip
You can install it manually from zip.

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.

How best to maintain an Eclipse RCP plugin target?

I have a plugin for an RCP app that uses BIRT. I have a target for building my app which contains only the plugins/features that are required. I recently updated the BIRT plugin versions in my IDE, which created an incompatibility in the design files with previous versions of BIRT. I have the old version of BIRT in my target and need to update to the newer plugins.
In the past I have manually updated plugin jars in the target, but BIRT is a complicated platform with dependencies out the wazoo. Is there any utility or way of organizing my target differently that will make this easier to control in the future?
I would recommend to keep all components separately and not copy them into a single folder. You can use Target Definition editor (see File / New / Other... / Target Definition). So, after downloading all the pieces, you can unpack them locally and assemble your Target Platform using Target Definition editor.
You can also do the same using Window / Preferences / Plugin Development / Target Platform preference page. There you can select previously created target definition or specify base Eclipse install and then use "Add..." button to add additional components from local folders or remote sites.
Also, as far as I know the PDE team is currently working on expanding Target platform support in Eclipse 3.5. I think they are planning to allow to select Target Definition per-launch configuration and per-project.
Im not sure if i understand you right, so please let me know if not.
When i use third party libraries, i create a plugin for every single one.
Example:
xstream library:
Import the jars (also the source code)
Add the jars to the MANIFEST
Bundle-ClassPath
Add all xtream packages to the
MANIFEST Export-Package
When a plugin needs the code of the xstream library it has to depend on the xtream plugin. Because the packages are public, every plugin can use the source code of it.
When a new version of xtream is comming, you only have to update the jars and not the dependend plugins. Sometimes you have to update the export packages of the third party plugin.
All depended plugins you dont have to change.