Skip to content
Merged

Rel422 #1002

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

### Fixed

## 4.2.2 - Jun 21, 2026

### Changed

- replaced deprecated function ReadAction.compute(ThrowableComputable)
- replaced internal function PluginManagerCore.getPlugin(PluginId)

## 4.2.1 - May 24, 2026

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

pluginName=CSV Editor
pluginId=net.seesharpsoft.intellij.plugins.csv
pluginVersion=4.2.1
pluginVersion=4.2.2

pluginSinceBuild=242

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.intellij.DynamicBundle;
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManagerCore;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.openapi.extensions.PluginId;

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

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

public static String getVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,14 @@ public final CsvFile getCsvFile() {
}
} else {
// Off EDT it is safe to resolve PSI
this.psiFile = ReadAction.compute(() -> {
this.psiFile = ReadAction.nonBlocking(() -> {
if (this.document == null) {
this.document = FileDocumentManager.getInstance().getDocument(this.file);
}
if (this.document == null) return null;
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(project);
return documentManager.getPsiFile(this.document);
});
}).executeSynchronously();
}

if (this.psiFile != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public LanguageCodeStyleSettingsProvider.SettingsType getSettingsType() {
// Defensive: PSI might be invalidated by the time the settings UI triggers reformat.
// Guard against invalid files and run inside a read action to avoid race conditions.
try {
return com.intellij.openapi.application.ReadAction.compute(() -> {
return com.intellij.openapi.application.ReadAction.nonBlocking(() -> {
if (!psiFile.isValid()) {
return psiFile;
}
Expand All @@ -110,7 +110,9 @@ public LanguageCodeStyleSettingsProvider.SettingsType getSettingsType() {
}
CodeStyleManager.getInstance(project).reformatText(psiFile, 0, endOffset);
return psiFile;
});
}).executeSynchronously();
} catch (com.intellij.openapi.progress.ProcessCanceledException e) {
throw e;
} catch (Throwable ignored) {
// As a last resort, do nothing to avoid PluginException surfacing to users.
return psiFile;
Expand Down
Loading