You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support more than just quick fixes (for ex. "Open docs for error_code") in Problems view context menu #71541
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:
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.
Sandeep Somavarapu (@sandy081) When calling getCodeActionshere, 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
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?
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.
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).
Activity
sandy081 commentedon Apr 3, 2019
Matt Bierner (@mjbvz) How can I get other code actions which are relevant to the given diagnostic? Right now I only get quick fixes.
mjbvz commentedon Apr 3, 2019
Sandeep Somavarapu (@sandy081) When calling
getCodeActionshere, remove thefilter. 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 menuDanny 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 menuDanTup commentedon 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.Helpor something would be appropriate?mjbvz commentedon Apr 3, 2019
Or, even better, put the help text in the error message itself. Sandeep Somavarapu (@sandy081) Is that something we support?
DanTup commentedon 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 commentedon 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 commentedon 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 commentedon Apr 8, 2019
Danny Tuppeny (@DanTup) Thanks for your feedback. Closing this in favor of #11847