mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RootIndex: return no dirs for packages starting with a dot
This commit is contained in:
@@ -220,10 +220,15 @@ public class DirectoryIndexTest extends IdeaTestCase {
|
||||
public void testDirsByPackageName() {
|
||||
checkPackage("", true, myFileLibSrc, myFileLibCls, mySrcDir1, myTestSrc1, myResDir, myTestResDir, myLibSrcDir, myLibClsDir, mySrcDir2);
|
||||
checkPackage("", false, myFileLibCls, mySrcDir1, myTestSrc1, myResDir, myTestResDir, myLibClsDir, mySrcDir2);
|
||||
|
||||
checkPackage("pack1", true, myPack1Dir);
|
||||
checkPackage("pack1", false, myPack1Dir);
|
||||
|
||||
checkPackage("pack2", true, myPack2Dir);
|
||||
checkPackage("pack2", false, myPack2Dir);
|
||||
|
||||
checkPackage(".pack2", false);
|
||||
checkPackage(".pack2", true);
|
||||
}
|
||||
|
||||
public void testCreateDir() throws Exception {
|
||||
|
||||
@@ -373,10 +373,12 @@ class RootIndex {
|
||||
if (StringUtil.isNotEmpty(packageName)) {
|
||||
String parentPackage = StringUtil.getPackageName(packageName);
|
||||
String shortName = StringUtil.getShortName(packageName);
|
||||
for (VirtualFile parentDir : getDirectoriesByPackageName(parentPackage, includeLibrarySources)) {
|
||||
VirtualFile child = parentDir.findChild(shortName);
|
||||
if (isValidPackageDirectory(includeLibrarySources, child)) {
|
||||
result.add(child);
|
||||
if (StringUtil.isNotEmpty(parentPackage) || parentPackage.equals(shortName)) {
|
||||
for (VirtualFile parentDir : getDirectoriesByPackageName(parentPackage, includeLibrarySources)) {
|
||||
VirtualFile child = parentDir.findChild(shortName);
|
||||
if (isValidPackageDirectory(includeLibrarySources, child)) {
|
||||
result.add(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user