mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection view: do not show empty package node under module-info node (re-fix for ec0783f)
This commit is contained in:
@@ -18,16 +18,13 @@ package com.intellij.codeInspection.reference;
|
||||
|
||||
import com.intellij.openapi.module.ModuleUtilCore;
|
||||
import com.intellij.psi.PsiJavaFile;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
|
||||
public class RefJavaFileImpl extends RefFileImpl {
|
||||
private final RefModule myRefModule;
|
||||
private final boolean myModuleFile;
|
||||
|
||||
RefJavaFileImpl(PsiJavaFile elem, RefManager manager) {
|
||||
super(elem, manager, false);
|
||||
myRefModule = manager.getRefModule(ModuleUtilCore.findModuleForPsiElement(elem));
|
||||
myModuleFile = PsiUtil.isModuleFile(elem);
|
||||
String packageName = elem.getPackageName();
|
||||
if (!packageName.isEmpty()) {
|
||||
((RefPackageImpl)getRefManager().getExtension(RefJavaManager.MANAGER).getPackage(packageName)).add(this);
|
||||
@@ -47,8 +44,4 @@ public class RefJavaFileImpl extends RefFileImpl {
|
||||
public RefModule getModule() {
|
||||
return myRefModule;
|
||||
}
|
||||
|
||||
boolean isModuleFile() {
|
||||
return myModuleFile;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -346,7 +346,7 @@ public class RefJavaManagerImpl extends RefJavaManager {
|
||||
@Override
|
||||
@Nullable
|
||||
public String getGroupName(final RefEntity entity) {
|
||||
if (entity instanceof RefFile && (!(entity instanceof RefJavaFileImpl) || ((RefJavaFileImpl)entity).isModuleFile())) return null;
|
||||
if (entity instanceof RefFile && !(entity instanceof RefJavaFileImpl)) return null;
|
||||
return RefJavaUtil.getInstance().getPackageName(entity);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ public class RefJavaUtilImpl extends RefJavaUtil{
|
||||
@Override
|
||||
@Nullable
|
||||
public String getPackageName(RefEntity refEntity) {
|
||||
if (refEntity instanceof RefProject || refEntity instanceof RefJavaFileImpl && ((RefJavaFileImpl)refEntity).isModuleFile()) {
|
||||
if (refEntity instanceof RefProject || refEntity instanceof RefJavaModule) {
|
||||
return null;
|
||||
}
|
||||
RefPackage refPackage = getPackage(refEntity);
|
||||
|
||||
Reference in New Issue
Block a user