diff --git a/.github/workflows/PublishStable.yml b/.github/workflows/PublishStable.yml index b1652f12..14157a90 100644 --- a/.github/workflows/PublishStable.yml +++ b/.github/workflows/PublishStable.yml @@ -21,6 +21,7 @@ jobs: - ideaVersion: 2023.1.1 - ideaVersion: 2023.2.1 - ideaVersion: 2023.3.1 + - ideaVersion: 2024.1.1 - ideaVersion: LATEST-EAP-SNAPSHOT steps: diff --git a/.github/workflows/PullRequest.yml b/.github/workflows/PullRequest.yml index 53393b72..4e339367 100644 --- a/.github/workflows/PullRequest.yml +++ b/.github/workflows/PullRequest.yml @@ -16,11 +16,11 @@ jobs: fail-fast: false matrix: include: - - ideaVersion: 2022.2.1 - ideaType: PS - ideaVersion: 2022.2.3 ideaType: PY - ideaVersion: 2023.3.1 + ideaType: PS + - ideaVersion: 2024.2.1 ideaType: IC steps: diff --git a/CHANGELOG b/CHANGELOG index 72d538ea..4946bd46 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +3.4.0 +Aug 10, 2024 + +CHORE: Update gradle build +FIX: ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon +FIX: Cannot create class CsvEditorSettingsProvider + 3.3.0 Feb 24, 2024 diff --git a/build.gradle b/build.gradle index c47e33cb..4f6aee57 100644 --- a/build.gradle +++ b/build.gradle @@ -8,16 +8,6 @@ plugins { id 'org.jetbrains.grammarkit' version '2022.3.2.2' } -jacoco { - toolVersion = "0.8.8" -} - -jacocoTestReport { - reports { - xml.enabled true - } -} - group 'net.seesharpsoft.intellij.plugins' apply plugin: 'java' @@ -67,19 +57,19 @@ idea { } var final EAP_VERSION = 'LATEST-EAP-SNAPSHOT' -var final EAP_BUILD = '241' +var final EAP_BUILD = '242' -var final DEFAULT_VERSION = '2022.2.1' //'LATEST-EAP-SNAPSHOT' // +var final LATEST_SUPPORTED_VERSION = '2024.1.5' //EAP_VERSION // IDE version - https://www.jetbrains.com/intellij-repository/releases -var idea_version = System.getenv().getOrDefault('IDEA_VERSION', DEFAULT_VERSION) +var idea_version = System.getenv().getOrDefault('IDEA_VERSION', LATEST_SUPPORTED_VERSION) var build_version = idea_version == EAP_VERSION ? EAP_BUILD : idea_version.substring(2, 4) + idea_version.charAt(5) // extract e.g. '221' from '2022.1.1' -version '3.3.0-' + build_version +version '3.4.0-' + build_version apply plugin: 'org.jetbrains.intellij' intellij { - version = idea_version + version = idea_version > LATEST_SUPPORTED_VERSION || idea_version == EAP_VERSION ? LATEST_SUPPORTED_VERSION : idea_version type = System.getenv().getOrDefault('IDEA_TYPE', 'IC') pluginName = 'CSVEditor' updateSinceUntilBuild = true @@ -97,11 +87,8 @@ patchPluginXml { changeNotes = """
CHORE: Update gradle build -FIX: PluginException: xxx ms to call on EDT CsvChangeSeparatorActionGroup#update@EditorPopup #401 -FIX: AlreadyDisposedException: Already disposed #639 -FIX: Exceptions occurred on invoking the intention 'Unquote' on a copy of the file #670 #816 -FIX: StringIndexOutOfBoundsException: begin 0, end -1, length 5993 #801 -FIX: Unhandled exception in [CoroutineName(PsiAwareFileEditorManagerImpl)] #666 +FIX: ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon +FIX: Cannot create class CsvEditorSettingsProvider""" } publishPlugin { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1624c47..171d8761 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java index 031776db..292ae47a 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvGithubIssueSubmitter.java @@ -154,10 +154,10 @@ protected GithubApiRequest createNewIssue(String title, String content) throws I protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException { String needle = title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", ""); - if (needle.length() > 255) { - int endIndex = needle.substring(0, 255).lastIndexOf(" "); + if (needle.length() > 250) { + int endIndex = needle.substring(0, 250).lastIndexOf(" "); if (endIndex == -1) { - endIndex = 255; + endIndex = 250; } needle = needle.substring(0, endIndex); } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/ActionUpdateThreadBGT.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/ActionUpdateThreadBGT.java deleted file mode 100644 index abb0ec4a..00000000 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/ActionUpdateThreadBGT.java +++ /dev/null @@ -1,6 +0,0 @@ -package net.seesharpsoft.intellij.plugins.csv.actions; - -import com.intellij.openapi.actionSystem.ActionUpdateThreadAware; - -public interface ActionUpdateThreadBGT extends ActionUpdateThreadAware.Recursive { -} diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeEscapeCharacterAction.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeEscapeCharacterAction.java index 140889c0..37ef53db 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeEscapeCharacterAction.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeEscapeCharacterAction.java @@ -1,9 +1,6 @@ package net.seesharpsoft.intellij.plugins.csv.actions; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.ToggleAction; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.psi.PsiFile; import com.intellij.util.FileContentUtilCore; @@ -12,7 +9,7 @@ import net.seesharpsoft.intellij.plugins.csv.components.CsvFileAttributes; import org.jetbrains.annotations.NotNull; -public class CsvChangeEscapeCharacterAction extends ToggleAction implements ActionUpdateThreadBGT { +public class CsvChangeEscapeCharacterAction extends ToggleAction implements ActionUpdateThreadAware { private final CsvEscapeCharacter myEscapeCharacter; CsvChangeEscapeCharacterAction(CsvEscapeCharacter escapeCharacter) { @@ -43,4 +40,9 @@ public void setSelected(@NotNull AnActionEvent anActionEvent, boolean selected) fileEditor.selectNotify(); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeSeparatorAction.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeSeparatorAction.java index f9a1efef..97f80411 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeSeparatorAction.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeSeparatorAction.java @@ -1,9 +1,6 @@ package net.seesharpsoft.intellij.plugins.csv.actions; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.ToggleAction; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileTypes.FileType; import com.intellij.psi.PsiFile; @@ -14,7 +11,7 @@ import net.seesharpsoft.intellij.plugins.csv.components.CsvFileAttributes; import org.jetbrains.annotations.NotNull; -public class CsvChangeSeparatorAction extends ToggleAction implements ActionUpdateThreadBGT { +public class CsvChangeSeparatorAction extends ToggleAction implements ActionUpdateThreadAware { private final CsvValueSeparator mySeparator; CsvChangeSeparatorAction(CsvValueSeparator separator) { @@ -50,4 +47,9 @@ public void setSelected(@NotNull AnActionEvent anActionEvent, boolean selected) fileEditor.selectNotify(); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvCustomSeparatorAction.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvCustomSeparatorAction.java index ac9af0a2..dffe5d34 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvCustomSeparatorAction.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvCustomSeparatorAction.java @@ -11,7 +11,7 @@ import javax.swing.*; -public class CsvCustomSeparatorAction extends ToggleAction implements ActionUpdateThreadBGT { +public class CsvCustomSeparatorAction extends ToggleAction implements ActionUpdateThreadAware { CsvCustomSeparatorAction() { super("Custom"); } @@ -54,4 +54,9 @@ public void setSelected(@NotNull AnActionEvent anActionEvent, boolean selected) fileEditor.selectNotify(); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultEscapeCharacterAction.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultEscapeCharacterAction.java index b1f78e62..840fde5f 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultEscapeCharacterAction.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultEscapeCharacterAction.java @@ -8,7 +8,7 @@ import net.seesharpsoft.intellij.plugins.csv.components.CsvFileAttributes; import org.jetbrains.annotations.NotNull; -public class CsvDefaultEscapeCharacterAction extends ToggleAction implements ActionUpdateThreadBGT { +public class CsvDefaultEscapeCharacterAction extends ToggleAction implements ActionUpdateThreadAware { CsvDefaultEscapeCharacterAction() { super("Project Default"); } @@ -36,4 +36,9 @@ public void setSelected(@NotNull AnActionEvent anActionEvent, boolean selected) fileEditor.selectNotify(); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultSeparatorAction.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultSeparatorAction.java index e74b0ac8..ed6d9696 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultSeparatorAction.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvDefaultSeparatorAction.java @@ -8,7 +8,7 @@ import net.seesharpsoft.intellij.plugins.csv.components.CsvFileAttributes; import org.jetbrains.annotations.NotNull; -public class CsvDefaultSeparatorAction extends ToggleAction implements ActionUpdateThreadBGT { +public class CsvDefaultSeparatorAction extends ToggleAction implements ActionUpdateThreadAware { CsvDefaultSeparatorAction() { super("Project Default"); } @@ -36,4 +36,9 @@ public void setSelected(@NotNull AnActionEvent anActionEvent, boolean selected) fileEditor.selectNotify(); } } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvTableEditorActions.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvTableEditorActions.java index a8709ea2..b6b29af1 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvTableEditorActions.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvTableEditorActions.java @@ -1,15 +1,12 @@ package net.seesharpsoft.intellij.plugins.csv.actions; -import com.intellij.openapi.actionSystem.ActionUpdateThreadAware; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.fileEditor.FileEditor; import net.seesharpsoft.intellij.plugins.csv.editor.table.CsvTableActions; import net.seesharpsoft.intellij.plugins.csv.editor.table.CsvTableEditor; import org.jetbrains.annotations.NotNull; -public abstract class CsvTableEditorActions extends AnAction implements ActionUpdateThreadBGT { +public abstract class CsvTableEditorActions extends AnAction implements ActionUpdateThreadAware { public static class AddRowBefore extends CsvTableEditorActions { @Override @@ -79,4 +76,9 @@ public static CsvTableActions getTableActions(@NotNull AnActionEvent anActionEve CsvTableEditor tableEditor = getTableEditor(anActionEvent); return tableEditor == null ? CsvTableActions.DUMMY : tableEditor.getActions(); } + + @Override + public @NotNull ActionUpdateThread getActionUpdateThread() { + return ActionUpdateThread.BGT; + } } diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java index ada01f79..8471d5db 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java @@ -85,10 +85,20 @@ public static final class OptionSet { public ValueColoring VALUE_COLORING = ValueColoring.RAINBOW; public boolean AUTO_DETECT_VALUE_SEPARATOR = true; - public OptionSet() { + private boolean isInitialized = false; + + public OptionSet() {} + + public void init() { + if (this.isInitialized) { + return; + } + EditorSettingsExternalizable editorSettingsExternalizable = EditorSettingsExternalizable.getInstance(); CARET_ROW_SHOWN = editorSettingsExternalizable == null ? true : editorSettingsExternalizable.isCaretRowShown(); USE_SOFT_WRAP = editorSettingsExternalizable == null ? false : editorSettingsExternalizable.isUseSoftWraps(); + + this.isInitialized = true; } } @@ -116,6 +126,7 @@ public void removePropertyChangeListener(PropertyChangeListener listener) { @Override public OptionSet getState() { + this.myOptions.init(); return this.myOptions; } diff --git a/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java index be7fadec..5afef282 100644 --- a/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java +++ b/src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsProviderTest.java @@ -130,6 +130,7 @@ public void testApply() throws ConfigurationException { editorSettingsPanel.apply(); CsvEditorSettings.OptionSet freshOptionSet = new CsvEditorSettings.OptionSet(); + freshOptionSet.init(); assertEquals(false, editorSettingsPanel.isModified()); assertEquals(freshOptionSet.CARET_ROW_SHOWN, csvEditorSettings.isCaretRowShown());