use of com.intellij.psi.search.NonClasspathDirectoriesScope in project intellij-community by JetBrains.
the class MavenGroovyPomScriptType method doPatchResolveScope.
public GlobalSearchScope doPatchResolveScope(@NotNull GroovyFile file, @NotNull GlobalSearchScope baseScope) {
final Module module = ModuleUtilCore.findModuleForPsiElement(file);
if (module == null) {
return baseScope;
}
Project project = module.getProject();
GlobalSearchScope result = baseScope;
CachedValuesManager cachedValuesManager = CachedValuesManager.getManager(file.getProject());
Boolean hasGroovyModuleLib = cachedValuesManager.getCachedValue(file.getProject(), () -> CachedValueProvider.Result.createSingleDependency(hasModuleWithGroovyLibrary(project), ProjectRootManagerEx.getInstanceEx(project)));
if (hasGroovyModuleLib) {
final Collection<VirtualFile> files = additionalScopeFiles();
result = result.uniteWith(new NonClasspathDirectoriesScope(files));
}
return result;
}
use of com.intellij.psi.search.NonClasspathDirectoriesScope in project intellij-community by JetBrains.
the class GradleScriptType method patchResolveScopeInner.
public GlobalSearchScope patchResolveScopeInner(@Nullable Module module, @NotNull GlobalSearchScope baseScope) {
if (module == null)
return GlobalSearchScope.EMPTY_SCOPE;
if (!ExternalSystemApiUtil.isExternalSystemAwareModule(GradleConstants.SYSTEM_ID, module))
return baseScope;
GlobalSearchScope result = GlobalSearchScope.EMPTY_SCOPE;
final Project project = module.getProject();
for (OrderEntry entry : ModuleRootManager.getInstance(module).getOrderEntries()) {
if (entry instanceof JdkOrderEntry) {
GlobalSearchScope scopeForSdk = LibraryScopeCache.getInstance(project).getScopeForSdk((JdkOrderEntry) entry);
result = result.uniteWith(scopeForSdk);
}
}
String modulePath = ExternalSystemApiUtil.getExternalProjectPath(module);
if (modulePath == null)
return result;
final Collection<VirtualFile> files = GradleBuildClasspathManager.getInstance(project).getModuleClasspathEntries(modulePath);
result = new ExternalModuleBuildGlobalSearchScope(project, result.uniteWith(new NonClasspathDirectoriesScope(files)), modulePath);
return result;
}
Aggregations