<commit_before>[//]: # (title: Plugin Compatibility with IntelliJ Platform Products)

<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->

All products based on the IntelliJ Platform are built on the same underlying API.
Some of these products share features built on top of the platform, such as Java support in IntelliJ IDEA and Android Studio.
Underlying those shared features are shared components.
When authoring a plugin for the IntelliJ Platform, it is important to understand and declare dependencies on these components.
Otherwise, it may not be possible to load or run the plugin in a product because the components on which it depends aren't available.

> Qualifying Open Source projects can [apply for free licenses](https://www.jetbrains.com/community/opensource/) of JetBrains products.
>
{type="tip"}

## Declaring Plugin Dependencies

For the purposes of dependencies, a _module_ can be thought of as a built-in plugin that ships as a non-removable part of a product.
A working definition of a dependency is that a plugin project cannot be run without the module present in an IntelliJ Platform-based product.
Declaring a dependency on a module also expresses a plugin's compatibility with a product in that the IntelliJ Platform determines whether a product contains the correct modules to support a plugin before loading it.

[Part I](plugin_dependencies.md) of this document describes the syntax for declaring plugin dependencies and optional plugin dependencies.
Part II of this document (below) describes the IntelliJ Platform modules' functionality to aid in determining the dependencies of a plugin.

The way dependency declarations are handled by the Intellij Platform is determined by the contents of the <path>[plugin.xml](plugin_configuration_file.md)</path> file:
* If a plugin does not declare any dependencies in its <path>plugin.xml</path> file, or if it declares dependencies only on other plugins but not modules, it's assumed to be a legacy plugin and is loaded only in IntelliJ IDEA.
  This configuration of the dependency declaration is deprecated; do not use it for new plugin projects.
* If a plugin declares at least _one_ module dependency in its <path>plugin.xml</path> file, the plugin is loaded if an IntelliJ Platform-based product contains _all the modules and plugins_ on which the plugin has declared a dependency.

## Modules

A _module_ represents a built-in plugin that is a non-removable part of a product.
Some modules are available in all products, and some modules are available only in some, or even just one product.
This section identifies and discusses modules of both types.

### Declaring Incompatibility with Module

Starting in 2020.2, a plugin can declare incompatibility with an arbitrary module by specifying [`<incompatible-with>`](plugin_configuration_file.md#idea-plugin__incompatible-with) containing module ID in its <path>plugin.xml</path>.

### Modules Available in All Products

A core set of modules is available in all products based on the IntelliJ Platform.
These modules provide a set of shared functionalities.
The following table lists modules that are currently available in all products.

> All plugins should declare a dependency on **`com.intellij.modules.platform`** to indicate dependence on shared functionality.
>
{type="note"}

| Module for [`<depends>`](plugin_configuration_file.md#idea-plugin__depends) Element<br/>Declaration in <path>plugin.xml</path> File | <br/>Functionality                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| **`com.intellij.modules.platform`**                                                                                                 | Messaging, Themes, UI Components, Files, Documents, Actions, Components, Services, Extensions, Editors        |
| `com.intellij.modules.lang`                                                                                                         | File Type, Lexer, Parser, Highlighting, References, Code Completion, Find, Rename, Formatter, Code Navigation |
| `com.intellij.modules.xml`                                                                                                          | XML, XML DOM, XSD/DTD, DOM Model                                                                              |
| `com.intellij.modules.vcs`                                                                                                          | VCS Revision Numbers, File Status, Change Lists, File History, Annotations                                    |
| `com.intellij.modules.xdebugger`                                                                                                    | Debug Session, Stack Frames, Break Points, Source Positions, Memory Views, Tracked Instances                  |

As of this writing, if a plugin: **A)** is dependent _only_ on one or more of the modules in the table above, **and B)** declares those module dependencies in <path>plugin.xml</path>, then any product developed by JetBrains based on the IntelliJ Platform will load it.

### Modules Specific to Functionality

More specialized functionality is also delivered via modules and plugins in IntelliJ Platform-based products.
For example, the `com.intellij.modules.python` module supports the Python language-specific functionality.
If a plugin uses this module's functionality, such as Python-specific inspections and refactoring, it must declare a dependency on this module.

Note that not all products define and declare modules.
For example, PhpStorm does not have its own module, but the product itself depends on (and ships with) the PHP language plugin.
A plugin project is compatible with PHP functionality if it declares a dependency on this PHP language plugin.

> A high-level feature comparison tool for JetBrains IDEs is available [here](https://www.jetbrains.com/products/compare/).
>
{type="tip"}


The following table lists **(1)** modules or built-in plugins that provide specific functionality, and the products currently shipping with them.

| Module or Plugin for [`<depends>`](plugin_configuration_file.md#idea-plugin__depends) Element<br/>Declaration in <path>plugin.xml</path> File | <br/>Functionality                                                                                                                                  | IntelliJ Platform-Based<br/>Product Compatibility                                                                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `com.intellij.modules.java` See **(2)** below. <br/>`com.intellij.java`                                                                       | **Java** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                       | IntelliJ IDEA, Android Studio                                                                                                                                              |
| `com.intellij.modules.androidstudio`                                                                                                          | Android SDK Platform, Build Tools, Platform Tools, SDK Tools                                                                                        | Android Studio                                                                                                                                                             |
| `com.intellij.modules.cidr.lang`                                                                                                              | **C, C++, Objective-C/C++** language PSI Model, Swift/Objective-C Interaction, Inspections, Intentions, Completion, Refactoring, Test Framework     | AppCode, CLion                                                                                                                                                             |
| `com.intellij.modules.cidr.debugger`                                                                                                          | Debugger Watches, Evaluations, Breakpoints, Inline Debugging                                                                                        | AppCode, CLion, RubyMine                                                                                                                                                   |
| `com.intellij.modules.appcode` See **(3)** below. <br/>`com.intellij.appcode`                                                                 | Xcode Project Model, CocoaPods, Core Data Objects, Device & Simulator Support                                                                       | AppCode                                                                                                                                                                    |
| `com.intellij.modules.clion` See **(3)** below. <br/>`com.intellij.clion`                                                                     | CMake, Profiler, Embedded Development, Remote Development, Remote Debug, Disassembly                                                                | CLion                                                                                                                                                                      |
| `com.intellij.cidr.base`                                                                                                                      | Native Debugger Integration, Utility Classes, C/C++ Project Model/Workspace Support (OCWorkspace, CidrWorkspace, etc.), C/C++ Build and Run Support | AppCode, CLion                                                                                                                                                             |
| `com.intellij.database`                                                                                                                       | **Database Tools and SQL** language PSI Model, Inspections, Completion, Refactoring, Queries                                                        | DataGrip, IntelliJ IDEA Ultimate, AppCode, PhpStorm, PyCharm Professional, RubyMine, CLion, GoLand, Rider, and WebStorm if the Database Tools and SQL plugin is installed. |
| `com.intellij.modules.goland` See **(4)** below.<br/>`com.intellij.modules.go`                                                                | **Go** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                         | GoLand                                                                                                                                                                     |
| `com.intellij.modules.python`                                                                                                                 | **Python** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                     | PyCharm, and other products if the Python plugin is installed.                                                                                                             |
| `com.intellij.modules.rider`                                                                                                                  | Connection to **ReSharper** Process in Background                                                                                                   | Rider                                                                                                                                                                      |
| `com.intellij.modules.ruby`                                                                                                                   | **Ruby** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                       | RubyMine, and IntelliJ IDEA Ultimate if the Ruby plugin is installed.                                                                                                      |
| `com.intellij.modules.ultimate`                                                                                                               | Licensing                                                                                                                                           | All commercial IDEs (IntelliJ IDEA Ultimate, PhpStorm, DataGrip, ...)                                                                                                      |
| `com.intellij.swift`                                                                                                                          | **Swift** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                      | AppCode, CLion                                                                                                                                                             |
| `com.jetbrains.php`                                                                                                                           | **PHP** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                        | PhpStorm, and other products if the PHP plugin is installed.                                                                                                               |
| `JavaScript`                                                                                                                                  | **JavaScript** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                 | WebStorm, and other products if the JavaScript plugin is installed.                                                                                                        |

**Notes about Module and Plugin Dependency:**

**(1)** This table is not exhaustive; other modules are currently available in JetBrains' IntelliJ Platform-based IDEs.
To see a list of modules, invoke the [code completion](https://www.jetbrains.com/help/idea/auto-completing-code.html#4eac28ba) feature for the `<depends>` element contents while editing the <path>plugin.xml</path> file.

**(2)** The [Java language functionality](https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/) was extracted as a plugin in version 2019.2 of the IntelliJ Platform.
This refactoring separated the Java implementation from the other, non-language portions of the platform.
Consequently, [dependencies](plugin_dependencies.md) on Java functionality are expressed differently in <path>plugin.xml</path> depending on the version of the IntelliJ Platform being targeted:

* Syntax for 2019.2 and later releases:
  * <path>plugin.xml</path> (_allowable alternative_):
     ```xml
     <depends>com.intellij.java</depends><commit_msg>plugin_compatibility.md: simplify table headers<commit_after>[//]: # (title: Plugin Compatibility with IntelliJ Platform Products)

<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->

All products based on the IntelliJ Platform are built on the same underlying API.
Some of these products share features built on top of the platform, such as Java support in IntelliJ IDEA and Android Studio.
Underlying those shared features are shared components.
When authoring a plugin for the IntelliJ Platform, it is important to understand and declare dependencies on these components.
Otherwise, it may not be possible to load or run the plugin in a product because the components on which it depends aren't available.

> Qualifying Open Source projects can [apply for free licenses](https://www.jetbrains.com/community/opensource/) of JetBrains products.
>
{type="tip"}

## Declaring Plugin Dependencies

For the purposes of dependencies, a _module_ can be thought of as a built-in plugin that ships as a non-removable part of a product.
A working definition of a dependency is that a plugin project cannot be run without the module present in an IntelliJ Platform-based product.
Declaring a dependency on a module also expresses a plugin's compatibility with a product in that the IntelliJ Platform determines whether a product contains the correct modules to support a plugin before loading it.

[Part I](plugin_dependencies.md) of this document describes the syntax for declaring plugin dependencies and optional plugin dependencies.
Part II of this document (below) describes the IntelliJ Platform modules' functionality to aid in determining the dependencies of a plugin.

The way dependency declarations are handled by the Intellij Platform is determined by the contents of the <path>[plugin.xml](plugin_configuration_file.md)</path> file:
* If a plugin does not declare any dependencies in its <path>plugin.xml</path> file, or if it declares dependencies only on other plugins but not modules, it's assumed to be a legacy plugin and is loaded only in IntelliJ IDEA.
  This configuration of the dependency declaration is deprecated; do not use it for new plugin projects.
* If a plugin declares at least _one_ module dependency in its <path>plugin.xml</path> file, the plugin is loaded if an IntelliJ Platform-based product contains _all the modules and plugins_ on which the plugin has declared a dependency.

## Modules

A _module_ represents a built-in plugin that is a non-removable part of a product.
Some modules are available in all products, and some modules are available only in some, or even just one product.
This section identifies and discusses modules of both types.

### Declaring Incompatibility with Module

Starting in 2020.2, a plugin can declare incompatibility with an arbitrary module by specifying [`<incompatible-with>`](plugin_configuration_file.md#idea-plugin__incompatible-with) containing module ID in its <path>plugin.xml</path>.

### Modules Available in All Products

A core set of modules is available in all products based on the IntelliJ Platform.
These modules provide a set of shared functionalities.
The following table lists modules that are currently available in all products.

> All plugins should declare a dependency on **`com.intellij.modules.platform`** to indicate dependence on shared functionality.
>
{type="note"}

| Module for [`<depends>`](plugin_configuration_file.md#idea-plugin__depends) Element | Functionality                                                                                                 |
|-------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| **`com.intellij.modules.platform`**                                                 | Messaging, Themes, UI Components, Files, Documents, Actions, Components, Services, Extensions, Editors        |
| `com.intellij.modules.lang`                                                         | File Type, Lexer, Parser, Highlighting, References, Code Completion, Find, Rename, Formatter, Code Navigation |
| `com.intellij.modules.xml`                                                          | XML, XML DOM, XSD/DTD, DOM Model                                                                              |
| `com.intellij.modules.vcs`                                                          | VCS Revision Numbers, File Status, Change Lists, File History, Annotations                                    |
| `com.intellij.modules.xdebugger`                                                    | Debug Session, Stack Frames, Break Points, Source Positions, Memory Views, Tracked Instances                  |

As of this writing, if a plugin: **A)** is dependent _only_ on one or more of the modules in the table above, **and B)** declares those module dependencies in <path>plugin.xml</path>, then any product developed by JetBrains based on the IntelliJ Platform will load it.

### Modules Specific to Functionality

More specialized functionality is also delivered via modules and plugins in IntelliJ Platform-based products.
For example, the `com.intellij.modules.python` module supports the Python language-specific functionality.
If a plugin uses this module's functionality, such as Python-specific inspections and refactoring, it must declare a dependency on this module.

Note that not all products define and declare modules.
For example, PhpStorm does not have its own module, but the product itself depends on (and ships with) the PHP language plugin.
A plugin project is compatible with PHP functionality if it declares a dependency on this PHP language plugin.

> A high-level feature comparison tool for JetBrains IDEs is available [here](https://www.jetbrains.com/products/compare/).
>
{type="tip"}


The following table lists **(1)** modules or built-in plugins that provide specific functionality, and the products currently shipping with them.

| Module or Plugin for [`<depends>`](plugin_configuration_file.md#idea-plugin__depends) Element | Functionality                                                                                                                                       | Product Compatibility                                                                                                                                                      |
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `com.intellij.modules.java` See **(2)** below. <br/>`com.intellij.java`                       | **Java** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                       | IntelliJ IDEA, Android Studio                                                                                                                                              |
| `com.intellij.modules.androidstudio`                                                          | Android SDK Platform, Build Tools, Platform Tools, SDK Tools                                                                                        | Android Studio                                                                                                                                                             |
| `com.intellij.modules.cidr.lang`                                                              | **C, C++, Objective-C/C++** language PSI Model, Swift/Objective-C Interaction, Inspections, Intentions, Completion, Refactoring, Test Framework     | AppCode, CLion                                                                                                                                                             |
| `com.intellij.modules.cidr.debugger`                                                          | Debugger Watches, Evaluations, Breakpoints, Inline Debugging                                                                                        | AppCode, CLion, RubyMine                                                                                                                                                   |
| `com.intellij.modules.appcode` See **(3)** below. <br/>`com.intellij.appcode`                 | Xcode Project Model, CocoaPods, Core Data Objects, Device & Simulator Support                                                                       | AppCode                                                                                                                                                                    |
| `com.intellij.modules.clion` See **(3)** below. <br/>`com.intellij.clion`                     | CMake, Profiler, Embedded Development, Remote Development, Remote Debug, Disassembly                                                                | CLion                                                                                                                                                                      |
| `com.intellij.cidr.base`                                                                      | Native Debugger Integration, Utility Classes, C/C++ Project Model/Workspace Support (OCWorkspace, CidrWorkspace, etc.), C/C++ Build and Run Support | AppCode, CLion                                                                                                                                                             |
| `com.intellij.database`                                                                       | **Database Tools and SQL** language PSI Model, Inspections, Completion, Refactoring, Queries                                                        | DataGrip, IntelliJ IDEA Ultimate, AppCode, PhpStorm, PyCharm Professional, RubyMine, CLion, GoLand, Rider, and WebStorm if the Database Tools and SQL plugin is installed. |
| `com.intellij.modules.goland` See **(4)** below.<br/>`com.intellij.modules.go`                | **Go** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                         | GoLand                                                                                                                                                                     |
| `com.intellij.modules.python`                                                                 | **Python** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                     | PyCharm, and other products if the Python plugin is installed.                                                                                                             |
| `com.intellij.modules.rider`                                                                  | Connection to **ReSharper** Process in Background                                                                                                   | Rider                                                                                                                                                                      |
| `com.intellij.modules.ruby`                                                                   | **Ruby** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                       | RubyMine, and IntelliJ IDEA Ultimate if the Ruby plugin is installed.                                                                                                      |
| `com.intellij.modules.ultimate`                                                               | Licensing                                                                                                                                           | All commercial IDEs (IntelliJ IDEA Ultimate, PhpStorm, DataGrip, ...)                                                                                                      |
| `com.intellij.swift`                                                                          | **Swift** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                      | AppCode, CLion                                                                                                                                                             |
| `com.jetbrains.php`                                                                           | **PHP** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                        | PhpStorm, and other products if the PHP plugin is installed.                                                                                                               |
| `JavaScript`                                                                                  | **JavaScript** language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework                                                 | WebStorm, and other products if the JavaScript plugin is installed.                                                                                                        |

**Notes about Module and Plugin Dependency:**

**(1)** This table is not exhaustive; other modules are currently available in JetBrains' IntelliJ Platform-based IDEs.
To see a list of modules, invoke the [code completion](https://www.jetbrains.com/help/idea/auto-completing-code.html#4eac28ba) feature for the `<depends>` element contents while editing the <path>plugin.xml</path> file.

**(2)** The [Java language functionality](https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/) was extracted as a plugin in version 2019.2 of the IntelliJ Platform.
This refactoring separated the Java implementation from the other, non-language portions of the platform.
Consequently, [dependencies](plugin_dependencies.md) on Java functionality are expressed differently in <path>plugin.xml</path> depending on the version of the IntelliJ Platform being targeted:

* Syntax for 2019.2 and later releases:
  * <path>plugin.xml</path> (_allowable alternative_):
     ```xml
     <depends>com.intellij.java</depends>
{'fraction_non_alphanumeric': 0.0975737361846838, 'fraction_numerical': 0.00268131580668367, 'mean_word_length': 1.0776494565217392, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 78, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 440, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2887053', 'n_tokens_mistral': 5252, 'n_tokens_neox': 4991, 'n_words': 2219}