Minor. Renamed method.
This commit is contained in:
@@ -71,7 +71,7 @@ public class ReferenceToClassesShortening {
|
||||
compactReferenceToClass(userType, targetClass);
|
||||
}
|
||||
else if (classifier == null) {
|
||||
ImportInsertHelper.addImportDirectiveIfNeeded(DescriptorUtils.getFQName(targetTopLevelClass).toSafe(), file);
|
||||
ImportInsertHelper.addImportDirectiveIfNeeded(DescriptorUtils.getFqName(targetTopLevelClass).toSafe(), file);
|
||||
compactReferenceToClass(userType, targetClass);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -76,7 +76,7 @@ public final class DescriptorLookupConverter {
|
||||
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||
if (containingDeclaration != null && extensionFunction) {
|
||||
tailText += " for " + DescriptorRenderer.TEXT.renderType(functionDescriptor.getReceiverParameter().getType());
|
||||
tailText += " in " + DescriptorUtils.getFQName(containingDeclaration);
|
||||
tailText += " in " + DescriptorUtils.getFqName(containingDeclaration);
|
||||
}
|
||||
}
|
||||
else if (descriptor instanceof VariableDescriptor) {
|
||||
@@ -86,7 +86,7 @@ public final class DescriptorLookupConverter {
|
||||
else if (descriptor instanceof ClassDescriptor) {
|
||||
DeclarationDescriptor declaredIn = descriptor.getContainingDeclaration();
|
||||
assert declaredIn != null;
|
||||
tailText = " (" + DescriptorUtils.getFQName(declaredIn) + ")";
|
||||
tailText = " (" + DescriptorUtils.getFqName(declaredIn) + ")";
|
||||
tailTextGrayed = true;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -282,7 +282,7 @@ private fun staticMembers(context: JetExpression, expectedType: JetType, resolve
|
||||
var builder = LookupElementBuilder.create(lookupElement.getObject(), classDescriptor.getName().asString() + "." + lookupElement.getLookupString())
|
||||
.withIcon(presentation.getIcon())
|
||||
.withStrikeoutness(presentation.isStrikeout())
|
||||
.withTailText(" (" + DescriptorUtils.getFQName(classDescriptor.getContainingDeclaration()) + ")")
|
||||
.withTailText(" (" + DescriptorUtils.getFqName(classDescriptor.getContainingDeclaration()) + ")")
|
||||
.withTypeText(if (!presentation.getTypeText().isNullOrEmpty())
|
||||
presentation.getTypeText()
|
||||
else
|
||||
|
||||
@@ -54,7 +54,7 @@ public class JetClassInsertHandler implements InsertHandler<LookupElement> {
|
||||
DeclarationDescriptor descriptor = lookupObject.getDescriptor();
|
||||
PsiElement targetElement = lookupObject.getPsiElement();
|
||||
if (descriptor != null) {
|
||||
FqName fqn = DescriptorUtils.getFQName(descriptor).toSafe();
|
||||
FqName fqn = DescriptorUtils.getFqName(descriptor).toSafe();
|
||||
|
||||
// TODO: Find out the way for getting psi element for JS libs
|
||||
if (targetElement != null) {
|
||||
|
||||
@@ -177,7 +177,7 @@ public class JetFunctionInsertHandler(val caretPosition : CaretPosition, val bra
|
||||
|
||||
if (DescriptorUtils.isTopLevelDeclaration(functionDescriptor)) {
|
||||
ApplicationManager.getApplication()?.runWriteAction {
|
||||
val fqn = DescriptorUtils.getFQName(functionDescriptor).toSafe()
|
||||
val fqn = DescriptorUtils.getFqName(functionDescriptor).toSafe()
|
||||
ImportInsertHelper.addImportDirectiveIfNeeded(fqn, file)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class JetDeclarationRemotenessWeigher extends LookupElementWeigher {
|
||||
|
||||
DeclarationDescriptor descriptor = lookupObject.getDescriptor();
|
||||
if (descriptor != null) {
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(descriptor);
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFqName(descriptor);
|
||||
// Invalid name can be met for class object descriptor: Test.MyTest.A.<no name provided>.testOther
|
||||
if (QualifiedNamesUtil.isValidJavaFqName(fqName.toString())) {
|
||||
ImportPath importPath = new ImportPath(fqName.toString());
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache;
|
||||
import org.jetbrains.jet.plugin.quickfix.ImportInsertHelper;
|
||||
import org.jetbrains.jet.util.QualifiedNamesUtil;
|
||||
|
||||
import java.util.*;
|
||||
@@ -184,7 +183,7 @@ public class JetImportOptimizer implements ImportOptimizer {
|
||||
private void addResolvedCallFqName(@Nullable ResolvedCall resolvedCall) {
|
||||
if (resolvedCall != null) {
|
||||
CallableDescriptor resultingDescriptor = resolvedCall.getResultingDescriptor();
|
||||
FqNameUnsafe name = DescriptorUtils.getFQName(resultingDescriptor);
|
||||
FqNameUnsafe name = DescriptorUtils.getFqName(resultingDescriptor);
|
||||
assert name.isSafe(): "FqName for resulting descriptor should be safe " + resultingDescriptor.getName();
|
||||
usedQualifiedNames.add(name.toSafe());
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ public class DeprecatedAnnotationVisitor extends AfterAnalysisHighlightingVisito
|
||||
|
||||
private static String getDescriptorString(@NotNull DeclarationDescriptor descriptor) {
|
||||
if (descriptor instanceof ClassDescriptor) {
|
||||
return DescriptorUtils.getFQName(descriptor).asString();
|
||||
return DescriptorUtils.getFqName(descriptor).asString();
|
||||
}
|
||||
else if (descriptor instanceof ConstructorDescriptor) {
|
||||
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||
|
||||
@@ -164,7 +164,7 @@ public class IdeRenderers {
|
||||
stringBuilder.append(" <i>defined in</i> ");
|
||||
DeclarationDescriptor containingDeclaration = funDescriptor.getContainingDeclaration();
|
||||
if (containingDeclaration != null) {
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(containingDeclaration);
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFqName(containingDeclaration);
|
||||
stringBuilder.append(FqName.ROOT.equalsTo(fqName) ? "root package" : fqName.asString());
|
||||
}
|
||||
stringBuilder.append("</li>");
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFQName;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFqName;
|
||||
|
||||
public final class DecompiledNavigationUtils {
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class DecompiledNavigationUtils {
|
||||
return jetDeclaration;
|
||||
}
|
||||
else {
|
||||
LOG.warn("Could not find an element to navigate to for descriptor " + getFQName(effectiveReferencedDescriptor));
|
||||
LOG.warn("Could not find an element to navigate to for descriptor " + getFqName(effectiveReferencedDescriptor));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public final class DecompiledNavigationUtils {
|
||||
if (classKind == ClassKind.CLASS_OBJECT || classKind == ClassKind.ENUM_ENTRY) {
|
||||
return getContainerFqName(containerDescriptor.getContainingDeclaration());
|
||||
}
|
||||
return getFQName(containerDescriptor).toSafe();
|
||||
return getFqName(containerDescriptor).toSafe();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ public class JetSourceNavigationHelper {
|
||||
assert className != null : "Class from BuiltIns should have a name";
|
||||
ClassDescriptor classDescriptor = KotlinBuiltIns.getInstance().getBuiltInClassByName(className);
|
||||
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(classDescriptor);
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFqName(classDescriptor);
|
||||
if (fqName.isSafe()) {
|
||||
FqName javaFqName = KotlinToJavaTypesMap.getInstance().getKotlinToJavaFqName(fqName.toSafe());
|
||||
if (javaFqName != null) {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class AutoImportFix extends JetHintAction<JetSimpleNameExpression> implem
|
||||
@Override
|
||||
public FqName apply(@Nullable DeclarationDescriptor declarationDescriptor) {
|
||||
assert declarationDescriptor != null;
|
||||
return DescriptorUtils.getFQName(declarationDescriptor).toSafe();
|
||||
return DescriptorUtils.getFqName(declarationDescriptor).toSafe();
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class AutoImportFix extends JetHintAction<JetSimpleNameExpression> implem
|
||||
@Override
|
||||
public FqName apply(@Nullable DeclarationDescriptor declarationDescriptor) {
|
||||
assert declarationDescriptor != null;
|
||||
return DescriptorUtils.getFQName(declarationDescriptor).toSafe();
|
||||
return DescriptorUtils.getFqName(declarationDescriptor).toSafe();
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class AutoImportFix extends JetHintAction<JetSimpleNameExpression> implem
|
||||
return Collections2.transform(descriptors, new Function<ClassDescriptor, FqName>() {
|
||||
@Override
|
||||
public FqName apply(ClassDescriptor descriptor) {
|
||||
return DescriptorUtils.getFQName(descriptor).toSafe();
|
||||
return DescriptorUtils.getFqName(descriptor).toSafe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -57,7 +57,6 @@ import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContextUtils;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
@@ -902,7 +901,7 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
|
||||
assert returnTypeRef != null;
|
||||
properties.setProperty(FileTemplate.ATTRIBUTE_RETURN_TYPE, returnTypeRef.getText());
|
||||
}
|
||||
properties.setProperty(FileTemplate.ATTRIBUTE_CLASS_NAME, DescriptorUtils.getFQName(ownerClassDescriptor).asString());
|
||||
properties.setProperty(FileTemplate.ATTRIBUTE_CLASS_NAME, DescriptorUtils.getFqName(ownerClassDescriptor).asString());
|
||||
properties.setProperty(FileTemplate.ATTRIBUTE_SIMPLE_CLASS_NAME, ownerClassDescriptor.getName().asString());
|
||||
properties.setProperty(ATTRIBUTE_FUNCTION_NAME, functionName);
|
||||
|
||||
@@ -1060,7 +1059,7 @@ public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
|
||||
String replacement = typeParameterNameMap.get(declarationDescriptor);
|
||||
return replacement == null ? declarationDescriptor.getName().asString() : replacement;
|
||||
} else {
|
||||
return fq ? DescriptorUtils.getFQName(declarationDescriptor).asString() : declarationDescriptor.getName().asString();
|
||||
return fq ? DescriptorUtils.getFqName(declarationDescriptor).asString() : declarationDescriptor.getName().asString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ public class BuiltInsReferenceResolver extends AbstractProjectComponent {
|
||||
return ((ClassDescriptor) currentParent).getClassObjectDescriptor();
|
||||
}
|
||||
else {
|
||||
return bindingContext.get(BindingContext.FQNAME_TO_CLASS_DESCRIPTOR, DescriptorUtils.getFQName(originalDescriptor).toSafe());
|
||||
return bindingContext.get(BindingContext.FQNAME_TO_CLASS_DESCRIPTOR, DescriptorUtils.getFqName(originalDescriptor).toSafe());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class KotlinAnnotatedElementsSearcher extends AnnotatedElementsSearcher {
|
||||
|
||||
ClassifierDescriptor descriptor = annotationDescriptor.getType().getConstructor().getDeclarationDescriptor();
|
||||
if (descriptor == null) return;
|
||||
if (!(DescriptorUtils.getFQName(descriptor).asString().equals(annotationFQN))) return;
|
||||
if (!(DescriptorUtils.getFqName(descriptor).asString().equals(annotationFQN))) return;
|
||||
|
||||
if (parentOfType instanceof JetClass) {
|
||||
PsiClass lightClass = LightClassUtil.getPsiClass((JetClass) parentOfType);
|
||||
|
||||
@@ -225,7 +225,7 @@ public class JetStructureViewElement implements StructureViewTreeElement {
|
||||
textBuilder = new StringBuilder(descriptor.getName().asString());
|
||||
textBuilder
|
||||
.append(" (")
|
||||
.append(DescriptorUtils.getFQName(descriptor.getContainingDeclaration()))
|
||||
.append(DescriptorUtils.getFqName(descriptor.getContainingDeclaration()))
|
||||
.append(")");
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user