I have created a read only editor. I want to disable inspection and syntax highlighting.
Answered
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?
Please sign in to leave a comment.
Hi,
It seems that you should implement
com.intellij.codeInsight.daemon.impl.analysis.DefaultHighlightingSettingProvider
and register it incom.intellij.defaultHighlightingSettingProvider
. It should returnFileHighlightingSetting.SKIP_HIGHLIGHTING
for the files you want to skip highlighting.