Different coloured annotations possible?
Hello,
I'm integrating Swagger 2 in my code using Spring Boot and have configured SpringFox Swagger. In my code (controller, model, etc.) I already have annotations like @Autowired, @GetMapping, etc. With Swagger I need to add multiple additional annotations like @Api, @ApiOperation, @ApiParam at each Class, Method and property level due to which the code becomes bulky and hard to read. With all annotations in place, it becomes difficult to identify the business logic within the code and there are just too many annotations in the file.
I've noticed that some of the annotations are differently coloured like @Metadata, @Target, @Retention (are yellow), @Documented, @Target, @Retention (in some files like @interface or where they are declared are "white"). The normal annotations are Orange.
Is there any way in the IDE where I can configure custom colours for the annotations, especially the Swagger related (@Api...) so while looking at the code they can be easily made out to be for documentation and the code becomes slightly more readable? It can be another colour or any other way they can be differentiated from other annotations. I've tried to dig in the settings "Fonts and colours" and other options, but was unsuccessful.
I'm coding with Kotlin using Intellij IDEA v2018.2.6
Thanks,
Hemang
Please sign in to leave a comment.
Hello,
Please check related requests for possible workaround: https://youtrack.jetbrains.com/issue/IDEA-116868, https://youtrack.jetbrains.com/issue/IDEA-102501