2828import com .github ._1c_syntax .bsl .languageserver .context .events .ServerContextPopulatedEvent ;
2929import com .github ._1c_syntax .bsl .languageserver .context .symbol .AnnotationSymbol ;
3030import com .github ._1c_syntax .bsl .languageserver .context .symbol .MethodSymbol ;
31- import com .github ._1c_syntax .bsl .languageserver .context .symbol .SymbolTree ;
3231import com .github ._1c_syntax .bsl .languageserver .context .symbol .annotations .Annotation ;
3332import com .github ._1c_syntax .bsl .languageserver .references .model .Reference ;
3433import com .github ._1c_syntax .bsl .languageserver .utils .Methods ;
3736import com .github ._1c_syntax .bsl .parser .BSLParser ;
3837import lombok .RequiredArgsConstructor ;
3938import org .antlr .v4 .runtime .tree .TerminalNode ;
40- import org .apache .commons .collections4 .map .CaseInsensitiveMap ;
4139import org .apache .commons .lang3 .tuple .Pair ;
4240import org .eclipse .lsp4j .Location ;
4341import org .eclipse .lsp4j .Position ;
4745import java .net .URI ;
4846import java .util .Map ;
4947import java .util .Optional ;
48+ import java .util .concurrent .ConcurrentHashMap ;
5049
5150@ Component
5251@ RequiredArgsConstructor
5352public class AnnotationReferenceFinder implements ReferenceFinder {
5453
5554 private final ServerContext serverContext ;
56- private final Map <String , AnnotationSymbol > registeredAnnotations = new CaseInsensitiveMap <>();
55+ private final Map <String , AnnotationSymbol > registeredAnnotations = new ConcurrentHashMap <>();
5756
5857 @ EventListener
5958 public void handleContextRefresh (ServerContextPopulatedEvent event ) {
@@ -68,9 +67,8 @@ public void handleDocumentContextChange(DocumentContextContentChangedEvent event
6867 DocumentContext documentContext = event .getSource ();
6968 var uri = documentContext .getUri ();
7069
71- registeredAnnotations .values ().stream ()
72- .filter (annotationSymbol -> annotationSymbol .getOwner ().getUri ().equals (uri ))
73- .forEach (annotationSymbol -> registeredAnnotations .remove (annotationSymbol .getName ()));
70+ registeredAnnotations .values ()
71+ .removeIf (annotationSymbol -> annotationSymbol .getOwner ().getUri ().equals (uri ));
7472
7573 findAndRegisterAnnotation (documentContext );
7674 }
0 commit comments