mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[kotlin] Fix property key confidence after UAST injection host changes
#KTIJ-27448 GitOrigin-RevId: 90dbd2216428ec3226f98393d624ee0577de71ac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0ce6da48f4
commit
d4fe2ef603
@@ -8,15 +8,15 @@ import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.ThreeState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.uast.ULiteralExpression;
|
||||
import org.jetbrains.uast.UastContextKt;
|
||||
import org.jetbrains.uast.expressions.UInjectionHost;
|
||||
|
||||
public class PropertyKeyLiteralConfidence extends CompletionConfidence {
|
||||
@NotNull
|
||||
@Override
|
||||
public ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) {
|
||||
ULiteralExpression literal = UastContextKt.toUElement(contextElement.getParent(), ULiteralExpression.class);
|
||||
return literal != null && !DumbService.isDumb(psiFile.getProject()) && JavaI18nUtil.mustBePropertyKey(literal, null)
|
||||
UInjectionHost injectionHost = UastContextKt.getUastParentOfType(contextElement.getParent(), UInjectionHost.class, false);
|
||||
return injectionHost != null && !DumbService.isDumb(psiFile.getProject()) && JavaI18nUtil.mustBePropertyKey(injectionHost, null)
|
||||
? ThreeState.NO
|
||||
: ThreeState.UNSURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user