mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GrClassReferenceType.rawType() should return raw type even if type is not resolved
This commit is contained in:
+1
-3
@@ -208,9 +208,7 @@ public class GrReferenceAdjuster implements ReferenceAdjuster {
|
||||
PsiResolveHelper helper = JavaPsiFacade.getInstance(ref.getProject()).getResolveHelper();
|
||||
if (ref instanceof GrReferenceElement) {
|
||||
final String classNameText = ((GrReferenceElement)ref).getClassNameText();
|
||||
if (classNameText != null) {
|
||||
return helper.resolveReferencedClass(classNameText, ref);
|
||||
}
|
||||
return helper.resolveReferencedClass(classNameText, ref);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public interface GrReferenceElement<Q extends PsiElement> extends GroovyPsiEleme
|
||||
@Nullable
|
||||
GrTypeArgumentList getTypeArgumentList();
|
||||
|
||||
@Nullable
|
||||
@NotNull
|
||||
String getClassNameText();
|
||||
|
||||
PsiElement handleElementRenameSimple(String newElementName) throws IncorrectOperationException;
|
||||
|
||||
+6
-3
@@ -108,13 +108,16 @@ public class GrClassReferenceType extends PsiClassType {
|
||||
@Override
|
||||
@NotNull
|
||||
public PsiClassType rawType() {
|
||||
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(myReferenceElement.getProject());
|
||||
|
||||
final PsiClass clazz = resolve();
|
||||
if (clazz != null) {
|
||||
final PsiElementFactory factory = JavaPsiFacade.getElementFactory(clazz.getProject());
|
||||
return factory.createType(clazz, factory.createRawSubstitutor(clazz));
|
||||
}
|
||||
|
||||
return this;
|
||||
else {
|
||||
String qName = myReferenceElement.getClassNameText();
|
||||
return factory.createTypeByFQClassName(qName, myReferenceElement.getResolveScope());
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
@@ -183,6 +183,7 @@ public abstract class GrReferenceElementImpl<Q extends PsiElement> extends Groov
|
||||
PsiImplUtil.setQualifier(this, newQualifier);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getClassNameText() {
|
||||
String cachedQName = myCachedQName;
|
||||
|
||||
+1
@@ -91,6 +91,7 @@ public class GrLightClassReferenceElement extends LightElement implements GrCode
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getClassNameText() {
|
||||
return myClassName;
|
||||
|
||||
@@ -154,7 +154,6 @@ public class GroovyShellConsoleImpl extends LanguageConsoleImpl {
|
||||
GrCodeReferenceElement reference = anImport.getImportReference();
|
||||
if (reference == null) return null;
|
||||
String qname = reference.getClassNameText();
|
||||
if (qname == null) return null;
|
||||
buffer.append(qname);
|
||||
if (!anImport.isOnDemand()) {
|
||||
String importedName = anImport.getImportedName();
|
||||
|
||||
Reference in New Issue
Block a user