mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
touch modification tracker to restart daemon (IDEA-58085)
This commit is contained in:
@@ -23,6 +23,8 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.psi.impl.PsiModificationTrackerImpl;
|
||||
import com.intellij.spellchecker.dictionary.EditableDictionary;
|
||||
import com.intellij.spellchecker.dictionary.Loader;
|
||||
import com.intellij.spellchecker.engine.SpellCheckerEngine;
|
||||
@@ -175,10 +177,13 @@ public class SpellCheckerManager {
|
||||
return !spellChecker.isCorrect(word);
|
||||
}
|
||||
|
||||
public void acceptWordAsCorrect(@NotNull String word) {
|
||||
public void acceptWordAsCorrect(@NotNull String word, Project project) {
|
||||
final String transformed = spellChecker.getTransformation().transform(word);
|
||||
if (transformed != null) {
|
||||
userDictionary.addToDictionary(transformed);
|
||||
final PsiModificationTrackerImpl modificationTracker =
|
||||
(PsiModificationTrackerImpl)PsiManager.getInstance(project).getModificationTracker();
|
||||
modificationTracker.incCounter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class AcceptWordAsCorrect implements SpellCheckerQuickFix {
|
||||
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
|
||||
SpellCheckerManager spellCheckerManager = SpellCheckerManager.getInstance(project);
|
||||
final String w = ProblemDescriptionNode.extractHighlightedText(descriptor, descriptor.getPsiElement());
|
||||
spellCheckerManager.acceptWordAsCorrect(w);
|
||||
spellCheckerManager.acceptWordAsCorrect(w, project);
|
||||
}
|
||||
|
||||
public Icon getIcon(int flags) {
|
||||
|
||||
Reference in New Issue
Block a user