From bf98f3e5c900f3adceaf2decd25a685773301941 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com>
Date: Sat, 15 Nov 2025 11:15:27 +0800
Subject: [PATCH] =?UTF-8?q?feat:=202.28=20Alt=20X=20switch=20line=20end=20?=
=?UTF-8?q?comment=20|=20Alt=20+=20X=20=E8=A1=8C=E6=9C=AB=E6=B3=A8?=
=?UTF-8?q?=E9=87=8A=E5=BC=80=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
build.gradle | 4 +++-
.../settings/action/LineEndSwitchAction.java | 20 +++++++++++++++++++
src/main/resources/META-INF/plugin.xml | 20 +++++++++----------
3 files changed, 33 insertions(+), 11 deletions(-)
create mode 100644 src/main/java/io/github/linwancen/plugin/show/settings/action/LineEndSwitchAction.java
diff --git a/build.gradle b/build.gradle
index 2c7126d..5f5dca2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
}
group 'io.github.linwancen'
-version '2.27.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
+version '2.28.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
patchPluginXml {
// The performance of 2019.3 has been greatly improved.
@@ -15,6 +15,7 @@ patchPluginXml {
changeNotes = """
English Change Notes:
+- 2.28 Add app-setting Alt X switch line end comment
- 2.27 Add project-view-tree use 1st or 2nd line to file comment
- 2.26 Add External Comment load *.sql ddl comment
- 2.25 Add project-view-tree use xml/html/vue 1st or 2nd line comment
@@ -71,6 +72,7 @@ patchPluginXml {
中文更新说明:
+- 2.28 增加 全局设置 Alt + X 行末注释开关
- 2.27 增加 文件树注释 用第 1 或第 2 行注释当文件注释
- 2.26 增加 外部注释 读取 *.sql ddl 注释
- 2.25 增加 文件树注释 用 xml/html/vue 第 1 或第 2 行注释当文件注释
diff --git a/src/main/java/io/github/linwancen/plugin/show/settings/action/LineEndSwitchAction.java b/src/main/java/io/github/linwancen/plugin/show/settings/action/LineEndSwitchAction.java
new file mode 100644
index 0000000..d845bee
--- /dev/null
+++ b/src/main/java/io/github/linwancen/plugin/show/settings/action/LineEndSwitchAction.java
@@ -0,0 +1,20 @@
+package io.github.linwancen.plugin.show.settings.action;
+
+import com.intellij.ide.actions.CopyReferenceAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import io.github.linwancen.plugin.show.settings.AppSettingsState;
+import io.github.linwancen.plugin.show.settings.ShowBundle;
+import org.jetbrains.annotations.NotNull;
+
+public class LineEndSwitchAction extends CopyReferenceAction {
+
+ @Override
+ public void update(@NotNull AnActionEvent e) {
+ e.getPresentation().setText(ShowBundle.message("show.line.end.comment"));
+ }
+
+ @Override
+ public void actionPerformed(@NotNull AnActionEvent e) {
+ AppSettingsState.getInstance().showLineEndComment = !AppSettingsState.getInstance().showLineEndComment;
+ }
+}
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 80dd082..147b9ee 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -202,35 +202,35 @@ Show doc comment in the Project view Tree, line End, json, other
+ class="io.github.linwancen.plugin.show.ext.action.ReloadExtDocAction">
+ class="io.github.linwancen.plugin.show.ext.action.ResetExtDocAction">
+ class="io.github.linwancen.plugin.show.LineEndAdd">
+ class="io.github.linwancen.plugin.show.LineEndCopy">
+ class="io.github.linwancen.plugin.show.CopyReferenceSimple">
+
+
+
\ No newline at end of file