Search in sources :

Example 11 with NamesValidator

use of com.intellij.lang.refactoring.NamesValidator in project intellij-community by JetBrains.

the class SpellCheckerDictionaryGenerator method addSeenWord.

protected void addSeenWord(HashSet<String> seenNames, String word, Language language) {
    final String lowerWord = word.toLowerCase();
    if (globalSeenNames.contains(lowerWord)) {
        return;
    }
    final NamesValidator namesValidator = LanguageNamesValidation.INSTANCE.forLanguage(language);
    if (namesValidator != null && namesValidator.isKeyword(word, myProject)) {
        return;
    }
    globalSeenNames.add(lowerWord);
    if (mySpellCheckerManager.hasProblem(lowerWord)) {
        seenNames.add(lowerWord);
    }
}
Also used : NamesValidator(com.intellij.lang.refactoring.NamesValidator)

Aggregations

NamesValidator (com.intellij.lang.refactoring.NamesValidator)11 NotNull (org.jetbrains.annotations.NotNull)3 Project (com.intellij.openapi.project.Project)2 PsiElement (com.intellij.psi.PsiElement)2 Module (com.intellij.openapi.module.Module)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 XmlAttribute (com.intellij.psi.xml.XmlAttribute)1 XmlAttributeValue (com.intellij.psi.xml.XmlAttributeValue)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 Nullable (org.jetbrains.annotations.Nullable)1 JavaFxFieldIdReferenceProvider (org.jetbrains.plugins.javaFX.fxml.refs.JavaFxFieldIdReferenceProvider)1