[spelling] IJPL-156759 Don't show typos for IntelliJ options

GitOrigin-RevId: c6315588b9a4a80bb245a1597b1fdb54ed6a1531
This commit is contained in:
Yuriy Artamonov
2025-03-23 14:27:00 +00:00
committed by intellij-monorepo-bot
parent c9bf80129e
commit 727376811c
2 changed files with 28 additions and 0 deletions
@@ -29,7 +29,9 @@
<nameSuggestionProvider id="DictionarySuggestionProvider" implementation="com.intellij.spellchecker.quickfixes.DictionarySuggestionProvider" order="first"/>
<severitiesProvider implementation="com.intellij.spellchecker.SpellCheckerSeveritiesProvider"/>
<spellchecker.support language="TEXT" implementationClass="com.intellij.spellchecker.tokenizer.VmOptionsSpellcheckingStrategy"/>
<spellchecker.support language="TEXT" implementationClass="com.intellij.spellchecker.tokenizer.SpellcheckingStrategy"/>
<spellchecker.bundledDictionaryProvider implementation="com.intellij.spellchecker.DefaultBundledDictionariesProvider"/>
<spellchecker.dictionary.customDictionaryProvider implementation="com.intellij.spellchecker.hunspell.HunspellDictionaryProvider"/>
<spellchecker.dictionaryLayersProvider implementation="com.intellij.spellchecker.PlatformSettingsDictionaryLayersProvider" order="first"/>
@@ -0,0 +1,26 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.spellchecker.tokenizer;
import com.intellij.codeInspection.SuppressQuickFix;
import com.intellij.openapi.project.DumbAware;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
final class VmOptionsSpellcheckingStrategy extends SuppressibleSpellcheckingStrategy implements DumbAware {
@Override
public boolean isMyContext(@NotNull PsiElement element) {
PsiFile file = element.getContainingFile();
return file != null && file.getName().equals("idea.vmoptions");
}
@Override
public boolean isSuppressedFor(@NotNull PsiElement element, @NotNull String name) {
return true;
}
@Override
public SuppressQuickFix[] getSuppressActions(@NotNull PsiElement element, @NotNull String name) {
return SuppressQuickFix.EMPTY_ARRAY;
}
}