From 498dd67191b2ca280826b8a61708efc7e60d65ec Mon Sep 17 00:00:00 2001 From: Ilia Permiashkin Date: Fri, 19 Dec 2025 00:05:11 +0200 Subject: [PATCH] [grazie] IJPL-224218 Adjust number of tokens GitOrigin-RevId: 8a66ca3a5b408907aee7d6edd9deba27794fd61c --- .../com/intellij/grazie/spellcheck/GrazieSpellchecker.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/grazie/src/main/kotlin/com/intellij/grazie/spellcheck/GrazieSpellchecker.kt b/plugins/grazie/src/main/kotlin/com/intellij/grazie/spellcheck/GrazieSpellchecker.kt index 19e06d70516e..dabf9d6dc954 100644 --- a/plugins/grazie/src/main/kotlin/com/intellij/grazie/spellcheck/GrazieSpellchecker.kt +++ b/plugins/grazie/src/main/kotlin/com/intellij/grazie/spellcheck/GrazieSpellchecker.kt @@ -63,7 +63,8 @@ class GrazieCheckers(coroutineScope: CoroutineScope) : GrazieStateLifecycle { return synchronized(speller) { computeWithClassLoader(GraziePlugin.classLoader) { val sentence = tool.getRawAnalyzedSentence(word) - if (sentence.nonWhitespaceTokenCount == 1) return@computeWithClassLoader !speller.isMisspelled(word) + // First token is always sentence start + if (sentence.nonWhitespaceTokenCount <= 2) return@computeWithClassLoader !speller.isMisspelled(word) if (speller.match(sentence).isEmpty()) { if (!speller.isMisspelled(word)) true else {