mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[uast, reactor] getting rid of analysis.kt because it uses deprecated getLanguagePlugin()
GitOrigin-RevId: cf441c675f97c5b64deff1c7b2a1c66ab40a4038
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d9bab91130
commit
63f78b37c5
@@ -18,7 +18,7 @@ interface UastAnalysisPlugin {
|
||||
|
||||
val language: Language
|
||||
|
||||
fun <T : Any> getExpressionFact(expression: UExpression, fact: UExpressionFact<T>): T?
|
||||
fun <T : Any> UExpression.getExpressionFact(fact: UExpressionFact<T>): T?
|
||||
}
|
||||
|
||||
sealed class UExpressionFact<T : Any> {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// Copyright 2000-2019 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 org.jetbrains.uast.analysis
|
||||
|
||||
import org.jetbrains.uast.UExpression
|
||||
import org.jetbrains.uast.getLanguagePlugin
|
||||
|
||||
fun <T : Any> UExpression.getExpressionFact(fact: UExpressionFact<T>): T? =
|
||||
this.getLanguagePlugin().analysisPlugin?.getExpressionFact(this, fact)
|
||||
|
||||
fun UExpression.canBeAnalyzedByUast() = this.getLanguagePlugin().analysisPlugin != null
|
||||
@@ -12,10 +12,10 @@ import org.jetbrains.uast.analysis.UNullability
|
||||
import org.jetbrains.uast.analysis.UastAnalysisPlugin
|
||||
|
||||
class JavaUastAnalysisPlugin : UastAnalysisPlugin {
|
||||
override fun <T : Any> getExpressionFact(expression: UExpression, fact: UExpressionFact<T>): T? {
|
||||
override fun <T : Any> UExpression.getExpressionFact(fact: UExpressionFact<T>): T? {
|
||||
when (fact) {
|
||||
is UExpressionFact.UNullabilityFact -> {
|
||||
val psiExpression = expression.sourcePsi as? PsiExpression ?: return null
|
||||
val psiExpression = sourcePsi as? PsiExpression ?: return null
|
||||
val nullability = CommonDataflow.getExpressionFact(psiExpression, DfaFactType.NULLABILITY)?.toUNullability()
|
||||
?: UNullability.UNKNOWN
|
||||
|
||||
|
||||
Reference in New Issue
Block a user