diff --git a/build.gradle.kts b/build.gradle.kts index 7fd16c4f858..3729ef2ca5f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,6 +32,7 @@ repositories { mavenCentral() maven(url = "https://jitpack.io") maven(url = "https://projectlombok.org/edge-releases") + maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots") } group = "io.github.1c-syntax" @@ -88,9 +89,11 @@ dependencies { exclude("org.antlr", "antlr-runtime") } api("io.github.1c-syntax", "utils", "0.6.1") - api("io.github.1c-syntax", "mdclasses", "0.13.0") - api("io.github.1c-syntax", "bsl-common-library", "0.6.0") - api("io.github.1c-syntax", "supportconf", "0.14.0") + api("io.github.1c-syntax", "mdclasses", "0.14.0") + api("io.github.1c-syntax", "bsl-common-library", "0.7.0") + api("io.github.1c-syntax", "supportconf", "0.14.0") { + exclude("io.github.1c-syntax", "bsl-common-library") + } api("io.github.1c-syntax", "bsl-parser-core", "0.1.0") // JLanguageTool diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java index e43afa828cf..a305ee926a0 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java @@ -56,9 +56,9 @@ public void check() { .filter(reference -> reference.getSymbol().isDeprecated()) .filter(reference -> !reference.getFrom().isDeprecated()) .forEach((Reference reference) -> { - Symbol deprecatedSymbol = reference.getSymbol(); - String deprecationInfo = getDeprecationInfo(deprecatedSymbol); - String message = info.getMessage(deprecatedSymbol.getName(), deprecationInfo); + var deprecatedSymbol = reference.getSymbol(); + var deprecationInfo = getDeprecationInfo(deprecatedSymbol); + var message = info.getMessage(deprecatedSymbol.getName(), deprecationInfo); diagnosticStorage.addDiagnostic(reference.getSelectionRange(), message); }); } diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java index 8fc323b798f..8a934f61b32 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java @@ -120,4 +120,4 @@ private static class MethodCall { Boolean[] parameters; Range range; } -} \ No newline at end of file +} diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java index 0ddb0d606ac..5b800a0dd33 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RefOveruseDiagnostic.java @@ -37,8 +37,6 @@ import com.github._1c_syntax.bsl.types.MdoReference; import com.github._1c_syntax.utils.CaseInsensitivePattern; import edu.umd.cs.findbugs.annotations.Nullable; -import lombok.AllArgsConstructor; -import lombok.Value; import org.antlr.v4.runtime.tree.ParseTree; import org.eclipse.lsp4j.Range; @@ -160,8 +158,8 @@ private Map> calcDataSourceWithTabularSectionNames( .map(dataSourceContext -> new TabularSectionTable(getTableNameOrAlias(dataSourceContext), getTabularSectionNames(dataSourceContext))) .collect(Collectors.toMap( - TabularSectionTable::getTableNameOrAlias, - TabularSectionTable::getTabularSectionNames, + TabularSectionTable::tableNameOrAlias, + TabularSectionTable::tabularSectionNames, (existing, replacement) -> existing)); } @@ -322,10 +320,6 @@ private static List extractFirstMetadataTypeName(SDBLParser.ColumnCon return children.subList(1, children.size() - 1); } - @Value - @AllArgsConstructor - private static class TabularSectionTable { - String tableNameOrAlias; - List tabularSectionNames; + private record TabularSectionTable(String tableNameOrAlias, List tabularSectionNames) { } } diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java index f9308c3caf6..7ad35b53ea3 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java @@ -66,7 +66,11 @@ public void check() { documentContext.getSymbolTree().getVariables().stream() .filter(variable -> CHECKING_VARIABLE_KINDS.contains(variable.getKind())) .filter(variable -> !variable.isExport()) - .filter(variable -> referenceIndex.getReferencesTo(variable).stream().filter(ref -> ref.getOccurrenceType() == OccurrenceType.REFERENCE).findFirst().isEmpty()) - .forEach(variable -> diagnosticStorage.addDiagnostic(variable.getSelectionRange(), info.getMessage(variable.getName()))); + .filter(variable -> referenceIndex.getReferencesTo(variable).stream() + .filter(ref -> ref.getOccurrenceType() == OccurrenceType.REFERENCE).findFirst().isEmpty() + ) + .forEach(variable -> diagnosticStorage.addDiagnostic( + variable.getSelectionRange(), info.getMessage(variable.getName())) + ); } } diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java index a0e573239a2..a697943ef9f 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/WrongDataPathForFormElementsDiagnostic.java @@ -64,7 +64,7 @@ protected void check() { } private static boolean wrongDataPath(FormItem formItem) { - return formItem.getDataPath().getSegments().startsWith("~"); + return formItem.getDataPath().segments().startsWith("~"); } private static boolean haveFormModules(Form form) {