<idea-pluginversion="2"> <name>Lombook Plugin</name> <description>A plugin that adds first-class support for Project Lombok</description> <version>0.1</version> <vendor>Michail Plushnikov</vendor> <idea-versionsince-build="8000"/>
<application-components> <!-- Add your application components here --> <component> <implementation-class>de.plushnikov.intellij.plugin.LombokLoader</implementation-class> </component> </application-components>
<project-components> <!-- Add your project components here --> </project-components>
<actions> <!-- Add your actions here --> </actions>
<extensionsdefaultExtensionNs="com.intellij"> <!-- Add your extensions here --> <lang.psiAugmentProviderimplementation="de.plushnikov.intellij.plugin.provider.LombokAugmentProvider"/> <implicitUsageProviderimplementation="de.plushnikov.intellij.plugin.provider.LombokImplicitUsageProvider"/> <renameHandlerimplementation="de.plushnikov.intellij.plugin.handler.LombokElementRenameHandler"order="first"/> <treeGeneratorimplementation="de.plushnikov.intellij.lombok.psi.MyLightMethodTreeGenerator"/> <!--<refactoring.changeSignatureUsageProcessor implementation=""/>--> <!--<refactoring.safeDeleteProcessor --> <!--<refactoring.moveHandler implementation="de.plushnikov.intellij.plugin.handler.LombokElementMoveHandler" order="first"/>--> </extensions> </idea-plugin>
里面重要的参数就是这个 lang.psiAugmentProvider ,但是离谱的是官方文档里面对这个完全没有任何介绍。经过谷歌之后找到了一点介绍 Idea社区 CSDN 那么查过资料之后就能很容易的知道这是干什么的了,这个东西是 IDEA 动态获取每个文件的 psi,添加相应的方法和字段, psi 是 IDEA 内部解析文件和语义转换的一层抽象模型
The Program Structure Interface, commonly referred to as just PSI, is the layer in the IntelliJ Platform responsible for parsing files and creating the syntactic and semantic code model that powers so many of the platform’s features.
评论