From 9c755e0bb14251e3d7aa5be33c82fe078b98b2da Mon Sep 17 00:00:00 2001 From: Nikita Gryzlov Date: Fri, 22 Oct 2021 17:16:47 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20Set=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B0=20=D0=BE=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=BA=D0=B8=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=83=D0=B7=D0=BB=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B2=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D0=B5=20=D1=80=D0=B0=D0=B7=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../languageserver/context/computer/MethodSymbolComputer.java | 3 ++- .../languageserver/context/computer/RegionSymbolComputer.java | 4 +++- .../context/computer/VariableSymbolComputer.java | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java index ca34743c38f..c3c371aefe0 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/MethodSymbolComputer.java @@ -46,6 +46,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; @@ -60,7 +61,7 @@ public final class MethodSymbolComputer BSLParser.ANNOTATION_ATCLIENTATSERVER_SYMBOL); private final DocumentContext documentContext; - private final List methods = new ArrayList<>(); + private final Set methods = new HashSet<>(); public MethodSymbolComputer(DocumentContext documentContext) { this.documentContext = documentContext; diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/RegionSymbolComputer.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/RegionSymbolComputer.java index adc56c4623b..c4ada8536fb 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/RegionSymbolComputer.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/RegionSymbolComputer.java @@ -33,7 +33,9 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Deque; +import java.util.HashSet; import java.util.List; +import java.util.Set; public final class RegionSymbolComputer extends BSLParserBaseVisitor @@ -42,7 +44,7 @@ public final class RegionSymbolComputer private final DocumentContext documentContext; private final Deque> regionStack = new ArrayDeque<>(); - private final List regions = new ArrayList<>(); + private final Set regions = new HashSet<>(); public RegionSymbolComputer(DocumentContext documentContext) { this.documentContext = documentContext; diff --git a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java index ad1559fa891..ff202f54321 100644 --- a/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java +++ b/src/main/java/com/github/_1c_syntax/bsl/languageserver/context/computer/VariableSymbolComputer.java @@ -34,13 +34,15 @@ import org.antlr.v4.runtime.tree.ParseTree; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Optional; +import java.util.Set; public class VariableSymbolComputer extends BSLParserBaseVisitor implements Computer> { private final DocumentContext documentContext; - private final List variables = new ArrayList<>(); + private final Set variables = new HashSet<>(); public VariableSymbolComputer(DocumentContext documentContext) { this.documentContext = documentContext;