Is it possible to create a new problem highlight type? (extend the enum class ProblemHighlightType)

Hi!

I'm currently working on a plugin for Android Studio. We define a new type of issue and we hope they can be labeled with a specific type of highlight (instead of the current highlight schemes for warning/error etc.) Is it possible to do that with open API? Could anyone give me some hint on how to achieve that goal?

Thanks,

Tianshi

0
5 comments

Hi Tianshil,

it's not possible to create a new ProblemHighlightType but it's possible to register custom severity. What kind of issue do you want to create actually? 

Anna

0

Hi Anna,

I have a list of APIs, and the plugin will search for them in the project. Once an instance is found, it will be annotated. And I hope it's in a different way from the existing highlight type to prevent habituation, e.g. change the font color to green.

This is for a research prototype, so it's fine if I can't do it directly with open API and I can change the source code of other parts of the IDE source code. Could you give me some idea about which part of code I should look at?

Thanks,

Tianshi

 

0

It's now declared com.intellij.codeInspection.ProblemDescriptorUtil#getHighlightInfoType.

Actually users are welcome to change the presentation of the errors/warnings they have in the editor and they may create custom severities for different kind of problems. So I'd rather create problems with warning level by default and in order to present the inspection, would configure special severity attributes.

Anna

0

What code should I look at if I want to create and configure the special severity attributes? Is it gonna change the presentation of an existing warning level, say GENERIC_ERROR_OR_WARNING?

0

You can try to follow the way how spellchecking inspection produces TYPE severity: com.intellij.spellchecker.SpellCheckerSeveritiesProvider

0

Please sign in to leave a comment.