WI-40696 Spellchecker considers known capitalized word incorrect

This commit is contained in:
Olga Strizhenko
2018-02-13 17:29:50 +03:00
parent 8b2f7eeb0c
commit 9eab6cfd1d
2 changed files with 27 additions and 3 deletions
@@ -222,18 +222,18 @@ public class SpellCheckerManager implements Disposable {
UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(file) {
@Override
public void undo() {
dictionary.removeFromDictionary(word);
dictionary.removeFromDictionary(transformed);
restartInspections();
}
@Override
public void redo() {
dictionary.addToDictionary(word);
dictionary.addToDictionary(transformed);
restartInspections();
}
});
}
dictionary.addToDictionary(word);
dictionary.addToDictionary(transformed);
restartInspections();
}
}
@@ -0,0 +1,24 @@
// Copyright 2000-2018 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 com.intellij.spellchecker.inspector;
import com.intellij.spellchecker.SpellCheckerManager;
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase;
@SuppressWarnings("SpellCheckingInspection")
public class AcceptWordAsCorrectTest extends LightPlatformCodeInsightFixtureTestCase {
private void doTest(String word) {
final SpellCheckerManager manager = SpellCheckerManager.getInstance(myFixture.getProject());
assertTrue(manager.hasProblem(word));
manager.acceptWordAsCorrect(word, myFixture.getProject());
assertFalse(manager.hasProblem(word));
}
public void testGeneral(){
doTest("wooord");
}
public void testCamelCase(){
doTest("Tyyyyypo");
}
}