Java Code Examples for com.intellij.codeInsight.lookup.LookupElement#EMPTY_ARRAY

The following examples show how to use com.intellij.codeInsight.lookup.LookupElement#EMPTY_ARRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CSharpLookupElementBuilder.java    From consulo-csharp with Apache License 2.0 6 votes vote down vote up
@Nonnull
@RequiredReadAction
public static LookupElement[] buildToLookupElements(@Nonnull PsiElement[] arguments)
{
	if(arguments.length == 0)
	{
		return LookupElement.EMPTY_ARRAY;
	}

	List<LookupElement> list = new ArrayList<>(arguments.length);
	for(PsiElement argument : arguments)
	{
		ContainerUtil.addIfNotNull(list, buildLookupElementWithContextType(argument, null, DotNetGenericExtractor.EMPTY, null));
	}
	return list.toArray(new LookupElement[list.size()]);
}
 
Example 2
Source File: SignalSlotMethodReference.java    From idea-php-typo3-plugin with MIT License 5 votes vote down vote up
@NotNull
@Override
public Object[] getVariants() {
    if (classFqn.isEmpty()) {
        return LookupElement.EMPTY_ARRAY;
    }

    return SignalSlotDispatcherUtil.getPossibleSlotMethodLookupElements(myElement.getProject(), classFqn);
}
 
Example 3
Source File: ForeachComponentTypeMacro.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
@RequiredReadAction
public LookupElement[] calculateLookupItems(@Nonnull Expression[] params, ExpressionContext context)
{
	Result result = calculateResult(params, context);
	if(result == null)
	{
		return LookupElement.EMPTY_ARRAY;
	}
	List<LookupElement> list = new SmartList<>();

	boolean useVarForExtractLocalVariable = CSharpCodeGenerationSettings.getInstance(context.getProject()).USE_VAR_FOR_EXTRACT_LOCAL_VARIABLE;
	boolean varSupported = CSharpModuleUtil.findLanguageVersion(context.getPsiElementAtStartOffset()).isAtLeast(CSharpLanguageVersion._2_0);

	boolean canUseVar = varSupported && useVarForExtractLocalVariable;

	if(canUseVar)
	{
		list.add(LookupElementBuilder.create("var").bold());
	}
	else
	{
		list.add(LookupElementBuilder.create(result.toString()));

		if(varSupported)
		{
			list.add(LookupElementBuilder.create("var").bold());
		}
	}
	return list.toArray(new LookupElement[list.size()]);
}
 
Example 4
Source File: CodeInsightTestFixtureImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@javax.annotation.Nullable
public LookupElement[] getLookupElements() {
  LookupImpl lookup = getLookup();
  if (lookup == null) {
    return myEmptyLookup ? LookupElement.EMPTY_ARRAY : null;
  }
  else {
    final List<LookupElement> list = lookup.getItems();
    return list.toArray(new LookupElement[list.size()]);
  }
}
 
Example 5
Source File: ReturnStatementExpression.java    From consulo-csharp with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public LookupElement[] calculateLookupItems(ExpressionContext context)
{
	return LookupElement.EMPTY_ARRAY;
}
 
Example 6
Source File: TypeRefExpression.java    From consulo-csharp with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public LookupElement[] calculateLookupItems(ExpressionContext context)
{
	return LookupElement.EMPTY_ARRAY;
}
 
Example 7
Source File: ConstantNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public LookupElement[] calculateLookupItems(ExpressionContext context) {
  return LookupElement.EMPTY_ARRAY;
}
 
Example 8
Source File: SelectionNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public LookupElement[] calculateLookupItems(ExpressionContext context) {
  return LookupElement.EMPTY_ARRAY;
}