mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RootIndex: no package name for ignored directories
This commit is contained in:
@@ -186,7 +186,7 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void testDirInfos() {
|
||||
public void testDirInfos() throws IOException {
|
||||
checkInfoNull(myRootVFile);
|
||||
|
||||
// beware: files in directory index
|
||||
@@ -215,9 +215,13 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
assertEquals(myModule1Dir, checkInfoNotNull(myLibClsDir).getContentRoot());
|
||||
|
||||
checkInfo(myModule3Dir, myModule3, false, false, null, null);
|
||||
|
||||
VirtualFile cvs = myPack1Dir.createChildDirectory(this, "CVS");
|
||||
checkInfoNull(cvs);
|
||||
assertNull(ProjectRootManager.getInstance(myProject).getFileIndex().getPackageNameByDirectory(cvs));
|
||||
}
|
||||
|
||||
public void testDirsByPackageName() {
|
||||
public void testDirsByPackageName() throws IOException {
|
||||
checkPackage("", true, myFileLibSrc, myFileLibCls, mySrcDir1, myTestSrc1, myResDir, myTestResDir, myLibSrcDir, myLibClsDir, mySrcDir2);
|
||||
checkPackage("", false, myFileLibCls, mySrcDir1, myTestSrc1, myResDir, myTestResDir, myLibClsDir, mySrcDir2);
|
||||
|
||||
|
||||
@@ -420,6 +420,10 @@ class RootIndex {
|
||||
@Nullable
|
||||
public String getPackageName(@NotNull final VirtualFile dir) {
|
||||
if (dir.isDirectory()) {
|
||||
if (FileTypeManager.getInstance().isFileIgnored(dir)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (final Map.Entry<String, HashSet<VirtualFile>> entry : myPackagePrefixRoots.entrySet()) {
|
||||
if (entry.getValue().contains(dir)) {
|
||||
return entry.getKey();
|
||||
|
||||
Reference in New Issue
Block a user