Intellij idea插件如何实现代码格式化器?

 时间:2024-10-31 00:54:13

1、定义一个ProtobufElementFactory进行处理。如图

Intellij idea插件如何实现代码格式化器?

2、在工厂类中提供创建属性文件的功能。如图

Intellij idea插件如何实现代码格式化器?

3、创建一个快速处理的目标action,继承自BaseIntentionAction。如图

Intellij idea插件如何实现代码格式化器?

4、使用ApplicationManager代理调用实现属性的创建。如图。

Intellij idea插件如何实现代码格式化器?

5、具体的创建属性的处理方法。如图

Intellij idea插件如何实现代码格式化器?

6、创建ProtobufAnnotator实现Annotator接口。如图

Intellij idea插件如何实现代码格式化器?

7、实现ProtobufAnnotator的annotate方法。如图

Intellij idea插件如何实现代码格式化器?
  • aardio新手开发教程怎么添加软件窗口菜单项
  • 使软件静默安装的方法汇总(一)
  • Win10系统如何禁用Windows search服务?
  • 如何利用微软自带的工具分一个新盘出来
  • Centos7如何发送邮件
  • 热门搜索
    怎么练肌肉 纸花怎么做 和平鸽怎么画 成都到九寨沟怎么走 员工旷工怎么扣工资 怎么瘦肌肉型小腿 怎么看自己电脑配置 肛瘘怎么办 怎么做鱼 跖疣怎么治