Minor
This commit is contained in:
+2
-2
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiClass
|
|||||||
import com.intellij.psi.PsiDocumentManager
|
import com.intellij.psi.PsiDocumentManager
|
||||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
import org.jetbrains.kotlin.idea.completion.isAfterDot
|
import org.jetbrains.kotlin.idea.completion.isAfterDot
|
||||||
import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject
|
import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject
|
||||||
import org.jetbrains.kotlin.idea.util.CallTypeAndReceiver
|
import org.jetbrains.kotlin.idea.util.CallTypeAndReceiver
|
||||||
@@ -54,7 +54,7 @@ object KotlinClassifierInsertHandler : BaseDeclarationInsertHandler() {
|
|||||||
val token = file.findElementAt(startOffset)
|
val token = file.findElementAt(startOffset)
|
||||||
val nameRef = token!!.getParent() as? KtNameReferenceExpression
|
val nameRef = token!!.getParent() as? KtNameReferenceExpression
|
||||||
if (nameRef != null) {
|
if (nameRef != null) {
|
||||||
val bindingContext = nameRef.getResolutionFacade().analyze(nameRef, BodyResolveMode.PARTIAL)
|
val bindingContext = nameRef.analyze(BodyResolveMode.PARTIAL)
|
||||||
val target = bindingContext[BindingContext.SHORT_REFERENCE_TO_COMPANION_OBJECT, nameRef]
|
val target = bindingContext[BindingContext.SHORT_REFERENCE_TO_COMPANION_OBJECT, nameRef]
|
||||||
?: bindingContext[BindingContext.REFERENCE_TARGET, nameRef] as? ClassDescriptor
|
?: bindingContext[BindingContext.REFERENCE_TARGET, nameRef] as? ClassDescriptor
|
||||||
if (target != null && IdeDescriptorRenderers.SOURCE_CODE.renderClassifierName(target) == qualifiedName) return
|
if (target != null && IdeDescriptorRenderers.SOURCE_CODE.renderClassifierName(target) == qualifiedName) return
|
||||||
|
|||||||
Reference in New Issue
Block a user