本文整理了Java中com.intellij.openapi.module.Module.getModuleContentScope()
方法的一些代码示例,展示了Module.getModuleContentScope()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.getModuleContentScope()
方法的具体详情如下:
包路径:com.intellij.openapi.module.Module
类名称:Module
方法名:getModuleContentScope
暂无
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Nullable
@Override
public XmlFile loadAppEngineStandardWebXml(
@NotNull Project project, @NotNull Collection<Module> modules) {
List<VirtualFile> appEngineWebXmls = new ArrayList<>();
for (Module module : modules) {
appEngineWebXmls.addAll(
FilenameIndex.getVirtualFilesByName(
project, "appengine-web.xml", module.getModuleContentScope()));
}
VirtualFile appEngineWebXml = findHighestPriorityAppEngineWebXml(appEngineWebXmls);
if (appEngineWebXml != null) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(appEngineWebXml);
if (psiFile instanceof XmlFile) {
return (XmlFile) psiFile;
} else {
logger.error(
String.format(
"appengine-web.xml PSI File %s with name %s is not an XmlFile. "
+ "It was chosen from the following appengine-web.xml's that were found: %s",
psiFile, psiFile != null ? psiFile.getName() : null, appEngineWebXmls));
}
}
return null;
}
代码示例来源:origin: BashSupport/BashSupport
public static GlobalSearchScope moduleScope(PsiFile file) {
VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile == null) {
return GlobalSearchScope.EMPTY_SCOPE;
}
Module module = ProjectRootManager.getInstance(file.getProject()).getFileIndex().getModuleForFile(virtualFile);
if (module == null) {
return GlobalSearchScope.fileScope(file);
}
//the module scope returned by getModuleScope() just contains the files in the configured source and test source directories,
//module content scope includes all files in the module directory
return module.getModuleContentScope();
}
内容来源于网络,如有侵权,请联系作者删除!