IntelliJ 平台本身并不是一个产品,而是提供了一个用于构建 IDE 的平台。这个平台本身是开源的,源码可从intellij-community源码,任何人都可以使用。但基于此平台开发的软件比如idea、phpStorem可能是收费的。
基于此是可以开发属于自己的idea软件的,最佳实践是修改runIde任务以使用本地安装的targetIDE作为IDE 开发实例。将该属性设置为目标 IDErunIde.ideDir应用程序的(用户特定的)绝对路径,确切的路径格式因操作系统而异。
intellij {
//type.set("CUSTOM")
// Define IntelliJ Platform against which to build the plugin project.
type.set("IU")
// Use the IntelliJ Platform BRANCH.BUILD version matching
// "targetIDE" (PhpStorm):
version.set("192.7142.36") // baseIntelliJPlatformVersion
// Require the targetIDE plugin or library. Use the stable version
// compatible with intellij.version and intellij.type specified above:
plugins.set(listOf("com.jetbrains.php:192.6603.42"))
}
runIde {
// Absolute path to the installed targetIDE to use as IDE Development
// Instance (the "Contents" directory is macOS specific):
ideDir.set(file("/Users/$USERNAME$/Library/Application Support/JetBrains/Toolbox/apps/PhpStorm/ch-0/192.7142.41/PhpStorm.app/Contents"))
}
使用特定于目标产品的功能 (API) 时,必须声明对目标产品模块的依赖性,比如以PhpStorm 开发插件,就需要如下配置:
com.jetbrains.php
com.intellij.modules.platform
兼容可用列表如下:
Module for |
Functionality |
---|---|
|
Messaging, Themes, UI Components, Files, Documents, Actions, Components, Services, Extensions, Editors |
|
File Type, Lexer, Parser, Highlighting, References, Code Completion, Find, Rename, Formatter, Code Navigation |
|
XML, XML DOM, XSD/DTD, DOM Model |
|
VCS Revision Numbers, File Status, Change Lists, File History, Annotations |
|
Debug Session, Stack Frames, Break Points, Source Positions, Memory Views, Tracked Instances |
有针对性的兼容列表如下:
Module or Plugin for |
Functionality |
Product Compatibility |
---|---|---|
See Java below. |
Java language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
IntelliJ IDEA, Android Studio |
|
Android SDK Platform, Build Tools, Platform Tools, SDK Tools |
Android Studio |
|
C, C++, Objective-C/C++ language PSI Model, Swift/Objective-C Interaction, Inspections, Intentions, Completion, Refactoring, Test Framework |
AppCode, CLion |
|
Debugger Watches, Evaluations, Breakpoints, Inline Debugging |
AppCode, CLion, RubyMine |
See AppCode/CLion below. |
Xcode Project Model, CocoaPods, Core Data Objects, Device & Simulator Support |
AppCode |
See AppCode/CLion below. |
CMake, Profiler, Embedded Development, Remote Development, Remote Debug, Disassembly |
CLion |
|
Native Debugger Integration, Utility Classes, C/C++ Project Model/Workspace Support (OCWorkspace, CidrWorkspace, etc.), C/C++ Build and Run Support |
AppCode, CLion |
|
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. |
|
Go language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
GoLand |
|
Python language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
PyCharm, and other products if the Python plugin is installed. |
|
Connection to ReSharper Process in Background |
Rider |
|
Ruby language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
RubyMine, and IntelliJ IDEA Ultimate if the Ruby plugin is installed. |
|
Licensing |
All commercial IDEs (IntelliJ IDEA Ultimate, PhpStorm, DataGrip, ...) |
|
Swift language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
AppCode, CLion |
|
PHP language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
PhpStorm, and other products if the PHP plugin is installed. |
|
JavaScript language PSI Model, Inspections, Intentions, Completion, Refactoring, Test Framework |
WebStorm, and other products if the JavaScript plugin is installed. |