From ebabc72f79ed7c29eb099613a9d15b4bd9d5b5d2 Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Sun, 11 Jun 2023 00:40:50 +0200 Subject: [PATCH 01/18] Fixes AlreadyDisposedException in HighlightProblemListener --- CHANGELOG.md | 3 +++ .../inlineproblems/listeners/HighlightProblemListener.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94cb945..aac7b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ## [Unreleased] +### Fixed +- AlreadyDisposedException in HighlightProblemListener + ## [0.4.3] ### Added diff --git a/src/main/java/org/overengineer/inlineproblems/listeners/HighlightProblemListener.java b/src/main/java/org/overengineer/inlineproblems/listeners/HighlightProblemListener.java index 6e92b60..9ff1e32 100644 --- a/src/main/java/org/overengineer/inlineproblems/listeners/HighlightProblemListener.java +++ b/src/main/java/org/overengineer/inlineproblems/listeners/HighlightProblemListener.java @@ -39,7 +39,7 @@ public void handleAccept(PsiFile file) { if (settingsState.getEnabledListener() != Listener.HIGHLIGHT_PROBLEMS_LISTENER) return; - if (file.getVirtualFile() == null) + if (file.getProject().isDisposed() || file.getVirtualFile() == null) return; FileEditor editor = FileEditorManager.getInstance(file.getProject()).getSelectedEditor(file.getVirtualFile()); From 85e6037af8612884504c4435feb7aacbcbac65e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=A8=81?= Date: Wed, 16 Aug 2023 10:46:22 +0800 Subject: [PATCH 02/18] =?UTF-8?q?Update=20settings=20UI=20with=20i18n=20su?= =?UTF-8?q?pport=EF=BC=8CThe=20settings=20UI=20supports=20Chinese.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit refactors hardcoded strings in SettingsComponent.java into resource bundles. The strings are now extracted into two properties files, SettingsBundle_en.properties and SettingsBundle_zh_CN.properties. This is intended to provide support for internationalization (i18n) and improve code maintainability. Also, a new class, SettingsBundle.java is created to manage these resource bundles dynamically using the path 'messages.SettingsBundle', which has been added to the plugin.xml file. This refactor creates a reusable and extensible mechanism for localizing the settings UI in the future. --- .../bundles/SettingsBundle.java | 35 ++++++ .../settings/SettingsComponent.java | 105 +++++++++--------- src/main/resources/META-INF/plugin.xml | 2 + .../messages/SettingsBundle_en.properties | 48 ++++++++ .../messages/SettingsBundle_zh_CN.properties | 48 ++++++++ 5 files changed, 186 insertions(+), 52 deletions(-) create mode 100644 src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java create mode 100644 src/main/resources/messages/SettingsBundle_en.properties create mode 100644 src/main/resources/messages/SettingsBundle_zh_CN.properties diff --git a/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java b/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java new file mode 100644 index 0000000..b2eecf0 --- /dev/null +++ b/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java @@ -0,0 +1,35 @@ +package org.overengineer.inlineproblems.bundles; + +import com.intellij.DynamicBundle; +import org.jetbrains.annotations.Nls; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.PropertyKey; + +import java.util.function.Supplier; + +/** + * The SettingsBundle class is a dynamic bundle for managing internationalized messages for the AiCodeBot project. + * It extends the DynamicBundle class. + * + * @author zhengwei + */ +public final class SettingsBundle extends DynamicBundle { + @NonNls + public static final String BUNDLE = "messages.SettingsBundle"; + private static final SettingsBundle INSTANCE = new SettingsBundle(); + + private SettingsBundle() { + super(BUNDLE); + } + + @NotNull + public static @Nls String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) { + return INSTANCE.getMessage(key, params); + } + + @NotNull + public static Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) { + return INSTANCE.getLazyMessage(key, params); + } +} \ No newline at end of file diff --git a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java index 894cf3d..088aa89 100644 --- a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java +++ b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java @@ -8,6 +8,7 @@ import com.intellij.util.ui.FormBuilder; import lombok.Getter; import org.overengineer.inlineproblems.DocumentMarkupModelScanner; +import org.overengineer.inlineproblems.bundles.SettingsBundle; import org.overengineer.inlineproblems.listeners.HighlightProblemListener; import org.overengineer.inlineproblems.listeners.MarkupModelProblemListener; @@ -22,14 +23,14 @@ public class SettingsComponent { - private final JBCheckBox showErrors = new JBCheckBox("Show errors"); - private final JBCheckBox highlightErrors = new JBCheckBox("Highlight errors"); - private final JBCheckBox showWarnings = new JBCheckBox("Show warnings"); - private final JBCheckBox highlightWarnings = new JBCheckBox("Highlight warnings"); - private final JBCheckBox showWeakWarnings = new JBCheckBox("Show weak warnings"); - private final JBCheckBox highlightWeakWarnings = new JBCheckBox("Highlight weak warnings"); - private final JBCheckBox showInfos = new JBCheckBox("Show infos"); - private final JBCheckBox highlightInfo = new JBCheckBox("Highlight infos"); + private final JBCheckBox showErrors = new JBCheckBox(SettingsBundle.message("settings.showErrors")); + private final JBCheckBox highlightErrors = new JBCheckBox(SettingsBundle.message("settings.highlightErrors")); + private final JBCheckBox showWarnings = new JBCheckBox(SettingsBundle.message("settings.showWarnings")); + private final JBCheckBox highlightWarnings = new JBCheckBox(SettingsBundle.message("settings.highlightWarnings")); + private final JBCheckBox showWeakWarnings = new JBCheckBox(SettingsBundle.message("settings.showWeakWarnings")); + private final JBCheckBox highlightWeakWarnings = new JBCheckBox(SettingsBundle.message("settings.highlightWeakWarnings")); + private final JBCheckBox showInfos = new JBCheckBox(SettingsBundle.message("settings.showInfos")); + private final JBCheckBox highlightInfo = new JBCheckBox(SettingsBundle.message("settings.highlightInfos")); private final ColorPanel errorTextColor = new ColorPanel(); private final ColorPanel errorLabelBackgroundColor = new ColorPanel(); private final ColorPanel errorHighlightColor = new ColorPanel(); @@ -42,18 +43,18 @@ public class SettingsComponent { private final ColorPanel infoTextColor = new ColorPanel(); private final ColorPanel infoLabelBackgroundColor = new ColorPanel(); private final ColorPanel infoHighlightColor = new ColorPanel(); - private final JBCheckBox forceErrorsInSameLine = new JBCheckBox("Force problems in the same line even if they are to long to fit"); - private final JBCheckBox drawBoxesAroundProblemLabels = new JBCheckBox("Draw boxes around problem labels"); - private final JBCheckBox roundedCornerBoxes = new JBCheckBox("Rounded corners"); - private final JBCheckBox useEditorFont = new JBCheckBox("Use editor font instead of tooltip font"); + private final JBCheckBox forceErrorsInSameLine = new JBCheckBox(SettingsBundle.message("settings.forceProblemsIn")); + private final JBCheckBox drawBoxesAroundProblemLabels = new JBCheckBox(SettingsBundle.message("settings.drawBoxesAroundProblemLabels")); + private final JBCheckBox roundedCornerBoxes = new JBCheckBox(SettingsBundle.message("settings.roundedCornerBoxes")); + private final JBCheckBox useEditorFont = new JBCheckBox(SettingsBundle.message("settings.useEditorFont")); - private final JBCheckBox showOnlyHighestSeverityPerLine = new JBCheckBox("Show only the problem with the highest severity per line"); + private final JBCheckBox showOnlyHighestSeverityPerLine = new JBCheckBox(SettingsBundle.message("settings.showOnlyTheProblem")); private final JFormattedTextField inlayFontSizeDeltaText; private final JFormattedTextField manualScannerDelay; - private final JBCheckBox fillProblemLabels = new JBCheckBox("Fill problem label background"); - private final JBCheckBox boldProblemLabels = new JBCheckBox("Bold problem labels"); - private final JBCheckBox italicProblemLabels = new JBCheckBox("Italic problem labels"); - private final JBTextField problemFilterList = new JBTextField("Problem text beginning filter"); + private final JBCheckBox fillProblemLabels = new JBCheckBox(SettingsBundle.message("settings.fillProblemLabels")); + private final JBCheckBox boldProblemLabels = new JBCheckBox(SettingsBundle.message("settings.boldProblemLabels")); + private final JBCheckBox italicProblemLabels = new JBCheckBox(SettingsBundle.message("settings.italicProblemLabels")); + private final JBTextField problemFilterList = new JBTextField(SettingsBundle.message("settings.problemFilterList")); private final String[] availableListeners = {HighlightProblemListener.NAME, MarkupModelProblemListener.NAME, DocumentMarkupModelScanner.NAME}; private final JComboBox enabledListener = new ComboBox<>(availableListeners); @@ -127,61 +128,61 @@ public SettingsComponent() { enabledListener.setPreferredSize(enabledListenerDimension); settingsPanel = FormBuilder.createFormBuilder() - .addComponent(new JBLabel("Box / Label")) + .addComponent(new JBLabel(SettingsBundle.message("settings.boxOrLabel"))) .addComponent(drawBoxesAroundProblemLabels, 0) .addComponent(roundedCornerBoxes, 0) .addComponent(fillProblemLabels, 0) .addComponent(boldProblemLabels, 0) .addComponent(italicProblemLabels, 0) .addSeparator() - .addComponent(new JBLabel("General")) - .addLabeledComponent(new JBLabel("Enabled problem listener"), enabledListener) - .addTooltip("- MarkupModelListener (default): Called after addition of a RangeHighlighter to a file. Faster on large files, slower on small ones") - .addTooltip("- HighlightProblemListener: Faster on small to medium sized files, slower on large ones. Called very often and can cause slowdowns.") - .addTooltip("- ManualScanner: Scans the DocumentMarkupModel for all highlighters at a fixed delay, uses the same logic ") - .addTooltip(" as HighlightProblemListener but can help with slowdowns on big files.") - .addLabeledComponent(new JBLabel("ManualScanner delay in milliseconds"), manualScannerDelay) - .addTooltip("Delay between manual scans, only used when ManualScanner is enabled") + .addComponent(new JBLabel(SettingsBundle.message("settings.general"))) + .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.enabledProblemListener")), enabledListener) + .addTooltip(SettingsBundle.message("settings.markupModelListenerDescription")) + .addTooltip(SettingsBundle.message("settings.highlightProblemListenerDescription")) + .addTooltip(SettingsBundle.message("settings.manualScannerDescription")) + .addTooltip(SettingsBundle.message("settings.manualScannerDescriptionSupplement")) + .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.manualScannerDelayLabel")), manualScannerDelay) + .addTooltip(SettingsBundle.message("settings.delayBetweenToolTip")) .addComponent(forceErrorsInSameLine, 0) .addComponent(useEditorFont, 0) .addComponent(showOnlyHighestSeverityPerLine, 0) - .addLabeledComponent(new JBLabel("Inlay size delta"), inlayFontSizeDeltaText) - .addTooltip("Used to have smaller font size for the inlays, should be smaller than editor font size") - .addLabeledComponent(new JLabel("Problem filter list"), problemFilterList) - .addTooltip("Semicolon separated list of problem text beginnings that will not be handled") + .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.inlaySizeDelta")), inlayFontSizeDeltaText) + .addTooltip(SettingsBundle.message("settings.usedToHaveToolTip")) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.problemFilterListLabel")), problemFilterList) + .addTooltip(SettingsBundle.message("settings.semicolonSeparatedToolTip")) .addSeparator() - .addComponent(new JBLabel("Colors")) + .addComponent(new JBLabel(SettingsBundle.message("settings.colors"))) .addComponent(showErrors) .addComponent(highlightErrors) - .addLabeledComponent(new JLabel("Error text color:"), errorTextColor) - .addLabeledComponent(new JLabel("Error label border color:"), errorLabelBackgroundColor) - .addLabeledComponent(new JLabel("Error line highlight color:"), errorHighlightColor) - .addLabeledComponent(new JLabel("Additional severities:"), additionalErrorSeverities) - .addTooltip("Semicolon separated list of additional error severities e.g. '10, 100'") + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.errorTextColor")), errorTextColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.errorLabelBorderColor")), errorLabelBackgroundColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.errorLineHighlightColor")), errorHighlightColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalErrorSeverities) + .addTooltip(SettingsBundle.message("settings.semicolonError")) .addSeparator() .addComponent(showWarnings) .addComponent(highlightWarnings) - .addLabeledComponent(new JLabel("Warning text color:"), warningTextColor) - .addLabeledComponent(new JLabel("Warning label border color:"), warningLabelBackgroundColor) - .addLabeledComponent(new JLabel("Warning line highlight color:"), warningHighlightColor) - .addLabeledComponent(new JLabel("Additional severities:"), additionalWarningSeverities) - .addTooltip("Semicolon separated list of additional warning severities e.g. '10, 100'") + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.warningTextColor")), warningTextColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.warningLabelBorderColor")), warningLabelBackgroundColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.warningLineHighlightColor")), warningHighlightColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalWarningSeverities) + .addTooltip(SettingsBundle.message("settings.semicolonWarning")) .addSeparator() .addComponent(showWeakWarnings) .addComponent(highlightWeakWarnings) - .addLabeledComponent(new JLabel("Weak warning text color:"), weakWarningTextColor) - .addLabeledComponent(new JLabel("Weak warning label border color:"), weakWarningLabelBackgroundColor) - .addLabeledComponent(new JLabel("Weak warning line highlight color:"), weakWarningHighlightColor) - .addLabeledComponent(new JLabel("Additional severities:"), additionalWeakWarningSeverities) - .addTooltip("Semicolon separated list of additional weak-warning severities e.g. '10, 100'") + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.weakWarningTextColor")), weakWarningTextColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.weakWarningLabelBorderColor")), weakWarningLabelBackgroundColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.weakWarningLineHighlightColor")), weakWarningHighlightColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalWeakWarningSeverities) + .addTooltip(SettingsBundle.message("settings.semicolonWeakWarning")) .addSeparator() .addComponent(showInfos) .addComponent(highlightInfo) - .addLabeledComponent(new JLabel("Info text color:"), infoTextColor) - .addLabeledComponent(new JLabel("Info label border color:"), infoLabelBackgroundColor) - .addLabeledComponent(new JLabel("Info line highlight color:"), infoHighlightColor) - .addLabeledComponent(new JLabel("Additional severities:"), additionalInfoSeverities) - .addTooltip("Semicolon separated list of additional info severities e.g. '10, 100'") + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.infoTextColor")), infoTextColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.infoLabelBorderColor")), infoLabelBackgroundColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.infoLineHighlightColor")), infoHighlightColor) + .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalInfoSeverities) + .addTooltip(SettingsBundle.message("settings.semicolon")) .addComponentFillVertically(new JPanel(), 0) .getPanel(); } @@ -524,4 +525,4 @@ public int getManualScannerDelay() { public void setManualScannerDelay(int delay) { manualScannerDelay.setText(Integer.toString(Math.max(10, delay))); } -} +} \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 0e4aa04..d7c6fc3 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -14,6 +14,8 @@ Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html --> com.intellij.modules.platform + messages.SettingsBundle + diff --git a/src/main/resources/messages/SettingsBundle_en.properties b/src/main/resources/messages/SettingsBundle_en.properties new file mode 100644 index 0000000..8c7f531 --- /dev/null +++ b/src/main/resources/messages/SettingsBundle_en.properties @@ -0,0 +1,48 @@ +settings.showErrors=Show errors +settings.highlightErrors=Highlight errors +settings.showWarnings=Show warnings +settings.highlightWarnings=Highlight warnings +settings.showWeakWarnings=Show weak warnings +settings.highlightWeakWarnings=Highlight weak warnings +settings.showInfos=Show infos +settings.highlightInfos=Highlight infos +settings.boxOrLabel=Box / Label +settings.drawBoxesAroundProblemLabels=Draw boxes around problem labels +settings.roundedCornerBoxes=Rounded corners +settings.fillProblemLabels=Fill problem label background +settings.boldProblemLabels=Bold problem labels +settings.italicProblemLabels=Italic problem labels +settings.problemFilterList=Problem text beginning filter +settings.general=General +settings.enabledProblemListener=Enabled problem listener +settings.markupModelListenerDescription=- MarkupModelListener (default): Called after addition of a RangeHighlighter to a file. Faster on large files, slower on small ones. +settings.highlightProblemListenerDescription=- HighlightProblemListener: Faster on small to medium sized files, slower on large ones. Called very often and can cause slowdowns. +settings.manualScannerDescription=- ManualScanner: Scans the DocumentMarkupModel for all highlighters at a fixed delay, uses the same logic. +settings.manualScannerDescriptionSupplement= as HighlightProblemListener but can help with slowdowns on big files. +settings.manualScannerDelayLabel=ManualScanner delay in milliseconds +settings.delayBetweenToolTip=Delay between manual scans, only used when ManualScanner is enabled +settings.inlaySizeDelta=Inlay size delta +settings.usedToHaveToolTip=Used to have smaller font size for the inlays, should be smaller than editor font size +settings.problemFilterListLabel=Problem filter list +settings.semicolonSeparatedToolTip=Semicolon separated list of problem text beginnings that will not be handled +settings.colors=Colors +settings.errorTextColor=Error text color: +settings.errorLabelBorderColor=Error label border color: +settings.errorLineHighlightColor=Error line highlight color: +settings.additionalSeverities=Additional severities: +settings.semicolonError=Semicolon separated list of additional error severities e.g. '10, 100' +settings.warningTextColor=Warning text color: +settings.warningLabelBorderColor=Warning label border color: +settings.warningLineHighlightColor=Warning line highlight color: +settings.semicolonWarning=Semicolon separated list of additional warning severities e.g. '10, 100' +settings.weakWarningTextColor=Weak warning text color: +settings.weakWarningLabelBorderColor=Weak warning label border color: +settings.weakWarningLineHighlightColor=Weak warning line highlight color: +settings.semicolonWeakWarning=Semicolon separated list of additional weak-warning severities e.g. '10, 100' +settings.infoTextColor=Info text color: +settings.infoLabelBorderColor=Info label border color: +settings.infoLineHighlightColor=Info line highlight color: +settings.semicolon=Semicolon separated list of additional info severities e.g. '10, 100' +settings.forceProblemsIn=Force problems in the same line even if they are to long to fit +settings.useEditorFont=Use editor font instead of tooltip font +settings.showOnlyTheProblem=Show only the problem with the highest severity per line \ No newline at end of file diff --git a/src/main/resources/messages/SettingsBundle_zh_CN.properties b/src/main/resources/messages/SettingsBundle_zh_CN.properties new file mode 100644 index 0000000..7783ee3 --- /dev/null +++ b/src/main/resources/messages/SettingsBundle_zh_CN.properties @@ -0,0 +1,48 @@ +settings.showErrors=\u663E\u793A\u9519\u8BEF +settings.highlightErrors=\u7A81\u51FA\u663E\u793A\u9519\u8BEF +settings.showWarnings=\u663E\u793A\u8B66\u544A +settings.highlightWarnings=\u7A81\u51FA\u663E\u793A\u8B66\u544A +settings.showWeakWarnings=\u663E\u793A\u8F7B\u5F31\u8B66\u544A +settings.highlightWeakWarnings=\u7A81\u51FA\u663E\u793A\u8F7B\u5F31\u8B66\u544A +settings.showInfos=\u663E\u793A\u4FE1\u606F +settings.highlightInfos=\u7A81\u51FA\u663E\u793A\u4FE1\u606F +settings.boxOrLabel=\u65B9\u6846 / \u6807\u7B7E +settings.drawBoxesAroundProblemLabels=\u5728\u95EE\u9898\u6807\u7B7E\u5468\u56F4\u7ED8\u5236\u65B9\u6846 +settings.roundedCornerBoxes=\u5706\u89D2\u65B9\u6846 +settings.fillProblemLabels=\u586B\u5145\u95EE\u9898\u6807\u7B7E\u80CC\u666F +settings.boldProblemLabels=\u9AD8\u7EA2\u95EE\u9898\u6807\u7B7E +settings.italicProblemLabels=\u659C\u4F53\u95EE\u9898\u6807\u7B7E +settings.problemFilterList=\u95EE\u9898\u6587\u672C\u5F00\u59CB\u8FC7\u6EE4\u5668 +settings.general=\u901A\u7528 +settings.enabledProblemListener=\u542F\u7528\u7684\u95EE\u9898\u76D1\u542C\u5668 +settings.markupModelListenerDescription=- MarkupModelListener\uFF08\u9ED8\u8BA4\uFF09\uFF1A\u5728\u6587\u4EF6\u6DFB\u52A0 RangeHighlighter \u540E\u8C03\u7528\u3002\u5927\u6587\u4EF6\u4E2D\u66F4\u5FEB\uFF0C\u5C0F\u6587\u4EF6\u4E2D\u66F4\u6162\u3002 +settings.highlightProblemListenerDescription=- HighlightProblemListener\uFF1A\u5C0F\u5230\u4E2D\u7B49\u5927\u5C0F\u7684\u6587\u4EF6\u66F4\u5FEB\uFF0C\u5927\u6587\u4EF6\u66F4\u6162\u3002\u8C03\u7528\u975E\u5E38\u9891\u7E41\uFF0C\u53EF\u80FD\u5BFC\u81F4\u901F\u5EA6\u653E\u6162\u3002 +settings.manualScannerDescription=- ManualScanner\uFF1A\u4EE5\u56FA\u5B9A\u7684\u5EF6\u8FDF\u626B\u63CF DocumentMarkupModel \u4E2D\u7684\u6240\u6709\u9AD8\u4EAE\u6807\u8BB0\uFF0C\u4F7F\u7528\u76F8\u540C\u7684\u903B\u8F91\u3002 +settings.manualScannerDescriptionSupplement= \u540C HighlightProblemListener\uFF0C\u4F46\u53EF\u4EE5\u5E2E\u52A9\u5904\u7406\u5927\u6587\u4EF6\u4E2D\u7684\u653E\u6162\u901F\u5EA6\u3002 +settings.manualScannerDelayLabel=ManualScanner \u4EE5\u6BEB\u79D2\u4E3A\u5355\u4F4D\u7684\u5EF6\u8FDF +settings.delayBetweenToolTip=\u624B\u52A8\u626B\u63CF\u95F4\u7684\u5EF6\u8FDF\uFF0C\u4EC5\u5728\u542F\u7528 ManualScanner \u65F6\u4F7F\u7528 +settings.inlaySizeDelta=\u5185\u805A\u5927\u5C0F\u53D8\u91CF +settings.usedToHaveToolTip=\u7528\u4E8E\u4E3A\u5185\u805A\u6709\u66F4\u5C0F\u7684\u5B57\u4F53\u5927\u5C0F\uFF0C\u5E94\u6BD4\u7F16\u8F91\u5668\u5B57\u4F53\u5927\u5C0F\u5C0F +settings.problemFilterListLabel=\u95EE\u9898\u8FC7\u6EE4\u5668\u5217\u8868 +settings.semicolonSeparatedToolTip=\u7528\u5206\u53F7\u5206\u9694\u7684\u95EE\u9898\u6587\u672C\u5F00\u59CB\u4E0D\u4F1A\u88AB\u5904\u7406\u7684\u5217\u8868 +settings.colors=\u989C\u8272 +settings.errorTextColor=\u9519\u8BEF\u6587\u672C\u989C\u8272\uFF1A +settings.errorLabelBorderColor=\u9519\u8BEF\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A +settings.errorLineHighlightColor=\u9519\u8BEF\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A +settings.additionalSeverities=\u9644\u52A0\u4E25\u91CD\u6027\uFF1A +settings.semicolonError=\u9644\u52A0\u9519\u8BEF\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.warningTextColor=\u8B66\u544A\u6587\u672C\u989C\u8272\uFF1A +settings.warningLabelBorderColor=\u8B66\u544A\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A +settings.warningLineHighlightColor=\u8B66\u544A\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A +settings.semicolonWarning=\u9644\u52A0\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.weakWarningTextColor=\u8F7B\u5F31\u8B66\u544A\u6587\u672C\u989C\u8272\uFF1A +settings.weakWarningLabelBorderColor=\u8F7B\u5F31\u8B66\u544A\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A +settings.weakWarningLineHighlightColor=\u8F7B\u5F31\u8B66\u544A\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A +settings.semicolonWeakWarning=\u9644\u52A0\u8F7B\u5F31\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.infoTextColor=\u4FE1\u606F\u6587\u672C\u989C\u8272\uFF1A +settings.infoLabelBorderColor=\u4FE1\u606F\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A +settings.infoLineHighlightColor=\u4FE1\u606F\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A +settings.semicolon=\u9644\u52A0\u4FE1\u606F\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.forceProblemsIn=\u5F3A\u5236\u5728\u540C\u4E00\u884C\u663E\u793A\u95EE\u9898\uFF0C\u5373\u4F7F\u5B83\u4EEC\u592A\u957F\u800C\u65E0\u6CD5\u9002\u5E94 +settings.useEditorFont=\u4F7F\u7528\u7F16\u8F91\u5668\u5B57\u4F53\u800C\u4E0D\u662F\u63D0\u793A\u5B57\u4F53 +settings.showOnlyTheProblem=\u4EC5\u663E\u793A\u6BCF\u884C\u7684\u6700\u9AD8\u4E25\u91CD\u95EE\u9898 \ No newline at end of file From 03bad405f772a001dcde36a2a4f51404bbe5190e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=A8=81?= Date: Wed, 16 Aug 2023 17:48:54 +0800 Subject: [PATCH 03/18] Improve translation for Chinese language in Settings The changes were made to improve the translation quality of some phrases and words in the settings of the program for the Chinese language. Certain phrases made better sense when replaced with different words, providing more context and clarity to the user. It is important that the quality of the translation is maintained to facilitate Chinese-speaking --- .../messages/SettingsBundle_zh_CN.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/resources/messages/SettingsBundle_zh_CN.properties b/src/main/resources/messages/SettingsBundle_zh_CN.properties index 7783ee3..efe1014 100644 --- a/src/main/resources/messages/SettingsBundle_zh_CN.properties +++ b/src/main/resources/messages/SettingsBundle_zh_CN.properties @@ -6,11 +6,11 @@ settings.showWeakWarnings=\u663E\u793A\u8F7B\u5F31\u8B66\u544A settings.highlightWeakWarnings=\u7A81\u51FA\u663E\u793A\u8F7B\u5F31\u8B66\u544A settings.showInfos=\u663E\u793A\u4FE1\u606F settings.highlightInfos=\u7A81\u51FA\u663E\u793A\u4FE1\u606F -settings.boxOrLabel=\u65B9\u6846 / \u6807\u7B7E -settings.drawBoxesAroundProblemLabels=\u5728\u95EE\u9898\u6807\u7B7E\u5468\u56F4\u7ED8\u5236\u65B9\u6846 -settings.roundedCornerBoxes=\u5706\u89D2\u65B9\u6846 +settings.boxOrLabel=\u8fb9\u6846 / \u6807\u7B7E +settings.drawBoxesAroundProblemLabels=\u5728\u95ee\u9898\u6807\u7b7e\u5468\u56f4\u7ed8\u5236\u8fb9\u6846 +settings.roundedCornerBoxes=\u5706\u89d2\u8fb9\u6846 settings.fillProblemLabels=\u586B\u5145\u95EE\u9898\u6807\u7B7E\u80CC\u666F -settings.boldProblemLabels=\u9AD8\u7EA2\u95EE\u9898\u6807\u7B7E +settings.boldProblemLabels=\u52a0\u7c97\u95ee\u9898\u6807\u7b7e settings.italicProblemLabels=\u659C\u4F53\u95EE\u9898\u6807\u7B7E settings.problemFilterList=\u95EE\u9898\u6587\u672C\u5F00\u59CB\u8FC7\u6EE4\u5668 settings.general=\u901A\u7528 @@ -21,10 +21,10 @@ settings.manualScannerDescription=- ManualScanner\uFF1A\u4EE5\u56FA\u5B9A\u7684\ settings.manualScannerDescriptionSupplement= \u540C HighlightProblemListener\uFF0C\u4F46\u53EF\u4EE5\u5E2E\u52A9\u5904\u7406\u5927\u6587\u4EF6\u4E2D\u7684\u653E\u6162\u901F\u5EA6\u3002 settings.manualScannerDelayLabel=ManualScanner \u4EE5\u6BEB\u79D2\u4E3A\u5355\u4F4D\u7684\u5EF6\u8FDF settings.delayBetweenToolTip=\u624B\u52A8\u626B\u63CF\u95F4\u7684\u5EF6\u8FDF\uFF0C\u4EC5\u5728\u542F\u7528 ManualScanner \u65F6\u4F7F\u7528 -settings.inlaySizeDelta=\u5185\u805A\u5927\u5C0F\u53D8\u91CF -settings.usedToHaveToolTip=\u7528\u4E8E\u4E3A\u5185\u805A\u6709\u66F4\u5C0F\u7684\u5B57\u4F53\u5927\u5C0F\uFF0C\u5E94\u6BD4\u7F16\u8F91\u5668\u5B57\u4F53\u5927\u5C0F\u5C0F -settings.problemFilterListLabel=\u95EE\u9898\u8FC7\u6EE4\u5668\u5217\u8868 -settings.semicolonSeparatedToolTip=\u7528\u5206\u53F7\u5206\u9694\u7684\u95EE\u9898\u6587\u672C\u5F00\u59CB\u4E0D\u4F1A\u88AB\u5904\u7406\u7684\u5217\u8868 +settings.inlaySizeDelta=\u5b57\u4f53\u5927\u5c0f\u5dee\u5f02 +settings.usedToHaveToolTip=\u7528\u4e8e\u4e3a\u6807\u7b7e\u8bbe\u7f6e\u8f83\u5c0f\u7684\u5b57\u4f53\uff0c\u5fc5\u987b\u5c0f\u4e8e\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f +settings.problemFilterListLabel=\u95ee\u9898\u8fc7\u6ee4\u5217\u8868 +settings.semicolonSeparatedToolTip=\u4e0d\u5904\u7406\u7684\u95ee\u9898\u6587\u672c\u5f00\u5934\u7684\u7528\u5206\u53f7\u5206\u9694\u7684\u5217\u8868 settings.colors=\u989C\u8272 settings.errorTextColor=\u9519\u8BEF\u6587\u672C\u989C\u8272\uFF1A settings.errorLabelBorderColor=\u9519\u8BEF\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A @@ -45,4 +45,4 @@ settings.infoLineHighlightColor=\u4FE1\u606F\u884C\u7A81\u51FA\u663E\u793A\u989C settings.semicolon=\u9644\u52A0\u4FE1\u606F\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' settings.forceProblemsIn=\u5F3A\u5236\u5728\u540C\u4E00\u884C\u663E\u793A\u95EE\u9898\uFF0C\u5373\u4F7F\u5B83\u4EEC\u592A\u957F\u800C\u65E0\u6CD5\u9002\u5E94 settings.useEditorFont=\u4F7F\u7528\u7F16\u8F91\u5668\u5B57\u4F53\u800C\u4E0D\u662F\u63D0\u793A\u5B57\u4F53 -settings.showOnlyTheProblem=\u4EC5\u663E\u793A\u6BCF\u884C\u7684\u6700\u9AD8\u4E25\u91CD\u95EE\u9898 \ No newline at end of file +settings.showOnlyTheProblem=\u4ec5\u663e\u793a\u6bcf\u884c\u4e2d\u6700\u4e25\u91cd\u7684\u95ee\u9898 \ No newline at end of file From efacd87c02dbb3291cc20ad0c3e012bdc6c29cd9 Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Fri, 18 Aug 2023 00:04:13 +0200 Subject: [PATCH 04/18] Gutter Icons --- .gitignore | 1 - .idea/.gitignore | 8 ++ .idea/codeStyles/Project.xml | 18 +++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 16 +++ .idea/discord.xml | 7 + .idea/gradle.xml | 17 +++ .idea/icon.svg | 133 ++++++++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/jarRepositories.xml | 20 +++ .idea/misc.xml | 11 ++ .idea/modules.xml | 10 ++ .idea/uiDesigner.xml | 124 ++++++++++++++++ .idea/vcs.xml | 6 + .../inlineproblems/GutterRenderer.java | 42 ++++++ .../inlineproblems/InlineDrawer.java | 76 ++++++++-- .../inlineproblems/ProblemManager.java | 32 +++-- .../inlineproblems/entities/DrawDetails.java | 12 ++ .../entities/InlineProblem.java | 4 +- .../settings/SettingsComponent.java | 52 +++++++ .../settings/SettingsConfigurable.java | 16 ++- .../settings/SettingsState.java | 9 ++ .../inlineproblems/utils/SeverityUtil.java | 18 +++ 23 files changed, 622 insertions(+), 21 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/compiler.xml create mode 100644 .idea/discord.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/icon.svg create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/vcs.xml create mode 100644 src/main/java/org/overengineer/inlineproblems/GutterRenderer.java create mode 100644 src/main/java/org/overengineer/inlineproblems/utils/SeverityUtil.java diff --git a/.gitignore b/.gitignore index 3fff68c..737ffc1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ build !**/src/test/**/build/ ### IntelliJ IDEA ### -.idea *.iws *.iml *.ipr diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..15e6830 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..2e83dce --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..d8e9561 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..611e7c8 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 0000000..288f661 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,133 @@ + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..fdc392f --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..24fff94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..66b27e2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/org/overengineer/inlineproblems/GutterRenderer.java b/src/main/java/org/overengineer/inlineproblems/GutterRenderer.java new file mode 100644 index 0000000..ecd15da --- /dev/null +++ b/src/main/java/org/overengineer/inlineproblems/GutterRenderer.java @@ -0,0 +1,42 @@ +package org.overengineer.inlineproblems; + +import com.intellij.openapi.editor.markup.GutterIconRenderer; +import org.jetbrains.annotations.NotNull; + +import javax.swing.*; +import java.util.Objects; + +public class GutterRenderer extends GutterIconRenderer { + + private final String text; + private final Icon icon; + + public GutterRenderer(String text, @NotNull Icon icon) { + this.text = text; + this.icon = icon; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof GutterRenderer) { + GutterRenderer other = (GutterRenderer) obj; + return Objects.equals(getIcon(), other.getIcon()) && Objects.equals(getTooltipText(), other.getTooltipText()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(getIcon(), getTooltipText()); + } + + @Override + public @NotNull Icon getIcon() { + return icon; + } + + @Override + public @NotNull String getTooltipText() { + return text; + } +} diff --git a/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java b/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java index 84886a9..556e794 100644 --- a/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java +++ b/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java @@ -1,23 +1,28 @@ package org.overengineer.inlineproblems; import com.intellij.openapi.Disposable; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.colors.EditorFontType; import com.intellij.openapi.editor.markup.HighlighterTargetArea; import com.intellij.openapi.editor.markup.MarkupModel; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.util.TextRange; -import org.overengineer.inlineproblems.entities.DrawDetails; import org.overengineer.inlineproblems.entities.InlineProblem; import org.overengineer.inlineproblems.settings.SettingsState; +import org.overengineer.inlineproblems.utils.SeverityUtil; -import java.awt.*; +import javax.annotation.Nullable; +import java.awt.Font; +import java.awt.Canvas; +import java.util.List; import java.util.Arrays; public class InlineDrawer { - public void drawProblemLabel(InlineProblem problem, DrawDetails drawDetails) { + public void drawProblemLabel(InlineProblem problem) { + var drawDetails = problem.getDrawDetails(); if (!drawDetails.isDrawProblem()) { return; } @@ -84,8 +89,16 @@ public void drawProblemLabel(InlineProblem problem, DrawDetails drawDetails) { problem.setInlineProblemLabelHashCode(inlineProblemLabel.hashCode()); } - public void drawProblemLineHighlight(InlineProblem problem, DrawDetails drawDetails) { - if (!drawDetails.isDrawHighlighter()) { + /** Draws the highlighter and the gutter icon for the currently shown problem in the line + */ + public void drawLineHighlighterAndGutterIcon(List problemsInLine) { + var problem = problemsInLine.get(0); + var drawDetails = problem.getDrawDetails(); + + /* If a lower severity has drawHighlighter and gutterIcon enabled and in the same line a problem with a higher + * severity which has drawHighlighter and gutterIcon disabled is added, no highlighter and gutter icon is shown. + */ + if (!drawDetails.isDrawHighlighter() && drawDetails.getIcon() == null) { return; } @@ -99,23 +112,42 @@ public void drawProblemLineHighlight(InlineProblem problem, DrawDetails drawDeta Font.PLAIN ); + if (!drawDetails.isDrawHighlighter()) + textAttributes.setBackgroundColor(editor.getColorsScheme().getDefaultBackground()); + Document document = editor.getDocument(); - problem.setProblemLineHighlighterHashCode(editor.getMarkupModel().addRangeHighlighter( + var highlighter = editor.getMarkupModel().addRangeHighlighter( document.getLineStartOffset(problem.getLine()), document.getLineEndOffset(problem.getLine()), problem.getSeverity(), // Use the severity as layer, hopefully it will not overdraw some important stuff textAttributes, HighlighterTargetArea.EXACT_RANGE - ).hashCode()); - } + ); + + if (drawDetails.getIcon() != null) + highlighter.setGutterIconRenderer(new GutterRenderer(getGutterText(problemsInLine), drawDetails.getIcon())); - public void undrawErrorLineHighlight(InlineProblem problem) { + problem.setProblemLineHighlighterHashCode(highlighter.hashCode()); +} + + /** + * @param problem the problem + * @param problemsInLine the problems in the same line as problem, null if no gutter icons are enabled, keep in mind that + * it still contains the problem itself + */ + public void undrawErrorLineHighlight(InlineProblem problem, @Nullable List problemsInLine) { MarkupModel markupModel = problem.getTextEditor().getEditor().getMarkupModel(); Arrays.stream(markupModel.getAllHighlighters()) .filter(h -> h.isValid() && h.hashCode() == problem.getProblemLineHighlighterHashCode()) .forEach(markupModel::removeHighlighter); + + // Gutter icon re-adding + if (problemsInLine != null && problemsInLine.size() > 1) { + problemsInLine.remove(problem); + drawLineHighlighterAndGutterIcon(problemsInLine); + } } public void undrawInlineProblemLabel(InlineProblem problem) { @@ -152,4 +184,30 @@ public void undrawInlineProblemLabel(InlineProblem problem) { .forEach(Disposable::dispose); } } + + private String getGutterText(List problemsInLine) { + StringBuilder text = new StringBuilder(); + int previousSeverity = -1; + String severityString; + boolean sizeBiggerThanOne = problemsInLine.size() > 1; + + for (var p : problemsInLine) { + if (sizeBiggerThanOne) { + if (p.getSeverity() != previousSeverity) { + severityString = SeverityUtil.getSeverityAsString(p.getSeverity()) + "S: \n"; + text.append(severityString); + } + text.append("- "); + } + + text.append(p.getText()); + + if (sizeBiggerThanOne) + text.append("\n"); + + previousSeverity = p.getSeverity(); + } + + return text.toString(); + } } diff --git a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java index 7edb55f..4f8ddf6 100644 --- a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java +++ b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java @@ -28,15 +28,19 @@ public void dispose() { public void removeProblem(InlineProblem problem) { InlineProblem problemToRemove = findActiveProblemByRangeHighlighterHashCode(problem.getRangeHighlighterHashCode()); - if (problemToRemove == null) { logger.warn("Removal of problem failed, not found by RangeHighlighterHashCode"); resetForEditor(problem.getTextEditor().getEditor()); return; } - inlineDrawer.undrawErrorLineHighlight(problemToRemove); - inlineDrawer.undrawInlineProblemLabel(problemToRemove); + List problemsInLine = null; + if (settingsState.isShowAnyGutterIcons()) { + problemsInLine = getProblemsInLineForProblemSorted(problem); + } + + inlineDrawer.undrawErrorLineHighlight(problem, problemsInLine); + inlineDrawer.undrawInlineProblemLabel(problem); if (!activeProblems.remove(problemToRemove)) { logger.warn("Removal of problem failed, resetting"); @@ -51,6 +55,8 @@ public void removeProblem(InlineProblem problem) { * @param problem problem to add */ public void addProblem(InlineProblem problem) { + problem.setDrawDetails(new DrawDetails(problem, problem.getTextEditor().getEditor())); + List problemsInLine = getProblemsInLineForProblem(problem); problemsInLine.add(problem); @@ -63,6 +69,8 @@ public void addProblem(InlineProblem problem) { removeProblem(p); }); + inlineDrawer.drawLineHighlighterAndGutterIcon(problemsInLine); + /* This only works when using a method reference, if we move the code from the addProblemPrivate func into a lambda * it does not work like expected, that is because there are differences the evaluation and the way it is called */ problemsInLine.forEach(this::addProblemPrivate); @@ -71,12 +79,13 @@ public void addProblem(InlineProblem problem) { private void addProblemPrivate(InlineProblem problem) { applyCustomSeverity(problem); - DrawDetails drawDetails = new DrawDetails(problem, problem.getTextEditor().getEditor()); - - inlineDrawer.drawProblemLabel(problem, drawDetails); - inlineDrawer.drawProblemLineHighlight(problem, drawDetails); + if (problem.getTextEditor().getEditor().getDocument().getLineCount() <= problem.getLine()) { + logger.warn("Line count is less or equal than problem line, problem not added"); + return; + } - activeProblems.add(problem); + inlineDrawer.drawProblemLabel(problem); + Collections.synchronizedList(activeProblems).add(problem); } private void applyCustomSeverity(InlineProblem problem) { @@ -137,6 +146,13 @@ private List getProblemsInLineForProblem(InlineProblem problem) { .collect(Collectors.toList()); } + private List getProblemsInLineForProblemSorted(InlineProblem problem) { + return activeProblems.stream() + .filter(p -> Objects.equals(p.getTextEditor(), problem.getTextEditor()) && p.getLine() == problem.getLine()) + .sorted((p1, p2) -> Integer.compare(p2.getSeverity(), p1.getSeverity())) + .collect(Collectors.toList()); + } + /** * Updates the active problems based on a list of new problems, problems can also be added and removed one by one, * like the MarkupModelProblemListener does, but if the feature "Show only highest severity per line" is enabled, diff --git a/src/main/java/org/overengineer/inlineproblems/entities/DrawDetails.java b/src/main/java/org/overengineer/inlineproblems/entities/DrawDetails.java index 35e3c43..3211d36 100644 --- a/src/main/java/org/overengineer/inlineproblems/entities/DrawDetails.java +++ b/src/main/java/org/overengineer/inlineproblems/entities/DrawDetails.java @@ -1,10 +1,12 @@ package org.overengineer.inlineproblems.entities; +import com.intellij.icons.AllIcons; import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.editor.Editor; import lombok.Getter; import org.overengineer.inlineproblems.settings.SettingsState; +import javax.swing.*; import java.awt.*; @@ -13,6 +15,8 @@ public class DrawDetails { private Color textColor; private Color backgroundColor; private Color highlightColor; + + private Icon icon = null; private boolean isDrawProblem = false; private boolean isDrawHighlighter = false; @@ -31,6 +35,8 @@ public DrawDetails(InlineProblem problem, Editor editor) { highlightColor = settings.getErrorHighlightColor(); isDrawHighlighter = settings.isHighlightErrors(); isDrawProblem = settings.isShowErrors(); + if (settings.isShowErrorsInGutter()) + icon = AllIcons.General.Error; } else if (severity >= HighlightSeverity.WARNING.myVal) { textColor = settings.getWarningTextColor(); @@ -38,6 +44,8 @@ else if (severity >= HighlightSeverity.WARNING.myVal) { highlightColor = settings.getWarningHighlightColor(); isDrawHighlighter = settings.isHighlightWarnings(); isDrawProblem = settings.isShowWarnings(); + if (settings.isShowWarningsInGutter()) + icon = AllIcons.General.Warning; } else if (severity >= HighlightSeverity.WEAK_WARNING.myVal) { textColor = settings.getWeakWarningTextColor(); @@ -45,6 +53,8 @@ else if (severity >= HighlightSeverity.WEAK_WARNING.myVal) { highlightColor = settings.getWeakWarningHighlightColor(); isDrawHighlighter = settings.isHighlightWeakWarnings(); isDrawProblem = settings.isShowWeakWarnings(); + if (settings.isShowWeakWarningsInGutter()) + icon = AllIcons.General.Warning; } else if (severity >= HighlightSeverity.INFORMATION.myVal) { textColor = settings.getInfoTextColor(); @@ -52,6 +62,8 @@ else if (severity >= HighlightSeverity.INFORMATION.myVal) { highlightColor = settings.getInfoHighlightColor(); isDrawHighlighter = settings.isHighlightInfos(); isDrawProblem = settings.isShowInfos(); + if (settings.isShowInfosInGutter()) + icon = AllIcons.General.Information; } } } diff --git a/src/main/java/org/overengineer/inlineproblems/entities/InlineProblem.java b/src/main/java/org/overengineer/inlineproblems/entities/InlineProblem.java index 261ee4d..bf3d37f 100644 --- a/src/main/java/org/overengineer/inlineproblems/entities/InlineProblem.java +++ b/src/main/java/org/overengineer/inlineproblems/entities/InlineProblem.java @@ -12,7 +12,7 @@ @Getter @Setter -@EqualsAndHashCode(exclude = {"line", "problemLineHighlighterHashCode", "inlineProblemLabelHashCode", "isBlockElement"}) +@EqualsAndHashCode(exclude = {"line", "problemLineHighlighterHashCode", "inlineProblemLabelHashCode", "isBlockElement", "drawDetails"}) public class InlineProblem { // The line the problem first appeared @@ -25,6 +25,8 @@ public class InlineProblem { private final TextEditor textEditor; private final Project project; + private DrawDetails drawDetails; + private int actualEndOffset; private boolean isBlockElement = false; diff --git a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java index eebe746..7f4799c 100644 --- a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java +++ b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java @@ -24,24 +24,36 @@ public class SettingsComponent { private final JBCheckBox showErrors = new JBCheckBox("Show errors"); private final JBCheckBox highlightErrors = new JBCheckBox("Highlight errors"); + private final JBCheckBox showErrorsInGutter = new JBCheckBox("Show error icons in gutter"); + private final JBCheckBox showWarnings = new JBCheckBox("Show warnings"); private final JBCheckBox highlightWarnings = new JBCheckBox("Highlight warnings"); + private final JBCheckBox showWarningsInGutter = new JBCheckBox("Show warning icons in gutter"); + private final JBCheckBox showWeakWarnings = new JBCheckBox("Show weak warnings"); private final JBCheckBox highlightWeakWarnings = new JBCheckBox("Highlight weak warnings"); + private final JBCheckBox showWeakWarningsInGutter = new JBCheckBox("Show weak warning icons in gutter"); + private final JBCheckBox showInfos = new JBCheckBox("Show infos"); private final JBCheckBox highlightInfo = new JBCheckBox("Highlight infos"); + private final JBCheckBox showInfosInGutter = new JBCheckBox("Show info icons in gutter"); + private final ColorPanel errorTextColor = new ColorPanel(); private final ColorPanel errorLabelBackgroundColor = new ColorPanel(); private final ColorPanel errorHighlightColor = new ColorPanel(); + private final ColorPanel warningTextColor = new ColorPanel(); private final ColorPanel warningLabelBackgroundColor = new ColorPanel(); private final ColorPanel warningHighlightColor = new ColorPanel(); + private final ColorPanel weakWarningTextColor = new ColorPanel(); private final ColorPanel weakWarningLabelBackgroundColor = new ColorPanel(); private final ColorPanel weakWarningHighlightColor = new ColorPanel(); + private final ColorPanel infoTextColor = new ColorPanel(); private final ColorPanel infoLabelBackgroundColor = new ColorPanel(); private final ColorPanel infoHighlightColor = new ColorPanel(); + private final JBCheckBox forceErrorsInSameLine = new JBCheckBox("Force problems in the same line even if they are to long to fit"); private final JBCheckBox drawBoxesAroundProblemLabels = new JBCheckBox("Draw boxes around problem labels"); private final JBCheckBox roundedCornerBoxes = new JBCheckBox("Rounded corners"); @@ -70,24 +82,28 @@ public SettingsComponent() { showErrors.setSelected(settingsState.isShowErrors()); highlightErrors.setSelected(settingsState.isHighlightErrors()); + showErrorsInGutter.setSelected(settingsState.isShowErrorsInGutter()); errorTextColor.setSelectedColor(settingsState.getErrorTextColor()); errorLabelBackgroundColor.setSelectedColor(settingsState.getErrorBackgroundColor()); errorHighlightColor.setSelectedColor(settingsState.getErrorHighlightColor()); showWarnings.setSelected(settingsState.isShowWarnings()); highlightWarnings.setSelected(settingsState.isHighlightWarnings()); + showWarningsInGutter.setSelected(settingsState.isShowWarningsInGutter()); warningTextColor.setSelectedColor(settingsState.getWarningTextColor()); warningLabelBackgroundColor.setSelectedColor(settingsState.getWarningBackgroundColor()); warningHighlightColor.setSelectedColor(settingsState.getWarningHighlightColor()); showWeakWarnings.setSelected(settingsState.isShowWeakWarnings()); highlightWeakWarnings.setSelected(settingsState.isHighlightWeakWarnings()); + showWeakWarningsInGutter.setSelected(settingsState.isShowWeakWarningsInGutter()); weakWarningTextColor.setSelectedColor(settingsState.getWeakWarningTextColor()); weakWarningLabelBackgroundColor.setSelectedColor(settingsState.getWeakWarningBackgroundColor()); weakWarningHighlightColor.setSelectedColor(settingsState.getWeakWarningHighlightColor()); showInfos.setSelected(settingsState.isShowInfos()); highlightInfo.setSelected(settingsState.isHighlightInfos()); + showInfosInGutter.setSelected(settingsState.isShowInfosInGutter()); infoTextColor.setSelectedColor(settingsState.getInfoTextColor()); infoLabelBackgroundColor.setSelectedColor(settingsState.getInfoBackgroundColor()); infoHighlightColor.setSelectedColor(settingsState.getInfoHighlightColor()); @@ -142,6 +158,7 @@ public SettingsComponent() { .addComponent(new JBLabel("Colors")) .addComponent(showErrors) .addComponent(highlightErrors) + .addComponent(showErrorsInGutter) .addLabeledComponent(new JLabel("Error text color:"), errorTextColor) .addLabeledComponent(new JLabel("Error label border color:"), errorLabelBackgroundColor) .addLabeledComponent(new JLabel("Error line highlight color:"), errorHighlightColor) @@ -150,6 +167,7 @@ public SettingsComponent() { .addSeparator() .addComponent(showWarnings) .addComponent(highlightWarnings) + .addComponent(showWarningsInGutter) .addLabeledComponent(new JLabel("Warning text color:"), warningTextColor) .addLabeledComponent(new JLabel("Warning label border color:"), warningLabelBackgroundColor) .addLabeledComponent(new JLabel("Warning line highlight color:"), warningHighlightColor) @@ -158,6 +176,7 @@ public SettingsComponent() { .addSeparator() .addComponent(showWeakWarnings) .addComponent(highlightWeakWarnings) + .addComponent(showWeakWarningsInGutter) .addLabeledComponent(new JLabel("Weak warning text color:"), weakWarningTextColor) .addLabeledComponent(new JLabel("Weak warning label border color:"), weakWarningLabelBackgroundColor) .addLabeledComponent(new JLabel("Weak warning line highlight color:"), weakWarningHighlightColor) @@ -166,6 +185,7 @@ public SettingsComponent() { .addSeparator() .addComponent(showInfos) .addComponent(highlightInfo) + .addComponent(showInfosInGutter) .addLabeledComponent(new JLabel("Info text color:"), infoTextColor) .addLabeledComponent(new JLabel("Info label border color:"), infoLabelBackgroundColor) .addLabeledComponent(new JLabel("Info line highlight color:"), infoHighlightColor) @@ -273,6 +293,14 @@ public void setHighlightErrors(boolean isSelected) { highlightErrors.setSelected(isSelected); } + public boolean isShowErrorsInGutter() { + return showErrorsInGutter.isSelected(); + } + + public void setShowErrorsInGutter(boolean isSelected) { + showErrorsInGutter.setSelected(isSelected); + } + public boolean isShowWarnings() { return showWarnings.isSelected(); } @@ -289,6 +317,14 @@ public void setHighlightWarnings(final boolean isSelected) { highlightWarnings.setSelected(isSelected); } + public boolean isShowWarningsInGutter() { + return showWarningsInGutter.isSelected(); + } + + public void setShowWarningsInGutter(final boolean isSelected) { + showWarningsInGutter.setSelected(isSelected); + } + public boolean isShowWeakWarnings() { return showWeakWarnings.isSelected(); } @@ -305,6 +341,14 @@ public void setHighlightWeakWarnings(final boolean isSelected) { highlightWeakWarnings.setSelected(isSelected); } + public boolean isShowWeakWarningsInGutter() { + return showWeakWarningsInGutter.isSelected(); + } + + public void setShowWeakWarningsInGutter(boolean isSelected) { + showWeakWarningsInGutter.setSelected(isSelected); + } + public boolean isShowInfos() { return showInfos.isSelected(); } @@ -321,6 +365,14 @@ public void setHighlightInfo(final boolean isSelected) { highlightInfo.setSelected(isSelected); } + public boolean isShowInfosInGutter() { + return showInfosInGutter.isSelected(); + } + + public void setShowInfosInGutter(boolean isSelected) { + showInfosInGutter.setSelected(isSelected); + } + public Color getErrorTextColor() { return errorTextColor.getSelectedColor(); } diff --git a/src/main/java/org/overengineer/inlineproblems/settings/SettingsConfigurable.java b/src/main/java/org/overengineer/inlineproblems/settings/SettingsConfigurable.java index 4238d8b..cd94f0a 100644 --- a/src/main/java/org/overengineer/inlineproblems/settings/SettingsConfigurable.java +++ b/src/main/java/org/overengineer/inlineproblems/settings/SettingsConfigurable.java @@ -14,8 +14,7 @@ public class SettingsConfigurable implements Configurable { private final ListenerManager listenerManager = ListenerManager.getInstance(); - SettingsConfigurable() { - } + SettingsConfigurable() {} @Override @NlsContexts.ConfigurableName @@ -54,24 +53,29 @@ public boolean isModified() { state.getErrorHighlightColor().equals(settingsComponent.getErrorHighlightColor()) && state.isShowErrors() == settingsComponent.isShowErrors() && state.isHighlightErrors() == settingsComponent.isHighlightErrors() && + state.isShowErrorsInGutter() == settingsComponent.isShowErrorsInGutter() && state.getWarningTextColor().equals(settingsComponent.getWarningTextColor()) && state.getWarningBackgroundColor().equals(settingsComponent.getWarningLabelBackgroundColor()) && state.getWarningHighlightColor().equals(settingsComponent.getWarningHighlightColor()) && state.isShowWarnings() == settingsComponent.isShowWarnings() && state.isHighlightWarnings() == settingsComponent.isHighlightWarnings() && + state.isShowWarningsInGutter() == settingsComponent.isShowWarningsInGutter() && state.getWeakWarningTextColor().equals(settingsComponent.getWeakWarningTextColor()) && state.getWeakWarningBackgroundColor().equals(settingsComponent.getWeakWarningLabelBackgroundColor()) && state.getWeakWarningHighlightColor().equals(settingsComponent.getWeakWarningHighlightColor()) && state.isShowWeakWarnings() == settingsComponent.isShowWeakWarnings() && state.isHighlightWeakWarnings() == settingsComponent.isHighlightWeakWarnings() && + state.isShowWeakWarningsInGutter() == settingsComponent.isShowWeakWarningsInGutter() && state.getInfoTextColor().equals(settingsComponent.getInfoTextColor()) && state.getInfoBackgroundColor().equals(settingsComponent.getInfoLabelBackgroundColor()) && state.getInfoHighlightColor().equals(settingsComponent.getInfoHighlightColor()) && state.isShowInfos() == settingsComponent.isShowInfos() && state.isHighlightInfos() == settingsComponent.isHighlightInfo() && + state.isShowInfosInGutter() == settingsComponent.isShowInfosInGutter() && + state.getEnabledListener() == settingsComponent.getEnabledListener() && state.getProblemFilterList().equals(settingsComponent.getProblemFilterList()) && @@ -93,24 +97,28 @@ public void apply() { state.setShowErrors(settingsComponent.isShowErrors()); state.setHighlightErrors(settingsComponent.isHighlightErrors()); + state.setShowErrorsInGutter(settingsComponent.isShowErrorsInGutter()); state.setErrorTextColor(settingsComponent.getErrorTextColor()); state.setErrorBackgroundColor(settingsComponent.getErrorLabelBackgroundColor()); state.setErrorHighlightColor(settingsComponent.getErrorHighlightColor()); state.setShowWarnings(settingsComponent.isShowWarnings()); state.setHighlightWarnings(settingsComponent.isHighlightWarnings()); + state.setShowWarningsInGutter(settingsComponent.isShowWarningsInGutter()); state.setWarningTextColor(settingsComponent.getWarningTextColor()); state.setWarningBackgroundColor(settingsComponent.getWarningLabelBackgroundColor()); state.setWarningHighlightColor(settingsComponent.getWarningHighlightColor()); state.setShowWeakWarnings(settingsComponent.isShowWeakWarnings()); state.setHighlightWeakWarnings(settingsComponent.isHighlightWeakWarnings()); + state.setShowWeakWarningsInGutter(settingsComponent.isShowWeakWarningsInGutter()); state.setWeakWarningTextColor(settingsComponent.getWeakWarningTextColor()); state.setWeakWarningBackgroundColor(settingsComponent.getWeakWarningLabelBackgroundColor()); state.setWeakWarningHighlightColor(settingsComponent.getWeakWarningHighlightColor()); state.setShowInfos(settingsComponent.isShowInfos()); state.setHighlightInfos(settingsComponent.isHighlightInfo()); + state.setShowInfosInGutter(settingsComponent.isShowInfosInGutter()); state.setInfoTextColor(settingsComponent.getInfoTextColor()); state.setInfoBackgroundColor(settingsComponent.getInfoLabelBackgroundColor()); state.setInfoHighlightColor(settingsComponent.getInfoHighlightColor()); @@ -146,24 +154,28 @@ public void reset() { settingsComponent.setShowErrors(state.isShowErrors()); settingsComponent.setHighlightErrors(state.isHighlightErrors()); + settingsComponent.setShowErrorsInGutter(state.isShowErrorsInGutter()); settingsComponent.setErrorTextColor(state.getErrorTextColor()); settingsComponent.setErrorLabelBackgroundColor(state.getErrorBackgroundColor()); settingsComponent.setErrorHighlightColor(state.getErrorHighlightColor()); settingsComponent.setShowWarnings(state.isShowWarnings()); settingsComponent.setHighlightWarnings(state.isHighlightWarnings()); + settingsComponent.setShowWarningsInGutter(state.isShowWarningsInGutter()); settingsComponent.setWarningTextColor(state.getWarningTextColor()); settingsComponent.setWarningLabelBackgroundColor(state.getWarningBackgroundColor()); settingsComponent.setWarningHighlightColor(state.getWarningHighlightColor()); settingsComponent.setShowWeakWarnings(state.isShowWeakWarnings()); settingsComponent.setHighlightWeakWarnings(state.isHighlightWeakWarnings()); + settingsComponent.setShowWeakWarningsInGutter(state.isShowWeakWarningsInGutter()); settingsComponent.setWeakWarningTextColor(state.getWeakWarningTextColor()); settingsComponent.setWeakWarningLabelBackgroundColor(state.getWeakWarningBackgroundColor()); settingsComponent.setWeakWarningHighlightColor(state.getWeakWarningHighlightColor()); settingsComponent.setShowInfos(state.isShowInfos()); settingsComponent.setHighlightInfo(state.isHighlightInfos()); + settingsComponent.setShowInfosInGutter(state.isShowInfosInGutter()); settingsComponent.setInfoTextColor(state.getInfoTextColor()); settingsComponent.setInfoLabelBackgroundColor(state.getInfoBackgroundColor()); settingsComponent.setInfoHighlightColor(state.getInfoHighlightColor()); diff --git a/src/main/java/org/overengineer/inlineproblems/settings/SettingsState.java b/src/main/java/org/overengineer/inlineproblems/settings/SettingsState.java index ba1db65..169585c 100644 --- a/src/main/java/org/overengineer/inlineproblems/settings/SettingsState.java +++ b/src/main/java/org/overengineer/inlineproblems/settings/SettingsState.java @@ -30,12 +30,16 @@ public class SettingsState implements PersistentStateComponent { private boolean showErrors = true; private boolean highlightErrors = false; + private boolean showErrorsInGutter = false; private boolean showWarnings = true; private boolean highlightWarnings = false; + private boolean showWarningsInGutter = false; private boolean showWeakWarnings = false; private boolean highlightWeakWarnings = false; + private boolean showWeakWarningsInGutter = false; private boolean showInfos = false; private boolean highlightInfos = false; + private boolean showInfosInGutter = false; /** * Colors renamed from 'Color' to 'Col' to solve @@ -265,4 +269,9 @@ public void setInfoHighlightColor(Color color) { this.infoHighlightCol = color; } // + + @Transient + public boolean isShowAnyGutterIcons() { + return showErrorsInGutter || showWarningsInGutter || showWeakWarningsInGutter || showInfosInGutter; + } } diff --git a/src/main/java/org/overengineer/inlineproblems/utils/SeverityUtil.java b/src/main/java/org/overengineer/inlineproblems/utils/SeverityUtil.java new file mode 100644 index 0000000..67efc7c --- /dev/null +++ b/src/main/java/org/overengineer/inlineproblems/utils/SeverityUtil.java @@ -0,0 +1,18 @@ +package org.overengineer.inlineproblems.utils; + +import com.intellij.lang.annotation.HighlightSeverity; + +public class SeverityUtil { + public static String getSeverityAsString(int severity) { + if (severity >= HighlightSeverity.ERROR.myVal) { + return "ERROR"; + } else if (severity >= HighlightSeverity.WARNING.myVal) { + return "WARNING"; + } else if (severity >= HighlightSeverity.WEAK_WARNING.myVal) { + return "WEAK WARNING"; + } else if (severity >= HighlightSeverity.INFORMATION.myVal) { + return "INFO"; + } + return ""; + } +} From 1c3009f7aabab18c6db7bdbee203032d832edf3a Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Fri, 18 Aug 2023 12:50:04 +0200 Subject: [PATCH 05/18] Fixes multiple gutter icons per line problems --- .../inlineproblems/InlineDrawer.java | 27 ++++++++++++++----- .../inlineproblems/ProblemManager.java | 6 ++--- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java b/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java index 556e794..4e734e6 100644 --- a/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java +++ b/src/main/java/org/overengineer/inlineproblems/InlineDrawer.java @@ -1,12 +1,9 @@ package org.overengineer.inlineproblems; import com.intellij.openapi.Disposable; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.colors.EditorFontType; -import com.intellij.openapi.editor.markup.HighlighterTargetArea; -import com.intellij.openapi.editor.markup.MarkupModel; -import com.intellij.openapi.editor.markup.TextAttributes; +import com.intellij.openapi.editor.markup.*; import com.intellij.openapi.util.TextRange; import org.overengineer.inlineproblems.entities.InlineProblem; import org.overengineer.inlineproblems.settings.SettingsState; @@ -125,11 +122,13 @@ public void drawLineHighlighterAndGutterIcon(List problemsInLine) HighlighterTargetArea.EXACT_RANGE ); - if (drawDetails.getIcon() != null) + if (drawDetails.getIcon() != null) { + removeGutterIconsForLine(editor, problem.getLine()); highlighter.setGutterIconRenderer(new GutterRenderer(getGutterText(problemsInLine), drawDetails.getIcon())); + } problem.setProblemLineHighlighterHashCode(highlighter.hashCode()); -} + } /** * @param problem the problem @@ -210,4 +209,20 @@ private String getGutterText(List problemsInLine) { return text.toString(); } + + private void removeGutterIconsForLine(Editor editor, int line) { + Document document = editor.getDocument(); + int lineStartOffset = document.getLineStartOffset(line); + int lineEndOffset = document.getLineEndOffset(line); + + MarkupModel markupModel = editor.getMarkupModel(); + for (RangeHighlighter highlighter : markupModel.getAllHighlighters()) { + if (highlighter.getStartOffset() <= lineEndOffset && highlighter.getEndOffset() >= lineStartOffset) { + GutterIconRenderer gutterIconRenderer = highlighter.getGutterIconRenderer(); + if (gutterIconRenderer instanceof GutterRenderer) { + highlighter.setGutterIconRenderer(null); + } + } + } + } } diff --git a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java index 10ad018..b35f2e4 100644 --- a/src/main/java/org/overengineer/inlineproblems/ProblemManager.java +++ b/src/main/java/org/overengineer/inlineproblems/ProblemManager.java @@ -64,16 +64,14 @@ public void addProblem(InlineProblem problem) { removeProblem(p); }); - inlineDrawer.drawLineHighlighterAndGutterIcon(problemsInLine); - /* This only works when using a method reference, if we move the code from the addProblemPrivate func into a lambda * it does not work like expected, that is because there are differences in the evaluation and the way it is called */ problemsInLine.forEach(this::addProblemPrivate); + + inlineDrawer.drawLineHighlighterAndGutterIcon(problemsInLine); } private void addProblemPrivate(InlineProblem problem) { - DrawDetails drawDetails = new DrawDetails(problem, problem.getTextEditor().getEditor()); - if (problem.getTextEditor().getEditor().getDocument().getLineCount() <= problem.getLine()) { logger.warn("Line count is less or equal than problem line, problem not added"); return; From 926b24370adfc6266aea3a39415a1290aa5ed28f Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Fri, 18 Aug 2023 16:11:17 +0200 Subject: [PATCH 06/18] Notifications when unity projects are opened in rider and the listener changes because of that --- .../overengineer/inlineproblems/Notifier.java | 15 +++++++++++++++ .../inlineproblems/ProjectStartupActivity.java | 1 + .../inlineproblems/UnityProjectManager.java | 17 +++++++++++++---- src/main/resources/META-INF/plugin.xml | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/main/java/org/overengineer/inlineproblems/Notifier.java diff --git a/src/main/java/org/overengineer/inlineproblems/Notifier.java b/src/main/java/org/overengineer/inlineproblems/Notifier.java new file mode 100644 index 0000000..8a5980d --- /dev/null +++ b/src/main/java/org/overengineer/inlineproblems/Notifier.java @@ -0,0 +1,15 @@ +package org.overengineer.inlineproblems; + +import com.intellij.notification.NotificationGroupManager; +import com.intellij.notification.NotificationType; +import com.intellij.openapi.project.Project; + + +public class Notifier { + public static void notify(String content, NotificationType type, Project project) { + NotificationGroupManager.getInstance() + .getNotificationGroup("InlineProblems") + .createNotification("InlineProblems", content, type) + .notify(project); + } +} \ No newline at end of file diff --git a/src/main/java/org/overengineer/inlineproblems/ProjectStartupActivity.java b/src/main/java/org/overengineer/inlineproblems/ProjectStartupActivity.java index d889a05..460caed 100644 --- a/src/main/java/org/overengineer/inlineproblems/ProjectStartupActivity.java +++ b/src/main/java/org/overengineer/inlineproblems/ProjectStartupActivity.java @@ -13,6 +13,7 @@ public class ProjectStartupActivity implements StartupActivity { @Override public void runActivity(@NotNull Project project) { + // Rider specific handling for Unity projects if (ApplicationInfo.getInstance().getFullApplicationName().startsWith(IDE.RIDER)) { UnityProjectManager projectManager = UnityProjectManager.getInstance(); diff --git a/src/main/java/org/overengineer/inlineproblems/UnityProjectManager.java b/src/main/java/org/overengineer/inlineproblems/UnityProjectManager.java index f72c264..cce52df 100644 --- a/src/main/java/org/overengineer/inlineproblems/UnityProjectManager.java +++ b/src/main/java/org/overengineer/inlineproblems/UnityProjectManager.java @@ -1,5 +1,6 @@ package org.overengineer.inlineproblems; +import com.intellij.notification.NotificationType; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; @@ -49,7 +50,7 @@ public void projectOpened(InlineProblemProject project) { projects.add(project); if (!isUnityProjectOpenedBefore && isAUnityProjectOpened()) { - handleUnityProjectOpened(); + handleUnityProjectOpened(project.getProject()); } } @@ -66,7 +67,7 @@ public void projectClosed(Project project) { projectsToRemove.forEach(projects::remove); if (isUnityProjectOpenedBefore && !isAUnityProjectOpened()) { - handleNoMoreUnityProjectsOpened(); + handleNoMoreUnityProjectsOpened(project); } } @@ -87,22 +88,30 @@ private boolean isAUnityProjectOpened() { .anyMatch(p -> p.getType().equals(ProjectType.UNITY_GAME_ENGINE)); } - private void handleUnityProjectOpened() { + private void handleUnityProjectOpened(Project project) { enabledListenerBefore = settings.getEnabledListener(); + if (enabledListenerBefore == Listener.MANUAL_SCANNING) + return; + settings.setEnabledListener(Listener.MANUAL_SCANNING); ListenerManager listenerManager = ListenerManager.getInstance(); listenerManager.resetAndRescan(); listenerManager.changeListener(); + Notifier.notify("Unity project opened. Listener changed to Manual Scanning.", NotificationType.INFORMATION, project); } - private void handleNoMoreUnityProjectsOpened() { + private void handleNoMoreUnityProjectsOpened(Project project) { + if (enabledListenerBefore == Listener.MANUAL_SCANNING) + return; + if (settings.getEnabledListener() == Listener.MANUAL_SCANNING) { settings.setEnabledListener(enabledListenerBefore); ListenerManager listenerManager = ListenerManager.getInstance(); listenerManager.resetAndRescan(); listenerManager.changeListener(); + Notifier.notify("No more Unity projects opened. Listener changed back to the previous one", NotificationType.INFORMATION, project); // PersistentStateComponent is somehow not working (Settings change is not persisted) ApplicationManager.getApplication().saveSettings(); diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 0e4aa04..600aa59 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -25,6 +25,7 @@ + From b78837041aa5051777c1f5035a010bb80cbc80da Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Fri, 18 Aug 2023 18:02:03 +0200 Subject: [PATCH 07/18] Adds some shields to the readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 58d7c2b..6a1dec2 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![GPLv3 License][license-shield]][license-url] +[![Version][plugin-version-shield]][plugin-url] +[![Downloads][plugin-downloads-shield]][plugin-url] +[![Rating][plugin-rating-shield]][plugin-url] @@ -136,3 +139,7 @@ Project Link: [https://github.com/0verEngineer/InlineProblems](https://github.co [issues-url]: https://github.com/0verEngineer/InlineProblems/issues [license-shield]: https://img.shields.io/github/license/0verEngineer/InlineProblems.svg?style=for-the-badge [license-url]: https://github.com/0verEngineer/InlineProblems/blob/master/LICENSE.txt +[plugin-url]: https://plugins.jetbrains.com/plugin/20789-inlineproblems +[plugin-version-shield]: https://img.shields.io/jetbrains/plugin/v/20789-inlineproblems.svg?style=for-the-badge +[plugin-downloads-shield]: https://img.shields.io/jetbrains/plugin/d/20789-inlineproblems.svg?style=for-the-badge +[plugin-rating-shield]: https://img.shields.io/jetbrains/plugin/r/rating/20789-inlineproblems?style=for-the-badge \ No newline at end of file From 4f6d8f998b07ae4717c91b74ded881ce6ba208a7 Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Fri, 18 Aug 2023 18:24:32 +0200 Subject: [PATCH 08/18] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aac7b7b..4a71a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ## [Unreleased] +### Added +- Gutter icon support (disabled by default) +- Notification when a Unity project is opened in Rider, and it switches to the ManualScan listener + ### Fixed - AlreadyDisposedException in HighlightProblemListener From 4ede304df62360548a104c61cac10e593e17555a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=A8=81?= Date: Mon, 21 Aug 2023 15:10:38 +0800 Subject: [PATCH 09/18] Refactored author and docstrings in SettingsBundle class --- .../overengineer/inlineproblems/bundles/SettingsBundle.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java b/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java index b2eecf0..155120d 100644 --- a/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java +++ b/src/main/java/org/overengineer/inlineproblems/bundles/SettingsBundle.java @@ -9,10 +9,10 @@ import java.util.function.Supplier; /** - * The SettingsBundle class is a dynamic bundle for managing internationalized messages for the AiCodeBot project. + * The SettingsBundle class is a dynamic bundle for managing internationalized messages. * It extends the DynamicBundle class. * - * @author zhengwei + * @author kuwei */ public final class SettingsBundle extends DynamicBundle { @NonNls From a6cc4b8796378a0bbe338f4f046a7ff35989844c Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Thu, 24 Aug 2023 20:24:36 +0200 Subject: [PATCH 10/18] - Fixes some of the SettingsBundle keys (internationalization) - Adds german translation for the settings --- .../settings/SettingsComponent.java | 24 ++++----- .../messages/SettingsBundle_de.properties | 51 +++++++++++++++++++ .../messages/SettingsBundle_en.properties | 24 ++++----- .../messages/SettingsBundle_zh_CN.properties | 24 ++++----- 4 files changed, 87 insertions(+), 36 deletions(-) create mode 100644 src/main/resources/messages/SettingsBundle_de.properties diff --git a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java index 1c67fdb..3cfd00d 100644 --- a/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java +++ b/src/main/java/org/overengineer/inlineproblems/settings/SettingsComponent.java @@ -55,7 +55,7 @@ public class SettingsComponent { private final ColorPanel infoLabelBackgroundColor = new ColorPanel(); private final ColorPanel infoHighlightColor = new ColorPanel(); - private final JBCheckBox forceErrorsInSameLine = new JBCheckBox(SettingsBundle.message("settings.forceProblemsIn")); + private final JBCheckBox forceErrorsInSameLine = new JBCheckBox(SettingsBundle.message("settings.forceProblemsInOneLine")); private final JBCheckBox drawBoxesAroundProblemLabels = new JBCheckBox(SettingsBundle.message("settings.drawBoxesAroundProblemLabels")); private final JBCheckBox roundedCornerBoxes = new JBCheckBox(SettingsBundle.message("settings.roundedCornerBoxes")); private final JBCheckBox useEditorFont = new JBCheckBox(SettingsBundle.message("settings.useEditorFont")); @@ -144,30 +144,30 @@ public SettingsComponent() { enabledListener.setPreferredSize(enabledListenerDimension); settingsPanel = FormBuilder.createFormBuilder() - .addComponent(new JBLabel(SettingsBundle.message("settings.boxOrLabel"))) + .addComponent(new JBLabel(SettingsBundle.message("settings.submenu.label"))) .addComponent(drawBoxesAroundProblemLabels, 0) .addComponent(roundedCornerBoxes, 0) .addComponent(fillProblemLabels, 0) .addComponent(boldProblemLabels, 0) .addComponent(italicProblemLabels, 0) .addSeparator() - .addComponent(new JBLabel(SettingsBundle.message("settings.general"))) - .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.enabledProblemListener")), enabledListener) + .addComponent(new JBLabel(SettingsBundle.message("settings.submenu.general"))) + .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.activeProblemListener")), enabledListener) .addTooltip(SettingsBundle.message("settings.markupModelListenerDescription")) .addTooltip(SettingsBundle.message("settings.highlightProblemListenerDescription")) .addTooltip(SettingsBundle.message("settings.manualScannerDescription")) .addTooltip(SettingsBundle.message("settings.manualScannerDescriptionSupplement")) .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.manualScannerDelayLabel")), manualScannerDelay) - .addTooltip(SettingsBundle.message("settings.delayBetweenToolTip")) + .addTooltip(SettingsBundle.message("settings.manualScannerDelayTooltip")) .addComponent(forceErrorsInSameLine, 0) .addComponent(useEditorFont, 0) .addComponent(showOnlyHighestSeverityPerLine, 0) .addLabeledComponent(new JBLabel(SettingsBundle.message("settings.inlaySizeDelta")), inlayFontSizeDeltaText) - .addTooltip(SettingsBundle.message("settings.usedToHaveToolTip")) + .addTooltip(SettingsBundle.message("settings.inlaySizeDeltaTooltip")) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.problemFilterListLabel")), problemFilterList) - .addTooltip(SettingsBundle.message("settings.semicolonSeparatedToolTip")) + .addTooltip(SettingsBundle.message("settings.problemFilterListTooltip")) .addSeparator() - .addComponent(new JBLabel(SettingsBundle.message("settings.colors"))) + .addComponent(new JBLabel(SettingsBundle.message("settings.submenu.colors"))) .addComponent(showErrors) .addComponent(highlightErrors) .addComponent(showErrorsInGutter) @@ -175,7 +175,7 @@ public SettingsComponent() { .addLabeledComponent(new JLabel(SettingsBundle.message("settings.errorLabelBorderColor")), errorLabelBackgroundColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.errorLineHighlightColor")), errorHighlightColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalErrorSeverities) - .addTooltip(SettingsBundle.message("settings.semicolonError")) + .addTooltip(SettingsBundle.message("settings.additionalSeveritiesErrorDesc")) .addSeparator() .addComponent(showWarnings) .addComponent(highlightWarnings) @@ -184,7 +184,7 @@ public SettingsComponent() { .addLabeledComponent(new JLabel(SettingsBundle.message("settings.warningLabelBorderColor")), warningLabelBackgroundColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.warningLineHighlightColor")), warningHighlightColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalWarningSeverities) - .addTooltip(SettingsBundle.message("settings.semicolonWarning")) + .addTooltip(SettingsBundle.message("settings.additionalSeveritiesWarningDesc")) .addSeparator() .addComponent(showWeakWarnings) .addComponent(highlightWeakWarnings) @@ -193,7 +193,7 @@ public SettingsComponent() { .addLabeledComponent(new JLabel(SettingsBundle.message("settings.weakWarningLabelBorderColor")), weakWarningLabelBackgroundColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.weakWarningLineHighlightColor")), weakWarningHighlightColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalWeakWarningSeverities) - .addTooltip(SettingsBundle.message("settings.semicolonWeakWarning")) + .addTooltip(SettingsBundle.message("settings.additionalSeveritiesWeakWarningDesc")) .addSeparator() .addComponent(showInfos) .addComponent(highlightInfo) @@ -202,7 +202,7 @@ public SettingsComponent() { .addLabeledComponent(new JLabel(SettingsBundle.message("settings.infoLabelBorderColor")), infoLabelBackgroundColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.infoLineHighlightColor")), infoHighlightColor) .addLabeledComponent(new JLabel(SettingsBundle.message("settings.additionalSeverities")), additionalInfoSeverities) - .addTooltip(SettingsBundle.message("settings.semicolon")) + .addTooltip(SettingsBundle.message("settings.additionalSeveritiesInfoDesc")) .addComponentFillVertically(new JPanel(), 0) .getPanel(); } diff --git a/src/main/resources/messages/SettingsBundle_de.properties b/src/main/resources/messages/SettingsBundle_de.properties new file mode 100644 index 0000000..7718939 --- /dev/null +++ b/src/main/resources/messages/SettingsBundle_de.properties @@ -0,0 +1,51 @@ +settings.showErrors=Errors anzeigen +settings.highlightErrors=Error hervorheben +settings.showErrorsInGutter=Error icons im Gutter anzeigen +settings.showWarnings=Warnings anzeigen +settings.highlightWarnings=Warnings hervorheben +settings.showWarningsInGutter=Warning icons im Gutter anzeigen +settings.showWeakWarnings=Weak warnings anzeigen +settings.highlightWeakWarnings=Weak warnings hervorheben +settings.showWeakWarningsInGutter=Weak warning icons im Gutter anzeigen +settings.showInfos=Infos anzeigen +settings.highlightInfos=Infos hervorheben +settings.showInfosInGutter=Info icons im Gutter anzeigen +settings.submenu.label=Box / Label +settings.drawBoxesAroundProblemLabels=Problem-Label Box-Effekt +settings.roundedCornerBoxes=Abgerundete Ecken +settings.fillProblemLabels=Problem-Label Box füllen +settings.boldProblemLabels=Fett gedruckte Problem-Labels +settings.italicProblemLabels=Kursiv gedruckte Problem-Labels +settings.submenu.general=Allgemein +settings.activeProblemListener=Aktiver Problem-Listener +settings.markupModelListenerDescription=- MarkupModelListener (standard): Wird nach dem Hinzufügen eines RangeHighlighters zu einer Datei aufgerufen. Schneller bei großen Dateien, langsamer bei kleinen. +settings.highlightProblemListenerDescription=- HighlightProblemListener: Schneller bei kleinen bis mittelgroßen Dateien, langsamer bei großen. Wird sehr oft aufgerufen und kann zu Verlangsamungen führen. +settings.manualScannerDescription=- ManualScanner: Scannt das DocumentMarkupModel nach allen Highlightern mit einer fixen Verzögerung zwischen den aufrufen, verwendet die gleiche Logik +settings.manualScannerDescriptionSupplement= wie der HighlightProblemListener, ist aber schneller bei großen Dateien. +settings.manualScannerDelayLabel=ManualScanner verzögerung in Millisekunden +settings.manualScannerDelayTooltip=Verzögerung zwischen den manuellen Scans wird nur verwendet, wenn der ManualScanner aktiviert ist +settings.inlaySizeDelta=Label größen Delta +settings.inlaySizeDeltaTooltip=Wird zum Verkleinern der Schriftgröße der Inlays verwendet, sollte kleiner als die Editor-Schriftgröße sein +settings.problemFilterListLabel=Problem Filterliste +settings.problemFilterListTooltip=Semikolon getrennte Liste von Problemtext-Anfängen, die nicht ignoriert werden sollen +settings.submenu.colors=Farben +settings.errorTextColor=Error Textfarbe: +settings.errorLabelBorderColor=Error-Label Randfarbe: +settings.errorLineHighlightColor=Error-Zeilen Hervorhebungsfarbe: +settings.additionalSeverities=Zusätzliche Schweregrade: +settings.additionalSeveritiesErrorDesc=Semikolon getrennte Liste von zusätzlichen Error-Schweregraden z.B. '10, 100' +settings.warningTextColor=Warnung Textfarbe: +settings.warningLabelBorderColor=Warnung-Label Randfarbe: +settings.warningLineHighlightColor=Warnung-Zeilen Hervorhebungsfarbe: +settings.additionalSeveritiesWarningDesc=Semikolon getrennte Liste von zusätzlichen Warnungs-Schweregraden z.B. '10, 100' +settings.weakWarningTextColor=Weak-Warnung Textfarbe: +settings.weakWarningLabelBorderColor=Weak-Warnung Label Randfarbe: +settings.weakWarningLineHighlightColor=Weak-Warnung Zeilen Hervorhebungsfarbe: +settings.additionalSeveritiesWeakWarningDesc=Semikolon getrennte Liste von zusätzlichen Weak-Warnungs-Schweregraden z.B. '10, 100' +settings.infoTextColor=Info Textfarbe: +settings.infoLabelBorderColor=Info-Label Randfarbe: +settings.infoLineHighlightColor=Info-Zeilen Hervorhebungsfarbe: +settings.additionalSeveritiesInfoDesc=Semikolon getrennte Liste von zusätzlichen Info-Schweregraden z.B. '10, 100' +settings.forceProblemsInOneLine=Zwinge Probleme in die gleiche Zeile, auch wenn sie zu lang sind um zu passen +settings.useEditorFont=Editor-Schriftart statt der Tooltip-Schriftart verwenden +settings.showOnlyHighestPerLine=Nur das Problem mit dem höchsten Schweregrad pro Zeile anzeigen \ No newline at end of file diff --git a/src/main/resources/messages/SettingsBundle_en.properties b/src/main/resources/messages/SettingsBundle_en.properties index 98e1f9e..1ef7387 100644 --- a/src/main/resources/messages/SettingsBundle_en.properties +++ b/src/main/resources/messages/SettingsBundle_en.properties @@ -10,42 +10,42 @@ settings.showWeakWarningsInGutter=Show weak warning icons in gutter settings.showInfos=Show infos settings.highlightInfos=Highlight infos settings.showInfosInGutter=Show info icons in gutter -settings.boxOrLabel=Box / Label +settings.submenu.label=Box / Label settings.drawBoxesAroundProblemLabels=Draw boxes around problem labels settings.roundedCornerBoxes=Rounded corners settings.fillProblemLabels=Fill problem label background settings.boldProblemLabels=Bold problem labels settings.italicProblemLabels=Italic problem labels -settings.general=General -settings.enabledProblemListener=Enabled problem listener +settings.submenu.general=General +settings.activeProblemListener=Enabled problem listener settings.markupModelListenerDescription=- MarkupModelListener (default): Called after addition of a RangeHighlighter to a file. Faster on large files, slower on small ones. settings.highlightProblemListenerDescription=- HighlightProblemListener: Faster on small to medium sized files, slower on large ones. Called very often and can cause slowdowns. settings.manualScannerDescription=- ManualScanner: Scans the DocumentMarkupModel for all highlighters at a fixed delay, uses the same logic settings.manualScannerDescriptionSupplement= as HighlightProblemListener but can help with slowdowns on big files. settings.manualScannerDelayLabel=ManualScanner delay in milliseconds -settings.delayBetweenToolTip=Delay between manual scans, only used when ManualScanner is enabled +settings.manualScannerDelayTooltip=Delay between manual scans, only used when ManualScanner is enabled settings.inlaySizeDelta=Inlay size delta -settings.usedToHaveToolTip=Used to have smaller font size for the inlays, should be smaller than editor font size +settings.inlaySizeDeltaTooltip=Used to have smaller font size for the inlays, should be smaller than editor font size settings.problemFilterListLabel=Problem filter list -settings.semicolonSeparatedToolTip=Semicolon separated list of problem text beginnings that will not be handled -settings.colors=Colors +settings.problemFilterListTooltip=Semicolon separated list of problem text beginnings that will not be handled +settings.submenu.colors=Colors settings.errorTextColor=Error text color: settings.errorLabelBorderColor=Error label border color: settings.errorLineHighlightColor=Error line highlight color: settings.additionalSeverities=Additional severities: -settings.semicolonError=Semicolon separated list of additional error severities e.g. '10, 100' +settings.additionalSeveritiesErrorDesc=Semicolon separated list of additional error severities e.g. '10, 100' settings.warningTextColor=Warning text color: settings.warningLabelBorderColor=Warning label border color: settings.warningLineHighlightColor=Warning line highlight color: -settings.semicolonWarning=Semicolon separated list of additional warning severities e.g. '10, 100' +settings.additionalSeveritiesWarningDesc=Semicolon separated list of additional warning severities e.g. '10, 100' settings.weakWarningTextColor=Weak warning text color: settings.weakWarningLabelBorderColor=Weak warning label border color: settings.weakWarningLineHighlightColor=Weak warning line highlight color: -settings.semicolonWeakWarning=Semicolon separated list of additional weak-warning severities e.g. '10, 100' +settings.additionalSeveritiesWeakWarningDesc=Semicolon separated list of additional weak-warning severities e.g. '10, 100' settings.infoTextColor=Info text color: settings.infoLabelBorderColor=Info label border color: settings.infoLineHighlightColor=Info line highlight color: -settings.semicolon=Semicolon separated list of additional info severities e.g. '10, 100' -settings.forceProblemsIn=Force problems in the same line even if they are too long to fit +settings.additionalSeveritiesInfoDesc=Semicolon separated list of additional info severities e.g. '10, 100' +settings.forceProblemsInOneLine=Force problems in the same line even if they are too long to fit settings.useEditorFont=Use editor font instead of tooltip font settings.showOnlyHighestPerLine=Show only the problem with the highest severity per line \ No newline at end of file diff --git a/src/main/resources/messages/SettingsBundle_zh_CN.properties b/src/main/resources/messages/SettingsBundle_zh_CN.properties index e5e2fc8..5b1cae2 100644 --- a/src/main/resources/messages/SettingsBundle_zh_CN.properties +++ b/src/main/resources/messages/SettingsBundle_zh_CN.properties @@ -6,42 +6,42 @@ settings.showWeakWarnings=\u663E\u793A\u8F7B\u5F31\u8B66\u544A settings.highlightWeakWarnings=\u7A81\u51FA\u663E\u793A\u8F7B\u5F31\u8B66\u544A settings.showInfos=\u663E\u793A\u4FE1\u606F settings.highlightInfos=\u7A81\u51FA\u663E\u793A\u4FE1\u606F -settings.boxOrLabel=\u8fb9\u6846 / \u6807\u7B7E +settings.submenu.label=\u8fb9\u6846 / \u6807\u7B7E settings.drawBoxesAroundProblemLabels=\u5728\u95ee\u9898\u6807\u7b7e\u5468\u56f4\u7ed8\u5236\u8fb9\u6846 settings.roundedCornerBoxes=\u5706\u89d2\u8fb9\u6846 settings.fillProblemLabels=\u586B\u5145\u95EE\u9898\u6807\u7B7E\u80CC\u666F settings.boldProblemLabels=\u52a0\u7c97\u95ee\u9898\u6807\u7b7e settings.italicProblemLabels=\u659C\u4F53\u95EE\u9898\u6807\u7B7E -settings.general=\u901A\u7528 -settings.enabledProblemListener=\u542F\u7528\u7684\u95EE\u9898\u76D1\u542C\u5668 +settings.submenu.general=\u901A\u7528 +settings.activeProblemListener=\u542F\u7528\u7684\u95EE\u9898\u76D1\u542C\u5668 settings.markupModelListenerDescription=- MarkupModelListener\uFF08\u9ED8\u8BA4\uFF09\uFF1A\u5728\u6587\u4EF6\u6DFB\u52A0 RangeHighlighter \u540E\u8C03\u7528\u3002\u5927\u6587\u4EF6\u4E2D\u66F4\u5FEB\uFF0C\u5C0F\u6587\u4EF6\u4E2D\u66F4\u6162\u3002 settings.highlightProblemListenerDescription=- HighlightProblemListener\uFF1A\u5C0F\u5230\u4E2D\u7B49\u5927\u5C0F\u7684\u6587\u4EF6\u66F4\u5FEB\uFF0C\u5927\u6587\u4EF6\u66F4\u6162\u3002\u8C03\u7528\u975E\u5E38\u9891\u7E41\uFF0C\u53EF\u80FD\u5BFC\u81F4\u901F\u5EA6\u653E\u6162\u3002 settings.manualScannerDescription=- ManualScanner\uFF1A\u4EE5\u56FA\u5B9A\u7684\u5EF6\u8FDF\u626B\u63CF DocumentMarkupModel \u4E2D\u7684\u6240\u6709\u9AD8\u4EAE\u6807\u8BB0\uFF0C\u4F7F\u7528\u76F8\u540C\u7684\u903B\u8F91\u3002 settings.manualScannerDescriptionSupplement= \u540C HighlightProblemListener\uFF0C\u4F46\u53EF\u4EE5\u5E2E\u52A9\u5904\u7406\u5927\u6587\u4EF6\u4E2D\u7684\u653E\u6162\u901F\u5EA6\u3002 settings.manualScannerDelayLabel=ManualScanner \u4EE5\u6BEB\u79D2\u4E3A\u5355\u4F4D\u7684\u5EF6\u8FDF -settings.delayBetweenToolTip=\u624B\u52A8\u626B\u63CF\u95F4\u7684\u5EF6\u8FDF\uFF0C\u4EC5\u5728\u542F\u7528 ManualScanner \u65F6\u4F7F\u7528 +settings.manualScannerDelayTooltip=\u624B\u52A8\u626B\u63CF\u95F4\u7684\u5EF6\u8FDF\uFF0C\u4EC5\u5728\u542F\u7528 ManualScanner \u65F6\u4F7F\u7528 settings.inlaySizeDelta=\u5b57\u4f53\u5927\u5c0f\u5dee\u5f02 -settings.usedToHaveToolTip=\u7528\u4e8e\u4e3a\u6807\u7b7e\u8bbe\u7f6e\u8f83\u5c0f\u7684\u5b57\u4f53\uff0c\u5fc5\u987b\u5c0f\u4e8e\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f +settings.inlaySizeDeltaTooltip=\u7528\u4e8e\u4e3a\u6807\u7b7e\u8bbe\u7f6e\u8f83\u5c0f\u7684\u5b57\u4f53\uff0c\u5fc5\u987b\u5c0f\u4e8e\u7f16\u8f91\u5668\u5b57\u4f53\u5927\u5c0f settings.problemFilterListLabel=\u95ee\u9898\u8fc7\u6ee4\u5217\u8868 -settings.semicolonSeparatedToolTip=\u4e0d\u5904\u7406\u7684\u95ee\u9898\u6587\u672c\u5f00\u5934\u7684\u7528\u5206\u53f7\u5206\u9694\u7684\u5217\u8868 -settings.colors=\u989C\u8272 +settings.problemFilterListTooltip=\u4e0d\u5904\u7406\u7684\u95ee\u9898\u6587\u672c\u5f00\u5934\u7684\u7528\u5206\u53f7\u5206\u9694\u7684\u5217\u8868 +settings.submenu.colors=\u989C\u8272 settings.errorTextColor=\u9519\u8BEF\u6587\u672C\u989C\u8272\uFF1A settings.errorLabelBorderColor=\u9519\u8BEF\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A settings.errorLineHighlightColor=\u9519\u8BEF\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A settings.additionalSeverities=\u9644\u52A0\u4E25\u91CD\u6027\uFF1A -settings.semicolonError=\u9644\u52A0\u9519\u8BEF\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.additionalSeveritiesErrorDesc=\u9644\u52A0\u9519\u8BEF\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' settings.warningTextColor=\u8B66\u544A\u6587\u672C\u989C\u8272\uFF1A settings.warningLabelBorderColor=\u8B66\u544A\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A settings.warningLineHighlightColor=\u8B66\u544A\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A -settings.semicolonWarning=\u9644\u52A0\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.additionalSeveritiesWarningDesc=\u9644\u52A0\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' settings.weakWarningTextColor=\u8F7B\u5F31\u8B66\u544A\u6587\u672C\u989C\u8272\uFF1A settings.weakWarningLabelBorderColor=\u8F7B\u5F31\u8B66\u544A\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A settings.weakWarningLineHighlightColor=\u8F7B\u5F31\u8B66\u544A\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A -settings.semicolonWeakWarning=\u9644\u52A0\u8F7B\u5F31\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.additionalSeveritiesWeakWarningDesc=\u9644\u52A0\u8F7B\u5F31\u8B66\u544A\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' settings.infoTextColor=\u4FE1\u606F\u6587\u672C\u989C\u8272\uFF1A settings.infoLabelBorderColor=\u4FE1\u606F\u6807\u7B7E\u8FB9\u6846\u989C\u8272\uFF1A settings.infoLineHighlightColor=\u4FE1\u606F\u884C\u7A81\u51FA\u663E\u793A\u989C\u8272\uFF1A -settings.semicolon=\u9644\u52A0\u4FE1\u606F\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' -settings.forceProblemsIn=\u5F3A\u5236\u5728\u540C\u4E00\u884C\u663E\u793A\u95EE\u9898\uFF0C\u5373\u4F7F\u5B83\u4EEC\u592A\u957F\u800C\u65E0\u6CD5\u9002\u5E94 +settings.additionalSeveritiesInfoDesc=\u9644\u52A0\u4FE1\u606F\u4E25\u91CD\u6027\u7684\u7528\u5206\u53F7\u5206\u9694\u7684\u5217\u8868\uFF0C\u4F8B\u5982 '10, 100' +settings.forceProblemsInOneLine=\u5F3A\u5236\u5728\u540C\u4E00\u884C\u663E\u793A\u95EE\u9898\uFF0C\u5373\u4F7F\u5B83\u4EEC\u592A\u957F\u800C\u65E0\u6CD5\u9002\u5E94 settings.useEditorFont=\u4F7F\u7528\u7F16\u8F91\u5668\u5B57\u4F53\u800C\u4E0D\u662F\u63D0\u793A\u5B57\u4F53 settings.showOnlyHighestPerLine=\u4ec5\u663e\u793a\u6bcf\u884c\u4e2d\u6700\u4e25\u91cd\u7684\u95ee\u9898 \ No newline at end of file From cb709e816d39a8530cebf499d34f927387abae0b Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Thu, 24 Aug 2023 20:30:58 +0200 Subject: [PATCH 11/18] Update CHANGELOG.md and gradle.properties (bump version) --- CHANGELOG.md | 4 +++- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a71a18..1381334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,13 @@ # InlineProblems Changelog -## [Unreleased] +## [0.5.0] ### Added - Gutter icon support (disabled by default) - Notification when a Unity project is opened in Rider, and it switches to the ManualScan listener +- Chinese translation (thanks to kuweiguge) +- German translation ### Fixed - AlreadyDisposedException in HighlightProblemListener diff --git a/gradle.properties b/gradle.properties index 9b98eb6..8a73259 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ pluginGroup = org.OverEngineer pluginName = InlineProblems pluginRepositoryUrl = https://github.com/OverEngineer/InlineProblems # SemVer format -> https://semver.org -pluginVersion = 0.4.3 +pluginVersion = 0.5.0 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 212.5 From fb4e3be0a4aea80f8a8ff530d3b6a8c73b035b04 Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 25 Aug 2023 14:49:13 +0200 Subject: [PATCH 12/18] Fixes changelog --- .idea/modules.xml | 10 ---------- CHANGELOG.md | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 66b27e2..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1381334..ffa68f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ # InlineProblems Changelog +## [Unreleased] + ## [0.5.0] ### Added From 01cd28e4270a4bd0387b5b75ca117b6419b0c18d Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 26 Aug 2023 09:37:32 +0200 Subject: [PATCH 13/18] Fixes a possible null pointer exception --- .../inlineproblems/listeners/MarkupModelProblemListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/overengineer/inlineproblems/listeners/MarkupModelProblemListener.java b/src/main/java/org/overengineer/inlineproblems/listeners/MarkupModelProblemListener.java index 5b0c646..655a7b4 100644 --- a/src/main/java/org/overengineer/inlineproblems/listeners/MarkupModelProblemListener.java +++ b/src/main/java/org/overengineer/inlineproblems/listeners/MarkupModelProblemListener.java @@ -94,7 +94,7 @@ private void handleEvent(EventType type, @NotNull RangeHighlighterEx highlighter Editor editor = textEditor.getEditor(); - if (editor.isDisposed() || editor.getProject().isDisposed() || !editor.getProject().isInitialized() || textEditor.getFile() == null) + if (editor.isDisposed() || editor.getProject() == null || editor.getProject().isDisposed() || !editor.getProject().isInitialized() || textEditor.getFile() == null) return; int lineCount = editor.getDocument().getLineCount(); From ced09b38e5960635522b174fa8abaf3231557610 Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 26 Aug 2023 17:57:56 +0200 Subject: [PATCH 14/18] Try to fix qodana with the plugin-template upstream stuff --- .github/workflows/build.yml | 39 +++++++++++++++++++++++++++++++++---- qodana.yml | 4 +++- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad72c50..41895cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,10 +105,6 @@ jobs: name: pluginVerifier-result path: ${{ github.workspace }}/build/reports/pluginVerifier - # Run Qodana inspections - - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v2022.3.4 - # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact id: artifact @@ -127,6 +123,41 @@ jobs: name: ${{ steps.artifact.outputs.filename }} path: ./build/distributions/content/*/* + # Run Qodana inspections and provide report + inspectCode: + name: Inspect code + needs: [ build ] + runs-on: ubuntu-latest + permissions: + contents: write + checks: write + pull-requests: write + steps: + + # Free GitHub Actions Environment Disk Space + - name: Maximize Build Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + large-packages: false + + # Check out current repository + - name: Fetch Sources + uses: actions/checkout@v3 + + # Set up Java environment for the next steps + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 17 + + # Run Qodana inspections + - name: Qodana - Code Inspection + uses: JetBrains/qodana-action@v2023.2.1 + with: + cache-default-branch-only: true + # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered releaseDraft: diff --git a/qodana.yml b/qodana.yml index d7c5065..de9b051 100644 --- a/qodana.yml +++ b/qodana.yml @@ -2,9 +2,11 @@ # https://www.jetbrains.com/help/qodana/qodana-yaml.html version: 1.0 +linter: jetbrains/qodana-jvm-community:latest +projectJDK: 17 profile: name: qodana.recommended exclude: - name: All paths: - - .qodana + - .qodana \ No newline at end of file From cdc3e25e6af6e92680c8fc40f12fef8f536af11a Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 26 Aug 2023 19:36:21 +0200 Subject: [PATCH 15/18] Fixes qodana jvm version --- qodana.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qodana.yml b/qodana.yml index de9b051..d5d5205 100644 --- a/qodana.yml +++ b/qodana.yml @@ -3,7 +3,7 @@ version: 1.0 linter: jetbrains/qodana-jvm-community:latest -projectJDK: 17 +projectJDK: 11 profile: name: qodana.recommended exclude: From 53fbc1c7af635431b875602c5dfe499de3010691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=A8=81?= Date: Mon, 28 Aug 2023 10:24:34 +0800 Subject: [PATCH 16/18] Add gutter display settings in Chinese locale New settings were added to the SettingsBundle_zh_CN.properties file to allow users to enable or disable the display of errors, warnings, weak warnings, and information in the gutter area of the user interface. This was made to enhance user experience and better support localization in the Chinese(text) version of the application --- src/main/resources/messages/SettingsBundle_zh_CN.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/messages/SettingsBundle_zh_CN.properties b/src/main/resources/messages/SettingsBundle_zh_CN.properties index 5b1cae2..c74d3fa 100644 --- a/src/main/resources/messages/SettingsBundle_zh_CN.properties +++ b/src/main/resources/messages/SettingsBundle_zh_CN.properties @@ -1,11 +1,15 @@ settings.showErrors=\u663E\u793A\u9519\u8BEF settings.highlightErrors=\u7A81\u51FA\u663E\u793A\u9519\u8BEF +settings.showErrorsInGutter=\u5728\u88c5\u8ba2\u533a\u57df\u663e\u793a\u9519\u8bef\u56fe\u6807 settings.showWarnings=\u663E\u793A\u8B66\u544A settings.highlightWarnings=\u7A81\u51FA\u663E\u793A\u8B66\u544A +settings.showWarningsInGutter=\u5728\u88c5\u8ba2\u533a\u57df\u663e\u793a\u8b66\u544a\u56fe\u6807 settings.showWeakWarnings=\u663E\u793A\u8F7B\u5F31\u8B66\u544A settings.highlightWeakWarnings=\u7A81\u51FA\u663E\u793A\u8F7B\u5F31\u8B66\u544A +settings.showWeakWarningsInGutter=\u5728\u88c5\u8ba2\u533a\u57df\u663e\u793a\u5f31\u8b66\u544a\u56fe\u6807 settings.showInfos=\u663E\u793A\u4FE1\u606F settings.highlightInfos=\u7A81\u51FA\u663E\u793A\u4FE1\u606F +settings.showInfosInGutter=\u5728\u88c5\u8ba2\u533a\u57df\u663e\u793a\u4fe1\u606f\u56fe\u6807 settings.submenu.label=\u8fb9\u6846 / \u6807\u7B7E settings.drawBoxesAroundProblemLabels=\u5728\u95ee\u9898\u6807\u7b7e\u5468\u56f4\u7ed8\u5236\u8fb9\u6846 settings.roundedCornerBoxes=\u5706\u89d2\u8fb9\u6846 From 79963607c48e4920bbe26b9a4d7446204deb40d1 Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Tue, 12 Sep 2023 09:42:07 +0200 Subject: [PATCH 17/18] Removes german translation again, devs should use english ^^ --- CHANGELOG.md | 1 - .../messages/SettingsBundle_de.properties | 51 ------------------- 2 files changed, 52 deletions(-) delete mode 100644 src/main/resources/messages/SettingsBundle_de.properties diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa68f7..e0f4640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ - Gutter icon support (disabled by default) - Notification when a Unity project is opened in Rider, and it switches to the ManualScan listener - Chinese translation (thanks to kuweiguge) -- German translation ### Fixed - AlreadyDisposedException in HighlightProblemListener diff --git a/src/main/resources/messages/SettingsBundle_de.properties b/src/main/resources/messages/SettingsBundle_de.properties deleted file mode 100644 index 7718939..0000000 --- a/src/main/resources/messages/SettingsBundle_de.properties +++ /dev/null @@ -1,51 +0,0 @@ -settings.showErrors=Errors anzeigen -settings.highlightErrors=Error hervorheben -settings.showErrorsInGutter=Error icons im Gutter anzeigen -settings.showWarnings=Warnings anzeigen -settings.highlightWarnings=Warnings hervorheben -settings.showWarningsInGutter=Warning icons im Gutter anzeigen -settings.showWeakWarnings=Weak warnings anzeigen -settings.highlightWeakWarnings=Weak warnings hervorheben -settings.showWeakWarningsInGutter=Weak warning icons im Gutter anzeigen -settings.showInfos=Infos anzeigen -settings.highlightInfos=Infos hervorheben -settings.showInfosInGutter=Info icons im Gutter anzeigen -settings.submenu.label=Box / Label -settings.drawBoxesAroundProblemLabels=Problem-Label Box-Effekt -settings.roundedCornerBoxes=Abgerundete Ecken -settings.fillProblemLabels=Problem-Label Box füllen -settings.boldProblemLabels=Fett gedruckte Problem-Labels -settings.italicProblemLabels=Kursiv gedruckte Problem-Labels -settings.submenu.general=Allgemein -settings.activeProblemListener=Aktiver Problem-Listener -settings.markupModelListenerDescription=- MarkupModelListener (standard): Wird nach dem Hinzufügen eines RangeHighlighters zu einer Datei aufgerufen. Schneller bei großen Dateien, langsamer bei kleinen. -settings.highlightProblemListenerDescription=- HighlightProblemListener: Schneller bei kleinen bis mittelgroßen Dateien, langsamer bei großen. Wird sehr oft aufgerufen und kann zu Verlangsamungen führen. -settings.manualScannerDescription=- ManualScanner: Scannt das DocumentMarkupModel nach allen Highlightern mit einer fixen Verzögerung zwischen den aufrufen, verwendet die gleiche Logik -settings.manualScannerDescriptionSupplement= wie der HighlightProblemListener, ist aber schneller bei großen Dateien. -settings.manualScannerDelayLabel=ManualScanner verzögerung in Millisekunden -settings.manualScannerDelayTooltip=Verzögerung zwischen den manuellen Scans wird nur verwendet, wenn der ManualScanner aktiviert ist -settings.inlaySizeDelta=Label größen Delta -settings.inlaySizeDeltaTooltip=Wird zum Verkleinern der Schriftgröße der Inlays verwendet, sollte kleiner als die Editor-Schriftgröße sein -settings.problemFilterListLabel=Problem Filterliste -settings.problemFilterListTooltip=Semikolon getrennte Liste von Problemtext-Anfängen, die nicht ignoriert werden sollen -settings.submenu.colors=Farben -settings.errorTextColor=Error Textfarbe: -settings.errorLabelBorderColor=Error-Label Randfarbe: -settings.errorLineHighlightColor=Error-Zeilen Hervorhebungsfarbe: -settings.additionalSeverities=Zusätzliche Schweregrade: -settings.additionalSeveritiesErrorDesc=Semikolon getrennte Liste von zusätzlichen Error-Schweregraden z.B. '10, 100' -settings.warningTextColor=Warnung Textfarbe: -settings.warningLabelBorderColor=Warnung-Label Randfarbe: -settings.warningLineHighlightColor=Warnung-Zeilen Hervorhebungsfarbe: -settings.additionalSeveritiesWarningDesc=Semikolon getrennte Liste von zusätzlichen Warnungs-Schweregraden z.B. '10, 100' -settings.weakWarningTextColor=Weak-Warnung Textfarbe: -settings.weakWarningLabelBorderColor=Weak-Warnung Label Randfarbe: -settings.weakWarningLineHighlightColor=Weak-Warnung Zeilen Hervorhebungsfarbe: -settings.additionalSeveritiesWeakWarningDesc=Semikolon getrennte Liste von zusätzlichen Weak-Warnungs-Schweregraden z.B. '10, 100' -settings.infoTextColor=Info Textfarbe: -settings.infoLabelBorderColor=Info-Label Randfarbe: -settings.infoLineHighlightColor=Info-Zeilen Hervorhebungsfarbe: -settings.additionalSeveritiesInfoDesc=Semikolon getrennte Liste von zusätzlichen Info-Schweregraden z.B. '10, 100' -settings.forceProblemsInOneLine=Zwinge Probleme in die gleiche Zeile, auch wenn sie zu lang sind um zu passen -settings.useEditorFont=Editor-Schriftart statt der Tooltip-Schriftart verwenden -settings.showOnlyHighestPerLine=Nur das Problem mit dem höchsten Schweregrad pro Zeile anzeigen \ No newline at end of file From 502d3bf143d4d39ac18912c68018cda604b0781e Mon Sep 17 00:00:00 2001 From: 0verEngineer Date: Tue, 12 Sep 2023 09:45:48 +0200 Subject: [PATCH 18/18] Update compiler.xml, misc.xml, and resourceBundles.xml --- .idea/compiler.xml | 2 +- .idea/misc.xml | 1 - .idea/resourceBundles.xml | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 2e83dce..5e1b002 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -7,8 +7,8 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 24fff94..f91b516 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/resourceBundles.xml b/.idea/resourceBundles.xml index 239abb2..3123738 100644 --- a/.idea/resourceBundles.xml +++ b/.idea/resourceBundles.xml @@ -1,11 +1,9 @@ - - SettingsBundle