IJPL-155874 make SpellChecker's quick fixes DumbAware

GitOrigin-RevId: 8ee646330a9090d309080fd252855e1eadc8d275
This commit is contained in:
Max Medvedev
2024-08-14 18:37:05 +02:00
committed by intellij-monorepo-bot
parent 67c93e119d
commit a1d4af8f5b
2 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.spellchecker.quickfixes
import com.intellij.codeInsight.intention.FileModifier
@@ -10,6 +10,7 @@ import com.intellij.codeInsight.intention.preview.IntentionPreviewUtils
import com.intellij.openapi.editor.Document
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.impl.DocumentMarkupModel
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.NlsSafe
import com.intellij.openapi.util.Segment
@@ -32,13 +33,13 @@ class ChangeTo(typo: String, element: PsiElement, private val range: TextRange)
}
}
private object ChangeToTitleAction : ChoiceTitleIntentionAction(fixName, fixName), HighPriorityAction
private object ChangeToTitleAction : ChoiceTitleIntentionAction(fixName, fixName), HighPriorityAction, DumbAware
override fun getTitle(): ChoiceTitleIntentionAction = ChangeToTitleAction
private inner class ChangeToVariantAction(
override val index: Int
) : ChoiceVariantIntentionAction(), HighPriorityAction {
) : ChoiceVariantIntentionAction(), HighPriorityAction, DumbAware {
@NlsSafe
private var suggestion: String? = null

View File

@@ -13,6 +13,7 @@ import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.impl.DocumentMarkupModel;
import com.intellij.openapi.editor.markup.MarkupModel;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.NlsContexts;
@@ -36,7 +37,7 @@ import javax.swing.*;
import java.util.ArrayList;
import java.util.List;
public final class SaveTo implements SpellCheckerQuickFix, LowPriorityAction {
public final class SaveTo implements SpellCheckerQuickFix, LowPriorityAction, DumbAware {
@Nullable private DictionaryLayer myLayer = null;
private String myWord;