Search in sources :

Example 1 with NamedBuildLookupElement

use of com.google.idea.blaze.base.lang.buildfile.completion.NamedBuildLookupElement in project intellij by bazelbuild.

the class ArgumentReference method getVariants.

@Override
public Object[] getVariants() {
    FunctionStatement function = resolveFunction();
    if (function == null) {
        return EMPTY_ARRAY;
    }
    List<LookupElement> params = Lists.newArrayList();
    for (Parameter param : function.getParameters()) {
        params.add(new NamedBuildLookupElement(param, QuoteType.NoQuotes));
    }
    return params.toArray();
}
Also used : FunctionStatement(com.google.idea.blaze.base.lang.buildfile.psi.FunctionStatement) NamedBuildLookupElement(com.google.idea.blaze.base.lang.buildfile.completion.NamedBuildLookupElement) Parameter(com.google.idea.blaze.base.lang.buildfile.psi.Parameter) LookupElement(com.intellij.codeInsight.lookup.LookupElement) NamedBuildLookupElement(com.google.idea.blaze.base.lang.buildfile.completion.NamedBuildLookupElement)

Aggregations

NamedBuildLookupElement (com.google.idea.blaze.base.lang.buildfile.completion.NamedBuildLookupElement)1 FunctionStatement (com.google.idea.blaze.base.lang.buildfile.psi.FunctionStatement)1 Parameter (com.google.idea.blaze.base.lang.buildfile.psi.Parameter)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1