Search in sources :

Example 1 with RubyLookupElement

use of org.jetbrains.plugins.ruby.ruby.codeInsight.completion.RubyLookupElement in project intellij-plugins by JetBrains.

the class RubyMotionCompletionProvider method createLookupItem.

private static LookupElement createLookupItem(@NotNull final FunctionSymbol symbol, final boolean bold, final boolean isInsertHandlerCanBeApplied) {
    final Symbol parent = symbol.getParentSymbol();
    if (parent == null || !isInsertHandlerCanBeApplied)
        return null;
    final Function function = symbol.getFunction();
    if (function.getArguments().size() < 2 || !function.getName().contains(":"))
        return null;
    return new RubyLookupElement(function.getName(), "", parent.getFQNWithNesting().getFullPath(), bold, AllIcons.Nodes.Method, null, new SelectorInsertHandler(function));
}
Also used : Function(org.jetbrains.plugins.ruby.motion.bridgesupport.Function) FunctionSymbol(org.jetbrains.plugins.ruby.motion.symbols.FunctionSymbol) Symbol(org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol) RubyLookupElement(org.jetbrains.plugins.ruby.ruby.codeInsight.completion.RubyLookupElement)

Aggregations

Function (org.jetbrains.plugins.ruby.motion.bridgesupport.Function)1 FunctionSymbol (org.jetbrains.plugins.ruby.motion.symbols.FunctionSymbol)1 RubyLookupElement (org.jetbrains.plugins.ruby.ruby.codeInsight.completion.RubyLookupElement)1 Symbol (org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.structure.Symbol)1