mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
correctly calculate relative path for packages
This commit is contained in:
@@ -75,8 +75,9 @@ public class CoreJavaFileManager implements JavaFileManager {
|
||||
final VirtualFile file = dir.getVirtualFile();
|
||||
for (VirtualFile root : myClasspath) {
|
||||
if (VfsUtilCore.isAncestor(root, file, false)) {
|
||||
final String relativePath = FileUtil.getRelativePath(root.getPath(), file.getPath(), '.');
|
||||
return new PsiPackageImpl(myPsiManager, relativePath);
|
||||
String relativePath = FileUtil.getRelativePath(root.getPath(), file.getPath(), '/');
|
||||
if (relativePath == null) continue;
|
||||
return new PsiPackageImpl(myPsiManager, relativePath.replace('/', '.'));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user