Search in sources :

Example 11 with Symbols

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols in project ballerina by ballerina-lang.

the class SignatureTreeVisitor method populateSymbols.

/**
 * Populate the symbols.
 * @param symbolEntries symbol entries
 */
private void populateSymbols(Map<Name, Scope.ScopeEntry> symbolEntries) {
    // TODO: Populate only the visible functions
    this.terminateVisitor = true;
    String identifierAgainst = documentServiceContext.get(SignatureKeys.IDENTIFIER_AGAINST);
    List<SymbolInfo> visibleSymbols = new ArrayList<>();
    /*
          During the first iteration we filter out the functions and if there is, the variable reference against which
          the function is called.
         */
    symbolEntries.forEach((k, v) -> {
        if (v.symbol instanceof BInvokableSymbol && !(v.symbol instanceof BOperatorSymbol) && !v.symbol.getName().getValue().contains("<init>")) {
            SymbolInfo symbolInfo = new SymbolInfo(k.getValue(), v);
            visibleSymbols.add(symbolInfo);
        } else if (v.symbol instanceof BVarSymbol && k.getValue().equals(identifierAgainst)) {
            documentServiceContext.put(SignatureKeys.IDENTIFIER_TYPE, v.symbol.type.toString());
        } else if (v.symbol instanceof BPackageSymbol && k.getValue().equals(identifierAgainst)) {
            documentServiceContext.put(SignatureKeys.IDENTIFIER_PKGID, v.symbol.pkgID.toString());
            documentServiceContext.put(SignatureKeys.IDENTIFIER_TYPE, v.symbol.type.toString());
            visibleSymbols.addAll(this.getInvokableSymbolsInPackage((BPackageSymbol) v.symbol));
        }
    });
    /*
          In this iteration we filter out the functions either having a receiver or otherwise.
          If the identifier against value is a valid value, then check whether the receiver type equals to identifier
          type. If there is no identifier, filter out functions without the receiver
         */
    List<SymbolInfo> filteredSymbols = new ArrayList<>();
    visibleSymbols.forEach(symbolInfo -> {
        BVarSymbol receiver = ((BInvokableSymbol) symbolInfo.getScopeEntry().symbol).receiverSymbol;
        String[] nameTokens = symbolInfo.getSymbolName().split("\\.");
        String funcNameFromSymbol = nameTokens[nameTokens.length - 1];
        String functionName = documentServiceContext.get(SignatureKeys.CALLABLE_ITEM_NAME);
        String identifierPkgName = documentServiceContext.get(SignatureKeys.IDENTIFIER_PKGID);
        boolean onIdentifierTypePkg = "package".equals(documentServiceContext.get(SignatureKeys.IDENTIFIER_TYPE)) && symbolInfo.getScopeEntry().symbol.pkgID.toString().equals(identifierPkgName);
        boolean onReceiverTypeMatchIdentifier = receiver != null && receiver.type.toString().equals(documentServiceContext.get(SignatureKeys.IDENTIFIER_TYPE));
        boolean onIdentifierAgainstNull = (receiver == null && (identifierAgainst == null || identifierAgainst.equals("")));
        if ((onIdentifierTypePkg || onReceiverTypeMatchIdentifier || onIdentifierAgainstNull) && funcNameFromSymbol.equals(functionName)) {
            filteredSymbols.add(symbolInfo);
        }
    });
    documentServiceContext.put(SignatureKeys.FILTERED_FUNCTIONS, filteredSymbols);
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) ArrayList(java.util.ArrayList) BInvokableSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol) BOperatorSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BOperatorSymbol) BVarSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BVarSymbol) SymbolInfo(org.ballerinalang.langserver.completions.SymbolInfo)

Example 12 with Symbols

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols in project ballerina by ballerina-lang.

the class CompletionTestUtil method getCompletions.

/**
 * Get the completions list.
 *
 * @param documentManager Document manager instance
 * @param pos             {@link TextDocumentPositionParams} position params
 */
public static List<CompletionItem> getCompletions(WorkspaceDocumentManagerImpl documentManager, TextDocumentPositionParams pos) {
    List<CompletionItem> completions;
    TextDocumentServiceContext completionContext = new TextDocumentServiceContext();
    completionContext.put(DocumentServiceKeys.POSITION_KEY, pos);
    completionContext.put(DocumentServiceKeys.FILE_URI_KEY, pos.getTextDocument().getUri());
    BLangPackage bLangPackage = TextDocumentServiceUtil.getBLangPackage(completionContext, documentManager, false, CompletionCustomErrorStrategy.class, false).get(0);
    completionContext.put(DocumentServiceKeys.CURRENT_PACKAGE_NAME_KEY, bLangPackage.symbol.getName().getValue());
    // Visit the package to resolve the symbols
    TreeVisitor treeVisitor = new TreeVisitor(completionContext);
    bLangPackage.accept(treeVisitor);
    BLangNode symbolEnvNode = completionContext.get(CompletionKeys.SYMBOL_ENV_NODE_KEY);
    if (symbolEnvNode == null) {
        completions = CompletionItemResolver.getResolverByClass(TopLevelResolver.class).resolveItems(completionContext);
    } else {
        completions = CompletionItemResolver.getResolverByClass(symbolEnvNode.getClass()).resolveItems(completionContext);
    }
    return completions;
}
Also used : TreeVisitor(org.ballerinalang.langserver.completions.TreeVisitor) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) CompletionCustomErrorStrategy(org.ballerinalang.langserver.completions.CompletionCustomErrorStrategy) TextDocumentServiceContext(org.ballerinalang.langserver.TextDocumentServiceContext) CompletionItem(org.eclipse.lsp4j.CompletionItem)

Example 13 with Symbols

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols in project ballerina by ballerina-lang.

the class BallerinaTextDocumentService method documentSymbol.

@Override
public CompletableFuture<List<? extends SymbolInformation>> documentSymbol(DocumentSymbolParams params) {
    String uri = params.getTextDocument().getUri();
    List<SymbolInformation> symbols = new ArrayList<>();
    TextDocumentServiceContext symbolsContext = new TextDocumentServiceContext();
    symbolsContext.put(DocumentServiceKeys.FILE_URI_KEY, uri);
    symbolsContext.put(DocumentServiceKeys.SYMBOL_LIST_KEY, symbols);
    BLangPackage bLangPackage = TextDocumentServiceUtil.getBLangPackage(symbolsContext, documentManager, false, LSCustomErrorStrategy.class, false).get(0);
    symbolsContext.put(DocumentServiceKeys.CURRENT_PACKAGE_NAME_KEY, bLangPackage.symbol.getName().getValue());
    Optional<BLangCompilationUnit> documentCUnit = bLangPackage.getCompilationUnits().stream().filter(cUnit -> (uri.endsWith(cUnit.getName()))).findFirst();
    documentCUnit.ifPresent(cUnit -> {
        SymbolFindingVisitor visitor = new SymbolFindingVisitor(symbolsContext);
        cUnit.accept(visitor);
    });
    return CompletableFuture.supplyAsync(() -> symbols);
}
Also used : CommonUtil(org.ballerinalang.langserver.common.utils.CommonUtil) JsonObject(com.google.gson.JsonObject) RenameUtil(org.ballerinalang.langserver.rename.RenameUtil) HoverUtil(org.ballerinalang.langserver.hover.util.HoverUtil) DidChangeTextDocumentParams(org.eclipse.lsp4j.DidChangeTextDocumentParams) NodeContextKeys(org.ballerinalang.langserver.common.constants.NodeContextKeys) DidSaveTextDocumentParams(org.eclipse.lsp4j.DidSaveTextDocumentParams) TreeVisitor(org.ballerinalang.langserver.completions.TreeVisitor) LSDocument(org.ballerinalang.langserver.common.LSDocument) PublishDiagnosticsParams(org.eclipse.lsp4j.PublishDiagnosticsParams) CodeLens(org.eclipse.lsp4j.CodeLens) Map(java.util.Map) Location(org.eclipse.lsp4j.Location) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) BLangCompilationUnit(org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit) URI(java.net.URI) DidCloseTextDocumentParams(org.eclipse.lsp4j.DidCloseTextDocumentParams) RenameParams(org.eclipse.lsp4j.RenameParams) Path(java.nio.file.Path) SignatureTreeVisitor(org.ballerinalang.langserver.signature.SignatureTreeVisitor) ReferenceUtil(org.ballerinalang.langserver.references.util.ReferenceUtil) TextDocumentService(org.eclipse.lsp4j.services.TextDocumentService) DiagnosticSeverity(org.eclipse.lsp4j.DiagnosticSeverity) TextDocumentPositionParams(org.eclipse.lsp4j.TextDocumentPositionParams) DiagnosticListener(org.ballerinalang.util.diagnostic.DiagnosticListener) MarkedString(org.eclipse.lsp4j.MarkedString) DocumentOnTypeFormattingParams(org.eclipse.lsp4j.DocumentOnTypeFormattingParams) CompletionItem(org.eclipse.lsp4j.CompletionItem) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) List(java.util.List) Command(org.eclipse.lsp4j.Command) DidOpenTextDocumentParams(org.eclipse.lsp4j.DidOpenTextDocumentParams) WorkspacePackageRepository(org.ballerinalang.langserver.workspace.repository.WorkspacePackageRepository) Optional(java.util.Optional) Debouncer(org.ballerinalang.langserver.util.Debouncer) WorkspaceDocumentManager(org.ballerinalang.langserver.workspace.WorkspaceDocumentManager) DocumentSymbolParams(org.eclipse.lsp4j.DocumentSymbolParams) WorkspaceDocumentManagerImpl(org.ballerinalang.langserver.workspace.WorkspaceDocumentManagerImpl) Diagnostic(org.eclipse.lsp4j.Diagnostic) Range(org.eclipse.lsp4j.Range) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) DocumentRangeFormattingParams(org.eclipse.lsp4j.DocumentRangeFormattingParams) Hover(org.eclipse.lsp4j.Hover) Compiler(org.wso2.ballerinalang.compiler.Compiler) SymbolInformation(org.eclipse.lsp4j.SymbolInformation) ArrayList(java.util.ArrayList) CommandUtil(org.ballerinalang.langserver.command.CommandUtil) SignatureHelpUtil(org.ballerinalang.langserver.signature.SignatureHelpUtil) PositionTreeVisitor(org.ballerinalang.langserver.common.position.PositionTreeVisitor) CodeActionParams(org.eclipse.lsp4j.CodeActionParams) TextEdit(org.eclipse.lsp4j.TextEdit) PackageRepository(org.ballerinalang.repository.PackageRepository) DocumentFormattingParams(org.eclipse.lsp4j.DocumentFormattingParams) Position(org.eclipse.lsp4j.Position) CompletionKeys(org.ballerinalang.langserver.completions.CompletionKeys) CodeLensParams(org.eclipse.lsp4j.CodeLensParams) CompletionList(org.eclipse.lsp4j.CompletionList) SymbolFindingVisitor(org.ballerinalang.langserver.symbols.SymbolFindingVisitor) CompletionItemResolver(org.ballerinalang.langserver.completions.util.CompletionItemResolver) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) DocumentHighlight(org.eclipse.lsp4j.DocumentHighlight) DefinitionUtil(org.ballerinalang.langserver.definition.util.DefinitionUtil) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) LSCustomErrorStrategy(org.ballerinalang.langserver.common.LSCustomErrorStrategy) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) Paths(java.nio.file.Paths) CompletionCustomErrorStrategy(org.ballerinalang.langserver.completions.CompletionCustomErrorStrategy) Collections(java.util.Collections) TopLevelResolver(org.ballerinalang.langserver.completions.resolvers.TopLevelResolver) TextDocumentFormatUtil(org.ballerinalang.langserver.format.TextDocumentFormatUtil) ReferenceParams(org.eclipse.lsp4j.ReferenceParams) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) SymbolFindingVisitor(org.ballerinalang.langserver.symbols.SymbolFindingVisitor) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) ArrayList(java.util.ArrayList) MarkedString(org.eclipse.lsp4j.MarkedString) SymbolInformation(org.eclipse.lsp4j.SymbolInformation) LSCustomErrorStrategy(org.ballerinalang.langserver.common.LSCustomErrorStrategy) BLangCompilationUnit(org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit)

Example 14 with Symbols

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.Symbols in project ballerina by ballerina-lang.

the class CommonUtil method generateJSON.

/**
 * Generate json representation for the given node.
 *
 * @param node        Node to get the json representation
 * @param anonStructs Map of anonymous structs
 * @return {@link JsonElement}          Json Representation of the node
 */
public static JsonElement generateJSON(Node node, Map<String, Node> anonStructs) {
    if (node == null) {
        return JsonNull.INSTANCE;
    }
    Set<Method> methods = ClassUtils.getAllInterfaces(node.getClass()).stream().flatMap(aClass -> Arrays.stream(aClass.getMethods())).collect(Collectors.toSet());
    JsonObject nodeJson = new JsonObject();
    JsonArray wsJsonArray = new JsonArray();
    Set<Whitespace> ws = node.getWS();
    if (ws != null && !ws.isEmpty()) {
        for (Whitespace whitespace : ws) {
            JsonObject wsJson = new JsonObject();
            wsJson.addProperty("ws", whitespace.getWs());
            wsJson.addProperty("i", whitespace.getIndex());
            wsJson.addProperty("text", whitespace.getPrevious());
            wsJson.addProperty("static", whitespace.isStatic());
            wsJsonArray.add(wsJson);
        }
        nodeJson.add("ws", wsJsonArray);
    }
    org.ballerinalang.util.diagnostic.Diagnostic.DiagnosticPosition position = node.getPosition();
    if (position != null) {
        JsonObject positionJson = new JsonObject();
        positionJson.addProperty("startColumn", position.getStartColumn());
        positionJson.addProperty("startLine", position.getStartLine());
        positionJson.addProperty("endColumn", position.getEndColumn());
        positionJson.addProperty("endLine", position.getEndLine());
        nodeJson.add("position", positionJson);
    }
    JsonArray type = getType(node);
    if (type != null) {
        nodeJson.add(SYMBOL_TYPE, type);
    }
    if (node.getKind() == NodeKind.INVOCATION) {
        assert node instanceof BLangInvocation : node.getClass();
        BLangInvocation invocation = (BLangInvocation) node;
        if (invocation.symbol != null && invocation.symbol.kind != null) {
            nodeJson.addProperty(INVOCATION_TYPE, invocation.symbol.kind.toString());
        }
    }
    for (Method m : methods) {
        String name = m.getName();
        if (name.equals("getWS") || name.equals("getPosition")) {
            continue;
        }
        String jsonName;
        if (name.startsWith("get")) {
            jsonName = toJsonName(name, 3);
        } else if (name.startsWith("is")) {
            jsonName = toJsonName(name, 2);
        } else {
            continue;
        }
        Object prop = null;
        try {
            prop = m.invoke(node);
        } catch (IllegalAccessException | InvocationTargetException e) {
            logger.error("Error while serializing source to JSON: [" + e.getMessage() + "]");
        }
        /* Literal class - This class is escaped in backend to address cases like "ss\"" and 8.0 and null */
        if (node.getKind() == NodeKind.LITERAL && "value".equals(jsonName)) {
            if (prop instanceof String) {
                nodeJson.addProperty(jsonName, '"' + StringEscapeUtils.escapeJava((String) prop) + '"');
                nodeJson.addProperty(UNESCAPED_VALUE, String.valueOf(prop));
            } else {
                nodeJson.addProperty(jsonName, String.valueOf(prop));
            }
            continue;
        }
        if (node.getKind() == NodeKind.USER_DEFINED_TYPE && jsonName.equals("typeName")) {
            IdentifierNode typeNode = (IdentifierNode) prop;
            Node structNode;
            if (typeNode.getValue().startsWith("$anonStruct$") && (structNode = anonStructs.remove(typeNode.getValue())) != null) {
                JsonObject anonStruct = generateJSON(structNode, anonStructs).getAsJsonObject();
                anonStruct.addProperty("anonStruct", true);
                nodeJson.add("anonStruct", anonStruct);
                continue;
            }
        }
        if (prop instanceof List && jsonName.equals("types")) {
            // Currently we don't need any Symbols for the UI. So skipping for now.
            continue;
        }
        /* Node classes */
        if (prop instanceof Node) {
            nodeJson.add(jsonName, generateJSON((Node) prop, anonStructs));
        } else if (prop instanceof List) {
            List listProp = (List) prop;
            JsonArray listPropJson = new JsonArray();
            nodeJson.add(jsonName, listPropJson);
            for (Object listPropItem : listProp) {
                if (listPropItem instanceof Node) {
                    /* Remove top level anon func and struct */
                    if (node.getKind() == NodeKind.COMPILATION_UNIT) {
                        if (listPropItem instanceof BLangStruct && ((BLangStruct) listPropItem).isAnonymous) {
                            anonStructs.put(((BLangStruct) listPropItem).getName().getValue(), ((BLangStruct) listPropItem));
                            continue;
                        }
                        if (listPropItem instanceof BLangFunction && (((BLangFunction) listPropItem)).name.value.startsWith("$lambda$")) {
                            continue;
                        }
                    }
                    listPropJson.add(generateJSON((Node) listPropItem, anonStructs));
                } else {
                    logger.debug("Can't serialize " + jsonName + ", has a an array of " + listPropItem);
                }
            }
        /* Runtime model classes */
        } else if (prop instanceof Set && jsonName.equals("flags")) {
            Set flags = (Set) prop;
            for (Flag flag : Flag.values()) {
                nodeJson.addProperty(StringUtils.lowerCase(flag.toString()), flags.contains(flag));
            }
        } else if (prop instanceof Set) {
            // TODO : limit this else if to getInputs getOutputs of transform.
            Set vars = (Set) prop;
            JsonArray listVarJson = new JsonArray();
            nodeJson.add(jsonName, listVarJson);
            for (Object obj : vars) {
                listVarJson.add(obj.toString());
            }
        } else if (prop instanceof NodeKind) {
            String kindName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, prop.toString());
            nodeJson.addProperty(jsonName, kindName);
        } else if (prop instanceof OperatorKind) {
            nodeJson.addProperty(jsonName, prop.toString());
        /* Generic classes */
        } else if (prop instanceof String) {
            nodeJson.addProperty(jsonName, (String) prop);
        } else if (prop instanceof Number) {
            nodeJson.addProperty(jsonName, (Number) prop);
        } else if (prop instanceof Boolean) {
            nodeJson.addProperty(jsonName, (Boolean) prop);
        } else if (prop instanceof Enum) {
            nodeJson.addProperty(jsonName, StringUtils.lowerCase(((Enum) prop).name()));
        } else if (prop != null) {
            nodeJson.addProperty(jsonName, prop.toString());
            String message = "Node " + node.getClass().getSimpleName() + " contains unknown type prop: " + jsonName + " of type " + prop.getClass();
            logger.error(message);
        }
    }
    return nodeJson;
}
Also used : JsonObject(com.google.gson.JsonObject) Arrays(java.util.Arrays) TokenStream(org.antlr.v4.runtime.TokenStream) URISyntaxException(java.net.URISyntaxException) Token(org.antlr.v4.runtime.Token) LoggerFactory(org.slf4j.LoggerFactory) TextDocumentIdentifier(org.eclipse.lsp4j.TextDocumentIdentifier) StringUtils(org.apache.commons.lang3.StringUtils) PROJECT_DIR(org.ballerinalang.compiler.CompilerOptionName.PROJECT_DIR) ClassUtils(org.apache.commons.lang3.ClassUtils) LSDocument(org.ballerinalang.langserver.common.LSDocument) OperatorKind(org.ballerinalang.model.tree.OperatorKind) Flag(org.ballerinalang.model.elements.Flag) IdentifierNode(org.ballerinalang.model.tree.IdentifierNode) Map(java.util.Map) BLangCompilationUnit(org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit) StringEscapeUtils(org.apache.commons.lang3.StringEscapeUtils) PRESERVE_WHITESPACE(org.ballerinalang.compiler.CompilerOptionName.PRESERVE_WHITESPACE) Method(java.lang.reflect.Method) Path(java.nio.file.Path) DocumentServiceKeys(org.ballerinalang.langserver.DocumentServiceKeys) CompilerPhase(org.ballerinalang.compiler.CompilerPhase) NullSourceDirectory(org.ballerinalang.langserver.workspace.repository.NullSourceDirectory) Set(java.util.Set) COMPILER_PHASE(org.ballerinalang.compiler.CompilerOptionName.COMPILER_PHASE) Collectors(java.util.stream.Collectors) InvocationTargetException(java.lang.reflect.InvocationTargetException) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) Whitespace(org.ballerinalang.model.Whitespace) JsonArray(com.google.gson.JsonArray) List(java.util.List) NodeKind(org.ballerinalang.model.tree.NodeKind) WorkspaceDocumentManager(org.ballerinalang.langserver.workspace.WorkspaceDocumentManager) CompilerOptions(org.wso2.ballerinalang.compiler.util.CompilerOptions) ArrayList(java.util.ArrayList) JsonElement(com.google.gson.JsonElement) SourceDirectory(org.wso2.ballerinalang.compiler.SourceDirectory) Position(org.eclipse.lsp4j.Position) BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType) DiagnosticPos(org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) TextDocumentServiceContext(org.ballerinalang.langserver.TextDocumentServiceContext) Logger(org.slf4j.Logger) MalformedURLException(java.net.MalformedURLException) CaseFormat(com.google.common.base.CaseFormat) BLangFunction(org.wso2.ballerinalang.compiler.tree.BLangFunction) Paths(java.nio.file.Paths) Node(org.ballerinalang.model.tree.Node) BLangInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation) JsonNull(com.google.gson.JsonNull) BLangStruct(org.wso2.ballerinalang.compiler.tree.BLangStruct) TextDocumentFormatUtil(org.ballerinalang.langserver.format.TextDocumentFormatUtil) CompilerContext(org.wso2.ballerinalang.compiler.util.CompilerContext) Set(java.util.Set) IdentifierNode(org.ballerinalang.model.tree.IdentifierNode) BLangNode(org.wso2.ballerinalang.compiler.tree.BLangNode) Node(org.ballerinalang.model.tree.Node) JsonObject(com.google.gson.JsonObject) BLangStruct(org.wso2.ballerinalang.compiler.tree.BLangStruct) Whitespace(org.ballerinalang.model.Whitespace) NodeKind(org.ballerinalang.model.tree.NodeKind) List(java.util.List) ArrayList(java.util.ArrayList) BLangInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation) BLangFunction(org.wso2.ballerinalang.compiler.tree.BLangFunction) IdentifierNode(org.ballerinalang.model.tree.IdentifierNode) Method(java.lang.reflect.Method) Flag(org.ballerinalang.model.elements.Flag) InvocationTargetException(java.lang.reflect.InvocationTargetException) JsonArray(com.google.gson.JsonArray) OperatorKind(org.ballerinalang.model.tree.OperatorKind) JsonObject(com.google.gson.JsonObject)

Aggregations

ArrayList (java.util.ArrayList)6 BPackageSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol)5 BLangNode (org.wso2.ballerinalang.compiler.tree.BLangNode)5 BLangPackage (org.wso2.ballerinalang.compiler.tree.BLangPackage)5 List (java.util.List)4 Map (java.util.Map)4 JsonObject (com.google.gson.JsonObject)3 Paths (java.nio.file.Paths)3 Arrays (java.util.Arrays)3 HashMap (java.util.HashMap)3 Collectors (java.util.stream.Collectors)3 TokenStream (org.antlr.v4.runtime.TokenStream)3 TextDocumentServiceContext (org.ballerinalang.langserver.TextDocumentServiceContext)3 CompletionCustomErrorStrategy (org.ballerinalang.langserver.completions.CompletionCustomErrorStrategy)3 SymbolInfo (org.ballerinalang.langserver.completions.SymbolInfo)3 TreeVisitor (org.ballerinalang.langserver.completions.TreeVisitor)3 BInvokableSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol)3 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)3 BLangCompilationUnit (org.wso2.ballerinalang.compiler.tree.BLangCompilationUnit)3 BLangInvocation (org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation)3