2.10 not doc comment | 非文档注释
This commit is contained in:
@@ -113,6 +113,7 @@ Show doc comment at the Project view Tree, line End, json, other
|
||||
|
||||
<h2>English Change Notes:</h2>
|
||||
<ul>
|
||||
<li>2.10 Add line-end-comment not doc comment
|
||||
<li>2.09 Add line-end-comment support Python doc strings
|
||||
<li>2.08 Add i18n and chinese
|
||||
<li>2.07 Add global-setting reset default
|
||||
@@ -151,6 +152,7 @@ Show doc comment at the Project view Tree, line End, json, other
|
||||
|
||||
<h2>中文更新说明:</h2>
|
||||
<ul>
|
||||
<li>2.10 增加 行末注释 非文档注释
|
||||
<li>2.09 增加 行末注释 支持 Python 文档字符串
|
||||
<li>2.08 增加 多语言与中文支持
|
||||
<li>2.07 增加 全局设置 复位默认值
|
||||
|
||||
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group 'io.github.linwancen'
|
||||
version '2.09.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
|
||||
version '2.10.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -87,6 +87,7 @@ patchPluginXml {
|
||||
changeNotes = """
|
||||
<h2>English Change Notes:</h2>
|
||||
<ul>
|
||||
<li>2.10 Add line-end-comment not doc comment
|
||||
<li>2.09 Add line-end-comment support Python doc strings
|
||||
<li>2.08 Add i18n and chinese
|
||||
<li>2.07 Add global-setting reset default
|
||||
@@ -125,6 +126,7 @@ patchPluginXml {
|
||||
|
||||
<h2>中文更新说明:</h2>
|
||||
<ul>
|
||||
<li>2.10 增加 行末注释 非文档注释
|
||||
<li>2.09 增加 行末注释 支持 Python 文档字符串
|
||||
<li>2.08 增加 多语言与中文支持
|
||||
<li>2.07 增加 全局设置 复位默认值
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.psi.util.PsiTreeUtil;
|
||||
import io.github.linwancen.plugin.show.bean.LineInfo;
|
||||
import io.github.linwancen.plugin.show.bean.SettingsInfo;
|
||||
import io.github.linwancen.plugin.show.java.doc.OwnerToPsiDocUtils;
|
||||
import io.github.linwancen.plugin.show.java.doc.PsiMethodToPsiDoc;
|
||||
import io.github.linwancen.plugin.show.java.line.OwnerToPsiDocSkip;
|
||||
import io.github.linwancen.plugin.show.lang.base.BaseTagLangDoc;
|
||||
import io.github.linwancen.plugin.show.lang.base.DocFilter;
|
||||
@@ -73,12 +74,24 @@ public class JavaLangDoc extends BaseTagLangDoc<PsiDocComment> {
|
||||
if (resolveDocPrint != null) {
|
||||
return resolveDocPrint;
|
||||
}
|
||||
// no doc comment support get set
|
||||
if (parseBaseComment(settingsInfo) && resolve instanceof PsiMethod) {
|
||||
@Nullable PsiField psiField = PsiMethodToPsiDoc.propMethodField((PsiMethod) resolve);
|
||||
if (psiField != null) {
|
||||
return super.resolveDocPrint(settingsInfo, psiField);
|
||||
}
|
||||
}
|
||||
if (settingsInfo.appSettings.fromParam && resolve instanceof PsiParameter) {
|
||||
return paramDoc((PsiParameter) resolve);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T extends SettingsInfo> boolean parseBaseComment(@NotNull T settingsInfo) {
|
||||
return settingsInfo.appSettings.showLineEndCommentJavaBase;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String paramDoc(@NotNull PsiParameter psiParameter) {
|
||||
@Nullable PsiMethod method = PsiTreeUtil.getParentOfType(psiParameter, PsiMethod.class);
|
||||
|
||||
@@ -33,6 +33,11 @@ public class KotlinLangDoc extends BaseTagLangDoc<KDocSection> {
|
||||
return lineInfo.appSettings.showLineEndCommentKotlin;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T extends SettingsInfo> boolean parseBaseComment(@NotNull T settingsInfo) {
|
||||
return settingsInfo.appSettings.showLineEndCommentKotlinBase;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected <T extends SettingsInfo> KDocSection toDocElement(@NotNull T settingsInfo, @NotNull PsiElement resolve) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class PsiMethodToPsiDoc {
|
||||
public class PsiMethodToPsiDoc {
|
||||
|
||||
private PsiMethodToPsiDoc() {}
|
||||
|
||||
@@ -69,7 +69,16 @@ class PsiMethodToPsiDoc {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PsiDocComment propMethodDoc(@NotNull PsiMethod psiMethod, @NotNull PsiClass psiClass) {
|
||||
public static PsiField propMethodField(@NotNull PsiMethod psiMethod) {
|
||||
@Nullable PsiClass clazz = psiMethod.getContainingClass();
|
||||
if (clazz == null) {
|
||||
return null;
|
||||
}
|
||||
return propMethodClassField(psiMethod, clazz);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static PsiField propMethodClassField(@NotNull PsiMethod psiMethod, @NotNull PsiClass psiClass) {
|
||||
@NotNull String name = psiMethod.getName();
|
||||
if (name.length() > 3 && (name.startsWith("get") || name.startsWith("set"))) {
|
||||
name = name.substring(3);
|
||||
@@ -82,7 +91,12 @@ class PsiMethodToPsiDoc {
|
||||
// Lower Case
|
||||
chars[0] += 32;
|
||||
name = String.valueOf(chars);
|
||||
@Nullable PsiField fieldByName = psiClass.findFieldByName(name, false);
|
||||
return psiClass.findFieldByName(name, false);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PsiDocComment propMethodDoc(@NotNull PsiMethod psiMethod, @NotNull PsiClass psiClass) {
|
||||
@Nullable PsiField fieldByName = propMethodClassField(psiMethod, psiClass);
|
||||
if (fieldByName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
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;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class JsLangDoc extends BaseLangDoc {
|
||||
if (text != null) {
|
||||
return text;
|
||||
}
|
||||
if (!lineInfo.appSettings.jsDoc) {
|
||||
if (lineInfo.appSettings.showLineEndCommentJsBase) {
|
||||
return super.resolveDocRaw(lineInfo, resolve);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -31,6 +31,11 @@ public class PythonLangDoc extends BaseTagLangDoc<StructuredDocString> {
|
||||
return lineInfo.appSettings.showLineEndCommentPy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T extends SettingsInfo> boolean parseBaseComment(@NotNull T settingsInfo) {
|
||||
return settingsInfo.appSettings.showLineEndCommentPyBase;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected <T extends SettingsInfo> StructuredDocString toDocElement(@NotNull T settingsInfo,
|
||||
|
||||
@@ -69,12 +69,14 @@ public abstract class BaseLangDoc extends EditorLinePainter {
|
||||
return null;
|
||||
}
|
||||
@Nullable String doc = null;
|
||||
@Nullable String text = null;
|
||||
@Nullable PsiElement refElement = element;
|
||||
while ((refElement = Prev.prevRefChild(lineInfo, refElement, refClass)) != null) {
|
||||
PsiElement parent = refElement.getParent();
|
||||
@Nullable String filterDoc = refElementDoc(lineInfo, parent);
|
||||
if (filterDoc != null) {
|
||||
doc = filterDoc;
|
||||
text = refElement.getText();
|
||||
refElement = parent;
|
||||
break;
|
||||
}
|
||||
@@ -87,24 +89,29 @@ public abstract class BaseLangDoc extends EditorLinePainter {
|
||||
if (refElement == null) {
|
||||
return doc;
|
||||
}
|
||||
String text = refElement.getText();
|
||||
boolean set = text.startsWith("set");
|
||||
PsiElement parent = refElement.getParent();
|
||||
@Nullable String before = refElementDoc(lineInfo, parent);
|
||||
if (before != null) {
|
||||
doc = mergeDoc(set, lineInfo.appSettings.getToSet, before, doc);
|
||||
doc = mergeDoc(refElement.getText(), text, lineInfo.appSettings.getToSet, before, doc);
|
||||
}
|
||||
return doc;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String mergeDoc(boolean set, boolean getToSet, String before, String doc) {
|
||||
if (set) {
|
||||
private String mergeDoc(@NotNull String beforeText, @NotNull String text, boolean getToSet, String before, String doc) {
|
||||
if (beforeText.startsWith("set")) {
|
||||
beforeText = beforeText.substring(3);
|
||||
if (text.startsWith("get")) {
|
||||
text = text.substring(3);
|
||||
} else if (text.startsWith("is")) {
|
||||
text = text.substring(2);
|
||||
}
|
||||
boolean same = beforeText.equals(text);
|
||||
if (getToSet) {
|
||||
// because lambda is -> or =>
|
||||
doc = doc + " --> " + before;
|
||||
doc = doc + (same ? " ==> " : " --> ") + before;
|
||||
} else {
|
||||
doc = before + " = " + doc;
|
||||
doc = before + (same ? " <== " : " <-- ") + doc;
|
||||
}
|
||||
} else {
|
||||
doc = before + " | " + doc;
|
||||
|
||||
@@ -11,8 +11,8 @@ public abstract class BaseTagLangDoc<DocElement> extends BaseLangDoc {
|
||||
public @Nullable <T extends SettingsInfo> String resolveDocPrint(@NotNull T settingsInfo,
|
||||
@NotNull PsiElement resolve) {
|
||||
@Nullable DocElement docElement = toDocElement(settingsInfo, resolve);
|
||||
if (docElement == null) {
|
||||
return null;
|
||||
if (docElement == null && parseBaseComment(settingsInfo)) {
|
||||
return super.resolveDocPrint(settingsInfo, resolve);
|
||||
}
|
||||
return docElementToStr(settingsInfo, docElement);
|
||||
}
|
||||
@@ -44,6 +44,8 @@ public abstract class BaseTagLangDoc<DocElement> extends BaseLangDoc {
|
||||
return text;
|
||||
}
|
||||
|
||||
protected abstract <T extends SettingsInfo> boolean parseBaseComment(T settingsInfo);
|
||||
|
||||
@Nullable
|
||||
protected abstract <T extends SettingsInfo> DocElement toDocElement(@NotNull T settingsInfo,
|
||||
@NotNull PsiElement resolve);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class Prev {
|
||||
@Nullable
|
||||
public static PsiElement prevRefChild(@NotNull LineInfo lineInfo, @NotNull PsiElement element,
|
||||
@NotNull Class<? extends PsiElement> refClass) {
|
||||
PsiElement prevParent = element.getParent();
|
||||
PsiElement prevParent = refClassParent(element, refClass);
|
||||
while ((element = PsiTreeUtil.prevVisibleLeaf(element)) != null) {
|
||||
if (element.getTextRange().getEndOffset() < lineInfo.startOffset) {
|
||||
return null;
|
||||
@@ -26,7 +26,8 @@ public class Prev {
|
||||
@Nullable PsiElement parent = refClassParent(element, refClass);
|
||||
if (parent != null) {
|
||||
// skip b in a.b.c
|
||||
if (prevParent.getTextRange().getEndOffset() < lineInfo.endOffset
|
||||
if (prevParent != null
|
||||
&& prevParent.getTextRange().getEndOffset() < lineInfo.endOffset
|
||||
&& PsiTreeUtil.findChildOfType(prevParent, refClass) == parent) {
|
||||
prevParent = parent;
|
||||
} else {
|
||||
|
||||
@@ -58,7 +58,10 @@ public class ResolveDoc {
|
||||
if (document == null) {
|
||||
return null;
|
||||
}
|
||||
@Nullable PsiElement psiElement = Prev.prevCompactElement(lineInfo, resolve, document);
|
||||
@Nullable PsiElement psiElement = PsiTreeUtil.getChildOfType(resolve, PsiComment.class);
|
||||
if (psiElement == null) {
|
||||
psiElement = Prev.prevCompactElement(lineInfo, resolve, document);
|
||||
}
|
||||
if (!keywords.isEmpty()) {
|
||||
while (psiElement != null) {
|
||||
String text = psiElement.getText();
|
||||
|
||||
@@ -9,7 +9,7 @@ public abstract class AbstractSettingsState {
|
||||
@NotNull
|
||||
public transient Pattern lineInclude = Pattern.compile("");
|
||||
@NotNull
|
||||
public transient Pattern lineExclude = Pattern.compile("^java");
|
||||
public transient Pattern lineExclude = Pattern.compile("^(java)\\.");
|
||||
@NotNull
|
||||
public transient Pattern docInclude = Pattern.compile("");
|
||||
@NotNull
|
||||
|
||||
@@ -20,13 +20,17 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
private final JBTextField treeTags = new JBTextField();
|
||||
private final JBCheckBox showLineEndComment = new JBCheckBox(ShowBundle.message("show.line.end.comment"));
|
||||
private final JBCheckBox showLineEndCommentJava = new JBCheckBox("Java ");
|
||||
private final JBCheckBox showLineEndCommentJavaBase = new JBCheckBox("// Java ");
|
||||
private final JBCheckBox showLineEndCommentKotlin = new JBCheckBox("Kotlin ");
|
||||
private final JBCheckBox showLineEndCommentKotlinBase = new JBCheckBox("// Kotlin ");
|
||||
private final JBCheckBox showLineEndCommentJs = new JBCheckBox("js ");
|
||||
private final JBCheckBox showLineEndCommentJsBase = new JBCheckBox("// js ");
|
||||
private final JBCheckBox showLineEndCommentPy = new JBCheckBox("Python ");
|
||||
private final JBCheckBox showLineEndCommentPyBase = new JBCheckBox("# Python ");
|
||||
private final JBCheckBox showLineEndCommentGo = new JBCheckBox("Go ");
|
||||
private final JBCheckBox showLineEndCommentGoBase = new JBCheckBox("// Go ");
|
||||
private final JBCheckBox showLineEndCommentSql = new JBCheckBox("sql ");
|
||||
private final JBCheckBox showLineEndCommentJson = new JBCheckBox("json ");
|
||||
private final JBCheckBox showLineEndCommentJs = new JBCheckBox("js ");
|
||||
private final JBCheckBox jsdoc = new JBCheckBox("jsdoc ");
|
||||
private final JBCheckBox showLineEndCommentPy = new JBCheckBox("Python ");
|
||||
private final JBCheckBox showLineEndCommentGo = new JBCheckBox("Go ");
|
||||
private final JBCheckBox showLineEndCommentKotlin = new JBCheckBox("Kotlin ");
|
||||
private final JBTextField lineTags = new JBTextField();
|
||||
private final JBCheckBox getToSet = new JBCheckBox("get --> set ");
|
||||
private final JBCheckBox fromNew = new JBCheckBox("java new ");
|
||||
@@ -40,7 +44,7 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
private final JBTextField lineEndCount = new JBTextField();
|
||||
|
||||
public AppSettingsComponent() {
|
||||
JButton resetDefault = new JButton(ShowBundle.message("reset.default"));
|
||||
@NotNull JButton resetDefault = new JButton(ShowBundle.message("reset.default"));
|
||||
resetDefault.addActionListener(e -> AppSettingsConfigurable.reset(AppSettingsState.DEFAULT_SETTING, this));
|
||||
myMainPanel = FormBuilder.createFormBuilder()
|
||||
.addComponent(resetDefault, 1)
|
||||
@@ -56,13 +60,18 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
.addComponent(JPanelFactory.of(showTreeComment, compact), 1)
|
||||
.addComponent(JPanelFactory.of(showLineEndComment,
|
||||
showLineEndCommentJava,
|
||||
showLineEndCommentKotlin,
|
||||
showLineEndCommentJs,
|
||||
showLineEndCommentPy,
|
||||
showLineEndCommentGo
|
||||
), 1)
|
||||
.addComponent(JPanelFactory.of(
|
||||
showLineEndCommentSql,
|
||||
showLineEndCommentJson,
|
||||
showLineEndCommentJs,
|
||||
jsdoc,
|
||||
showLineEndCommentPy,
|
||||
showLineEndCommentGo,
|
||||
showLineEndCommentKotlin
|
||||
showLineEndCommentJavaBase,
|
||||
showLineEndCommentKotlinBase,
|
||||
showLineEndCommentJsBase,
|
||||
showLineEndCommentPyBase
|
||||
), 1)
|
||||
.addLabeledComponent(new JBLabel(ShowBundle.message("tree.tags")), treeTags, 1, true)
|
||||
.addLabeledComponent(new JBLabel(ShowBundle.message("line.tags")), lineTags, 1, true)
|
||||
@@ -122,6 +131,7 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
treeTags.setText(newText);
|
||||
}
|
||||
|
||||
// region line end
|
||||
public boolean getShowLineEndComment() {
|
||||
return showLineEndComment.isSelected();
|
||||
}
|
||||
@@ -138,20 +148,12 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
showLineEndCommentJava.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentSql() {
|
||||
return showLineEndCommentSql.isSelected();
|
||||
public boolean getShowLineEndCommentKotlin() {
|
||||
return showLineEndCommentKotlin.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentSql(boolean newStatus) {
|
||||
showLineEndCommentSql.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentJson() {
|
||||
return showLineEndCommentJson.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentJson(boolean newStatus) {
|
||||
showLineEndCommentJson.setSelected(newStatus);
|
||||
public void setShowLineEndCommentKotlin(boolean newStatus) {
|
||||
showLineEndCommentKotlin.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentJs() {
|
||||
@@ -162,14 +164,6 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
showLineEndCommentJs.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getJsdoc() {
|
||||
return jsdoc.isSelected();
|
||||
}
|
||||
|
||||
public void setJsdoc(boolean newStatus) {
|
||||
jsdoc.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentPy() {
|
||||
return showLineEndCommentPy.isSelected();
|
||||
}
|
||||
@@ -186,14 +180,64 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
|
||||
showLineEndCommentGo.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentKotlin() {
|
||||
return showLineEndCommentKotlin.isSelected();
|
||||
public boolean getShowLineEndCommentJavaBase() {
|
||||
return showLineEndCommentJavaBase.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentKotlin(boolean newStatus) {
|
||||
showLineEndCommentKotlin.setSelected(newStatus);
|
||||
public void setShowLineEndCommentJavaBase(boolean newStatus) {
|
||||
showLineEndCommentJavaBase.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentKotlinBase() {
|
||||
return showLineEndCommentKotlinBase.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentKotlinBase(boolean newStatus) {
|
||||
showLineEndCommentKotlinBase.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentJsBase() {
|
||||
return showLineEndCommentJsBase.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentJsBase(boolean newStatus) {
|
||||
showLineEndCommentJsBase.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentPyBase() {
|
||||
return showLineEndCommentPyBase.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentPyBase(boolean newStatus) {
|
||||
showLineEndCommentPyBase.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentGoBase() {
|
||||
return showLineEndCommentGoBase.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentGoBase(boolean newStatus) {
|
||||
showLineEndCommentGoBase.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentSql() {
|
||||
return showLineEndCommentSql.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentSql(boolean newStatus) {
|
||||
showLineEndCommentSql.setSelected(newStatus);
|
||||
}
|
||||
|
||||
public boolean getShowLineEndCommentJson() {
|
||||
return showLineEndCommentJson.isSelected();
|
||||
}
|
||||
|
||||
public void setShowLineEndCommentJson(boolean newStatus) {
|
||||
showLineEndCommentJson.setSelected(newStatus);
|
||||
}
|
||||
|
||||
// endregion line end
|
||||
|
||||
@NotNull
|
||||
public String getLineTags() {
|
||||
return lineTags.getText();
|
||||
|
||||
@@ -40,13 +40,17 @@ public class AppSettingsConfigurable implements Configurable {
|
||||
|
||||
modified |= mySettingsComponent.getShowLineEndComment() != settings.showLineEndComment;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJava() != settings.showLineEndCommentJava;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentSql() != settings.showLineEndCommentSql;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJson() != settings.showLineEndCommentJson;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentKotlin() != settings.showLineEndCommentKotlin;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJs() != settings.showLineEndCommentJs;
|
||||
modified |= mySettingsComponent.getJsdoc() != settings.jsDoc;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentPy() != settings.showLineEndCommentPy;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentGo() != settings.showLineEndCommentGo;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentKotlin() != settings.showLineEndCommentKotlin;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJavaBase() != settings.showLineEndCommentJavaBase;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentKotlinBase() != settings.showLineEndCommentKotlinBase;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJsBase() != settings.showLineEndCommentJsBase;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentPyBase() != settings.showLineEndCommentPyBase;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentGoBase() != settings.showLineEndCommentGoBase;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentSql() != settings.showLineEndCommentSql;
|
||||
modified |= mySettingsComponent.getShowLineEndCommentJson() != settings.showLineEndCommentJson;
|
||||
|
||||
modified |= !mySettingsComponent.getTreeTags().equals(String.join("|", settings.treeTags));
|
||||
modified |= !mySettingsComponent.getLineTags().equals(String.join("|", settings.lineTags));
|
||||
@@ -76,13 +80,17 @@ public class AppSettingsConfigurable implements Configurable {
|
||||
|
||||
settings.showLineEndComment = mySettingsComponent.getShowLineEndComment();
|
||||
settings.showLineEndCommentJava = mySettingsComponent.getShowLineEndCommentJava();
|
||||
settings.showLineEndCommentSql = mySettingsComponent.getShowLineEndCommentSql();
|
||||
settings.showLineEndCommentJson = mySettingsComponent.getShowLineEndCommentJson();
|
||||
settings.showLineEndCommentKotlin = mySettingsComponent.getShowLineEndCommentKotlin();
|
||||
settings.showLineEndCommentJs = mySettingsComponent.getShowLineEndCommentJs();
|
||||
settings.jsDoc = mySettingsComponent.getJsdoc();
|
||||
settings.showLineEndCommentPy = mySettingsComponent.getShowLineEndCommentPy();
|
||||
settings.showLineEndCommentGo = mySettingsComponent.getShowLineEndCommentGo();
|
||||
settings.showLineEndCommentKotlin = mySettingsComponent.getShowLineEndCommentKotlin();
|
||||
settings.showLineEndCommentJavaBase = mySettingsComponent.getShowLineEndCommentJavaBase();
|
||||
settings.showLineEndCommentKotlinBase = mySettingsComponent.getShowLineEndCommentKotlinBase();
|
||||
settings.showLineEndCommentJsBase = mySettingsComponent.getShowLineEndCommentJsBase();
|
||||
settings.showLineEndCommentPyBase = mySettingsComponent.getShowLineEndCommentPyBase();
|
||||
settings.showLineEndCommentGoBase = mySettingsComponent.getShowLineEndCommentGoBase();
|
||||
settings.showLineEndCommentSql = mySettingsComponent.getShowLineEndCommentSql();
|
||||
settings.showLineEndCommentJson = mySettingsComponent.getShowLineEndCommentJson();
|
||||
|
||||
settings.treeTags = Splitter.on('|').splitToList(mySettingsComponent.getTreeTags()).toArray(new String[0]);
|
||||
settings.lineTags = Splitter.on('|').splitToList(mySettingsComponent.getLineTags()).toArray(new String[0]);
|
||||
@@ -112,19 +120,23 @@ public class AppSettingsConfigurable implements Configurable {
|
||||
reset(settings, mySettingsComponent);
|
||||
}
|
||||
|
||||
static void reset(@NotNull AppSettingsState settings, AppSettingsComponent mySettingsComponent) {
|
||||
static void reset(@NotNull AppSettingsState settings, @NotNull AppSettingsComponent mySettingsComponent) {
|
||||
mySettingsComponent.setShowTreeComment(settings.showTreeComment);
|
||||
mySettingsComponent.setCompact(settings.compact);
|
||||
|
||||
mySettingsComponent.setShowLineEndComment(settings.showLineEndComment);
|
||||
mySettingsComponent.setShowLineEndCommentJava(settings.showLineEndCommentJava);
|
||||
mySettingsComponent.setShowLineEndCommentSql(settings.showLineEndCommentSql);
|
||||
mySettingsComponent.setShowLineEndCommentJson(settings.showLineEndCommentJson);
|
||||
mySettingsComponent.setShowLineEndCommentKotlin(settings.showLineEndCommentKotlin);
|
||||
mySettingsComponent.setShowLineEndCommentJs(settings.showLineEndCommentJs);
|
||||
mySettingsComponent.setJsdoc(settings.jsDoc);
|
||||
mySettingsComponent.setShowLineEndCommentPy(settings.showLineEndCommentPy);
|
||||
mySettingsComponent.setShowLineEndCommentGo(settings.showLineEndCommentGo);
|
||||
mySettingsComponent.setShowLineEndCommentKotlin(settings.showLineEndCommentKotlin);
|
||||
mySettingsComponent.setShowLineEndCommentJavaBase(settings.showLineEndCommentJavaBase);
|
||||
mySettingsComponent.setShowLineEndCommentKotlinBase(settings.showLineEndCommentKotlinBase);
|
||||
mySettingsComponent.setShowLineEndCommentJsBase(settings.showLineEndCommentJsBase);
|
||||
mySettingsComponent.setShowLineEndCommentPyBase(settings.showLineEndCommentPyBase);
|
||||
mySettingsComponent.setShowLineEndCommentGoBase(settings.showLineEndCommentGoBase);
|
||||
mySettingsComponent.setShowLineEndCommentSql(settings.showLineEndCommentSql);
|
||||
mySettingsComponent.setShowLineEndCommentJson(settings.showLineEndCommentJson);
|
||||
|
||||
mySettingsComponent.setTreeTags(String.join("|", settings.treeTags));
|
||||
mySettingsComponent.setLineTags(String.join("|", settings.lineTags));
|
||||
|
||||
@@ -28,13 +28,17 @@ public class AppSettingsState extends AbstractSettingsState implements Persisten
|
||||
|
||||
public boolean showLineEndComment = true;
|
||||
public boolean showLineEndCommentJava = true;
|
||||
public boolean showLineEndCommentJavaBase = false;
|
||||
public boolean showLineEndCommentKotlin = true;
|
||||
public boolean showLineEndCommentKotlinBase = false;
|
||||
public boolean showLineEndCommentJs = true;
|
||||
public boolean showLineEndCommentJsBase = false;
|
||||
public boolean showLineEndCommentPy = true;
|
||||
public boolean showLineEndCommentPyBase = false;
|
||||
public boolean showLineEndCommentGo = true;
|
||||
public boolean showLineEndCommentGoBase = false;
|
||||
public boolean showLineEndCommentSql = true;
|
||||
public boolean showLineEndCommentJson = true;
|
||||
public boolean showLineEndCommentJs = true;
|
||||
public boolean jsDoc = true;
|
||||
public boolean showLineEndCommentPy = true;
|
||||
public boolean showLineEndCommentGo = true;
|
||||
public boolean showLineEndCommentKotlin = true;
|
||||
|
||||
@NotNull
|
||||
public String[] treeTags = {"author"};
|
||||
|
||||
Reference in New Issue
Block a user