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

Workbench should provide language agnostic actions to apply all quick fixes to a file #5650

Closed
dbaeumer opened this issue Apr 22, 2016 · 11 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@dbaeumer
Copy link
Member

  • VSCode Version: 1.0.0
  • OS Version:

Instead of extensions and language servers providing their own language specific actions the workbench should provide actions to apply all available quick fixes to a file. I think that this is even possible with the extension API today since we can ask for all code actions for a given range.

See microsoft/vscode-eslint#70.

@jrieken
Copy link
Member

jrieken commented Apr 22, 2016

I think we should do that in the quick fix UI. When there is more than one action we should offer Apply all

@dbaeumer
Copy link
Member Author

ESLint does exactly what you recommend. The use case for an action / command is to bind it to a short cut. Easier to trigger then setting a cursor on a problem, clicking the light bulb, .... I doubt that a lot of devs do F1 > .....

@jrieken jrieken added this to the April 2016 milestone Apr 22, 2016
@jrieken
Copy link
Member

jrieken commented Apr 22, 2016

stretch for april, tho rain on sunday

@dbaeumer
Copy link
Member Author

Rain on Saturday and snow on Sunday :-)

@jrieken
Copy link
Member

jrieken commented Apr 22, 2016

Saturday is this: http://www.redbull.com/us/en/bike/events/1331753879682/uci-mtb-world-cup-2016-round-2-cairns-australia

@dbaeumer
Copy link
Member Author

Accepted :-)

@jrieken
Copy link
Member

jrieken commented Apr 22, 2016

to clarify: we want a command that fetches and applies all code actions UI-less? not another entry in the code action UI, correct?

@jrieken
Copy link
Member

jrieken commented Apr 22, 2016

Actually this isn't simple. The problem is that our CodeActions are just commands, not necessarily text edits. That mean we cannot run them all at once we because the change on which they have been computed might be different already. We have to do this:

  1. ask for all code actions
  2. run the first code actions
  3. if there is another code action, repeat at Open Source VS Code #1

Then the challenge is to know when to stop. Because it doesn't mean that running that command make the code action go away...

@dbaeumer
Copy link
Member Author

OK. See the problem. And we can't hook an handler for a language either since there can be more than one 'quick fix' provider per language. May be having a command 'ELint - fix all problems' is not a bad idea afterall.

@jrieken jrieken removed this from the April 2016 milestone Apr 25, 2016
@jrieken
Copy link
Member

jrieken commented Aug 25, 2016

No action planned because there are challenges as outlined above

@jrieken jrieken closed this as completed Aug 25, 2016
@dbaeumer
Copy link
Member Author

Agree :-)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants