Skip to content

Commit 5b268c7

Browse files
authored
Merge pull request #1006 from SeeSharpSoft/main
Release 4.3.0
2 parents 1bad4f5 + 1c35a63 commit 5b268c7

8 files changed

Lines changed: 74 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@
1010

1111
### Fixed
1212

13-
## 4.2.3 - Jun 21, 2026
14-
15-
### Fixed
16-
17-
- branch code for retrieving plugin info for legacy vs EAP version
18-
19-
## 4.2.2 - Jun 21, 2026
13+
## 4.3.0 - Jun 21, 2026
2014

2115
### Changed
2216

2317
- replaced deprecated function ReadAction.compute(ThrowableComputable)
2418
- replaced internal function PluginManagerCore.getPlugin(PluginId)
25-
26-
## 4.2.1 - May 24, 2026
19+
- branch code for retrieving plugin info for legacy vs EAP version
2720

2821
### Fixed
2922

23+
- Fixed `NoClassDefFoundError` in `CsvEditorSettings`
24+
- Fixed `java.lang.Throwable: ... Class initialization must not depend on services` by removing service access from class initializers and constructors
25+
- Fixed a `PluginException` (caused by `java.lang.IllegalArgumentException`) that occurred during early plugin initialization
3026
- PluginException: Invalid PSI Element CsvFile when file is invalidated during annotation, intention actions, or inspection fixes #964
3127
- IncorrectOperationException: parent CsvTableEditorSwing already disposed when async PsiTreeChangeListener registration completes #962
3228
- Modified `CsvPlugin.openLink` to use `executeOnPooledThread` for setting dialogs #953

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
pluginName=CSV Editor
66
pluginId=net.seesharpsoft.intellij.plugins.csv
7-
pluginVersion=4.2.3
7+
pluginVersion=4.3.0
88

99
pluginSinceBuild=242
1010

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginDescriptorRetriever.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ public final class CsvPluginDescriptorRetriever {
1414
private static final PluginId PLUGIN_ID = PluginId.getId("net.seesharpsoft.intellij.plugins.csv");
1515

1616
public static IdeaPluginDescriptor getPluginDescriptor() {
17-
BuildNumber buildNumber = ApplicationInfo.getInstance().getBuild();
17+
BuildNumber buildNumber = null;
18+
try {
19+
buildNumber = ApplicationInfo.getInstance().getBuild();
20+
} catch (Exception e) {
21+
LOG.debug("Failed to retrieve build number", e);
22+
}
23+
1824
// PluginDetailsService is available from 2026.2, which roughly corresponds to build 262
19-
if (buildNumber.getBaselineVersion() >= 262) {
25+
if (buildNumber != null && buildNumber.getBaselineVersion() >= 262) {
2026
try {
2127
Class<?> serviceClass = Class.forName("com.intellij.ide.plugins.PluginDetailsService");
2228
Method getInstanceMethod = serviceClass.getMethod("getInstance");

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginManager.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public final class CsvPluginManager {
1111

1212
public static ResourceBundle getResourceBundle() {
1313
if (_resourceBundle == null) {
14-
_resourceBundle = DynamicBundle.getPluginBundle(getPluginDescriptor());
14+
IdeaPluginDescriptor descriptor = getPluginDescriptor();
15+
if (descriptor != null) {
16+
_resourceBundle = DynamicBundle.getPluginBundle(descriptor);
17+
} else {
18+
return ResourceBundle.getBundle("localization.CsvEditorResources");
19+
}
1520
}
1621
return _resourceBundle;
1722
}

src/main/java/net/seesharpsoft/intellij/plugins/csv/highlighter/CsvTextAttributeKeys.java

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,36 @@ public final class CsvTextAttributeKeys {
3434
createTextAttributesKey("CSV_BAD_CHARACTER", HighlighterColors.BAD_CHARACTER);
3535

3636
public static final Integer MAX_COLUMN_COLORING_COLORS = 10;
37-
public static final AttributesDescriptor[] DESCRIPTORS;
37+
private static AttributesDescriptor[] DESCRIPTORS = null;
38+
39+
public static AttributesDescriptor[] getDescriptors() {
40+
if (DESCRIPTORS == null) {
41+
List<AttributesDescriptor> attributesDescriptors = new ArrayList<>();
42+
ResourceBundle bundle = getResourceBundle();
43+
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.separator"), CsvTextAttributeKeys.COMMA));
44+
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.quote"), CsvTextAttributeKeys.QUOTE));
45+
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.text"), CsvTextAttributeKeys.TEXT));
46+
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.text.escaped"), CsvTextAttributeKeys.ESCAPED_TEXT));
47+
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.comment"), CsvTextAttributeKeys.COMMENT));
48+
49+
for (int i = 0; i < MAX_COLUMN_COLORING_COLORS; ++i) {
50+
TextAttributesKey textAttributesKey = COLUMN_COLORING_ATTRIBUTES.get(i);
51+
attributesDescriptors.add(new AttributesDescriptor(String.format(bundle.getString("color.attribute.column.nr"), i + 1), textAttributesKey));
52+
}
53+
DESCRIPTORS = attributesDescriptors.toArray(new AttributesDescriptor[0]);
54+
}
55+
return DESCRIPTORS;
56+
}
57+
3858
private static final List<TextAttributesKey> COLUMN_COLORING_ATTRIBUTES;
3959
private static final Key<List<TextAttributes>> COLUMN_COLORING_TEXT_ATTRIBUTES = Key.create("CSV_PLUGIN_COLUMN_COLORING_ATTRIBUTES");
4060

4161
static {
42-
List<AttributesDescriptor> attributesDescriptors = new ArrayList<>();
43-
ResourceBundle bundle = getResourceBundle();
44-
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.separator"), CsvTextAttributeKeys.COMMA));
45-
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.quote"), CsvTextAttributeKeys.QUOTE));
46-
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.text"), CsvTextAttributeKeys.TEXT));
47-
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.text.escaped"), CsvTextAttributeKeys.ESCAPED_TEXT));
48-
attributesDescriptors.add(new AttributesDescriptor(bundle.getString("color.attribute.comment"), CsvTextAttributeKeys.COMMENT));
49-
5062
COLUMN_COLORING_ATTRIBUTES = new ArrayList<>();
5163
for (int i = 0; i < MAX_COLUMN_COLORING_COLORS; ++i) {
5264
TextAttributesKey textAttributesKey = createTextAttributesKey(String.format("CSV_PLUGIN_COLUMN_COLORING_ATTRIBUTE_%d", i), CsvTextAttributeKeys.TEXT);
5365
COLUMN_COLORING_ATTRIBUTES.add(textAttributesKey);
54-
attributesDescriptors.add(new AttributesDescriptor(String.format(bundle.getString("color.attribute.column.nr"), i + 1), textAttributesKey));
5566
}
56-
DESCRIPTORS = attributesDescriptors.toArray(new AttributesDescriptor[0]);
5767
}
5868

5969
public static TextAttributesKey getTextAttributesKeys(int columnIndex) {

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvColorSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Map<String, TextAttributesKey> getAdditionalHighlightingTagToDescriptorMa
4848
@NotNull
4949
@Override
5050
public AttributesDescriptor[] getAttributeDescriptors() {
51-
return CsvTextAttributeKeys.DESCRIPTORS;
51+
return CsvTextAttributeKeys.getDescriptors();
5252
}
5353

5454
@NotNull

src/main/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettings.java

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,33 +42,41 @@ public class CsvEditorSettings implements PersistentStateComponent<CsvEditorSett
4242
private static final CsvEditorSettings STATIC_TEST_INSTANCE = new CsvEditorSettings();
4343

4444
public enum EditorPrio {
45-
TEXT_FIRST(getLocalizedText("settings.editor.prio.text_first")),
46-
TABLE_FIRST(getLocalizedText("settings.editor.prio.table_first")),
47-
TEXT_ONLY(getLocalizedText("settings.editor.prio.text_only"));
48-
49-
private final String label;
50-
51-
private EditorPrio(String label) {
52-
this.label = label;
45+
TEXT_FIRST("settings.editor.prio.text_first"),
46+
TABLE_FIRST("settings.editor.prio.table_first"),
47+
TEXT_ONLY("settings.editor.prio.text_only");
48+
49+
private final String resourceKey;
50+
private String display;
51+
52+
private EditorPrio(String resourceKey) {
53+
this.resourceKey = resourceKey;
5354
}
5455

5556
public String getDisplay() {
56-
return label;
57+
if (display == null) {
58+
display = getLocalizedText(resourceKey);
59+
}
60+
return display;
5761
}
5862
}
5963

6064
public enum ValueColoring {
61-
RAINBOW(getLocalizedText("settings.editor.coloring.rainbow")),
62-
SIMPLE(getLocalizedText("settings.editor.coloring.simple"));
65+
RAINBOW("settings.editor.coloring.rainbow"),
66+
SIMPLE("settings.editor.coloring.simple");
6367

64-
private final String display;
68+
private final String resourceKey;
69+
private String display;
6570

66-
ValueColoring(String displayArg) {
67-
this.display = displayArg;
71+
ValueColoring(String resourceKey) {
72+
this.resourceKey = resourceKey;
6873
}
6974

7075
public String getDisplay() {
71-
return this.display;
76+
if (display == null) {
77+
display = getLocalizedText(this.resourceKey);
78+
}
79+
return display;
7280
}
7381
}
7482

src/test/java/net/seesharpsoft/intellij/plugins/csv/settings/CsvEditorSettingsTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@ public void testDefaultEscapeCharacter() {
2121

2222
assertEquals(CsvEditorSettings.ESCAPE_CHARACTER_DEFAULT, CsvHelper.getEscapeCharacter(myFixture.getFile()));
2323
}
24+
25+
public void testGetDisplayDoesNotThrow() {
26+
for (CsvEditorSettings.EditorPrio prio : CsvEditorSettings.EditorPrio.values()) {
27+
assertNotNull(prio.getDisplay());
28+
}
29+
for (CsvEditorSettings.ValueColoring coloring : CsvEditorSettings.ValueColoring.values()) {
30+
assertNotNull(coloring.getDisplay());
31+
}
32+
}
2433
}

0 commit comments

Comments
 (0)