mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
IJPL-171917 don't allow GrazieInspection to touch indexes in dumb mode
GrazieInspection can run in dumb mode after implementation of IJPL-155874. But unfortunately, one of its filters (CommentProblemFilter) needs indexes. So in some situations IDE gets stuck. The easy solution is just to avoid checks requiring indexes. A better solution would be to detect todo comments without indexes IDEA-364846. (cherry picked from commit bc8962287f61eade48df703b7fa25dbd78fb83aa) IJ-CR-151765 GitOrigin-RevId: 41df36e2ee169afedd2667c923afb36f932e6685
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f45c905fe2
commit
137b1d2b13
@@ -4,6 +4,7 @@ import ai.grazie.nlp.tokenizer.sentence.StandardSentenceTokenizer
|
||||
import com.intellij.grazie.text.TextContent.TextDomain.COMMENTS
|
||||
import com.intellij.grazie.text.TextContent.TextDomain.DOCUMENTATION
|
||||
import com.intellij.grazie.utils.Text
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.util.TextRange
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.search.PsiTodoSearchHelper
|
||||
@@ -53,6 +54,7 @@ internal class CommentProblemFilter : ProblemFilter() {
|
||||
|
||||
// the _todo_ word spoils the grammar of what follows
|
||||
private fun isTodoComment(file: PsiFile, text: TextContent): Boolean {
|
||||
if (DumbService.getInstance(file.project).isDumb) return false
|
||||
val todos = CachedValuesManager.getProjectPsiDependentCache(file) {
|
||||
PsiTodoSearchHelper.getInstance(it.project).findTodoItems(it)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user