Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DanTup opened this issue Apr 1, 2019 · 8 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@DanTup
Copy link
Contributor

DanTup commented Apr 1, 2019

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.

@sandy081
Copy link
Member

sandy081 commented Apr 3, 2019

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

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 3, 2019

@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

@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

@DanTup
Copy link
Contributor Author

DanTup commented Apr 3, 2019

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?

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 3, 2019

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

@DanTup
Copy link
Contributor Author

DanTup commented Apr 3, 2019

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.

@sandy081 sandy081 added the info-needed Issue requires more information from poster label Apr 4, 2019
@sandy081
Copy link
Member

sandy081 commented Apr 4, 2019

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.

@DanTup
Copy link
Contributor Author

DanTup commented Apr 4, 2019

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).

@sandy081
Copy link
Member

sandy081 commented Apr 8, 2019

@DanTup Thanks for your feedback. Closing this in favor of #11847

@sandy081 sandy081 closed this as completed Apr 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants