Skip to content

LinWanCen/show-comment

Repository files navigation

智能注释插件 Show Comment Plugin IDEA

Version Downloads

Thanks to JetBrains Licenses for Open Source.

Notes 说明

Show doc comment in the Project view Tree, line End, json, other

在文件树、行末、JSON 等地方显示注释.

  • Java, Kotlin, Groovy, Scala
  • C/C++/OC, Python, Go, Rust, Ruby
  • HTML(Vue), JS/TS, PHP, SQL
  • YAML/yml

English Note

  • tree doc from lang or README.md pom .gradle etc. by settings
  • input `doc` `docc` -> /** */
  • json doc from xxx.json.tsv
  • json dict doc from (key).tsv
  • "xx-ClassNameOrSimpleName.json" and jump to field
  • from External Conf for folder, resources, COBOL etc.
  • Config: settings -> Tools -> // Show Comment App/Global/Project
External Comment
Demo(GitHub)
  • Reload: Tools -> 🔄 // Reload External Comment
  • path/[any][filename.]ext.tree.tsv // file and folder tree comment 📝 📁
  • path/[any][filename.]ext.key.regexp // line keywords to split and comment
  • path/[any][filename.]ext.doc.tsv // line words comment
  • In path, "doc" can replace any, and can use % like in SQL, effect at previous layer when folder named -1
  • The lines in key.regexp will be concatenated with `|` to regexp; longer str should in front; startWith `?` to exclude
  • Chang tsv file in find pop window would not reload!
  • The tsv conf file must could be search in "Go to File" (Ctrl + Shift + N)
My Project
  • Show doc comment at the Project view Tree, line End, json etc.: Show Comment
  • show line count for file / method, show children count for dir in project view (tree on left): Line Num
  • Method call usage graph and maven dependency graph: Draw Graph
  • Find author/comment of multiple files or lines and export Find: Find Author
  • Auto sync coverage and capture coverage during debug: Sync Coverage

中文说明

  • 在结构树显示 文件注释 或 项目说明 (README.md pom.xml 等,可设置)
  • 在行末尾显示 引用对象的文档注释,欢迎反馈您想要支持的语言,欢迎 C# 大神研究 CsLineEnd.java
  • 输入 doc / docc 等生成 /** */
  • json 字段注释从 xxx.json.tsv 读取
  • json 字典注释从 键名.tsv 读取
  • 支持 "xx-类全名或简名.json" 读取字段注释和跳转
  • 支持 从配置文件获取外部注释用于文件夹、资源、COBOL 等
  • 修改配置:设置 -> 工具 -> // Show Comment App/Global/Project
外部注释
示例(Gitee) :比如你要给 .go 的文件配置文件注释可以放在相同目录或父目录的 xxx.go.tree.tsv 中
  • 重新加载:工具 -> "🔄 // Reload External Comment"
  • path/[any][filename.]ext.tree.tsv // 文件(夹)注释 📝 📁
  • path/[any][filename.]ext.key.regexp // 切割关键字与注释
  • path/[any][filename.]ext.doc.tsv // 词注释
  • key.regexp 的每一行将会用`|`连接起来形成正则表达式,较长的关键字应该放在前面,用 `?` 开头排除
  • doc 文件夹可以替换任何一层文件夹,可以像 SQL 那样用 % 模糊匹配,文件夹名为 -1 时在上一层文件夹生效
  • 在搜索弹出窗中修改 tsv 文件将不会被重加载
  • tsv 配置文件必须能被搜索(Ctrl + Shift + N)
我的项目
  • 在文件树、行末、JSON 显示注释: Show Comment
  • 在文件树显示行数、文件数: Line Num
  • 生成 方法调用图 和 Maven 依赖图: Draw Graph
  • 查找多个文件或行的作者 与 导出搜索: Find Author
  • 自动同步覆盖率 和 调试中抓取覆盖率: Sync Coverage

反馈问题和需求


支持

  • 如果对你有所帮助,可以通过群或文章等形式分享给大家,在插件市场好评,或者给本项目 GitHub 主页一个 Star,您的支持是项目前进的动力。

Change Notes 更新说明

build.gradle

Demo 示例

See in IDEA with this plugin | 安装插件后用 IDEA 查看

Maven down source jar 自动下载带注释的源码

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.2</version>
        <executions>
          <execution>
            <id>down_source_jar</id>
            <phase>validate</phase>
            <goals>
              <goal>sources</goal>
            </goals>
            <configuration>
              <includeArtifactIds>
                <!-- 公司统一出入参基类 -->
                com.company.common.base,
                <!-- 公司统一错误码 -->
                com.company.common.errcode
              </includeArtifactIds>
            </configuration>
          </execution>
        </executions>
      </plugin>