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

Allow triggering quick fixes from problems view #52627

Closed
mjbvz opened this issue Jun 21, 2018 · 10 comments
Closed

Allow triggering quick fixes from problems view #52627

mjbvz opened this issue Jun 21, 2018 · 10 comments
Assignees
Labels
error-list Problems view feature-request Request for new features or functionality on-testplan
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Jun 21, 2018

Feature request
Provide a way to trigger a quick fix from the problems view.

For example, for the javascript:

//@ts-check
class Abc {}

new AbC()

A quick fix is available:

screen shot 2018-06-21 at 10 27 07 am

But this is not shown or indicated in the problems view:

screen shot 2018-06-21 at 10 27 58 am

Additionally, when you click on the problems entry, the editor is not focused so you cannot use a keyboard shortcut to trigger the quick fix

@mjbvz mjbvz added feature-request Request for new features or functionality error-list Problems view labels Jun 21, 2018
@sandy081 sandy081 added this to the July 2018 milestone Jun 25, 2018
@sandy081
Copy link
Member

sandy081 commented Jul 12, 2018

Following are the quick fixes when shown in problems view.

image

image

Let me know if it is ok

@jrieken FYI

@jrieken
Copy link
Member

jrieken commented Jul 13, 2018

I like it. This is per error/warning, right? Per file we could offer source actions, like orga-imports et al.

@sandy081
Copy link
Member

Yeah it is per marker. Sure, we can offer source actions and may be also fix all action on file.

@kieferrm
Copy link
Member

kieferrm commented Jul 13, 2018

@sandy081 do I see if quick fixes are available without opening the context menu?

sandy081 added a commit that referenced this issue Jul 13, 2018
@sandy081
Copy link
Member

@kieferrm No, you don't.
But is not it intuitive to find fixes from context menu in problems view.

Otherwise, we can show overlaid light bulb icon on top of error/warning icon?

@kieferrm
Copy link
Member

@sandy081 that's something we should experiment with.

@jrieken
Copy link
Member

jrieken commented Jul 13, 2018

Otherwise, we can show overlaid light bulb icon on top of error/warning icon?

Maybe on select/hover?

@sandy081
Copy link
Member

On select might inline with editor

@sandy081
Copy link
Member

I think Source Actions are not a good fit as they are nothing to do with diagnostics.

@sandy081
Copy link
Member

A light bulb will be shown if there are quick fixes available for a problem.

image

For performance reasons, quick fixes check is done by

  • Getting the quick fixes for the complete file
  • Check if there is a quick fix for the given marker

So, it is necessary that the extension should provide the diagnostics in the quick fixes. See CodeAction.diagnostics

Otherwise, light bulb indicator is not shown, but the quick fixes are shown in the context menu.

image

I will file an issue against those extension which are not providing diagnostics in quick fixes so that the light bulb can be shown for their diagnostics in Problems view.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
error-list Problems view feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

4 participants