File tree 5 files changed +23
-5
lines changed
java/net/seesharpsoft/intellij/plugins/csv
5 files changed +23
-5
lines changed Original file line number Diff line number Diff line change
1
+ 2.14.2
2
+ Sep 17, 2020
3
+
4
+ FIX: Settings reset every update #245
5
+ FIX: Removing comment indicator causes parsing errors
6
+
1
7
2.14.1
2
8
Aug 14, 2020
3
9
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ jacocoTestReport {
24
24
}
25
25
26
26
group ' net.seesharpsoft.intellij.plugins'
27
- version ' 2.14.1 '
27
+ version ' 2.14.2 '
28
28
29
29
apply plugin : ' java'
30
30
sourceCompatibility = javaVersion
Original file line number Diff line number Diff line change 18
18
19
19
public class CsvSharpLexer extends LexerBase {
20
20
21
+ private final static String NON_MATCHING_REGEX = "[^\\ w\\ W]" ;
22
+
21
23
private final Tokenizer <TokenType > tokenizer ;
22
24
private final List <Tokenizer .Token <TokenType >> initialNextStateTokens ;
23
25
private final List <Tokenizer .Token <TokenType >> unquotedNextStateTokens ;
@@ -122,6 +124,9 @@ public CsvSharpLexer(Configuration configuration) {
122
124
if (!configuration .commentCharacter .isEmpty ()) {
123
125
tokenizer .add (TokenType .COMMENT_CHARACTER , configuration .commentCharacter );
124
126
tokenizer .add (TokenType .COMMENT , configuration .commentCharacter + ".*(?=(\n |$))" );
127
+ } else {
128
+ tokenizer .add (TokenType .COMMENT_CHARACTER , NON_MATCHING_REGEX );
129
+ tokenizer .add (TokenType .COMMENT , NON_MATCHING_REGEX );
125
130
}
126
131
127
132
if (configuration .escapeCharacter .equals (configuration .quoteCharacter )) {
Original file line number Diff line number Diff line change 1
1
package net .seesharpsoft .intellij .plugins .csv .settings ;
2
2
3
+ import com .intellij .openapi .application .Application ;
4
+ import com .intellij .openapi .application .ApplicationManager ;
3
5
import com .intellij .openapi .components .PersistentStateComponent ;
4
6
import com .intellij .openapi .components .ServiceManager ;
5
7
import com .intellij .openapi .components .State ;
@@ -32,7 +34,8 @@ public class CsvEditorSettings implements PersistentStateComponent<CsvEditorSett
32
34
33
35
public static final String COMMENT_INDICATOR_DEFAULT = "#" ;
34
36
35
- private static final CsvEditorSettings STATIC_INSTANCE = new CsvEditorSettings ();
37
+ // only required for testing
38
+ private static final CsvEditorSettings STATIC_TEST_INSTANCE = new CsvEditorSettings ();
36
39
37
40
public enum EditorPrio {
38
41
TEXT_FIRST ,
@@ -95,8 +98,11 @@ public CsvEditorSettings() {
95
98
}
96
99
97
100
public static CsvEditorSettings getInstance () {
98
- CsvEditorSettings instance = ServiceManager .getService (CsvEditorSettings .class );
99
- return instance == null ? STATIC_INSTANCE : instance ;
101
+ Application application = ApplicationManager .getApplication ();
102
+ if (application .isUnitTestMode ()) {
103
+ return CsvEditorSettings .STATIC_TEST_INSTANCE ;
104
+ }
105
+ return application .isDisposed () ? new CsvEditorSettings () : ServiceManager .getService (CsvEditorSettings .class );
100
106
}
101
107
102
108
public void addPropertyChangeListener (PropertyChangeListener listener ) {
Original file line number Diff line number Diff line change 49
49
50
50
<change-notes ><![CDATA[
51
51
<pre style="font-family: sans-serif">
52
- FIX: Performance for indexing large CSV files #239
52
+ FIX: Settings reset every update #245
53
+ FIX: Removing comment indicator causes parsing errors
53
54
</pre>
54
55
]]>
55
56
</change-notes >
You can’t perform that action at this time.
0 commit comments