How to register LocalQuickFix with ExternalAnnotator?

I'm trying to convert my inspection to use an ExternalAnnotator because I understood it fits better an external tool, how exactly I don't know.
I'm having trouble converting my local quick fixes. the registerFix has one signature that accept LocalQuickFix, but requires also a ProblemDescriptor, which sadly I don't have.

  public void registerFix(@NotNull LocalQuickFix fix, @Nullable TextRange range, @Nullable HighlightDisplayKey key,
                          @NotNull ProblemDescriptor problemDescriptor)

Any clues on how to solve it will be appreciated.

Comment actions Permalink

Why not use

public void registerFix(@NotNull IntentionAction fix);

Just implement your fix as an IntentionAction.

Perhaps you can get some inspiration on how to use an external annotator for inspections.

Comment actions Permalink

Thanks for the reply.
I have, but it doesn't show in the anaylize code panel, only in the editor.

Comment actions Permalink

They will show if you use inspection approach (see PyPep8Inspection example linked above)


Please sign in to leave a comment.