getContainingPackageFqName() added to JetClassLikeInfo
This commit is contained in:
@@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassKind;
|
import org.jetbrains.jet.lang.descriptors.ClassKind;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -28,6 +29,10 @@ import java.util.List;
|
|||||||
* @author abreslav
|
* @author abreslav
|
||||||
*/
|
*/
|
||||||
public interface JetClassLikeInfo extends JetDeclarationContainer {
|
public interface JetClassLikeInfo extends JetDeclarationContainer {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
FqName getContainingPackageFqName();
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
List<JetDelegationSpecifier> getDelegationSpecifiers();
|
List<JetDelegationSpecifier> getDelegationSpecifiers();
|
||||||
|
|
||||||
|
|||||||
+19
-4
@@ -17,12 +17,11 @@
|
|||||||
package org.jetbrains.jet.lang.resolve.lazy.data;
|
package org.jetbrains.jet.lang.resolve.lazy.data;
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
|
import com.intellij.psi.PsiFile;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.psi.JetClassOrObject;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.psi.JetDelegationSpecifier;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetModifierList;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -70,4 +69,20 @@ public abstract class JetClassOrObjectInfo<E extends JetClassOrObject> implement
|
|||||||
public PsiElement getScopeAnchor() {
|
public PsiElement getScopeAnchor() {
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public FqName getContainingPackageFqName() {
|
||||||
|
PsiFile file = element.getContainingFile();
|
||||||
|
if (file instanceof JetFile) {
|
||||||
|
JetFile jetFile = (JetFile) file;
|
||||||
|
return new FqName(jetFile.getNamespaceHeader().getQualifiedName());
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Not in a JetFile: " + element);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "info for " + element.getText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user