Search in sources :

Example 6 with SignatureInformation

use of org.eclipse.lsp4j.SignatureInformation in project xtext-core by eclipse.

the class SignatureHelpServiceImpl method getSignatureHelp.

private SignatureHelp getSignatureHelp(OperationCall call, String operationName, int offset) {
    // If the offset exceeds either the opening or the closing characters'
    // offset we should not
    // provide signature help at all.
    List<Integer> separatorIndices = new ArrayList<>();
    for (INode node : NodeModelUtils.getNode(call).getChildren()) {
        String text = node.getText();
        if (SignatureHelpServiceImpl.OPENING_CHAR.equals(text) && node.getOffset() >= offset) {
            return ISignatureHelpService.EMPTY;
        } else {
            if (SignatureHelpServiceImpl.CLOSING_CHAR.equals(text) && node.getOffset() < offset) {
                return ISignatureHelpService.EMPTY;
            } else {
                if (SignatureHelpServiceImpl.SEPARATOR_CHAR.equals(text)) {
                    separatorIndices.add(node.getOffset());
                }
            }
        }
    }
    // Here we will distinguish between three different AST states:
    // 1. Valid state: when the number of parameter separators equals with
    // the number of (parameters - 1)
    // and each separator is surrounded by two parameters.
    // 2. Broken recoverable state: the number of parameters equals with the
    // number of separators and the
    // last separator offset is greater than the last parameter (offset +
    // length) and each separator is
    // surrounded by two parameters. Expect the last separator.
    // 3. Broken inconsistent state: non of the above cases.
    int paramCount = call.getParams().size();
    int separatorCount = separatorIndices.size();
    if (separatorCount + 1 == paramCount || separatorCount == paramCount) {
        List<INode> paramNodes = NodeModelUtils.findNodesForFeature(call, TestLanguagePackage.Literals.OPERATION__PARAMS);
        // Parameter count could be greater than separator count.
        for (int i = 0; i < separatorCount; i++) {
            INode paramNode = paramNodes.get(i);
            // should not be provided.
            if (paramNode.getOffset() + paramNode.getLength() > separatorIndices.get(i).intValue()) {
                return ISignatureHelpService.EMPTY;
            }
        }
    } else {
        return ISignatureHelpService.EMPTY;
    }
    final int currentParameter;
    if (paramCount != 0) {
        if (separatorIndices.contains(offset)) {
            currentParameter = separatorIndices.indexOf(offset) + 2;
        } else {
            // Here we can execute a binary search for sure, because the
            // nodes where visited in order.
            currentParameter = -Collections.binarySearch(separatorIndices, offset);
        }
    } else {
        currentParameter = 0;
    }
    Iterable<Operation> visibleOperations = Iterables.filter(getVisibleOperationsWithName(call, operationName), it -> currentParameter <= it.getParams().size());
    int paramOffset = separatorIndices.contains(offset) ? 2 : 1;
    final Integer activeParamIndex;
    if (paramCount == 0) {
        Iterable<Integer> paramSize = Iterables.transform(visibleOperations, it -> it.getParams().size());
        // parameter on use-side.
        if (!Iterables.any(paramSize, it -> it.intValue() == 0) && Iterables.any(visibleOperations, it -> !it.getParams().isEmpty())) {
            activeParamIndex = 0;
        } else {
            activeParamIndex = null;
        }
    } else {
        activeParamIndex = currentParameter - paramOffset;
    }
    SignatureHelp signatureHelp = new SignatureHelp();
    signatureHelp.setActiveParameter(activeParamIndex);
    signatureHelp.setActiveSignature(0);
    signatureHelp.setSignatures(IterableExtensions.sortWith(IterableExtensions.toList(Iterables.transform(visibleOperations, (Operation operation) -> {
        SignatureInformation signatureInformation = new SignatureInformation(getLabel(operation));
        signatureInformation.setParameters(Lists.transform(operation.getParams(), (Parameter param) -> new ParameterInformation(param.getName() + ": " + getLabel(param.getType()))));
        return signatureInformation;
    })), SignatureHelpServiceImpl.SIGNATURE_INFO_ORDERING));
    return signatureHelp;
}
Also used : TestLanguagePackage(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage) Operation(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Operation) Arrays(java.util.Arrays) Iterables(com.google.common.collect.Iterables) TypeReference(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference) Inject(com.google.inject.Inject) NodeModelUtils(org.eclipse.xtext.nodemodel.util.NodeModelUtils) ArrayList(java.util.ArrayList) Strings(com.google.common.base.Strings) Document(org.eclipse.xtext.ide.server.Document) Lists(com.google.common.collect.Lists) EcoreUtil2(org.eclipse.xtext.EcoreUtil2) CancelIndicator(org.eclipse.xtext.util.CancelIndicator) INode(org.eclipse.xtext.nodemodel.INode) Objects(com.google.common.base.Objects) Parameter(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Parameter) XtextResource(org.eclipse.xtext.resource.XtextResource) PrimitiveType(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType) ParameterInformation(org.eclipse.lsp4j.ParameterInformation) ISignatureHelpService(org.eclipse.xtext.ide.server.signatureHelp.ISignatureHelpService) EObject(org.eclipse.emf.ecore.EObject) SignatureInformation(org.eclipse.lsp4j.SignatureInformation) EObjectAtOffsetHelper(org.eclipse.xtext.resource.EObjectAtOffsetHelper) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) List(java.util.List) IterableExtensions(org.eclipse.xtext.xbase.lib.IterableExtensions) OperationCall(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.OperationCall) IScopeProvider(org.eclipse.xtext.scoping.IScopeProvider) TypeDeclaration(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration) Preconditions(com.google.common.base.Preconditions) SignatureHelpParams(org.eclipse.lsp4j.SignatureHelpParams) Comparator(java.util.Comparator) Collections(java.util.Collections) IEObjectDescription(org.eclipse.xtext.resource.IEObjectDescription) Joiner(com.google.common.base.Joiner) INode(org.eclipse.xtext.nodemodel.INode) ArrayList(java.util.ArrayList) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) Operation(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Operation) ParameterInformation(org.eclipse.lsp4j.ParameterInformation) SignatureInformation(org.eclipse.lsp4j.SignatureInformation) Parameter(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Parameter)

Example 7 with SignatureInformation

use of org.eclipse.lsp4j.SignatureInformation in project vscode-nextgenas by BowlerHatLLC.

the class ActionScriptTextDocumentService method signatureHelp.

/**
     * Displays a function's parameters, including which one is currently
     * active. Called automatically by VSCode any time that the user types "(",
     * so be sure to check that a function call is actually happening at the
     * current position.
     */
@Override
public CompletableFuture<SignatureHelp> signatureHelp(TextDocumentPositionParams position) {
    String textDocumentUri = position.getTextDocument().getUri();
    if (!textDocumentUri.endsWith(AS_EXTENSION) && !textDocumentUri.endsWith(MXML_EXTENSION)) {
        //we couldn't find a node at the specified location
        return CompletableFuture.completedFuture(new SignatureHelp(Collections.emptyList(), -1, -1));
    }
    IASNode offsetNode = null;
    IMXMLTagData offsetTag = getOffsetMXMLTag(position);
    if (offsetTag != null) {
        IMXMLTagAttributeData attributeData = getMXMLTagAttributeWithValueAtOffset(offsetTag, currentOffset);
        if (attributeData != null) {
            //some attributes can have ActionScript completion, such as
            //events and properties with data binding
            IClassDefinition tagDefinition = (IClassDefinition) currentProject.resolveXMLNameToDefinition(offsetTag.getXMLName(), offsetTag.getMXMLDialect());
            IDefinition attributeDefinition = currentProject.resolveSpecifier(tagDefinition, attributeData.getShortName());
            if (attributeDefinition instanceof IEventDefinition) {
                IMXMLInstanceNode mxmlNode = (IMXMLInstanceNode) getOffsetNode(position);
                IMXMLEventSpecifierNode eventNode = mxmlNode.getEventSpecifierNode(attributeData.getShortName());
                for (IASNode asNode : eventNode.getASNodes()) {
                    IASNode containingNode = getContainingNodeIncludingStart(asNode, currentOffset);
                    if (containingNode != null) {
                        offsetNode = containingNode;
                    }
                }
                if (offsetNode == null) {
                    offsetNode = eventNode;
                }
            }
        }
    }
    if (offsetNode == null) {
        offsetNode = getOffsetNode(position);
    }
    if (offsetNode == null) {
        //we couldn't find a node at the specified location
        return CompletableFuture.completedFuture(new SignatureHelp(Collections.emptyList(), -1, -1));
    }
    IFunctionCallNode functionCallNode = getAncestorFunctionCallNode(offsetNode);
    IFunctionDefinition functionDefinition = null;
    if (functionCallNode != null) {
        IExpressionNode nameNode = functionCallNode.getNameNode();
        IDefinition definition = nameNode.resolve(currentUnit.getProject());
        if (definition instanceof IFunctionDefinition) {
            functionDefinition = (IFunctionDefinition) definition;
        } else if (definition instanceof IClassDefinition) {
            IClassDefinition classDefinition = (IClassDefinition) definition;
            functionDefinition = classDefinition.getConstructor();
        } else if (nameNode instanceof IIdentifierNode) {
            //special case for super()
            IIdentifierNode identifierNode = (IIdentifierNode) nameNode;
            if (identifierNode.getName().equals(IASKeywordConstants.SUPER)) {
                ITypeDefinition typeDefinition = nameNode.resolveType(currentProject);
                if (typeDefinition instanceof IClassDefinition) {
                    IClassDefinition classDefinition = (IClassDefinition) typeDefinition;
                    functionDefinition = classDefinitionToConstructor(classDefinition);
                }
            }
        }
    }
    if (functionDefinition != null) {
        SignatureHelp result = new SignatureHelp();
        List<SignatureInformation> signatures = new ArrayList<>();
        SignatureInformation signatureInfo = new SignatureInformation();
        signatureInfo.setLabel(getSignatureLabel(functionDefinition));
        List<ParameterInformation> parameters = new ArrayList<>();
        for (IParameterDefinition param : functionDefinition.getParameters()) {
            ParameterInformation paramInfo = new ParameterInformation();
            paramInfo.setLabel(param.getBaseName());
            parameters.add(paramInfo);
        }
        signatureInfo.setParameters(parameters);
        signatures.add(signatureInfo);
        result.setSignatures(signatures);
        result.setActiveSignature(0);
        int index = getFunctionCallNodeArgumentIndex(functionCallNode, offsetNode);
        IParameterDefinition[] params = functionDefinition.getParameters();
        int paramCount = params.length;
        if (paramCount > 0 && index >= paramCount) {
            if (index >= paramCount) {
                IParameterDefinition lastParam = params[paramCount - 1];
                if (lastParam.isRest()) {
                    //functions with rest parameters may accept any
                    //number of arguments, so continue to make the rest
                    //parameter active
                    index = paramCount - 1;
                } else {
                    //if there's no rest parameter, and we're beyond the
                    //final parameter, none should be active
                    index = -1;
                }
            }
        }
        if (index != -1) {
            result.setActiveParameter(index);
        }
        return CompletableFuture.completedFuture(result);
    }
    return CompletableFuture.completedFuture(new SignatureHelp(Collections.emptyList(), -1, -1));
}
Also used : IMXMLEventSpecifierNode(org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode) IClassDefinition(org.apache.flex.compiler.definitions.IClassDefinition) IMXMLInstanceNode(org.apache.flex.compiler.tree.mxml.IMXMLInstanceNode) ITypeDefinition(org.apache.flex.compiler.definitions.ITypeDefinition) ArrayList(java.util.ArrayList) IIdentifierNode(org.apache.flex.compiler.tree.as.IIdentifierNode) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) IMXMLTagData(org.apache.flex.compiler.mxml.IMXMLTagData) IFunctionCallNode(org.apache.flex.compiler.tree.as.IFunctionCallNode) ParameterInformation(org.eclipse.lsp4j.ParameterInformation) IDefinition(org.apache.flex.compiler.definitions.IDefinition) IFunctionDefinition(org.apache.flex.compiler.definitions.IFunctionDefinition) SignatureInformation(org.eclipse.lsp4j.SignatureInformation) IASNode(org.apache.flex.compiler.tree.as.IASNode) IParameterDefinition(org.apache.flex.compiler.definitions.IParameterDefinition) IEventDefinition(org.apache.flex.compiler.definitions.IEventDefinition) IExpressionNode(org.apache.flex.compiler.tree.as.IExpressionNode) IMXMLTagAttributeData(org.apache.flex.compiler.mxml.IMXMLTagAttributeData)

Example 8 with SignatureInformation

use of org.eclipse.lsp4j.SignatureInformation in project eclipse.jdt.ls by eclipse.

the class SignatureHelpHandler method signatureHelp.

public SignatureHelp signatureHelp(TextDocumentPositionParams position, IProgressMonitor monitor) {
    SignatureHelp help = new SignatureHelp();
    if (!preferenceManager.getPreferences(null).isSignatureHelpEnabled()) {
        return help;
    }
    try {
        ICompilationUnit unit = JDTUtils.resolveCompilationUnit(position.getTextDocument().getUri());
        final int offset = JsonRpcHelpers.toOffset(unit.getBuffer(), position.getPosition().getLine(), position.getPosition().getCharacter());
        int[] contextInfomation = getContextInfomation(unit.getBuffer(), offset);
        if (contextInfomation[0] == -1) {
            return help;
        }
        SignatureHelpRequestor collector = new SignatureHelpRequestor(unit, contextInfomation[0] + 1);
        if (offset > -1 && !monitor.isCanceled()) {
            unit.codeComplete(contextInfomation[0] + 1, collector, monitor);
            help = collector.getSignatureHelp(monitor);
            if (help != null) {
                int currentParameter = contextInfomation[1];
                List<SignatureInformation> infos = help.getSignatures();
                for (int i = 0; i < infos.size(); i++) {
                    if (infos.get(i).getParameters().size() >= currentParameter + 1) {
                        help.setActiveSignature(i);
                        help.setActiveParameter(currentParameter);
                        break;
                    }
                }
            }
        }
    } catch (CoreException ex) {
        JavaLanguageServerPlugin.logException("Find signatureHelp failure ", ex);
    }
    return help;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) SignatureInformation(org.eclipse.lsp4j.SignatureInformation) CoreException(org.eclipse.core.runtime.CoreException) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) SignatureHelpRequestor(org.eclipse.jdt.ls.core.internal.contentassist.SignatureHelpRequestor)

Example 9 with SignatureInformation

use of org.eclipse.lsp4j.SignatureInformation in project eclipse.jdt.ls by eclipse.

the class SignatureHelpHandler method isSameParameters.

private boolean isSameParameters(IMethod m, SignatureHelp help, SignatureHelpRequestor collector, IJavaProject javaProject, IProgressMonitor monitor) throws JavaModelException {
    if (m == null || help == null || javaProject == null) {
        return false;
    }
    List<SignatureInformation> infos = help.getSignatures();
    for (int i = 0; i < infos.size(); i++) {
        CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
        IMethod method = JDTUtils.resolveMethod(proposal, javaProject, monitor);
        if (m.getElementName().equals(method.getElementName()) && JDTUtils.isSameParameters(method, m)) {
            return true;
        }
    }
    return false;
}
Also used : SignatureInformation(org.eclipse.lsp4j.SignatureInformation) InternalCompletionProposal(org.eclipse.jdt.internal.codeassist.InternalCompletionProposal) CompletionProposal(org.eclipse.jdt.core.CompletionProposal) IMethod(org.eclipse.jdt.core.IMethod)

Example 10 with SignatureInformation

use of org.eclipse.lsp4j.SignatureInformation in project eclipse.jdt.ls by eclipse.

the class SignatureHelpHandler method signatureHelp.

public SignatureHelp signatureHelp(SignatureHelpParams position, IProgressMonitor monitor) {
    SignatureHelp help = new SignatureHelp();
    if (!preferenceManager.getPreferences(null).isSignatureHelpEnabled()) {
        return help;
    }
    try {
        ICompilationUnit unit = JDTUtils.resolveCompilationUnit(position.getTextDocument().getUri());
        final int offset = JsonRpcHelpers.toOffset(unit.getBuffer(), position.getPosition().getLine(), position.getPosition().getCharacter());
        int[] contextInfomation = getContextInfomation(unit.getBuffer(), offset);
        ASTNode node = getNode(unit, contextInfomation, monitor);
        if (node == null) {
            return help;
        }
        IMethod method = getMethod(node);
        String name = method != null ? method.getElementName() : getMethodName(node, unit, contextInfomation);
        SignatureHelpRequestor collector = new SignatureHelpRequestor(unit, name, contextInfomation[0] + 1);
        if (offset > -1 && !monitor.isCanceled()) {
            unit.codeComplete(contextInfomation[0] + 1, collector, monitor);
            help = collector.getSignatureHelp(monitor);
            if (help.getSignatures().isEmpty()) {
                int pos = offset;
                if (method != null) {
                    int start;
                    if (node instanceof MethodInvocation) {
                        start = ((MethodInvocation) node).getName().getStartPosition();
                    } else if (node instanceof ClassInstanceCreation) {
                        start = ((ClassInstanceCreation) node).getType().getStartPosition();
                    } else {
                        start = node.getStartPosition();
                    }
                    pos = start + method.getElementName().length();
                }
                unit.codeComplete(pos, collector, monitor);
                help = collector.getSignatureHelp(monitor);
                addConstructorProposals(help, node, method, collector, pos);
            }
            if (!monitor.isCanceled() && help != null) {
                SignatureHelp help2 = null;
                SignatureHelpRequestor collector2 = null;
                if (contextInfomation[0] + 1 != offset) {
                    collector2 = new SignatureHelpRequestor(unit, offset, name, true);
                    unit.codeComplete(offset, collector2, monitor);
                    help2 = collector2.getSignatureHelp(monitor);
                }
                int currentParameter = contextInfomation[1];
                int size = currentParameter + 1;
                List<SignatureInformation> infos = help.getSignatures();
                int activeParameter = currentParameter < 0 ? 0 : currentParameter;
                if (node != null) {
                    IJavaProject javaProject = unit.getJavaProject();
                    if (help2 != null) {
                        if (method != null) {
                            for (int i = 0; i < infos.size(); i++) {
                                if (infos.get(i).getParameters().size() >= size) {
                                    CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                                    IMethod m = JDTUtils.resolveMethod(proposal, javaProject, monitor);
                                    if (!monitor.isCanceled() && JDTUtils.isSameParameters(m, method)) {
                                        help.setActiveSignature(i);
                                        help.setActiveParameter(activeParameter);
                                        return help;
                                    }
                                }
                            }
                        }
                        if (!monitor.isCanceled() && help.getActiveSignature() == null) {
                            for (int i = 0; i < infos.size(); i++) {
                                if (infos.get(i).getParameters().size() >= size) {
                                    CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                                    IMethod m = JDTUtils.resolveMethod(proposal, javaProject, monitor);
                                    if (!monitor.isCanceled() && isSameParameters(m, help2, collector2, javaProject, monitor)) {
                                        help.setActiveSignature(i);
                                        help.setActiveParameter(activeParameter);
                                        return help;
                                    }
                                    for (CompletionProposal typeProposal : collector2.getTypeProposals()) {
                                        if (isSameParameters(m, method, typeProposal)) {
                                            help.setActiveSignature(i);
                                            help.setActiveParameter(activeParameter);
                                            return help;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (!monitor.isCanceled() && help.getActiveSignature() == null) {
                        if (method != null) {
                            for (int i = 0; i < infos.size(); i++) {
                                if (infos.get(i).getParameters().size() >= size) {
                                    CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                                    IMethod m = JDTUtils.resolveMethod(proposal, javaProject, monitor);
                                    if (!monitor.isCanceled() && JDTUtils.isSameParameters(method, m)) {
                                        help.setActiveSignature(i);
                                        help.setActiveParameter(activeParameter);
                                        return help;
                                    }
                                }
                            }
                        }
                    }
                    if (!monitor.isCanceled() && help.getActiveSignature() == null) {
                        for (int i = 0; i < infos.size(); i++) {
                            CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                            if (Flags.isVarargs(proposal.getFlags())) {
                                help.setActiveSignature(i);
                                char[][] infoTypes = Signature.getParameterTypes(SignatureUtil.fix83600(proposal.getSignature()));
                                if (infoTypes.length <= activeParameter) {
                                    help.setActiveParameter(infoTypes.length - 1);
                                } else {
                                    help.setActiveParameter(activeParameter);
                                }
                                return help;
                            }
                        }
                    }
                    if (!monitor.isCanceled() && help.getActiveSignature() == null && node instanceof Block) {
                        String methodName = getMethodName(node, unit, contextInfomation);
                        for (int i = 0; i < infos.size(); i++) {
                            if (infos.get(i).getParameters().size() >= activeParameter) {
                                CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                                IMethod m = JDTUtils.resolveMethod(proposal, javaProject, monitor);
                                if (!monitor.isCanceled() && m != null && m.getElementName().equals(methodName)) {
                                    help.setActiveSignature(i);
                                    help.setActiveParameter(activeParameter);
                                    return help;
                                }
                            }
                        }
                    }
                    if (method != null && !monitor.isCanceled() && help.getActiveSignature() == null) {
                        for (int i = 0; i < infos.size(); i++) {
                            if (infos.get(i).getParameters().size() >= size) {
                                CompletionProposal proposal = collector.getInfoProposals().get(infos.get(i));
                                IMethod m = JDTUtils.resolveMethod(proposal, javaProject, monitor);
                                if (!monitor.isCanceled() && isSameParameters(m, method, null)) {
                                    help.setActiveSignature(i);
                                    help.setActiveParameter(activeParameter);
                                    return help;
                                }
                            }
                        }
                    }
                }
            }
        }
    } catch (CoreException ex) {
        JavaLanguageServerPlugin.logException("Find signatureHelp failure ", ex);
    }
    return help;
}
Also used : ClassInstanceCreation(org.eclipse.jdt.core.dom.ClassInstanceCreation) ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) InternalCompletionProposal(org.eclipse.jdt.internal.codeassist.InternalCompletionProposal) CompletionProposal(org.eclipse.jdt.core.CompletionProposal) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation) SignatureInformation(org.eclipse.lsp4j.SignatureInformation) IJavaProject(org.eclipse.jdt.core.IJavaProject) CoreException(org.eclipse.core.runtime.CoreException) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block) IMethod(org.eclipse.jdt.core.IMethod) SignatureHelpRequestor(org.eclipse.jdt.ls.core.internal.contentassist.SignatureHelpRequestor)

Aggregations

SignatureInformation (org.eclipse.lsp4j.SignatureInformation)15 SignatureHelp (org.eclipse.lsp4j.SignatureHelp)12 ArrayList (java.util.ArrayList)6 ParameterInformation (org.eclipse.lsp4j.ParameterInformation)6 List (java.util.List)4 InternalCompletionProposal (org.eclipse.jdt.internal.codeassist.InternalCompletionProposal)4 Position (org.eclipse.lsp4j.Position)4 Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 Collectors (java.util.stream.Collectors)3 CompletionProposal (org.eclipse.jdt.core.CompletionProposal)3 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)3 IMethod (org.eclipse.jdt.core.IMethod)3 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 SymbolInfo (org.ballerinalang.langserver.completions.SymbolInfo)2 CoreException (org.eclipse.core.runtime.CoreException)2 IJavaProject (org.eclipse.jdt.core.IJavaProject)2 ClassInstanceCreation (org.eclipse.jdt.core.dom.ClassInstanceCreation)2