当前位置: 首页>>代码示例>>Java>>正文


Java ParameterInfoContext类代码示例

本文整理汇总了Java中com.intellij.lang.parameterInfo.ParameterInfoContext的典型用法代码示例。如果您正苦于以下问题:Java ParameterInfoContext类的具体用法?Java ParameterInfoContext怎么用?Java ParameterInfoContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ParameterInfoContext类属于com.intellij.lang.parameterInfo包,在下文中一共展示了ParameterInfoContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
@RequiredReadAction
public ItemToShow[] getParametersForLookup(LookupElement item, ParameterInfoContext context)
{
	Object object = item.getObject();

	if(object instanceof DotNetLikeMethodDeclaration)
	{
		return new ItemToShow[]{new ItemToShow((CSharpSimpleLikeMethod) object, context.getFile())};
	}
	if(object instanceof DotNetVariable)
	{
		DotNetVariable variable = (DotNetVariable) object;
		DotNetTypeRef dotNetTypeRef = variable.toTypeRef(tracksParameterIndex());

		DotNetTypeResolveResult typeResolveResult = dotNetTypeRef.resolve();
		if(typeResolveResult instanceof CSharpLambdaResolveResult)
		{
			return new ItemToShow[]{new ItemToShow((CSharpSimpleLikeMethod) typeResolveResult, variable)};
		}
	}
	return ItemToShow.EMPTY_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:CSharpParameterInfoHandler.java

示例2: findGenericParameterOwner

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
private static DotNetGenericParameterListOwner findGenericParameterOwner(ParameterInfoContext context)
{
	final PsiElement at = context.getFile().findElementAt(context.getEditor().getCaretModel().getOffset());
	if(at == null)
	{
		return null;
	}

	DotNetTypeList typeList = PsiTreeUtil.getParentOfType(at, DotNetTypeList.class);
	if(typeList == null)
	{
		return null;
	}

	PsiElement parent = typeList.getParent();
	if(!(parent instanceof CSharpReferenceExpression))
	{
		return null;
	}

	int argumentsSize = DotNetPsiCountUtil.countChildrenOfType(typeList.getNode(), CSharpTokens.COMMA) + 1;

	CSharpReferenceExpression referenceExpression = (CSharpReferenceExpression) parent;
	ResolveResult[] resolveResults = referenceExpression.multiResolve(true);
	for(ResolveResult resolveResult : resolveResults)
	{
		PsiElement element = resolveResult.getElement();
		if(element instanceof DotNetGenericParameterListOwner)
		{
			int genericParametersCount = ((DotNetGenericParameterListOwner) element).getGenericParametersCount();
			if(genericParametersCount == argumentsSize)
			{
				return (DotNetGenericParameterListOwner) element;
			}
		}
	}

	return null;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:41,代码来源:CSharpGenericParameterInfoHandler.java

示例3: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Override
public Object[] getParametersForLookup(final LookupElement item, final ParameterInfoContext context)
{
	if(!(item instanceof MutableLookupElement))
	{
		return null;
	}

	PsiElement element = item.getPsiElement();
	if(element instanceof JSFunction)
	{
		final JSFunction originalFunction = (JSFunction) element;
		final List<JSFunction> lookupItems = new ArrayList<JSFunction>();
		Set<String> availableSignatures = new HashSet<String>();

		for(PsiElement el : DefinitionsScopedSearch.search(originalFunction))
		{
			doAddSignature(lookupItems, availableSignatures, el);
		}

		if(lookupItems.size() == 0)
		{
			lookupItems.add(originalFunction);
		}

		return lookupItems.toArray(new Object[lookupItems.size()]);
	}

	return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:31,代码来源:JSParameterInfoHandler.java

示例4: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Override
public Object[] getParametersForDocumentation(final JSFunction p, final ParameterInfoContext context)
{
	final JSParameterList list = p.getParameterList();
	if(list != null)
	{
		return list.getParameters();
	}
	return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:11,代码来源:JSParameterInfoHandler.java

示例5: findArgumentList

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
private static VtlArgumentList findArgumentList(final ParameterInfoContext context) {
    final PsiFile file = context.getFile();

    PsiDocumentManager.getInstance(file.getProject()).commitDocument(context.getEditor().getDocument());
    final PsiElement elementAt = file.getViewProvider().findElementAt(context.getOffset(), VtlLanguage.INSTANCE);
    if (elementAt == null) {
        return null;
    }
    final VtlCallExpression call = PsiTreeUtil.getParentOfType(elementAt, VtlCallExpression.class);
    if (call == null) {
        return null;
    }
    return call.findArgumentList();
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:16,代码来源:VtlParameterInfoHandler.java

示例6: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Override
public Object[] getParametersForDocumentation(final Object p, final ParameterInfoContext context)
{
	if(p instanceof MethodCandidateInfo)
	{
		return ((MethodCandidateInfo) p).getElement().getParameterList().getParameters();
	}
	if(p instanceof PsiMethod)
	{
		return ((PsiMethod) p).getParameterList().getParameters();
	}
	return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:14,代码来源:MethodParameterInfoHandler.java

示例7: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
public Object[] getParametersForDocumentation(ItemToShow p, ParameterInfoContext context)
{
	return new Object[0];
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpParameterInfoHandler.java

示例8: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context)
{
	return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpGenericParameterInfoHandler.java

示例9: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
public Object[] getParametersForDocumentation(DotNetGenericParameterListOwner p, ParameterInfoContext context)
{
	return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:7,代码来源:CSharpGenericParameterInfoHandler.java

示例10: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context) {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:6,代码来源:XQueryParameterInfoHandler.java

示例11: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Nullable
@Override
public Object[] getParametersForDocumentation(Object p, ParameterInfoContext context) {
    return null;
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:6,代码来源:XQueryParameterInfoHandler.java

示例12: getArgumentList

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
private XQueryArgumentList getArgumentList(ParameterInfoContext context) {
    PsiElement at = context.getFile().findElementAt(context.getOffset());
    return PsiTreeUtil.getParentOfType(at, XQueryArgumentList.class);
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:5,代码来源:XQueryParameterInfoHandler.java

示例13: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
public Object[] getParametersForLookup(final LookupElement item, final ParameterInfoContext context) {
    //todo
    return null;
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:5,代码来源:VtlParameterInfoHandler.java

示例14: getParametersForDocumentation

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
public Object[] getParametersForDocumentation(final VtlCallable callable, final ParameterInfoContext context) {
    return new Object[]{callable};
}
 
开发者ID:consulo,项目名称:consulo-apache-velocity,代码行数:4,代码来源:VtlParameterInfoHandler.java

示例15: getParametersForLookup

import com.intellij.lang.parameterInfo.ParameterInfoContext; //导入依赖的package包/类
@Override
public Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context)
{
	final List<? extends PsiElement> elements = JavaCompletionUtil.getAllPsiElements(item);
	return elements != null && !elements.isEmpty() && elements.get(0) instanceof PsiMethod ? elements.toArray() : null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:MethodParameterInfoHandler.java


注:本文中的com.intellij.lang.parameterInfo.ParameterInfoContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。