detecting syntax errors / WolfTheProblemSolver.hasSyntaxErrors

What is the recommended way to detect syntax errors in a Scala PsiFile in a plugin?

From looking at Scala worksheet it appears that WolfTheProblemSolver.hasSyntaxErrors(psiFile.getVirtualFile) should be sufficient, but this always returns false for me even when the editor clearly shows syntax errors.  I tried explicitly arranging for this call to happen on the Swing thread, but to no avail.

I looked around in the Worksheet sources to see if there was some explicit initialization step for Wolf that I was possibly missing but it looks like the only reference is the use in WorksheetAutoRunner.

Is Wolf the preferred way to do this?  A quick Google search and searching through the forums here doesn't turn up very much.

Thanks in advance for any help here.

2 comments
Comment actions Permalink

You can do it by yourself. You can scan psiFile tree for PsiErrorElement presence. WolfTheProblemSolver looks like solution, but I don't know much about this class.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

OK, we've managed to make the direct scan (without wolf) work.  Thanks for your help with this.

0

Please sign in to leave a comment.