From 2ea3be0f79f20ad63917428901f9738f5105c6f8 Mon Sep 17 00:00:00 2001 From: Dima Date: Fri, 2 Dec 2022 11:51:21 +0300 Subject: [PATCH 1/2] fix comparison --- .../diagnostics/QueryToMissingMetadataDiagnostic.java | 2 +- .../diagnostics/QueryToMissingMetadataDiagnosticTest.java | 3 +++ .../diagnostics/QueryToMissingMetadataDiagnostic.bsl | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnostic.java index 6e838f6b6f1..7f012ab0741 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnostic.java @@ -76,7 +76,7 @@ private Optional getMdo(String mdoTypeName, String mdoName return MDOType.fromValue(mdoTypeName).flatMap(mdoType -> documentContext.getServerContext().getConfiguration().getChildrenByMdoRef().entrySet().stream() .filter(entry -> entry.getKey().getType() == mdoType - && mdoName.equals(entry.getValue().getName())) + && mdoName.equalsIgnoreCase(entry.getValue().getName())) .map(Map.Entry::getValue) .findFirst() ); diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java index 72352cd4404..76431bb70f9 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java @@ -44,6 +44,9 @@ void test() { List diagnostics = getDiagnostics(); + assertThat(diagnostics, true) + .hasSize(2); + assertThat(diagnostics, true) .hasMessageOnRange("Исправьте обращение к несуществующему метаданному \"РегистрСведений.УстаревшееИмяРегистра\" в запросе", 4, 18, 55) diff --git a/src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl b/src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl index 70cba7f173e..4633a42f133 100644 --- a/src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl +++ b/src/test/resources/diagnostics/QueryToMissingMetadataDiagnostic.bsl @@ -29,3 +29,11 @@ | ВНУТРЕННЕЕ СОЕДИНЕНИЕ РегистрСведений.РегистрСведений1 КАК ТаблицаФильтр // не ошибка | ПО ТаблицаФильтр.Справочник1 = Таблица.Справочник1"; ЗапросСоединение2.Выполнить(); + +Запрос2 = Новый Запрос; +Запрос2.Текст = "ВЫБРАТЬ + | Таблица.Справочник1 КАК Справочник1 + |ИЗ + | РегистрСведений.рЕГИСТРСведений1 КАК Таблица"; // не ошибка +Запрос2.Выполнить(); + From 113ec45bdc9c896ce11d7a130ccfa340f9cb1771 Mon Sep 17 00:00:00 2001 From: Dima Date: Fri, 2 Dec 2022 12:52:01 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20assert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnostics/QueryToMissingMetadataDiagnosticTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java index 76431bb70f9..72352cd4404 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/QueryToMissingMetadataDiagnosticTest.java @@ -44,9 +44,6 @@ void test() { List diagnostics = getDiagnostics(); - assertThat(diagnostics, true) - .hasSize(2); - assertThat(diagnostics, true) .hasMessageOnRange("Исправьте обращение к несуществующему метаданному \"РегистрСведений.УстаревшееИмяРегистра\" в запросе", 4, 18, 55)