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:
https://github.com/JetBrains/intellij-community/blob/master/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightClassUtil.java#L295-L329
You can try to implement an error filter to disable it in your language text field context:
https://plugins.jetbrains.com/docs/intellij/controlling-highlighting.html
This method is effective. I have registered the following extensions
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
andPsiFile
.