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


Java CompletionParameters.getInvocationCount方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.completion.CompletionParameters.getInvocationCount方法的典型用法代码示例。如果您正苦于以下问题:Java CompletionParameters.getInvocationCount方法的具体用法?Java CompletionParameters.getInvocationCount怎么用?Java CompletionParameters.getInvocationCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.completion.CompletionParameters的用法示例。


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

示例1: delegate

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@RequiredReadAction
private static void delegate(CompletionParameters parameters, final CompletionResultSet result, final InheritorsHolder inheritorsHolder)
{
	if(parameters.getCompletionType() == CompletionType.BASIC)
	{
		PsiElement position = parameters.getPosition();
		if(parameters.getInvocationCount() <= 1 && CSharpCompletionUtil.mayStartClassName(result) && CSharpCompletionUtil.isClassNamePossible(parameters))
		{
			addTypesForUsing(parameters, result, inheritorsHolder);
			return;
		}

		//suggestChainedCalls(parameters, result, position);
	}

	if(parameters.getCompletionType() == CompletionType.SMART && parameters.getInvocationCount() == 2)
	{
		result.runRemainingContributors(parameters.withInvocationCount(3), true);
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:21,代码来源:CSharpNoVariantsDelegator.java

示例2: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
  PsiFile file = parameters.getOriginalFile();
  Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
  if (document != null) {
    DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
    if (dataContext != null) {
      result.stopHere();
      if (parameters.getInvocationCount() > 0) {
        ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dataContext);
        if (lists != null) {
          String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
          CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
          for (ChangeList list : lists) {
            for (Change change : list.getChanges()) {
              ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
              if (revision != null) {
                FilePath filePath = revision.getFile();
                LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).
                    withIcon(filePath.getFileType().getIcon());
                insensitive.addElement(element);
              }
            }
          }
        }
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:CommitCompletionContributor.java

示例3: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) {
  final Editor editor = parameters.getEditor();
  final TemplateState state = TemplateManagerImpl.getTemplateState(editor);
  if (state != null) {
    if (editor.getUserData(InplaceRefactoring.INPLACE_RENAMER) != null && parameters.getInvocationCount() == 0) {
      result.stopHere();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:CompletionContributorForInplaceRename.java

示例4: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
  PsiFile file = parameters.getOriginalFile();
  Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
  if (document != null) {
    DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
    if (dataContext != null) {
      result.stopHere();
      if (parameters.getInvocationCount() > 0) {
        ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dataContext);
        if (lists != null) {
          String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
          CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
          for (ChangeList list : lists) {
            for (Change change : list.getChanges()) {
              ContentRevision revision = change.getAfterRevision() == null ? change.getBeforeRevision() : change.getAfterRevision();
              if (revision != null) {
                FilePath filePath = revision.getFile();
                LookupElementBuilder element = LookupElementBuilder.create(filePath.getName()).
                    withIcon(filePath.getFileType().getIcon());
                insensitive.addElement(element);
              }
            }
          }
        }
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:CommitCompletionContributor.java

示例5: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
  final Editor editor = parameters.getEditor();
  final TemplateState state = TemplateManagerImpl.getTemplateState(editor);
  if (state != null) {
    if (editor.getUserData(InplaceRefactoring.INPLACE_RENAMER) != null && parameters.getInvocationCount() == 0) {
      result.stopHere();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:CompletionContributorForInplaceRename.java

示例6: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) {
  PsiFile file = parameters.getOriginalFile();
  Document document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
  if (document != null) {
    DataContext dataContext = document.getUserData(CommitMessage.DATA_CONTEXT_KEY);
    if (dataContext != null) {
      result.stopHere();
      if (parameters.getInvocationCount() > 0) {
        ChangeList[] lists = dataContext.getData(VcsDataKeys.CHANGE_LISTS);
        if (lists != null) {
          String prefix = TextFieldWithAutoCompletionListProvider.getCompletionPrefix(parameters);
          CompletionResultSet insensitive = result.caseInsensitive().withPrefixMatcher(new CamelHumpMatcher(prefix));
          for (ChangeList list : lists) {
            for (Change change : list.getChanges()) {
              VirtualFile virtualFile = change.getVirtualFile();
              if (virtualFile != null) {
                LookupElementBuilder element = LookupElementBuilder.create(virtualFile.getName()).
                  withIcon(VirtualFilePresentation.getIcon(virtualFile));
                insensitive.addElement(element);
              }
            }
          }
        }
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:CommitCompletionContributor.java

示例7: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@RequiredReadAction
@Override
public void fillCompletionVariants(@Nonnull CompletionParameters parameters, @Nonnull CompletionResultSet result) {
  final Editor editor = parameters.getEditor();
  final TemplateState state = TemplateManagerImpl.getTemplateState(editor);
  if (state != null) {
    if (editor.getUserData(InplaceRefactoring.INPLACE_RENAMER) != null && parameters.getInvocationCount() == 0) {
      result.stopHere();
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:CompletionContributorForInplaceRename.java

示例8: fillCompletionVariants

import com.intellij.codeInsight.completion.CompletionParameters; //导入方法依赖的package包/类
@RequiredReadAction
@RequiredDispatchThread
public static void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result)
{
	final InheritorsHolder holder = new InheritorsHolder(result);
	ResultTracker tracker = new ResultTracker(result)
	{
		@Override
		public void consume(CompletionResult plainResult)
		{
			super.consume(plainResult);

			LookupElement element = plainResult.getLookupElement();
			Object o = element.getObject();
			if(o instanceof PsiElement && CSharpPsiUtilImpl.isTypeLikeElement((PsiElement) o))
			{
				holder.registerTypeLike((DotNetQualifiedElement) o);
			}
		}
	};
	result.runRemainingContributors(parameters, tracker);
	final boolean empty = tracker.containsOnlyNamespaces;

	if(!empty && parameters.getInvocationCount() == 0)
	{
		result.restartCompletionWhenNothingMatches();
	}

	if(empty)
	{
		delegate(parameters, result, holder);
	}
	else
	{
		if(parameters.getCompletionType() == CompletionType.BASIC && parameters.getInvocationCount() <= 1 && CSharpCompletionUtil.mayStartClassName(result) && CSharpCompletionUtil
				.isClassNamePossible(parameters))
		{
			addTypesForUsing(parameters, result.withPrefixMatcher(tracker.betterMatcher), holder);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:42,代码来源:CSharpNoVariantsDelegator.java


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