LanguageTextField turns off Java file detection



I wrote a piece of Java code using LanguageTextField, but it may have reported an error because there is no file name that matches the class name. How to turn off this detection



Please clarify what you want to achieve. Do you want to disable all analysis or only this particular one?


I just want to disable this one


I don't see any direct API that allows disabling this in LanguageTextField.

The error is added in:

You can try to implement an error filter to disable it in your language text field context:


This method is effective. I have registered the following extensions

   <daemon.highlightInfoFilter implementation="com.test.HighlightInfoFilterImpl"/>

But the disadvantage is that it is effective for all editors, is there a way to only face the specified EditorTextField,


I couldn't find the relevant API


The only way I see is debugging and checking whether you can determine the context from the accept method's parameters: HighlightInfo and PsiFile.