diff --git a/README.md b/README.md
index cb75369..9133a18 100644
--- a/README.md
+++ b/README.md
@@ -7,12 +7,10 @@ Thanks JetBrains Licenses for Open Source.
## Notes 说明
-
English Notes:
+Show doc comment at the Project view Tree, line End, json etc.
-- Show javadoc comments at the Project view Tree structure
-
- Show javadoc comments at the end-of-line
-
- Show javadoc comments at "xx-ClassNameOrSimpleName.json" and jump to field
-
- Show comments from External Conf for folder, resources, COBOL etc.
+
- "xx-ClassNameOrSimpleName.json" and jump to field
+
- from External Conf for folder, resources, COBOL etc.
- Config: settings -> Tools -> // Show Comment Global/Project
@@ -41,6 +39,7 @@ Thanks JetBrains Licenses for Open Source.
外部注释:
示例(Gitee)
+:比如你要给 .go 的文件配置文件注释可以放在相同目录或父目录的 xxx.go.tree.tsv 中
- 重新加载:工具 -> "🔄 // Reload External Comment"
- path/[any][filename.]ext.tree.tsv // 文件(夹)注释 📝 📁
@@ -52,12 +51,17 @@ Thanks JetBrains Licenses for Open Source.
- tsv 配置文件必须能被搜索(Ctrl + Shift + N)
+如果对你有所帮助,别忘了给本项目
+GitHub
+主页一个 Start,您的支持是项目前进的动力。
+
## Change Notes 更新说明
English Change Notes:
+- 1.24 Add PopupMenu Copy FileName:LineNumber
- 1.23 Add project-view-tree-comment setting for show when compact middle packages
- 1.22 Add PopupMenu Copy ClassName.MethodName
- 1.21 Add line-end-comment default skip only English when system lang is not `en`
@@ -85,6 +89,7 @@ Thanks JetBrains Licenses for Open Source.
中文更新说明:
+- 1.24 增加 右键菜单 复制 文件名:行号
- 1.23 增加 项目导航栏注释 折叠中间包时显示中间包注释设置
- 1.22 增加 右键菜单 复制 类名.方法名
- 1.21 增加 行末注释 系统语言非英文时 默认 忽略纯英文
@@ -119,4 +124,31 @@ See in IDEA with this plugin | 安装插件后用 IDEA 查看
- [Java Doc Comment Demo | Java 文档注释](src/test/java/io/github/linwancen/plugin/show/demo/java/Call.java)
- [JSON Doc Comment Demo | JSON 文档注释](src/test/java/io/github/linwancen/plugin/show/demo/json/base-Pojo.json)
- [External Comment Demo For COBOL | 外部注释 Demo](src/test/java/io/github/linwancen/plugin/show/demo/ext/cobol/demo/BASE.cbl)
-- [COBOL Highlighting | COBOL 高亮配置](src/test/java/io/github/linwancen/plugin/show/demo/ext/cobol/cobol/COBOL_IDEA.md)
\ No newline at end of file
+- [COBOL Highlighting | COBOL 高亮配置](src/test/java/io/github/linwancen/plugin/show/demo/ext/cobol/cobol/COBOL_IDEA.md)
+
+
+#### Maven down source jar 自动下载带注释的源码
+```xml
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ 3.1.2
+
+
+ down_source_jar
+ validate
+
+ sources
+
+
+
+
+ com.company.common.base,
+
+ com.company.common.errcode
+
+
+
+
+
+```
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index c6f994c..cd9c1c8 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
}
group 'io.github.linwancen'
-version '1.23.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
+version '1.24.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
apply plugin: 'java'
@@ -39,6 +39,7 @@ patchPluginXml {
changeNotes = """
English Change Notes:
+- 1.24 Add PopupMenu Copy FileName:LineNumber
- 1.23 Add project-view-tree-comment setting for show when compact middle packages
- 1.22 Add PopupMenu Copy ClassName.MethodName
- 1.21 Add line-end-comment default skip only English when system lang is not `en`
@@ -66,6 +67,7 @@ patchPluginXml {
中文更新说明:
+- 1.24 增加 右键菜单 复制 文件名:行号
- 1.23 增加 项目导航栏注释 折叠中间包时显示中间包注释设置
- 1.22 增加 右键菜单 复制 类名.方法名
- 1.21 增加 行末注释 系统语言非英文时 默认 忽略纯英文
diff --git a/src/main/java/io/github/linwancen/plugin/show/CopyReferenceSimple.java b/src/main/java/io/github/linwancen/plugin/show/CopyReferenceSimple.java
index ec86a59..e5a0bfc 100644
--- a/src/main/java/io/github/linwancen/plugin/show/CopyReferenceSimple.java
+++ b/src/main/java/io/github/linwancen/plugin/show/CopyReferenceSimple.java
@@ -3,8 +3,12 @@ package io.github.linwancen.plugin.show;
import com.intellij.ide.IdeBundle;
import com.intellij.ide.actions.CopyReferenceAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -17,7 +21,7 @@ public class CopyReferenceSimple extends CopyReferenceAction {
super.update(e);
String tip = IdeBundle.message("copy.reference");
if (tip != null && tip.replace("\u001B", "").equals(e.getPresentation().getText())) {
- e.getPresentation().setText("Copy ClassName.MethodName");
+ e.getPresentation().setText("Copy Class.Method/File:Line");
}
}
@@ -27,6 +31,16 @@ public class CopyReferenceSimple extends CopyReferenceAction {
protected String getQualifiedName(Editor editor, List elements) {
String qualifiedName = super.getQualifiedName(editor, elements);
if (qualifiedName == null) {
+ Document document = editor.getDocument();
+ Project project = editor.getProject();
+ if (project == null) {
+ return null;
+ }
+ PsiFile file = PsiDocumentManager.getInstance(project).getCachedPsiFile(document);
+ if (file != null) {
+ // getFileFqn(file) => file.getName()
+ return file.getName() + ":" + (editor.getCaretModel().getLogicalPosition().line + 1);
+ }
return null;
}
int i = qualifiedName.indexOf("(");
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 82dcada..4fb7d6e 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -1,15 +1,13 @@
-
+
io.github.linwancen.show-comment
Show Comment
林万程
English Notes:
+Show doc comment at the Project view Tree, line End, json etc.
-- Show javadoc comments at the Project view Tree structure
-
- Show javadoc comments at the end-of-line
-
- Show javadoc comments at "xx-ClassNameOrSimpleName.json" and jump to field
-
- Show comments from External Conf for folder, resources, COBOL etc.
+
- "xx-ClassNameOrSimpleName.json" and jump to field
+
- from External Conf for folder, resources, COBOL etc.
- Config: settings -> Tools -> // Show Comment Global/Project
@@ -38,6 +36,7 @@
外部注释:
示例(Gitee)
+:比如你要给 .go 的文件配置文件注释可以放在相同目录或父目录的 xxx.go.tree.tsv 中
- 重新加载:工具 -> "🔄 // Reload External Comment"
- path/[any][filename.]ext.tree.tsv // 文件(夹)注释 📝 📁
@@ -48,6 +47,10 @@
- 在搜索弹出窗中修改 tsv 文件将不会被重加载
- tsv 配置文件必须能被搜索(Ctrl + Shift + N)
+
+如果对你有所帮助,别忘了给本项目
+GitHub
+主页一个 Start,您的支持是项目前进的动力。
]]>