diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnostic.java index 725c1958979..01f128cfd1f 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnostic.java @@ -49,7 +49,8 @@ severity = DiagnosticSeverity.MAJOR, modules = { ModuleType.CommonModule, - ModuleType.ObjectModule + ModuleType.ObjectModule, + ModuleType.UNKNOWN }, minutesToFix = 1, tags = { diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnosticTest.java index 681a61283e0..7f83fd580c3 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalMethodDiagnosticTest.java @@ -75,6 +75,12 @@ void testObjectModuleByDefault() { assertThat(diagnostics).isEmpty(); } + @Test + void testUnknowModule() { + getModuleDocumentContext(ModuleType.UNKNOWN); + checkByDefault(getDiagnostics(documentContext)); + } + @Test void testConfigure() { // given @@ -111,9 +117,13 @@ void testObjectModuleWithEnabledConfiguration() { } private void getObjectModuleDocumentContext() { + getModuleDocumentContext(ModuleType.ObjectModule); + } + + private void getModuleDocumentContext(ModuleType moduleType) { Path testFile = Paths.get(PATH_TO_MODULE_CONTENT).toAbsolutePath(); getDocumentContextFromFile(testFile); - when(documentContext.getModuleType()).thenReturn(ModuleType.ObjectModule); + when(documentContext.getModuleType()).thenReturn(moduleType); when(documentContext.getMdObject()).thenReturn(Optional.of(module)); }