Skip to content

Commit ce5c724

Browse files
authored
Merge pull request #1002 from SeeSharpSoft/rel422
Rel422
2 parents fe3bc9f + 2862c33 commit ce5c724

5 files changed

Lines changed: 16 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
### Fixed
1212

13+
## 4.2.2 - Jun 21, 2026
14+
15+
### Changed
16+
17+
- replaced deprecated function ReadAction.compute(ThrowableComputable)
18+
- replaced internal function PluginManagerCore.getPlugin(PluginId)
19+
1320
## 4.2.1 - May 24, 2026
1421

1522
### Fixed

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.1
7+
pluginVersion=4.2.2
88

99
pluginSinceBuild=242
1010

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.intellij.DynamicBundle;
44
import com.intellij.ide.plugins.IdeaPluginDescriptor;
5-
import com.intellij.ide.plugins.PluginManagerCore;
5+
import com.intellij.ide.plugins.PluginManager;
66
import com.intellij.openapi.extensions.PluginId;
77

88
import java.util.ResourceBundle;
@@ -22,7 +22,7 @@ public static String getLocalizedText(String token) {
2222
}
2323

2424
public static IdeaPluginDescriptor getPluginDescriptor() {
25-
return PluginManagerCore.getPlugin(PluginId.getId("net.seesharpsoft.intellij.plugins.csv"));
25+
return PluginManager.getInstance().findEnabledPlugin(PluginId.getId("net.seesharpsoft.intellij.plugins.csv"));
2626
}
2727

2828
public static String getVersion() {

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/CsvTableEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,14 @@ public final CsvFile getCsvFile() {
227227
}
228228
} else {
229229
// Off EDT it is safe to resolve PSI
230-
this.psiFile = ReadAction.compute(() -> {
230+
this.psiFile = ReadAction.nonBlocking(() -> {
231231
if (this.document == null) {
232232
this.document = FileDocumentManager.getInstance().getDocument(this.file);
233233
}
234234
if (this.document == null) return null;
235235
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
236236
return documentManager.getPsiFile(this.document);
237-
});
237+
}).executeSynchronously();
238238
}
239239

240240
if (this.psiFile != null) {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public LanguageCodeStyleSettingsProvider.SettingsType getSettingsType() {
9797
// Defensive: PSI might be invalidated by the time the settings UI triggers reformat.
9898
// Guard against invalid files and run inside a read action to avoid race conditions.
9999
try {
100-
return com.intellij.openapi.application.ReadAction.compute(() -> {
100+
return com.intellij.openapi.application.ReadAction.nonBlocking(() -> {
101101
if (!psiFile.isValid()) {
102102
return psiFile;
103103
}
@@ -110,7 +110,9 @@ public LanguageCodeStyleSettingsProvider.SettingsType getSettingsType() {
110110
}
111111
CodeStyleManager.getInstance(project).reformatText(psiFile, 0, endOffset);
112112
return psiFile;
113-
});
113+
}).executeSynchronously();
114+
} catch (com.intellij.openapi.progress.ProcessCanceledException e) {
115+
throw e;
114116
} catch (Throwable ignored) {
115117
// As a last resort, do nothing to avoid PluginException surfacing to users.
116118
return psiFile;

0 commit comments

Comments
 (0)