Adding some CancellationCheck.runWithCancellationCheck

GitOrigin-RevId: 5c2ec8ecc78122d115c721ac25e2559a63a1671e
This commit is contained in:
Nicolay Mitropolsky
2020-12-01 21:13:31 +03:00
committed by intellij-monorepo-bot
parent ab3b050a6b
commit 7161c8bf6b
2 changed files with 3 additions and 1 deletions

View File

@@ -14,5 +14,6 @@
<orderEntry type="module" module-name="intellij.platform.lang" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.platform.indexing.impl" />
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
</component>
</module>

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi
import com.intellij.openapi.progress.impl.CancellationCheck
import com.intellij.util.ProcessingContext
import org.jetbrains.uast.UElement
@@ -9,7 +10,7 @@ internal class UastReferenceProviderAdapter(private val supportedUElementTypes:
override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array<PsiReference> {
val uElement = UastPatternAdapter.getOrCreateCachedElement(element, context, supportedUElementTypes) ?: return PsiReference.EMPTY_ARRAY
return provider.getReferencesByElement(uElement, context)
return CancellationCheck.runWithCancellationCheck { provider.getReferencesByElement (uElement, context) }
}
override fun acceptsTarget(target: PsiElement): Boolean {