mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[grazie] IJPL-214314 Capital letters in typos not saving to dictionary due to adding as lowercase
Merge-request: IJ-MR-180691 Merged-by: Ilia Permiashkin <ilia.permiashkin@jetbrains.com> Merge-request: IJ-MR-180776 Merged-by: Ilia Permiashkin <ilia.permiashkin@jetbrains.com> GitOrigin-RevId: fb08d2b820c49ea8a6abf1618a834265ab3169af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fd2c42c884
commit
b6b93d7950
@@ -69,6 +69,13 @@ public class ProjectDictionaryTest extends SpellcheckerInspectionTestCase {
|
||||
assertEquals(Alien, projectDictionary.lookup(eeee));
|
||||
}
|
||||
|
||||
public void testNoTyposInUpperCaseWords() {
|
||||
var dictionary = createProjectDictionary(Set.of("pghost"));
|
||||
assertEquals(Present, dictionary.lookup("PGHOST"));
|
||||
assertEquals(Present, dictionary.lookup("Pghost"));
|
||||
assertEquals(Alien, dictionary.lookup("pgHoSt"));
|
||||
}
|
||||
|
||||
public void testClear() {
|
||||
ProjectDictionary projectDictionary = createProjectDictionary(PROJECT_WORDS);
|
||||
projectDictionary.clear();
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.openapi.util.text.StringUtil.*;
|
||||
import static com.intellij.util.containers.CollectionFactory.createSmallMemoryFootprintSet;
|
||||
|
||||
public final class UserDictionary implements EditableDictionary {
|
||||
@@ -37,7 +38,9 @@ public final class UserDictionary implements EditableDictionary {
|
||||
|
||||
@Override
|
||||
public @Nullable Boolean contains(@NotNull String word) {
|
||||
return words.contains(word) ? true : null;
|
||||
if (words.contains(word)) return true;
|
||||
if (isUpperCase(word) || isCapitalized(word)) return words.contains(toLowerCase(word)) ? true : null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user