I have created a read only editor. I want to disable inspection and syntax highlighting.
已回答
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(doc);
HighlightLevelUtil.forceRootHighlighting(psiFile, FileHighlightingSetting.SKIP_HIGHLIGHTING);
HighlightLevelUtil.forceRootHighlighting(psiFile, FileHighlightingSetting.SKIP_INSPECTION);This is the code. This is not working. It may be due to deprecated FileHighlightSetting. What to use instead?
请先登录再写评论。
Hi,
It seems that you should implement
com.intellij.codeInsight.daemon.impl.analysis.DefaultHighlightingSettingProviderand register it incom.intellij.defaultHighlightingSettingProvider. It should returnFileHighlightingSetting.SKIP_HIGHLIGHTINGfor the files you want to skip highlighting.