Rename ResolveInWriteActionManager -> ResolveInDispatchThreadManager

This commit is contained in:
Nikolay Krasko
2019-09-24 14:26:23 +03:00
parent ea56a5e8b1
commit 343502125b
11 changed files with 51 additions and 50 deletions
@@ -11,7 +11,7 @@ import com.intellij.psi.PsiClass
import com.intellij.psi.PsiDocumentManager
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.allowResolveInWriteAction
import org.jetbrains.kotlin.idea.caches.resolve.allowResolveInDispatchThread
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.completion.isAfterDot
import org.jetbrains.kotlin.idea.completion.isArtificialImportAliasedDescriptor
@@ -53,7 +53,7 @@ object KotlinClassifierInsertHandler : BaseDeclarationInsertHandler() {
val token = file.findElementAt(startOffset)!!
val nameRef = token.parent as? KtNameReferenceExpression
if (nameRef != null) {
val bindingContext = allowResolveInWriteAction { nameRef.analyze(BodyResolveMode.PARTIAL) }
val bindingContext = allowResolveInDispatchThread { nameRef.analyze(BodyResolveMode.PARTIAL) }
val target = bindingContext[BindingContext.SHORT_REFERENCE_TO_COMPANION_OBJECT, nameRef]
?: bindingContext[BindingContext.REFERENCE_TARGET, nameRef] as? ClassDescriptor
if (target != null && IdeDescriptorRenderers.SOURCE_CODE.renderClassifierName(target) == qualifiedName) return