Skip to content

Commit 09e6330

Browse files
authored
Merge pull request #353 from SeeSharpSoft/fb_release_prep
Prepare major release
2 parents 18107b7 + 3fd4e34 commit 09e6330

File tree

10 files changed

+45
-24
lines changed

10 files changed

+45
-24
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ This enables default editor features like syntax validation, highlighting and in
3535

3636
**!!Please note!!**
3737

38-
- Previous versions can be downloaded and installed manually from the following locations: [GitHub Releases](https://github.com/SeeSharpSoft/intellij-csv-validator/releases), [Plugin Repository](https://plugins.jetbrains.com/plugin/10037-csv-plugin/versions) (see also section [Installation](https://github.com/SeeSharpSoft/intellij-csv-validator#installation)).
38+
For release 3.*, the plugin got a major overhaul focusing on performance and table editor usage.
39+
Some features and settings were removed for simplification and consistency.
40+
The previous version (incl README) can still be accessed [here](https://github.com/SeeSharpSoft/intellij-csv-validator/tree/release_2) and installed manually (see section [Installation](https://github.com/SeeSharpSoft/intellij-csv-validator#installation)).
3941

4042
### Syntax parser & validation
4143

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,16 @@ intellij {
8282
}
8383
patchPluginXml {
8484
changeNotes = """<pre style="font-family: sans-serif">
85-
NEW: major update release!
86-
</pre>"""
85+
Major update release 3.*!
86+
87+
For this realase, the plugin was reworked quite a bit, focusing on performance and table editor usage. The table editor is now the default editor!
88+
89+
Some options were removed for simplification and consistency (e.g. 'Tabularize' formatting), while new features were added (e.g. comment support in table editor).
90+
91+
Feedback is welcome!
92+
93+
PS: The previous versions are still available on the project page.
94+
</pre>"""
8795
}
8896
publishPlugin {
8997
token = System.getenv().getOrDefault('JI_TOKEN', '')

docs/editor.png

374 KB
Loading

docs/editorsettings.png

13.6 KB
Loading

docs/example.png

566 KB
Loading

docs/tableeditor.png

158 KB
Loading

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,31 @@ protected GithubApiRequest createNewIssue(String title, String content) throws I
129129
Collections.emptyList());
130130
}
131131

132-
protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String needle, ProgressIndicator progressIndicator) throws IOException {
132+
protected String searchExistingIssues(GithubApiRequestExecutor githubExecutor, String needleArg, ProgressIndicator progressIndicator) throws IOException {
133+
String needle = needleArg;
134+
if (needle.length() > 255) {
135+
needle = needle.substring(0, needle.substring(0, 255).lastIndexOf(" "));
136+
}
133137
GithubApiRequest<GithubResponsePage<GithubSearchedIssue>> existingIssueRequest =
134138
GithubApiRequests.Search.Issues.get(
135139
GithubServerPath.DEFAULT_SERVER,
136140
GITHUB_FULL_PATH,
137141
GithubIssueState.open.name(),
138142
null,
139143
needle,
140-
new GithubRequestPagination(1, 1)
144+
new GithubRequestPagination(1, 5)
141145
);
142146

143-
String issueId = null;
144147
GithubResponsePage<GithubSearchedIssue> foundIssuesPage = githubExecutor.execute(progressIndicator, existingIssueRequest);
145148
if (foundIssuesPage != null && !foundIssuesPage.getItems().isEmpty()) {
146-
GithubSearchedIssue foundIssue = foundIssuesPage.getItems().get(0);
147-
if (foundIssue.getTitle().equals(needle)) {
148-
issueId = Long.toString(foundIssue.getNumber());
149+
for (GithubSearchedIssue foundIssue : foundIssuesPage.getItems()) {
150+
if (foundIssue.getTitle().equals(needleArg)) {
151+
return Long.toString(foundIssue.getNumber());
152+
}
149153
}
150154
}
151155

152-
return issueId;
156+
return null;
153157
}
154158

155159
protected String getIssueTitle(IdeaLoggingEvent event) {

src/main/java/net/seesharpsoft/intellij/plugins/csv/actions/CsvChangeEscapeCharacterActionGroup.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package net.seesharpsoft.intellij.plugins.csv.actions;
22

3+
import com.intellij.lang.Language;
34
import com.intellij.openapi.actionSystem.ActionGroup;
45
import com.intellij.openapi.actionSystem.AnAction;
56
import com.intellij.openapi.actionSystem.AnActionEvent;
67
import com.intellij.openapi.actionSystem.CommonDataKeys;
78
import com.intellij.psi.PsiFile;
89
import net.seesharpsoft.intellij.plugins.csv.CsvEscapeCharacter;
910
import net.seesharpsoft.intellij.plugins.csv.CsvHelper;
11+
import net.seesharpsoft.intellij.plugins.csv.CsvLanguage;
1012
import org.jetbrains.annotations.NotNull;
1113
import org.jetbrains.annotations.Nullable;
1214

@@ -25,9 +27,10 @@ public class CsvChangeEscapeCharacterActionGroup extends ActionGroup {
2527
@Override
2628
public void update(AnActionEvent anActionEvent) {
2729
PsiFile psiFile = anActionEvent.getData(CommonDataKeys.PSI_FILE);
28-
boolean isCsvFile = CsvHelper.isCsvFile(psiFile);
29-
anActionEvent.getPresentation().setEnabledAndVisible(isCsvFile);
30-
if (isCsvFile) {
30+
boolean canChangeEscapeCharacter = CsvHelper.isCsvFile(psiFile) && psiFile.getLanguage().isKindOf(CsvLanguage.INSTANCE);
31+
32+
anActionEvent.getPresentation().setEnabledAndVisible(canChangeEscapeCharacter);
33+
if (canChangeEscapeCharacter) {
3134
CsvEscapeCharacter escapeCharacter = CsvHelper.getEscapeCharacter(psiFile);
3235
anActionEvent.getPresentation().setText(String.format("CSV Escape Character: %s", escapeCharacter.getDisplay()));
3336
}

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import net.seesharpsoft.intellij.ui.EditableCellFocusAction;
55

66
import javax.swing.*;
7+
import javax.swing.plaf.TableUI;
78
import javax.swing.plaf.basic.BasicTableUI;
89
import javax.swing.table.TableCellEditor;
910
import javax.swing.table.TableCellRenderer;
@@ -27,6 +28,17 @@ public CsvTable(TableModel model) {
2728
new EditableCellFocusAction(this, KeyStroke.getKeyStroke("DOWN"));
2829
}
2930

31+
@Override
32+
public void setUI(TableUI ui) {
33+
TableUI newUI = ui instanceof MultiSpanCellTableUI ? ui : new MultiSpanCellTableUI();
34+
super.setUI(newUI);
35+
}
36+
37+
@Override
38+
public MultiSpanCellTableUI getUI() {
39+
return (MultiSpanCellTableUI) super.getUI();
40+
}
41+
3042
@Override
3143
public CsvTableModelSwing getModel() {
3244
return (CsvTableModelSwing) super.getModel();
@@ -86,11 +98,6 @@ public boolean isCellEditable(int row, int column) {
8698
return (!isCommentRow(row) || convertColumnIndexToModel(column) == 0) && super.isCellEditable(row, column);
8799
}
88100

89-
@Override
90-
public MultiSpanCellTableUI getUI() {
91-
return (MultiSpanCellTableUI) super.getUI();
92-
}
93-
94101
public class MultiSpanCellTableUI extends BasicTableUI {
95102

96103
int paintCounter = 0;

src/main/resources/META-INF/plugin.xml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
<description><![CDATA[
99
10-
<p>Lightweight plugin for editing CSV/TSV/PSV files with a flexible Table Editor, syntax validation, structure highlighting, customizable coloring, new intentions and helpful inspections.</p><br>
11-
<img width="600" height="297" src="https://plugins.jetbrains.com/files/10037/screenshot_22766.png" /><br><br>
10+
<p>Plugin for editing CSV files with a rainbow colored text- & table-editor. It supports are syntax validation, customization, intentions and many more.</p><br>
11+
<img width="600" height="297" src="https://plugins.jetbrains.com/files/10037/screenshot_80656a25-da46-4f76-b5c1-a9e8263b8bf3.png" /><br><br>
1212
<p><b>Features:</b><br>
1313
<ul>
1414
<li>support for CSV/TSV/PSV file extensions</li>
15-
<li>customizable Table Editor</li>
15+
<li>customizable table editor</li>
1616
<li>customizable text editor</li>
1717
<li>customizable column coloring</li>
1818
<li>customizable line comment</li>
@@ -22,7 +22,6 @@
2222
<li>quick fix inspections</li>
2323
<li>intentions (Alt+Enter), e.g. Quote/Unquote (all), Shift Column Left/Right</li>
2424
<li>balloon help & spell checker</li>
25-
<li>structure view (header-entry layout)</li>
2625
<li>support for ',', ';', '|' or '&#8633;' as value separator</li>
2726
<li>support for '"' or '\' as escape character</li>
2827
<li>support line comments (# by default, customizable)</li>
@@ -34,8 +33,6 @@
3433
<p>
3534
<b>TSV/PSV file support:</b> <em>TSV/PSV files are recognized as such but treated as a variant of CSV files, the same syntax highlighting and code style settings are applied.</em>
3635
<br><br>
37-
<b>Code formatting:</b> <em>Default code formatting is 'Tabularize'. Can be changed in Settings -> Editor -> Code Style -> CSV/TSV/PSV</em>
38-
<br><br>
3936
For more detailed information please have a look at the <a href="https://github.com/SeeSharpSoft/intellij-csv-validator/blob/main/README.md">README</a>.
4037
<br><br><br>
4138
<em>Thanks to @royqh1979, @egoisticalgoat, @sabi0, @ptahchiev, @ghost, @MarkJeronimus, <a href="https://finevisuals.de" target="_blank">FineVisuals</a> and others for supporting me and the project!</em>

0 commit comments

Comments
 (0)