How to simulate user viewing file in editor, in unit test?

I want to determine errors & warnings present in a file, from a unit
test. This involves:
1. Lexing
2. Parsing
3. Reference providing
4. Annotating
5. Inspections

I can simulate 1,2,4 directly from the Language but I don't know how to
run inspections or run the reference providers. Of course I could invoke
these things manually but I don't want to reimplement this part of IDEA
just for my tests, it would take long and be error-prone.

I'm looking at executing GeneralHighlightingPass and
LocalInspectionsPass but the IDEA license doesn't allow decompilation
and these classes are not documented. I don't know how to use them.

Is there some other way to do this?


Please sign in to leave a comment.