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?

0
1 comment

Hi,

It seems that you should implement com.intellij.codeInsight.daemon.impl.analysis.DefaultHighlightingSettingProvider and register it in com.intellij.defaultHighlightingSettingProvider. It should return FileHighlightingSetting.SKIP_HIGHLIGHTING for the files you want to skip highlighting.

0

Please sign in to leave a comment.