mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] IDEA-353900 k2: ShortenReference for uast
This is necessary for the Reactive-streams plugin, which uses shortening GitOrigin-RevId: fae6588709134846da0c279e372f59505c7530e0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f8a99dafbd
commit
a2ca3fd2e3
@@ -37,5 +37,6 @@
|
||||
<orderEntry type="library" name="kotlinc.low-level-api-fir" level="project" />
|
||||
<orderEntry type="library" name="kotlinc.analysis-api-platform-interface" level="project" />
|
||||
<orderEntry type="library" name="kotlinc.symbol-light-classes" level="project" />
|
||||
<orderEntry type="module" module-name="kotlin.base.analysis-api.utils" />
|
||||
</component>
|
||||
</module>
|
||||
+4
-9
@@ -2,18 +2,13 @@
|
||||
package org.jetbrains.uast.kotlin
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.idea.base.analysis.api.utils.shortenReferences
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.uast.kotlin.generate.KotlinUastBaseCodeGenerationPlugin
|
||||
import org.jetbrains.uast.kotlin.internal.analyzeForUast
|
||||
|
||||
abstract class FirKotlinUastCodeGenerationPlugin : KotlinUastBaseCodeGenerationPlugin() {
|
||||
override fun shortenReference(sourcePsi: KtElement): PsiElement {
|
||||
val ktFile = sourcePsi.containingKtFile
|
||||
analyzeForUast(ktFile) {
|
||||
collectPossibleReferenceShortenings(ktFile, sourcePsi.textRange)
|
||||
override fun shortenReference(sourcePsi: KtElement): PsiElement? {
|
||||
shortenReferences(sourcePsi)
|
||||
return sourcePsi
|
||||
}
|
||||
|
||||
//todo apply shortening
|
||||
return sourcePsi
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user