mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Have equivalents to Eclipse error markers

Open gunnarmorling opened this issue 8 years ago • 3 comments

It'd be great to see warnings/errors similar to the way it's done in Eclipse, i.e. with warning/error markers right on the mapper interface and its annotations, e.g. if a mapping method fails to map some target attributes or if a source() property is misspelled.

gunnarmorling avatar Nov 05 '17 18:11 gunnarmorling

Yeah, this should be implemented to see the errors earlier. Now the error is visible at compile time. This is OK but it could be visible earlier, just do the same checks and add an error highlighter. IDEA runs the implemented checks in the background. :)

mkrumpholz avatar Jun 30 '20 15:06 mkrumpholz

@mkrumpholz we do have some checks and inspections.

What Gunnar was referring to (I think) is to get the warnings / errors from the compiler and not reimplement the same logic as we have in the Mapstruct code generator. I don't know much about the Eclipse plugin, but from what I've seen the Eclipse plugin uses the compiler output to show the error markers.

Do you have some ideas for how to achieve this @mkrumpholz?

filiphr avatar Jul 04 '20 17:07 filiphr

IntelliJ parses the code and builds the internal tree (PSI). I think you know that when you're on plugin development. The checks are part of that process and i would expect that you could have a bit more generic code as a module to use it in the code generator as well as in the code analysis in the IDEA plugin. And i think @gunnarmorling is talking about the error highlighting in IDEA that is not asking the java compiler for the errors but using its own checks.

mkrumpholz avatar Jul 06 '20 07:07 mkrumpholz