diff --git a/build.gradle.kts b/build.gradle.kts index c6dc7ec1c61..563ae8b2b26 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -83,7 +83,7 @@ dependencies { exclude("org.glassfish", "javax.json") } api("com.github.1c-syntax", "utils", "0.5.1") - api("io.github.1c-syntax", "mdclasses", "0.12.0-rc.5") + api("io.github.1c-syntax", "mdclasses", "0.12.0") api("io.github.1c-syntax", "bsl-common-library", "0.5.0") api("io.github.1c-syntax", "supportconf", "0.12.1") 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 77528c81a4c..42c8d16d4d1 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 @@ -29,9 +29,9 @@ import com.github._1c_syntax.bsl.languageserver.utils.Ranges; import com.github._1c_syntax.bsl.mdo.Form; import com.github._1c_syntax.bsl.mdo.MD; +import com.github._1c_syntax.bsl.mdo.storage.form.FormItem; import com.github._1c_syntax.bsl.mdo.support.ScriptVariant; import com.github._1c_syntax.bsl.types.ModuleType; -import com.github._1c_syntax.mdclasses.mdo.children.form.FormItem; import org.eclipse.lsp4j.Range; import java.util.function.Predicate; @@ -57,16 +57,15 @@ public class WrongDataPathForFormElementsDiagnostic extends AbstractDiagnostic { @Override protected void check() { - var range = documentContext.getSymbolTree().getModule().getSelectionRange(); if (!Ranges.isEmpty(range)) { checkCurrentModule(range); } } -// private static boolean wrongDataPath(FormItem formItem) { -// return formItem.getDataPath().getSegment().startsWith("~"); -// } + private static boolean wrongDataPath(FormItem formItem) { + return formItem.getDataPath().getSegments().startsWith("~"); + } private static boolean haveFormModules(Form form) { return !form.getModules().isEmpty(); @@ -84,13 +83,11 @@ private void checkCurrentModule(Range range) { } private void checkAllFormsWithoutModules() { - // todo формы не доделаны -// checkMdoObjectStream(form -> !haveFormModules(form), -// documentContext.getServerContext().getConfiguration().getChildrenByMdoRef().values().stream()); + checkMdoObjectStream(form -> !haveFormModules(form), + documentContext.getServerContext().getConfiguration().getPlainChildren().stream()); } private void checkMdoObjectStream(Predicate