How can I tell if the content of a LanguageTextField is valid?
Answered
I'm trying to use a LanguageTextField to enter a JSON configuration. Visually I can see, via syntax highlighting, whether or not the contents of the field are valid JSON.
Programmatically, however, I don't see any method I can call to check if the contents of the LanguageTextField are syntactically valid. How would I do this?
Please sign in to leave a comment.
You can check underlying PsiFile via com.intellij.psi.util.PsiTreeUtil#hasErrorElements