feat: 2.28 Alt X switch line end comment | Alt + X 行末注释开关

This commit is contained in:
林万程
2025-11-15 11:15:27 +08:00
parent cb7b979243
commit bf98f3e5c9
3 changed files with 33 additions and 11 deletions

View File

@@ -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 = """
<h2>English Change Notes:</h2>
<ul>
<li>2.28 Add app-setting Alt X switch line end comment
<li>2.27 Add project-view-tree use 1st or 2nd line to file comment
<li>2.26 Add External Comment load *.sql ddl comment
<li>2.25 Add project-view-tree use xml/html/vue 1st or 2nd line comment
@@ -71,6 +72,7 @@ patchPluginXml {
<h2>中文更新说明:</h2>
<ul>
<li>2.28 增加 全局设置 Alt + X 行末注释开关
<li>2.27 增加 文件树注释 用第 1 或第 2 行注释当文件注释
<li>2.26 增加 外部注释 读取 *.sql ddl 注释
<li>2.25 增加 文件树注释 用 xml/html/vue 第 1 或第 2 行注释当文件注释

View File

@@ -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;
}
}

View File

@@ -202,35 +202,35 @@ Show doc comment in the Project view Tree, line End, json, other
<actions>
<action
id="io.github.linwancen.plugin.show.ext.conf.ReLoadExtDocAction"
class="io.github.linwancen.plugin.show.ext.action.ReloadExtDocAction"
text="🔄 // Reload External Comment">
class="io.github.linwancen.plugin.show.ext.action.ReloadExtDocAction">
<add-to-group group-id="ToolsMenu"/>
</action>
<action
id="io.github.linwancen.plugin.show.ext.action.ResetExtDocAction"
class="io.github.linwancen.plugin.show.ext.action.ResetExtDocAction"
text="🆑 // Clear External Comment">
class="io.github.linwancen.plugin.show.ext.action.ResetExtDocAction">
<add-to-group group-id="ToolsMenu"/>
</action>
<action
id="io.github.linwancen.plugin.show.LineEndAdd"
class="io.github.linwancen.plugin.show.LineEndAdd"
text="// Add Line Comment">
class="io.github.linwancen.plugin.show.LineEndAdd">
<add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
</action>
<action
id="io.github.linwancen.plugin.show.LineEndCopy"
class="io.github.linwancen.plugin.show.LineEndCopy"
text="// Copy With Line Comment">
class="io.github.linwancen.plugin.show.LineEndCopy">
<add-to-group group-id="EditorPopupMenu" anchor="after"
relative-to-action="CopyGroup"/>
</action>
<action
id="io.github.linwancen.plugin.show.CopyReferenceSimple"
class="io.github.linwancen.plugin.show.CopyReferenceSimple"
text="Copy Class.Method / File:LineNum">
class="io.github.linwancen.plugin.show.CopyReferenceSimple">
<add-to-group group-id="EditorPopupMenu" anchor="after"
relative-to-action="CopyGroup"/>
</action>
<action
id="io.github.linwancen.plugin.show.settings.action.LineEndSwitchAction"
class="io.github.linwancen.plugin.show.settings.action.LineEndSwitchAction">
<keyboard-shortcut first-keystroke="alt x" keymap="$default"/>
</action>
</actions>
</idea-plugin>