Skip to content

Commit a2f579b

Browse files
committed
не ругаемся на висячую запятую
closes #2859
1 parent bfe95a0 commit a2f579b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IncorrectLineBreakDiagnostic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class IncorrectLineBreakDiagnostic extends AbstractDiagnostic {
4949
// check first symbol
5050
private static final boolean DEFAULT_CHECK_START = true;
5151
// forbidden characters at the beginning of the line
52-
private static final String DEFAULT_LIST_FOR_CHECK_START = "\\)|;|,|\\);";
52+
private static final String DEFAULT_LIST_FOR_CHECK_START = "\\)|;|,\\s*\\S+|\\);";
5353
// check last symbol
5454
private static final boolean DEFAULT_CHECK_END = true;
5555
// forbidden end-of-line characters

src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/IncorrectLineBreakDiagnosticTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class IncorrectLineBreakDiagnosticTest extends AbstractDiagnosticTest<IncorrectL
3737
@Test
3838
void test() {
3939

40-
Map<String, Object> configuration = diagnosticInstance.getInfo().getDefaultConfiguration();
41-
diagnosticInstance.configure(configuration);
4240
List<Diagnostic> diagnostics = getDiagnostics();
4341

4442
assertThat(diagnostics, true)
@@ -49,10 +47,10 @@ void test() {
4947
.hasRange(20, 49, 50)
5048
.hasRange(69, 80, 83)
5149
.hasRange(82, 89, 92)
52-
.hasRange(44, 25, 26)
53-
.hasRange(46, 25, 26)
54-
.hasRange(58, 4, 5)
55-
.hasRange(60, 4, 5)
50+
.hasRange(44, 25, 76)
51+
.hasRange(46, 25, 79)
52+
.hasRange(58, 4, 55)
53+
.hasRange(60, 4, 58)
5654
.hasRange(101, 2, 3)
5755
.hasRange(105, 2, 3)
5856
.hasRange(109, 2, 3)
@@ -88,7 +86,7 @@ void testTrailingBraceCodestyle() {
8886

8987
List<Diagnostic> diagnostics = getDiagnostics();
9088

91-
assertThat(diagnostics).hasSize(11);
89+
assertThat(diagnostics).hasSize(12);
9290
assertThat(diagnostics, true)
9391
.hasRange(6, 32, 33)
9492
.hasRange(7, 35, 36)
@@ -101,6 +99,7 @@ void testTrailingBraceCodestyle() {
10199
.hasRange(46, 25, 26)
102100
.hasRange(58, 4, 5)
103101
.hasRange(60, 4, 5)
102+
.hasRange(134, 4, 5)
104103
;
105104

106105
}

src/test/resources/diagnostics/IncorrectLineBreakDiagnostic.bsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,9 @@
128128

129129
// Pass
130130
// Структура -
131+
132+
ЗафиксироватьОшибку(
133+
ИмяСобытияЖР(),
134+
УровеньЖурналаРегистрации.Ошибка,
135+
, // не ошибка
136+
ТекстОшибки);

0 commit comments

Comments
 (0)