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


Java ProjectAndLibrariesScope类代码示例

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


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

示例1: multiResolve

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
@NotNull
public ResolveResult[] multiResolve(final boolean incompleteCode) {
    final String refName = getName();
    if (refName == null)
        return LuaResolveResult.EMPTY_ARRAY;

    ResolveProcessor processor = new SymbolResolveProcessor(refName, this, incompleteCode);

    final LuaDocCommentOwner docOwner = LuaDocCommentUtil.findDocOwner(this);
    if (docOwner != null) {
        final LuaStatementElement statementElement =
                PsiTreeUtil.getParentOfType(docOwner, LuaStatementElement.class, false);
        if (statementElement != null)
            statementElement.processDeclarations(processor, ResolveState.initial(), this, this);
    }
    if (processor.hasCandidates()) {
        return processor.getCandidates();
    }
    
    LuaGlobalDeclarationIndex index = LuaGlobalDeclarationIndex.getInstance();
    Collection<LuaDeclarationExpression> names = index.get(refName, getProject(),
            new ProjectAndLibrariesScope(getProject()));
    for (LuaDeclarationExpression name : names) {
        name.processDeclarations(processor, ResolveState.initial(), this, this);
    }

    if (processor.hasCandidates()) {
        return processor.getCandidates();
    }

    return LuaResolveResult.EMPTY_ARRAY;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:33,代码来源:LuaDocSymbolReferenceElementImpl.java

示例2: call

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
@Override
public Collection<LuaDeclarationExpression> call() throws Exception {
    DumbService.getInstance(project).waitForSmartMode();
    return ApplicationManager.getApplication()
                             .runReadAction(new Computable<Collection<LuaDeclarationExpression>>() {

                                 @Override
                                 public Collection<LuaDeclarationExpression> compute() {
                                     return ResolveUtil.getFilteredGlobals(project,
                                             new ProjectAndLibrariesScope(project));
                                 }
                             });
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:14,代码来源:LuaPsiManager.java

示例3: addGraphQLSchemaFileToProjectAndLibrariesScope

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
/**
 * includes the GraphQL schema virtual file in the provided "Project and Libraries" scope
 * @see JSGraphQLProjectAndLibrariesScope
 */
private static void addGraphQLSchemaFileToProjectAndLibrariesScope(FindUsagesOptions options) {
    if(options.searchScope instanceof ProjectAndLibrariesScope) {
        final ProjectAndLibrariesScope projectAndLibrariesScope = (ProjectAndLibrariesScope) options.searchScope;
        options.searchScope = new JSGraphQLProjectAndLibrariesScope(projectAndLibrariesScope);
    }
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:11,代码来源:JSGraphQLFindUsagesHandlerFactory.java

示例4: getGlobalEnvItems

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
private Map<PsiElement,Item> getGlobalEnvItems() {
  if (global_envitems_ready) {
    return global_envitems;
  } else {

    synchronized (global_envitems_lock) {

      if (global_envitems == null) {
        // get all classes from IntelliJ
        global_envitems = new HashMap<PsiElement, Item>();
      }

      logger.info("making global_envitems (" + global_envitems.size() + " items already there)");

      PsiShortNamesCache cache = PsiShortNamesCache.getInstance(project);
      String[] classnames = cache.getAllClassNames();
      GlobalSearchScope scope = new ProjectAndLibrariesScope(project, true);

      // Add all classes.  TODO: This includes local classes, but probably shouldn't
      Map<PsiElement,Item> fake_globals = new HashMap<PsiElement,Item>();
      for (String name : classnames)
        for (PsiClass cls : cache.getClassesByName(name, scope))
          if (!isInaccessible(cls, true))
            addClass(fake_globals, global_envitems, cls, true, true);

      logger.info("making global_env with " + global_envitems.size() + " items.");

      // update global_env
      global_env = Tarski.environment(global_envitems.values());

      logger.info("global_env ready.");

      global_envitems_ready = true;

    }

    return global_envitems;
  }
}
 
开发者ID:eddysystems,项目名称:eddy,代码行数:40,代码来源:EnvironmentProcessorTest.java

示例5: findCall

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
public static TheRCallExpression findCall(Project project, String functionName, Predicate<TheRCallExpression> predicate) {
  ProjectAndLibrariesScope scope = new ProjectAndLibrariesScope(project);
  Collection<TheRAssignmentStatement> possibleDefinitions =
    TheRAssignmentNameIndex.find(functionName, project, scope);
  TheRAssignmentStatement functionDefinition = null;
  for (TheRAssignmentStatement assignment : possibleDefinitions) {
    if (assignment.getAssignedValue() instanceof TheRFunctionExpression) {
      functionDefinition = assignment;
      break;
    }
  }
  if (functionDefinition == null) {
    return null;
  }
  for (PsiReference reference : ReferencesSearch.search(functionDefinition, scope)) {
    PsiElement referenceFrom = reference.getElement();
    PsiElement parent = referenceFrom.getParent();
    if (parent == null || !TheRCallExpression.class.isInstance(parent)) {
      continue;
    }
    TheRCallExpression call = (TheRCallExpression)parent;
    if (predicate.apply(call)) {
      return call;
    }
  }
  return null;
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:28,代码来源:TheRPsiUtils.java

示例6: JSGraphQLProjectAndLibrariesScope

import com.intellij.psi.search.ProjectAndLibrariesScope; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
public JSGraphQLProjectAndLibrariesScope(ProjectAndLibrariesScope delegate) {
    super(delegate.getProject(), delegate.isSearchOutsideRootModel());
    this.delegate = delegate;
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:6,代码来源:JSGraphQLProjectAndLibrariesScope.java


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