Rename: NameShortness -> ClassifierNamePolicy

This commit is contained in:
Pavel V. Talanov
2016-02-18 17:15:18 +03:00
parent ced5a6c917
commit c7cb596f74
15 changed files with 46 additions and 46 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -141,7 +141,7 @@ abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment() {
}) })
val renderer = DescriptorRenderer.withOptions { val renderer = DescriptorRenderer.withOptions {
nameShortness = NameShortness.FULLY_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.FULLY_QUALIFIED
modifiers = DescriptorRendererModifier.ALL modifiers = DescriptorRendererModifier.ALL
} }
val renderedDescriptors = descriptors.map { renderer.render(it) }.joinToString(separator = "\n") val renderedDescriptors = descriptors.map { renderer.render(it) }.joinToString(separator = "\n")
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ abstract class AbstractFunctionDescriptorInExpressionRendererTest : KotlinTestWi
}) })
val renderer = DescriptorRenderer.withOptions { val renderer = DescriptorRenderer.withOptions {
nameShortness = NameShortness.FULLY_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.FULLY_QUALIFIED
modifiers = DescriptorRendererModifier.ALL modifiers = DescriptorRendererModifier.ALL
verbose = true verbose = true
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.renderer.DescriptorRenderer; import org.jetbrains.kotlin.renderer.DescriptorRenderer;
import org.jetbrains.kotlin.renderer.DescriptorRendererModifier; import org.jetbrains.kotlin.renderer.DescriptorRendererModifier;
import org.jetbrains.kotlin.renderer.DescriptorRendererOptions; import org.jetbrains.kotlin.renderer.DescriptorRendererOptions;
import org.jetbrains.kotlin.renderer.NameShortness; import org.jetbrains.kotlin.renderer.ClassifierNamePolicy;
import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.resolve.scopes.MemberScope;
@@ -61,7 +61,7 @@ public abstract class AbstractAnnotationDescriptorResolveTest extends KotlinLite
@Override @Override
public Unit invoke(DescriptorRendererOptions options) { public Unit invoke(DescriptorRendererOptions options) {
options.setVerbose(true); options.setVerbose(true);
options.setNameShortness(NameShortness.SHORT.INSTANCE); options.setClassifierNamePolicy(ClassifierNamePolicy.SHORT.INSTANCE);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE; return Unit.INSTANCE;
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ public class RecursiveDescriptorComparator {
options.setExcludedAnnotationClasses(Collections.singleton(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME))); options.setExcludedAnnotationClasses(Collections.singleton(new FqName(ExpectedLoadErrorsUtil.ANNOTATION_CLASS_NAME)));
options.setOverrideRenderingPolicy(OverrideRenderingPolicy.RENDER_OPEN_OVERRIDE); options.setOverrideRenderingPolicy(OverrideRenderingPolicy.RENDER_OPEN_OVERRIDE);
options.setIncludePropertyConstant(true); options.setIncludePropertyConstant(true);
options.setNameShortness(NameShortness.FULLY_QUALIFIED.INSTANCE); options.setClassifierNamePolicy(ClassifierNamePolicy.FULLY_QUALIFIED.INSTANCE);
options.setVerbose(true); options.setVerbose(true);
options.setModifiers(DescriptorRendererModifier.ALL); options.setModifiers(DescriptorRendererModifier.ALL);
return Unit.INSTANCE; return Unit.INSTANCE;
@@ -21,8 +21,8 @@ import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.DescriptorUtils
import java.util.* import java.util.*
interface NameShortness { interface ClassifierNamePolicy {
object SHORT : NameShortness { object SHORT : ClassifierNamePolicy {
override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String { override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String {
if (classifier is TypeParameterDescriptor) return renderer.renderName(classifier.name) if (classifier is TypeParameterDescriptor) return renderer.renderName(classifier.name)
@@ -40,7 +40,7 @@ interface NameShortness {
} }
} }
object FULLY_QUALIFIED : NameShortness { object FULLY_QUALIFIED : ClassifierNamePolicy {
override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String { override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String {
if (classifier is TypeParameterDescriptor) return renderer.renderName(classifier.name) if (classifier is TypeParameterDescriptor) return renderer.renderName(classifier.name)
@@ -49,7 +49,7 @@ interface NameShortness {
} }
// for local declarations qualified up to function scope // for local declarations qualified up to function scope
object SOURCE_CODE_QUALIFIED : NameShortness { object SOURCE_CODE_QUALIFIED : ClassifierNamePolicy {
override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String { override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String {
return qualifiedNameForSourceCode(classifier) return qualifiedNameForSourceCode(classifier)
} }
@@ -105,14 +105,14 @@ abstract class DescriptorRenderer {
@JvmField val COMPACT_WITH_SHORT_TYPES: DescriptorRenderer = withOptions { @JvmField val COMPACT_WITH_SHORT_TYPES: DescriptorRenderer = withOptions {
modifiers = emptySet() modifiers = emptySet()
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
parameterNameRenderingPolicy = ParameterNameRenderingPolicy.ONLY_NON_SYNTHESIZED parameterNameRenderingPolicy = ParameterNameRenderingPolicy.ONLY_NON_SYNTHESIZED
} }
@JvmField val ONLY_NAMES_WITH_SHORT_TYPES: DescriptorRenderer = withOptions { @JvmField val ONLY_NAMES_WITH_SHORT_TYPES: DescriptorRenderer = withOptions {
withDefinedIn = false withDefinedIn = false
modifiers = emptySet() modifiers = emptySet()
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
withoutTypeParameters = true withoutTypeParameters = true
parameterNameRenderingPolicy = ParameterNameRenderingPolicy.NONE parameterNameRenderingPolicy = ParameterNameRenderingPolicy.NONE
receiverAfterName = true receiverAfterName = true
@@ -126,13 +126,13 @@ abstract class DescriptorRenderer {
} }
@JvmField val SHORT_NAMES_IN_TYPES: DescriptorRenderer = withOptions { @JvmField val SHORT_NAMES_IN_TYPES: DescriptorRenderer = withOptions {
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
parameterNameRenderingPolicy = ParameterNameRenderingPolicy.ONLY_NON_SYNTHESIZED parameterNameRenderingPolicy = ParameterNameRenderingPolicy.ONLY_NON_SYNTHESIZED
} }
@JvmField val DEBUG_TEXT: DescriptorRenderer = withOptions { @JvmField val DEBUG_TEXT: DescriptorRenderer = withOptions {
debugMode = true debugMode = true
nameShortness = NameShortness.FULLY_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.FULLY_QUALIFIED
modifiers = DescriptorRendererModifier.ALL modifiers = DescriptorRendererModifier.ALL
} }
@@ -162,7 +162,7 @@ abstract class DescriptorRenderer {
} }
interface DescriptorRendererOptions { interface DescriptorRendererOptions {
var nameShortness: NameShortness var classifierNamePolicy: ClassifierNamePolicy
var withDefinedIn: Boolean var withDefinedIn: Boolean
var modifiers: Set<DescriptorRendererModifier> var modifiers: Set<DescriptorRendererModifier>
var startFromName: Boolean var startFromName: Boolean
@@ -123,7 +123,7 @@ internal class DescriptorRendererImpl(
if (ErrorUtils.isError(klass)) { if (ErrorUtils.isError(klass)) {
return klass.typeConstructor.toString() return klass.typeConstructor.toString()
} }
return nameShortness.renderClassifier(klass, this) return classifierNamePolicy.renderClassifier(klass, this)
} }
/* TYPES RENDERING */ /* TYPES RENDERING */
@@ -143,7 +143,7 @@ internal class DescriptorRendererImpl(
return renderFlexibleTypeWithBothBounds(type.flexibility().lowerBound, type.flexibility().upperBound) return renderFlexibleTypeWithBothBounds(type.flexibility().lowerBound, type.flexibility().upperBound)
} }
else if (flexibleTypesForCode) { else if (flexibleTypesForCode) {
val prefix = if (nameShortness == NameShortness.SHORT) "" else Flexibility.FLEXIBLE_TYPE_CLASSIFIER.packageFqName.asString() + "." val prefix = if (classifierNamePolicy == ClassifierNamePolicy.SHORT) "" else Flexibility.FLEXIBLE_TYPE_CLASSIFIER.packageFqName.asString() + "."
return prefix + Flexibility.FLEXIBLE_TYPE_CLASSIFIER.relativeClassName + lt() + renderNormalizedType(type.flexibility().lowerBound) + ", " + renderNormalizedType(type.flexibility().upperBound) + gt() return prefix + Flexibility.FLEXIBLE_TYPE_CLASSIFIER.relativeClassName + lt() + renderNormalizedType(type.flexibility().lowerBound) + ", " + renderNormalizedType(type.flexibility().upperBound) + gt()
} }
else { else {
@@ -203,7 +203,7 @@ internal class DescriptorRendererImpl(
} }
val kotlinCollectionsPrefix = nameShortness.renderClassifier(type.builtIns.collection, this).substringBefore("Collection") val kotlinCollectionsPrefix = classifierNamePolicy.renderClassifier(type.builtIns.collection, this).substringBefore("Collection")
val mutablePrefix = "Mutable" val mutablePrefix = "Mutable"
// java.util.List<Foo> -> (Mutable)List<Foo!>! // java.util.List<Foo> -> (Mutable)List<Foo!>!
val simpleCollection = replacePrefixes(lowerRendered, kotlinCollectionsPrefix + mutablePrefix, upperRendered, kotlinCollectionsPrefix, kotlinCollectionsPrefix + "(" + mutablePrefix + ")") val simpleCollection = replacePrefixes(lowerRendered, kotlinCollectionsPrefix + mutablePrefix, upperRendered, kotlinCollectionsPrefix, kotlinCollectionsPrefix + "(" + mutablePrefix + ")")
@@ -212,7 +212,7 @@ internal class DescriptorRendererImpl(
val mutableEntry = replacePrefixes(lowerRendered, kotlinCollectionsPrefix + "MutableMap.MutableEntry", upperRendered, kotlinCollectionsPrefix + "Map.Entry", kotlinCollectionsPrefix + "(Mutable)Map.(Mutable)Entry") val mutableEntry = replacePrefixes(lowerRendered, kotlinCollectionsPrefix + "MutableMap.MutableEntry", upperRendered, kotlinCollectionsPrefix + "Map.Entry", kotlinCollectionsPrefix + "(Mutable)Map.(Mutable)Entry")
if (mutableEntry != null) return mutableEntry if (mutableEntry != null) return mutableEntry
val kotlinPrefix = nameShortness.renderClassifier(type.builtIns.array, this).substringBefore("Array") val kotlinPrefix = classifierNamePolicy.renderClassifier(type.builtIns.array, this).substringBefore("Array")
// Foo[] -> Array<(out) Foo!>! // Foo[] -> Array<(out) Foo!>!
val array = replacePrefixes(lowerRendered, kotlinPrefix + escape("Array<"), upperRendered, kotlinPrefix + escape("Array<out "), kotlinPrefix + escape("Array<(out) ")) val array = replacePrefixes(lowerRendered, kotlinPrefix + escape("Array<"), upperRendered, kotlinPrefix + escape("Array<out "), kotlinPrefix + escape("Array<(out) "))
if (array != null) return array if (array != null) return array
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ internal class DescriptorRendererOptionsImpl : DescriptorRendererOptions {
} }
} }
override var nameShortness: NameShortness by property(NameShortness.SOURCE_CODE_QUALIFIED) override var classifierNamePolicy: ClassifierNamePolicy by property(ClassifierNamePolicy.SOURCE_CODE_QUALIFIED)
override var withDefinedIn by property(true) override var withDefinedIn by property(true)
override var modifiers: Set<DescriptorRendererModifier> by property(DescriptorRendererModifier.DEFAULTS) override var modifiers: Set<DescriptorRendererModifier> by property(DescriptorRendererModifier.DEFAULTS)
override var startFromName by property(false) override var startFromName by property(false)
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.idea.util
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.DescriptorRendererModifier import org.jetbrains.kotlin.renderer.DescriptorRendererModifier
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.renderer.OverrideRenderingPolicy import org.jetbrains.kotlin.renderer.OverrideRenderingPolicy
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.isDynamic import org.jetbrains.kotlin.types.isDynamic
@@ -54,17 +54,17 @@ object IdeDescriptorRenderers {
} }
@JvmField val SOURCE_CODE: DescriptorRenderer = BASE.withOptions { @JvmField val SOURCE_CODE: DescriptorRenderer = BASE.withOptions {
nameShortness = NameShortness.SOURCE_CODE_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.SOURCE_CODE_QUALIFIED
typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES(unwrapAnonymousType(it)) } typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES(unwrapAnonymousType(it)) }
} }
@JvmField val SOURCE_CODE_FOR_TYPE_ARGUMENTS: DescriptorRenderer = BASE.withOptions { @JvmField val SOURCE_CODE_FOR_TYPE_ARGUMENTS: DescriptorRenderer = BASE.withOptions {
nameShortness = NameShortness.SOURCE_CODE_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.SOURCE_CODE_QUALIFIED
typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES_IN_ARGUMENTS(unwrapAnonymousType(it)) } typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES_IN_ARGUMENTS(unwrapAnonymousType(it)) }
} }
@JvmField val SOURCE_CODE_SHORT_NAMES_IN_TYPES: DescriptorRenderer = BASE.withOptions { @JvmField val SOURCE_CODE_SHORT_NAMES_IN_TYPES: DescriptorRenderer = BASE.withOptions {
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES(unwrapAnonymousType(it)) } typeNormalizer = { APPROXIMATE_FLEXIBLE_TYPES(unwrapAnonymousType(it)) }
} }
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.renderer.RenderingFormat import org.jetbrains.kotlin.renderer.RenderingFormat
import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.calls.callUtil.hasTypeMismatchErrorOnParameter import org.jetbrains.kotlin.resolve.calls.callUtil.hasTypeMismatchErrorOnParameter
@@ -42,7 +42,7 @@ fun renderStrong(o: Any, error: Boolean): String = (if (error) RED_TEMPLATE else
private val HTML_FOR_UNINFERRED_TYPE_PARAMS: DescriptorRenderer = DescriptorRenderer.withOptions { private val HTML_FOR_UNINFERRED_TYPE_PARAMS: DescriptorRenderer = DescriptorRenderer.withOptions {
uninferredTypeParameterAsName = true uninferredTypeParameterAsName = true
modifiers = emptySet() modifiers = emptySet()
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
textFormat = RenderingFormat.HTML textFormat = RenderingFormat.HTML
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -100,7 +100,7 @@ private val OVERRIDE_RENDERER = DescriptorRenderer.withOptions {
renderDefaultValues = false renderDefaultValues = false
modifiers = setOf(DescriptorRendererModifier.OVERRIDE) modifiers = setOf(DescriptorRendererModifier.OVERRIDE)
withDefinedIn = false withDefinedIn = false
nameShortness = NameShortness.SOURCE_CODE_QUALIFIED classifierNamePolicy = ClassifierNamePolicy.SOURCE_CODE_QUALIFIED
overrideRenderingPolicy = OverrideRenderingPolicy.RENDER_OVERRIDE overrideRenderingPolicy = OverrideRenderingPolicy.RENDER_OVERRIDE
unitReturnType = false unitReturnType = false
typeNormalizer = IdeDescriptorRenderers.APPROXIMATE_FLEXIBLE_TYPES typeNormalizer = IdeDescriptorRenderers.APPROXIMATE_FLEXIBLE_TYPES
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtNamedDeclaration import org.jetbrains.kotlin.psi.KtNamedDeclaration
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.renderer.render import org.jetbrains.kotlin.renderer.render
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import javax.swing.Icon import javax.swing.Icon
@@ -70,7 +70,7 @@ open class DescriptorMemberChooserObject(
withDefinedIn = false withDefinedIn = false
modifiers = emptySet() modifiers = emptySet()
startFromName = true startFromName = true
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
} }
fun getText(descriptor: DeclarationDescriptor): String { fun getText(descriptor: DeclarationDescriptor): String {
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.psi.KtReferenceExpression
import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.resolve.source.PsiSourceElement import org.jetbrains.kotlin.resolve.source.PsiSourceElement
@@ -84,7 +84,7 @@ class KotlinQuickDocumentationProvider : AbstractDocumentationProvider() {
private val LOG = Logger.getInstance(KotlinQuickDocumentationProvider::class.java) private val LOG = Logger.getInstance(KotlinQuickDocumentationProvider::class.java)
private val DESCRIPTOR_RENDERER = DescriptorRenderer.HTML.withOptions { private val DESCRIPTOR_RENDERER = DescriptorRenderer.HTML.withOptions {
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
renderCompanionObjectName = true renderCompanionObjectName = true
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtParameterList import org.jetbrains.kotlin.psi.KtParameterList
import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.resolve.FunctionDescriptorUtil import org.jetbrains.kotlin.resolve.FunctionDescriptorUtil
import org.jetbrains.kotlin.resolve.descriptorUtil.setSingleOverridden import org.jetbrains.kotlin.resolve.descriptorUtil.setSingleOverridden
import org.jetbrains.kotlin.resolve.findMemberWithMaxVisibility import org.jetbrains.kotlin.resolve.findMemberWithMaxVisibility
@@ -72,7 +72,7 @@ class ChangeMemberFunctionSignatureFix private constructor(
typeNormalizer = IdeDescriptorRenderers.APPROXIMATE_FLEXIBLE_TYPES typeNormalizer = IdeDescriptorRenderers.APPROXIMATE_FLEXIBLE_TYPES
withDefinedIn = false withDefinedIn = false
modifiers = emptySet() modifiers = emptySet()
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
unitReturnType = false unitReturnType = false
renderDefaultValues = false renderDefaultValues = false
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2015 JetBrains s.r.o. * Copyright 2010-2016 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.idea.util.application.runReadAction
import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.NameShortness import org.jetbrains.kotlin.renderer.ClassifierNamePolicy
import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy
class DeprecatedSymbolUsageInWholeProjectFix( class DeprecatedSymbolUsageInWholeProjectFix(
@@ -122,7 +122,7 @@ class DeprecatedSymbolUsageInWholeProjectFix(
//TODO: better rendering needed //TODO: better rendering needed
private val RENDERER = DescriptorRenderer.withOptions { private val RENDERER = DescriptorRenderer.withOptions {
modifiers = emptySet() modifiers = emptySet()
nameShortness = NameShortness.SHORT classifierNamePolicy = ClassifierNamePolicy.SHORT
parameterNameRenderingPolicy = ParameterNameRenderingPolicy.NONE parameterNameRenderingPolicy = ParameterNameRenderingPolicy.NONE
receiverAfterName = true receiverAfterName = true
renderCompanionObjectName = true renderCompanionObjectName = true