From be62b8c6128e5c44c76433b344e645d63df9dd60 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Fri, 23 Jun 2023 21:04:46 +0300 Subject: [PATCH 1/8] =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/diagnostics/InternetAccess.md | 17 ++++++ docs/en/diagnostics/InternetAccess.md | 16 +++++ .../diagnostics/InternetAccessDiagnostic.java | 60 ++++++++++++++++++ .../InternetAccessDiagnostic_en.properties | 2 + .../InternetAccessDiagnostic_ru.properties | 2 + .../InternetAccessDiagnosticTest.java | 61 +++++++++++++++++++ .../diagnostics/InternetAccessDiagnostic.bsl | 39 ++++++++++++ 7 files changed, 197 insertions(+) create mode 100644 docs/diagnostics/InternetAccess.md create mode 100644 docs/en/diagnostics/InternetAccess.md create mode 100644 src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java create mode 100644 src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_en.properties create mode 100644 src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties create mode 100644 src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java create mode 100644 src/test/resources/diagnostics/InternetAccessDiagnostic.bsl diff --git a/docs/diagnostics/InternetAccess.md b/docs/diagnostics/InternetAccess.md new file mode 100644 index 00000000000..71c168b105c --- /dev/null +++ b/docs/diagnostics/InternetAccess.md @@ -0,0 +1,17 @@ +# (InternetAccess) + + +## Описание диагностики + +При код-ревью или аудите кода необходимо проверять обращения к Интернет-ресурсам и набор передаваемых данных для исключения передачи конфиденциальной или защищенной информации. + +## Примеры + + +## Источники + + diff --git a/docs/en/diagnostics/InternetAccess.md b/docs/en/diagnostics/InternetAccess.md new file mode 100644 index 00000000000..403cc40d707 --- /dev/null +++ b/docs/en/diagnostics/InternetAccess.md @@ -0,0 +1,16 @@ +# (InternetAccess) + + +## Description + + +## Examples + + +## Sources + + diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java new file mode 100644 index 00000000000..20e28719ff2 --- /dev/null +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java @@ -0,0 +1,60 @@ +/* + * This file is a part of BSL Language Server. + * + * Copyright (c) 2018-2023 + * Alexey Sosnoviy , Nikita Fedkin and contributors + * + * SPDX-License-Identifier: LGPL-3.0-or-later + * + * BSL Language Server is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * BSL Language Server is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with BSL Language Server. + */ +package com.github._1c_syntax.bsl.languageserver.diagnostics; + +import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticMetadata; +import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity; +import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag; +import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType; +import com.github._1c_syntax.bsl.parser.BSLParser; +import com.github._1c_syntax.utils.CaseInsensitivePattern; +import org.antlr.v4.runtime.tree.ParseTree; + +import java.util.regex.Pattern; + +@DiagnosticMetadata( + type = DiagnosticType.CODE_SMELL, + severity = DiagnosticSeverity.MINOR, + minutesToFix = 1, + tags = { + DiagnosticTag.SUSPICIOUS + } +) + +public class InternetAccessDiagnostic extends AbstractVisitorDiagnostic { + private static final Pattern PATTERN_NEW_EXPRESSION = CaseInsensitivePattern.compile( + "FTPСоединение|FTPConnection|HTTPСоединение|HTTPConnection|WSОпределения|WSDefinitions|WSПрокси|WSProxy" + + "|ИнтернетПочтовыйПрофиль|InternetMailProfile|ИнтернетПочта|InternetMail|Почта|Mail|HTTPЗапрос|HTTPRequest|" + + "ИнтернетПрокси|InternetProxy"); + + @Override + public ParseTree visitNewExpression(BSLParser.NewExpressionContext ctx) { + var typeNameContext = ctx.typeName(); + if (typeNameContext != null) { + var matcherTypeName = PATTERN_NEW_EXPRESSION.matcher(typeNameContext.getText()); + if (matcherTypeName.matches()) { + diagnosticStorage.addDiagnostic(ctx); + } + } + return super.visitNewExpression(ctx); + } +} diff --git a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_en.properties b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_en.properties new file mode 100644 index 00000000000..1e4019e3eb8 --- /dev/null +++ b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_en.properties @@ -0,0 +1,2 @@ +diagnosticMessage=Check the reference to Internet resources +diagnosticName=Referring to Internet resources diff --git a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties new file mode 100644 index 00000000000..e867153bc6a --- /dev/null +++ b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties @@ -0,0 +1,2 @@ +diagnosticMessage=Проверьте обращение к Интернет-ресурсам +diagnosticName=Обращение к Интернет-ресурсам \ No newline at end of file diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java new file mode 100644 index 00000000000..8ee4571ff67 --- /dev/null +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java @@ -0,0 +1,61 @@ +/* + * This file is a part of BSL Language Server. + * + * Copyright (c) 2018-2023 + * Alexey Sosnoviy , Nikita Fedkin and contributors + * + * SPDX-License-Identifier: LGPL-3.0-or-later + * + * BSL Language Server is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3.0 of the License, or (at your option) any later version. + * + * BSL Language Server is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with BSL Language Server. + */ +package com.github._1c_syntax.bsl.languageserver.diagnostics; + +import org.eclipse.lsp4j.Diagnostic; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static com.github._1c_syntax.bsl.languageserver.util.Assertions.assertThat; + +class InternetAccessDiagnosticTest extends AbstractDiagnosticTest { + InternetAccessDiagnosticTest() { + super(InternetAccessDiagnostic.class); + } + + @Test + void test() { + + List diagnostics = getDiagnostics(); + + assertThat(diagnostics, true) + .hasRange(1, 20, 75) + .hasRange(3, 18, 72) + .hasRange(5, 16, 80) + .hasRange(8, 8, 111) + .hasRange(13, 21, 65) + .hasRange(14, 17, 35) + .hasRange(15, 17, 47) + .hasRange(16, 17, 43) + .hasRange(17, 21, 51) + .hasRange(21, 21, 65) + .hasRange(22, 17, 35) + .hasRange(23, 17, 47) + .hasRange(24, 17, 43) + .hasRange(25, 21, 51) + .hasRange(29, 14, 43) + .hasRange(35, 14, 32) + .hasRange(38, 10, 21) + .hasSize(17); + } +} diff --git a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl new file mode 100644 index 00000000000..8f0e4a83a8c --- /dev/null +++ b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl @@ -0,0 +1,39 @@ +Процедура Тест1() + FTPСоединение = Новый FTPСоединение(Сервер, Порт, Пользователь, Пароль); // ошибка + + Определения = Новый WSОпределения("http://localhost/test.asmx?WSDL"); // ошибка + + ПроксиДва = Новый WSПрокси(Определения, "http://localhost/", "test", "test"); // ошибка + + Определения = + Новый WSОпределения("http://localhost/test.asmx?WSDL", "Пользователь", "Пароль", Неопределено, Таймаут); // ошибка + +КонецПроцедуры + +Процедура HTTP() + HTTPСоединение = Новый HTTPСоединение("zabbix.localhost", 80); // ошибка + HTTPЗапрос = Новый HTTPЗапрос(); // ошибка + HTTPЗапрос = Новый HTTPЗапрос("zabbix", 80); // ошибка + HTTPЗапрос = Новый HTTPЗапрос("zabbix"); // ошибка + ИнтернетПрокси = Новый ИнтернетПрокси("zabbix"); // ошибка +КонецПроцедуры + +Процедура HTTP() + HTTPСоединение = Новый HTTPСоединение("zabbix.localhost", 80); // ошибка + HTTPЗапрос = Новый HTTPЗапрос(); // ошибка + HTTPЗапрос = Новый HTTPЗапрос("zabbix", 80); // ошибка + HTTPЗапрос = Новый HTTPЗапрос("zabbix"); // ошибка + ИнтернетПрокси = Новый ИнтернетПрокси("zabbix"); // ошибка +КонецПроцедуры + +Функция НовыйИнтернетПочтовыйПрофильБезТаймАута() + Профиль = Новый ИнтернетПочтовыйПрофиль; // ошибка + Профиль.Пользователь = "admin"; + Возврат Профиль; +КонецФункции + +Функция InternetMail() + Профиль = Новый InternetMail; // ошибка +КонецФункции + +Профиль = Новый Почта; // ошибка \ No newline at end of file From c95c01058648793058a818f5666243464874af8b Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Fri, 23 Jun 2023 21:10:13 +0300 Subject: [PATCH 2/8] precommit --- docs/diagnostics/InternetAccess.md | 2 +- docs/en/diagnostics/InternetAccess.md | 2 +- .../configuration/parameters-schema.json | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/diagnostics/InternetAccess.md b/docs/diagnostics/InternetAccess.md index 71c168b105c..b6c2c4646d8 100644 --- a/docs/diagnostics/InternetAccess.md +++ b/docs/diagnostics/InternetAccess.md @@ -1,4 +1,4 @@ -# (InternetAccess) +# Обращение к Интернет-ресурсам (InternetAccess) ## Описание диагностики diff --git a/docs/en/diagnostics/InternetAccess.md b/docs/en/diagnostics/InternetAccess.md index 403cc40d707..9c2305abc49 100644 --- a/docs/en/diagnostics/InternetAccess.md +++ b/docs/en/diagnostics/InternetAccess.md @@ -1,4 +1,4 @@ -# (InternetAccess) +# Referring to Internet resources (InternetAccess) ## Description 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 2652d6eed1e..194546f1487 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 @@ -888,6 +888,16 @@ "title": "Incorrect use of \"StrTemplate\"", "$id": "#/definitions/IncorrectUseOfStrTemplate" }, + "InternetAccess": { + "description": "Referring to Internet resources", + "default": true, + "type": [ + "boolean", + "object" + ], + "title": "Referring to Internet resources", + "$id": "#/definitions/InternetAccess" + }, "InvalidCharacterInFile": { "description": "Invalid character", "default": true, From b77d9473f5196419ae13ba5ef2271c46c6b20f08 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Thu, 20 Jul 2023 14:55:18 +0300 Subject: [PATCH 3/8] =?UTF-8?q?=D1=82=D0=B8=D0=BF=20=D0=BE=D0=B1=D1=8B?= =?UTF-8?q?=D1=87=D0=BD=D0=B0=D1=8F=20=D1=83=D1=8F=D0=B7=D0=B2=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20+=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B0=20=D0=9D=D0=BE=D0=B2=D1=8B=D0=B9(?= =?UTF-8?q?=D0=A2=D0=B8=D0=BF)=20+=20=D0=B2=D1=8B=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnostics/InternetAccessDiagnostic.java | 13 +++++++------ .../diagnostics/InternetAccessDiagnosticTest.java | 5 +++-- .../diagnostics/InternetAccessDiagnostic.bsl | 4 ++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java index 20e28719ff2..ed34637e69e 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java @@ -25,6 +25,7 @@ import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticSeverity; import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticTag; import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticType; +import com.github._1c_syntax.bsl.languageserver.utils.bsl.Constructors; import com.github._1c_syntax.bsl.parser.BSLParser; import com.github._1c_syntax.utils.CaseInsensitivePattern; import org.antlr.v4.runtime.tree.ParseTree; @@ -32,12 +33,13 @@ import java.util.regex.Pattern; @DiagnosticMetadata( - type = DiagnosticType.CODE_SMELL, + type = DiagnosticType.VULNERABILITY, severity = DiagnosticSeverity.MINOR, minutesToFix = 1, tags = { DiagnosticTag.SUSPICIOUS - } + }, + activatedByDefault = false ) public class InternetAccessDiagnostic extends AbstractVisitorDiagnostic { @@ -48,13 +50,12 @@ public class InternetAccessDiagnostic extends AbstractVisitorDiagnostic { @Override public ParseTree visitNewExpression(BSLParser.NewExpressionContext ctx) { - var typeNameContext = ctx.typeName(); - if (typeNameContext != null) { - var matcherTypeName = PATTERN_NEW_EXPRESSION.matcher(typeNameContext.getText()); + Constructors.typeName(ctx).ifPresent((String typeName) -> { + var matcherTypeName = PATTERN_NEW_EXPRESSION.matcher(typeName); if (matcherTypeName.matches()) { diagnosticStorage.addDiagnostic(ctx); } - } + }); return super.visitNewExpression(ctx); } } diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java index 8ee4571ff67..096df28e5d6 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java @@ -55,7 +55,8 @@ void test() { .hasRange(25, 21, 51) .hasRange(29, 14, 43) .hasRange(35, 14, 32) - .hasRange(38, 10, 21) - .hasSize(17); + .hasRange(39, 14, 35) + .hasRange(42, 10, 21) + .hasSize(18); } } diff --git a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl index 8f0e4a83a8c..af23599447d 100644 --- a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl +++ b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl @@ -36,4 +36,8 @@ Профиль = Новый InternetMail; // ошибка КонецФункции +Функция InternetMail_НовыйТип() + Профиль = Новый("InternetMail"); // ошибка +КонецФункции + Профиль = Новый Почта; // ошибка \ No newline at end of file From 05abc31febb11d7a087124d537525ddd377a99f6 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Sun, 15 Oct 2023 19:21:24 +0300 Subject: [PATCH 4/8] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../languageserver/diagnostics/InternetAccessDiagnostic.java | 4 ++-- .../diagnostics/InternetAccessDiagnostic_ru.properties | 2 +- src/test/resources/diagnostics/InternetAccessDiagnostic.bsl | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java index ed34637e69e..5f61d1fb290 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java @@ -34,8 +34,8 @@ @DiagnosticMetadata( type = DiagnosticType.VULNERABILITY, - severity = DiagnosticSeverity.MINOR, - minutesToFix = 1, + severity = DiagnosticSeverity.MAJOR, + minutesToFix = 60, tags = { DiagnosticTag.SUSPICIOUS }, diff --git a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties index e867153bc6a..4cf26b98770 100644 --- a/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties +++ b/src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic_ru.properties @@ -1,2 +1,2 @@ diagnosticMessage=Проверьте обращение к Интернет-ресурсам -diagnosticName=Обращение к Интернет-ресурсам \ No newline at end of file +diagnosticName=Обращение к Интернет-ресурсам diff --git a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl index af23599447d..daa61b1756e 100644 --- a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl +++ b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl @@ -36,8 +36,8 @@ Профиль = Новый InternetMail; // ошибка КонецФункции -Функция InternetMail_НовыйТип() +Функция InternetMail_НовыйИмя() Профиль = Новый("InternetMail"); // ошибка КонецФункции -Профиль = Новый Почта; // ошибка \ No newline at end of file +Профиль = Новый Почта; // ошибка From 9937768ffd87bf2e3d2f6ac8263d529a4bbdf746 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Tue, 4 Jun 2024 12:03:15 +0300 Subject: [PATCH 5/8] =?UTF-8?q?=D0=A3=D1=82=D0=BE=D1=87=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=D0=BC=D0=B5=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/diagnostics/InternetAccess.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/diagnostics/InternetAccess.md b/docs/diagnostics/InternetAccess.md index b6c2c4646d8..974639618c7 100644 --- a/docs/diagnostics/InternetAccess.md +++ b/docs/diagnostics/InternetAccess.md @@ -3,10 +3,14 @@ ## Описание диагностики -При код-ревью или аудите кода необходимо проверять обращения к Интернет-ресурсам и набор передаваемых данных для исключения передачи конфиденциальной или защищенной информации. +Проверьте обращение к Интернет-ресурсам и набор передаваемых данных для исключения передачи конфиденциальной или защищенной информации. ## Примеры +```bsl +HTTPСоединение = Новый HTTPСоединение("zabbix.localhost", 80); // замечание +FTPСоединение = Новый FTPСоединение(Сервер, Порт, Пользователь, Пароль); // замечание +``` ## Источники From 4a24a23c7d29cb248a84e3d7a26e979165f78484 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Tue, 4 Jun 2024 12:20:51 +0300 Subject: [PATCH 6/8] precommit --- .../languageserver/diagnostics/InternetAccessDiagnostic.java | 2 +- .../bsl/languageserver/configuration/parameters-schema.json | 2 +- .../diagnostics/InternetAccessDiagnosticTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java index 5f61d1fb290..cb5c0017b64 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnostic.java @@ -1,7 +1,7 @@ /* * This file is a part of BSL Language Server. * - * Copyright (c) 2018-2023 + * Copyright (c) 2018-2024 * Alexey Sosnoviy , Nikita Fedkin and contributors * * SPDX-License-Identifier: LGPL-3.0-or-later 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 194546f1487..426a9533cd8 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 @@ -890,7 +890,7 @@ }, "InternetAccess": { "description": "Referring to Internet resources", - "default": true, + "default": false, "type": [ "boolean", "object" diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java index 096df28e5d6..46cdcc91428 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java @@ -1,7 +1,7 @@ /* * This file is a part of BSL Language Server. * - * Copyright (c) 2018-2023 + * Copyright (c) 2018-2024 * Alexey Sosnoviy , Nikita Fedkin and contributors * * SPDX-License-Identifier: LGPL-3.0-or-later From dfe0737ad3ae5c454c58ce5b18ff1591cf6a5ccb Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Tue, 4 Jun 2024 12:27:38 +0300 Subject: [PATCH 7/8] =?UTF-8?q?=D0=B4=D1=83=D0=B1=D0=BB=D1=8C=20=D0=B2=20?= =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D0=BE=D0=BC=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InternetAccessDiagnosticTest.java | 20 +++++++++---------- .../diagnostics/InternetAccessDiagnostic.bsl | 8 -------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java index 46cdcc91428..01230161a8f 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java @@ -48,15 +48,15 @@ void test() { .hasRange(15, 17, 47) .hasRange(16, 17, 43) .hasRange(17, 21, 51) - .hasRange(21, 21, 65) - .hasRange(22, 17, 35) - .hasRange(23, 17, 47) - .hasRange(24, 17, 43) - .hasRange(25, 21, 51) - .hasRange(29, 14, 43) - .hasRange(35, 14, 32) - .hasRange(39, 14, 35) - .hasRange(42, 10, 21) - .hasSize(18); +// .hasRange(21, 21, 65) +// .hasRange(22, 17, 35) +// .hasRange(23, 17, 47) +// .hasRange(24, 17, 43) +// .hasRange(25, 21, 51) + .hasRange(21, 14, 43) + .hasRange(27, 14, 32) + .hasRange(31, 14, 35) + .hasRange(34, 10, 21) + .hasSize(13); } } diff --git a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl index daa61b1756e..f556f167b3a 100644 --- a/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl +++ b/src/test/resources/diagnostics/InternetAccessDiagnostic.bsl @@ -18,14 +18,6 @@ ИнтернетПрокси = Новый ИнтернетПрокси("zabbix"); // ошибка КонецПроцедуры -Процедура HTTP() - HTTPСоединение = Новый HTTPСоединение("zabbix.localhost", 80); // ошибка - HTTPЗапрос = Новый HTTPЗапрос(); // ошибка - HTTPЗапрос = Новый HTTPЗапрос("zabbix", 80); // ошибка - HTTPЗапрос = Новый HTTPЗапрос("zabbix"); // ошибка - ИнтернетПрокси = Новый ИнтернетПрокси("zabbix"); // ошибка -КонецПроцедуры - Функция НовыйИнтернетПочтовыйПрофильБезТаймАута() Профиль = Новый ИнтернетПочтовыйПрофиль; // ошибка Профиль.Пользователь = "admin"; From 27da16dbea99701270800134aef9a7685de73978 Mon Sep 17 00:00:00 2001 From: Artur Ayukhanov Date: Tue, 4 Jun 2024 12:55:15 +0300 Subject: [PATCH 8/8] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B1=D1=8B=D1=82=D1=8B=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diagnostics/InternetAccessDiagnosticTest.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java index 01230161a8f..2b6216a8a47 100644 --- a/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java +++ b/src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/InternetAccessDiagnosticTest.java @@ -48,11 +48,6 @@ void test() { .hasRange(15, 17, 47) .hasRange(16, 17, 43) .hasRange(17, 21, 51) -// .hasRange(21, 21, 65) -// .hasRange(22, 17, 35) -// .hasRange(23, 17, 47) -// .hasRange(24, 17, 43) -// .hasRange(25, 21, 51) .hasRange(21, 14, 43) .hasRange(27, 14, 32) .hasRange(31, 14, 35)