diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnostic.java index 07798ae5738..d0255aae186 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnostic.java @@ -43,14 +43,13 @@ ) public class ExternalAppStartingDiagnostic extends AbstractFindMethodDiagnostic { - private static final String MAIN_PATTERN_STRING = + private static final String DEFAULT_PATTERN_STRING = "КомандаСистемы|System|ЗапуститьСистему|RunSystem|ЗапуститьПриложение|RunApp" + "|НачатьЗапускПриложения|BeginRunningApplication" + "|ЗапуститьПриложениеАсинх|RunAppAsync|ЗапуститьПрограмму|ОткрытьПроводник|ОткрытьФайл"; private static final String PATTERN_STRING_FOR_NAVI = "|ПерейтиПоНавигационнойСсылке|GotoURL|ОткрытьНавигационнуюСсылку"; - private static final Pattern FULL_PATTERN = CaseInsensitivePattern.compile( - MAIN_PATTERN_STRING + PATTERN_STRING_FOR_NAVI); + private static final Pattern DEFAULT_PATTERN = CaseInsensitivePattern.compile(DEFAULT_PATTERN_STRING); private static final boolean CHECK_GOTO_URL = false; @DiagnosticParameter( @@ -61,12 +60,12 @@ public class ExternalAppStartingDiagnostic extends AbstractFindMethodDiagnostic @DiagnosticParameter( type = String.class, - defaultValue = MAIN_PATTERN_STRING + defaultValue = DEFAULT_PATTERN_STRING ) - private String userPatternString = MAIN_PATTERN_STRING; + private String userPatternString = DEFAULT_PATTERN_STRING; public ExternalAppStartingDiagnostic() { - super(FULL_PATTERN); + super(DEFAULT_PATTERN); } @Override diff --git a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json index d622a7fbd58..1d9b5aae21f 100644 --- a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json +++ b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json @@ -653,7 +653,7 @@ "properties": { "checkGotoUrl": { "description": "Check navigation links", - "default": true, + "default": false, "type": "boolean", "title": "Check navigation links" }, diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnosticTest.java index 3a22071fae2..0c281f9fc7d 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ExternalAppStartingDiagnosticTest.java @@ -75,10 +75,12 @@ void testConfigure_checkGotoUrl() { .hasRange(9, 4, 23) .hasRange(10, 4, 23) .hasRange(12, 4, 26) - .hasRange(14, 4, 32) + + .hasRange(14, 4, 32) .hasRange(15, 26, 52) .hasRange(16, 26, 52) - .hasRange(18, 26, 44) + + .hasRange(18, 26, 44) .hasRange(19, 26, 44) .hasRange(20, 20, 38) .hasRange(21, 20, 38) @@ -105,19 +107,14 @@ void testConfigure_userPatternString() { assertThat(diagnostics, true) .hasRange(8, 4, 18) - - .hasRange(14, 4, 32) - .hasRange(15, 26, 52) - .hasRange(16, 26, 52) - - .hasSize(4); + .hasSize(1); } @Test void testConfigure_userPatternString_checkGotoUrl() { Map configuration = diagnosticInstance.info.getDefaultConfiguration(); - configuration.put("checkGotoUrl", false); + configuration.put("checkGotoUrl", true); configuration.put("userPatternString", "КомандаСистемы"); diagnosticInstance.configure(configuration); @@ -125,6 +122,11 @@ void testConfigure_userPatternString_checkGotoUrl() { assertThat(diagnostics, true) .hasRange(8, 4, 18) - .hasSize(1); + + .hasRange(14, 4, 32) + .hasRange(15, 26, 52) + .hasRange(16, 26, 52) + + .hasSize(4); } }