Skip to content
Open
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: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@

### Fixed

- PluginException: Invalid PSI Element CsvFile when file is invalidated during annotation, intention actions, or inspection fixes
- IncorrectOperationException: parent CsvTableEditorSwing already disposed when async PsiTreeChangeListener registration completes
- PluginException: Invalid PSI Element CsvFile when file is invalidated during annotation, intention actions, or inspection fixes #964
- IncorrectOperationException: parent CsvTableEditorSwing already disposed when async PsiTreeChangeListener registration completes #962
- Modified `CsvPlugin.openLink` to use `executeOnPooledThread` for setting dialogs #953
- Modified `CsvEditorSettings.java` to ensure all getter methods access the internal `OptionSet` directly instead of calling `getState()` #954
- GithubStatusCodeException: 422 Unprocessable Entity - Validation Failed during issue submission #920

## 4.2.0 - Jan 26, 2026

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ protected GithubApiRequest<?> createNewIssue(String title, String content) throw
Collections.emptyList());
}

protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException {
protected String searchExistingIssuesNeedle(String title) {
// Create a search needle from the title but ensure it is never null/empty to avoid GitHub 422 (Validation Failed)
String needle = title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", "");
String needle = title == null ? "" : title.replaceAll("\\s*(\\[.*?]|\\(.*?\\)|\\{.*?})\\s*", "");

// If the sanitized title becomes empty (e.g., only brackets present), fall back to the raw title
if (Strings.isEmptyOrSpaces(needle)) {
Expand All @@ -182,6 +182,12 @@ protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, S
if (Strings.isEmptyOrSpaces(needle)) {
needle = "crash";
}
return needle;
}

protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String title, ProgressIndicator progressIndicator) throws IOException {
String needle = searchExistingIssuesNeedle(title);

GithubApiRequest<GithubResponsePage<GithubSearchedIssue>> existingIssueRequest =
GithubApiRequests.Search.Issues.get(
GithubServerPath.DEFAULT_SERVER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ public class CsvPlugin implements ProjectActivity, DumbAware {
private static void openLink(Project project, String link) {
if (project.isDisposed()) return;

ApplicationManager.getApplication().invokeLater(() ->
{
if (link.startsWith("#")) {
ShowSettingsUtil.getInstance().showSettingsDialog(project, link.substring(1));
} else {
BrowserUtil.browse(link, project);
}
});
if (link.startsWith("#")) {
ApplicationManager.getApplication().executeOnPooledThread(() ->
Comment thread
SeeSharpSoft marked this conversation as resolved.
ShowSettingsUtil.getInstance().showSettingsDialog(project, link.substring(1))
);
} else {
ApplicationManager.getApplication().invokeLater(() ->
BrowserUtil.browse(link, project)
);
}
}

public static void doAsyncProjectMaintenance(@NotNull Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public String getDisplay() {
public static final class OptionSet {
public String CURRENT_PLUGIN_VERSION;

public boolean CARET_ROW_SHOWN;
public boolean USE_SOFT_WRAP;
public boolean CARET_ROW_SHOWN = true;
public boolean USE_SOFT_WRAP = false;
public boolean HIGHTLIGHT_TAB_SEPARATOR = true;
public boolean SHOW_INFO_BALLOON = true;
public String TAB_HIGHLIGHT_COLOR = "-7984";
Expand All @@ -100,18 +100,6 @@ public static final class 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;
}
}

private OptionSet myOptions = new OptionSet();
Expand All @@ -138,7 +126,6 @@ public void removePropertyChangeListener(PropertyChangeListener listener) {

@Override
public OptionSet getState() {
this.myOptions.init();
return this.myOptions;
}

Expand Down Expand Up @@ -184,7 +171,7 @@ public void setShowInfoBalloon(boolean showInfoBalloon) {
public Color getTabHighlightColor() {
String color = getState().TAB_HIGHLIGHT_COLOR;
try {
return color == null || color.isEmpty() ? null : Color.decode(getState().TAB_HIGHLIGHT_COLOR);
return color == null || color.isEmpty() ? null : Color.decode(color);
} catch (NumberFormatException exc) {
return null;
}
Expand All @@ -195,13 +182,7 @@ public void setTabHighlightColor(Color color) {
}

public EditorPrio getEditorPrio() {
// Important: avoid triggering OptionSet.init() here because it consults
// EditorSettingsExternalizable on first access which may require UI/EDT
// initialization. The file editor providers call this method from background
// threads during provider discovery, and any slow or blocking initialization
// can lead to timeouts when the IDE checks providers.
// Access the current option directly to keep provider checks fast and non-blocking.
return this.myOptions.EDITOR_PRIO;
return getState().EDITOR_PRIO;
}

public void setEditorPrio(EditorPrio editorPrio) {
Expand All @@ -217,9 +198,8 @@ public void showTableEditorInfoPanel(boolean showInfoPanel) {
}

public int getTableEditorRowHeight() {
// ensure the current state of row height fits the boundaries (which is checked in the setTableEditorRowHeight method
setTableEditorRowHeight(getState().TABLE_EDITOR_ROW_HEIGHT);
return getState().TABLE_EDITOR_ROW_HEIGHT;
int rowHeight = getState().TABLE_EDITOR_ROW_HEIGHT;
return rowHeight > TABLE_EDITOR_ROW_HEIGHT_MAX || rowHeight < TABLE_EDITOR_ROW_HEIGHT_MIN ? TABLE_EDITOR_ROW_HEIGHT_DEFAULT : rowHeight;
}

public void setTableEditorRowHeight(int rowHeight) {
Expand Down Expand Up @@ -268,7 +248,7 @@ public void setDefaultEscapeCharacter(CsvEscapeCharacter defaultEscapeCharacter)

public CsvEscapeCharacter getDefaultEscapeCharacter() {
CsvEscapeCharacter csvValueSeparator = getState().DEFAULT_ESCAPE_CHARACTER;
return csvValueSeparator == null ? ESCAPE_CHARACTER_DEFAULT : getState().DEFAULT_ESCAPE_CHARACTER;
return csvValueSeparator == null ? ESCAPE_CHARACTER_DEFAULT : csvValueSeparator;
}

public void setDefaultValueSeparator(CsvValueSeparator defaultValueSeparator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public void printStackTrace(PrintWriter writer) {

private CsvGithubIssueSubmitterSubClass classUnderTest = new CsvGithubIssueSubmitterSubClass();

public void testSearchExistingIssuesNeedle() throws Exception {
assertEquals("crash", classUnderTest.searchExistingIssuesNeedle(null));
assertEquals("crash", classUnderTest.searchExistingIssuesNeedle(""));
assertEquals("crash", classUnderTest.searchExistingIssuesNeedle(" "));
assertEquals("test", classUnderTest.searchExistingIssuesNeedle("test"));
assertEquals("test", classUnderTest.searchExistingIssuesNeedle("[Automated Report] test"));
assertEquals("[Automated Report]", classUnderTest.searchExistingIssuesNeedle("[Automated Report]"));
}

public void testGetIssueTitle() {
assertEquals("[Automated Report] Test", classUnderTest.getIssueTitle(new IdeaLoggingEvent("Test", new DummyException("Test"))));
assertEquals("[Automated Report] Unhandled exception in [CoroutineName(com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl), StandaloneCoroutine{Cancelling}, Dispatchers.Default]", classUnderTest.getIssueTitle(new IdeaLoggingEvent("Test", new DummyException("Unhandled exception in [CoroutineName(com.intellij.openapi.fileEditor.impl.PsiAwareFileEditorManagerImpl), StandaloneCoroutine{Cancelling}@5cfe3e69, Dispatchers.Default]"))));
Expand Down
Loading
Loading