mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
some people add directory to module classpath by making it a library instead of a source root, let the module scope accept that (http://devnet.jetbrains.net/message/5291160#5291160)
This commit is contained in:
@@ -201,4 +201,15 @@ public class ModuleScopesTest extends ModuleTestCase {
|
||||
|
||||
return libraryRoot;
|
||||
}
|
||||
|
||||
public void testLibUnderModuleContent() throws IOException {
|
||||
VirtualFile lib = myFixture.findOrCreateDir("lib");
|
||||
ModifiableRootModel model = ModuleRootManager.getInstance(myModule).getModifiableModel();
|
||||
model.addContentEntry(lib);
|
||||
model.commit();
|
||||
|
||||
VirtualFile file = lib.createChildData(this, "a.txt");
|
||||
addLibrary(myModule, DependencyScope.COMPILE);
|
||||
assertTrue(myModule.getModuleWithDependenciesAndLibrariesScope(false).contains(file));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -118,7 +118,10 @@ public class ModuleWithDependenciesScope extends GlobalSearchScope {
|
||||
|
||||
@Override
|
||||
public boolean contains(VirtualFile file) {
|
||||
return myRoots.contains(getFileRoot(file));
|
||||
if (myProjectFileIndex.isInContent(file) && myRoots.contains(myProjectFileIndex.getSourceRootForFile(file))) {
|
||||
return true;
|
||||
}
|
||||
return myRoots.contains(myProjectFileIndex.getClassRootForFile(file));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user