idea插件开发-开发属于自己的IDE开发平台

        IntelliJ 平台本身并不是一个产品,而是提供了一个用于构建 IDE 的平台。这个平台本身是开源的,源码可从intellij-community源码,任何人都可以使用。但基于此平台开发的软件比如idea、phpStorem可能是收费的。

        基于此是可以开发属于自己的idea软件的,最佳实践是修改runIde任务以使用本地安装的targetIDE作为IDE 开发实例。将该属性设置为目标 IDErunIde.ideDir应用程序的(用户特定的)绝对路径,确切的路径格式因操作系统而异。

一、如何开发

build.gradle.kts配置

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"))
}

配置plugin.xml

        使用特定于目标产品的功能 (API) 时,必须声明对目标产品模块的依赖性,比如以PhpStorm 开发插件,就需要如下配置:

声明模块依赖


com.jetbrains.php
com.intellij.modules.platform

兼容可用列表如下:

Module for  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

有针对性的兼容列表如下:

Module or Plugin for  Element

Functionality

Product Compatibility

com.intellij.modules.java or com.intellij.java

See Java below.

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 or com.intellij.appcode

See AppCode/CLion below.

Xcode Project Model, CocoaPods, Core Data Objects, Device & Simulator Support

AppCode

com.intellij.modules.clion or com.intellij.clion

See AppCode/CLion below.

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.

org.jetbrains.plugins.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.

Intellij platform所有公开的扩展点

  • IDEA平台提供:IntelliJ Platform Extension Point and Listener List
  • 开源插件提供:Open Source Plugins Extension Point and Listener List
  • Spring插件提供:Spring API Extension Point and Listener List

你可能感兴趣的:(Idea插件开发,intellij-idea,java,ide,开发语言,spring,boot)