How to disable the DaemonCodeAnalyzer for a LightVirtualFile?

已回答

Hi, I created a a LightVirtualFile:

LightVirtualFile snippetFile = new LightVirtualFile("", language, content);

then create an editor holding the document of the LightVirtualFile:

EditorTextField editor = EditorTextFieldProvider.getInstance().getEditorField();

FileViewProvider snippetViewProvider = PsiManager.getInstance(this.project).findViewProvider((VirtualFile)snippetFile);
if (snippetViewProvider != null)
    editor.setDocument(snippetViewProvider.getDocument());

How to disable the DaemonCodeAnalyzer of the EditorTextField? 

 

 

 

0

Why do you want a full Editor without highlighting for a given language?

Reference: https://plugins.jetbrains.com/docs/intellij/editor-components.html#editortextfield

0

I have wanted to do this as well. Sometimes, I allow the user to enter code in a non-project context, you can see an example of when this appears in the UI in my doc here: https://cursive-ide.com/userguide/repl.html#repl-commands. I spent a while trying to do this a long time ago, IIRC you can do it with access to the Editor, but EditorTextField doesn't allow you that. 

0

请先登录再写评论。