Skip to content

Support more than just quick fixes (for ex. "Open docs for error_code") in Problems view context menu #71541

Closed

Description

@DanTup

Right-clicking in the Problems view shows a filtered list of QuickFix code actions. I'd really like to add an entry in there to open the help docs for more information on the error - however it doesn't seem right to mark it as a QuickFix:

Screenshot 2019-04-01 at 12 37 10 pm
Screenshot 2019-04-01 at 12 37 16 pm

It would be great if there was some way to either supply a URL for more help about an error, or at least another CodeAction kind that can be shown in the problems view.

Activity

  1. sandy081 commented on Apr 3, 2019

    @sandy081
    Member

    Matt Bierner (@mjbvz) How can I get other code actions which are relevant to the given diagnostic? Right now I only get quick fixes.

  2. mjbvz commented on Apr 3, 2019

    @mjbvz
    Contributor

    Sandeep Somavarapu (@sandy081) When calling getCodeActions here, remove the filter. However keep in mind that the returned result may also include refactorings and other actions that probably should not show up in the problems context menu

    Danny Tuppeny (@DanTup) For those documentation code actions, could mark them with a code action kind of CodeActionKind.QuickFix.append('documentation') or similar? The action is related to quick fixes so abusing the code action kind this way may not be too terrible. Once you add that kind, the actions should should show up in the problems menu

  3. DanTup commented on Apr 3, 2019

    @DanTup
    ContributorAuthor

    I certainly could, but it feels a bit weird. For ex. if you had a keybind to show the menu filtered to "all quick fixes" (I think you can do that?) it'd be weird for this to show up there. Maybe a CodeAction.Help or something would be appropriate?

  4. mjbvz commented on Apr 3, 2019

    @mjbvz
    Contributor

    Or, even better, put the help text in the error message itself. Sandeep Somavarapu (@sandy081) Is that something we support?

  5. DanTup commented on Apr 3, 2019

    @DanTup
    ContributorAuthor

    We do have extra help text in the errors (in the screenshot at the top you can see some errors have a second line with more descriptive text), but we wanted to be able to link to online docs that are more detailed than we'd want to cram into the problems list.

  6. added
    info-needed
    on Apr 4, 2019
  7. sandy081 commented on Apr 4, 2019

    @sandy081
    Member

    There are discussions to add help link to diagnostics - #11847

    So options here are to change the code action kind to quick fix or follow up on other item.

  8. DanTup commented on Apr 4, 2019

    @DanTup
    ContributorAuthor

    Making a help URL a first-class citizen sounds good to me - it opens the door to other nice functionality (for ex. a keybind that opens help for the current error). I still think being able to show non-fix items in this context menu is worthwhile, but I don't have a specific need for it if diagnostics could have URLs.

    That said, it's not clear what's going on in that issue - using RelatedInformation sounds wonky to me, and I don't think supporting formatted content in errors solves the problem (I don't want to clutter the error list even more with visible links, the context menu is an idea place for it).

  9. sandy081 commented on Apr 8, 2019

    @sandy081
    Member

    Danny Tuppeny (@DanTup) Thanks for your feedback. Closing this in favor of #11847

  10. locked and limited conversation to collaborators on May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions