mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SpellcheckingStrategy: javadoc
GitOrigin-RevId: 671ef3e58e54c8bec63530f5d3e7b69e3720b816
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b7b3d101d7
commit
64a47f0aea
@@ -1,4 +1,4 @@
|
||||
// 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.
|
||||
// Copyright 2000-2019 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.tokenizer;
|
||||
|
||||
import com.intellij.codeInspection.SuppressionUtil;
|
||||
@@ -21,6 +21,12 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Defines spellchecking support for a custom language.
|
||||
* <p>
|
||||
* Register via extension point {@code com.intellij.spellchecker.support}
|
||||
* and override {@link #getTokenizer(PsiElement)} to skip/handle specific elements.
|
||||
*/
|
||||
public class SpellcheckingStrategy {
|
||||
protected final Tokenizer<PsiComment> myCommentTokenizer = new CommentTokenizer();
|
||||
protected final Tokenizer<XmlAttributeValue> myXmlAttributeTokenizer = new XmlAttributeValueTokenizer();
|
||||
@@ -42,6 +48,9 @@ public class SpellcheckingStrategy {
|
||||
private static final SpellCheckerQuickFix[] BATCH_FIXES =
|
||||
new SpellCheckerQuickFix[]{SaveTo.getSaveToLevelFix(DictionaryLevel.APP), SaveTo.getSaveToLevelFix(DictionaryLevel.PROJECT)};
|
||||
|
||||
/**
|
||||
* @return {@link #EMPTY_TOKENIZER} to skip spellchecking, {@link #TEXT_TOKENIZER} for full element text or custom Tokenizer implementation.
|
||||
*/
|
||||
@NotNull
|
||||
public Tokenizer getTokenizer(PsiElement element) {
|
||||
if (element instanceof PsiWhiteSpace) {
|
||||
|
||||
Reference in New Issue
Block a user