Skip to content

Commit f378e30

Browse files
committed
исправлена внесенная ошибка
переделаны тесты выполнен precommit
1 parent 5f18058 commit f378e30

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@
4343

4444
)
4545
public class ExternalAppStartingDiagnostic extends AbstractFindMethodDiagnostic {
46-
private static final String MAIN_PATTERN_STRING =
46+
private static final String DEFAULT_PATTERN_STRING =
4747
"КомандаСистемы|System|ЗапуститьСистему|RunSystem|ЗапуститьПриложение|RunApp" +
4848
"|НачатьЗапускПриложения|BeginRunningApplication" +
4949
"|ЗапуститьПриложениеАсинх|RunAppAsync|ЗапуститьПрограмму|ОткрытьПроводник|ОткрытьФайл";
5050
private static final String PATTERN_STRING_FOR_NAVI =
5151
"|ПерейтиПоНавигационнойСсылке|GotoURL|ОткрытьНавигационнуюСсылку";
52-
private static final Pattern FULL_PATTERN = CaseInsensitivePattern.compile(
53-
MAIN_PATTERN_STRING + PATTERN_STRING_FOR_NAVI);
52+
private static final Pattern DEFAULT_PATTERN = CaseInsensitivePattern.compile(DEFAULT_PATTERN_STRING);
5453
private static final boolean CHECK_GOTO_URL = false;
5554

5655
@DiagnosticParameter(
@@ -61,12 +60,12 @@ public class ExternalAppStartingDiagnostic extends AbstractFindMethodDiagnostic
6160

6261
@DiagnosticParameter(
6362
type = String.class,
64-
defaultValue = MAIN_PATTERN_STRING
63+
defaultValue = DEFAULT_PATTERN_STRING
6564
)
66-
private String userPatternString = MAIN_PATTERN_STRING;
65+
private String userPatternString = DEFAULT_PATTERN_STRING;
6766

6867
public ExternalAppStartingDiagnostic() {
69-
super(FULL_PATTERN);
68+
super(DEFAULT_PATTERN);
7069
}
7170

7271
@Override

src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@
653653
"properties": {
654654
"checkGotoUrl": {
655655
"description": "Check navigation links",
656-
"default": true,
656+
"default": false,
657657
"type": "boolean",
658658
"title": "Check navigation links"
659659
},

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ void testConfigure_checkGotoUrl() {
7575
.hasRange(9, 4, 23)
7676
.hasRange(10, 4, 23)
7777
.hasRange(12, 4, 26)
78-
.hasRange(14, 4, 32)
78+
79+
.hasRange(14, 4, 32)
7980
.hasRange(15, 26, 52)
8081
.hasRange(16, 26, 52)
81-
.hasRange(18, 26, 44)
82+
83+
.hasRange(18, 26, 44)
8284
.hasRange(19, 26, 44)
8385
.hasRange(20, 20, 38)
8486
.hasRange(21, 20, 38)
@@ -105,26 +107,26 @@ void testConfigure_userPatternString() {
105107

106108
assertThat(diagnostics, true)
107109
.hasRange(8, 4, 18)
108-
109-
.hasRange(14, 4, 32)
110-
.hasRange(15, 26, 52)
111-
.hasRange(16, 26, 52)
112-
113-
.hasSize(4);
110+
.hasSize(1);
114111
}
115112

116113
@Test
117114
void testConfigure_userPatternString_checkGotoUrl() {
118115

119116
Map<String, Object> configuration = diagnosticInstance.info.getDefaultConfiguration();
120-
configuration.put("checkGotoUrl", false);
117+
configuration.put("checkGotoUrl", true);
121118
configuration.put("userPatternString", "КомандаСистемы");
122119
diagnosticInstance.configure(configuration);
123120

124121
List<Diagnostic> diagnostics = getDiagnostics();
125122

126123
assertThat(diagnostics, true)
127124
.hasRange(8, 4, 18)
128-
.hasSize(1);
125+
126+
.hasRange(14, 4, 32)
127+
.hasRange(15, 26, 52)
128+
.hasRange(16, 26, 52)
129+
130+
.hasSize(4);
129131
}
130132
}

0 commit comments

Comments
 (0)