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

Define standard OrganizeImports CodeActionKind #47845

Closed
mjbvz opened this issue Apr 13, 2018 · 0 comments · Fixed by #47850
Closed

Define standard OrganizeImports CodeActionKind #47845

mjbvz opened this issue Apr 13, 2018 · 0 comments · Fixed by #47850
Assignees
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 13, 2018

Problem
See #46647. Multiple extensions registering organize imports commands for various languages. I believe that organize imports is common enough that our api should help by providing basic support for it.

Proposal
Leverage the new Source CodeActionKind to define a built-in CodeActionKind.SourceOrganizeImports type. Use this kind to define a standard keybinding and command for organize imports

/cc @jrieken

@mjbvz mjbvz added this to the April 2018 milestone Apr 13, 2018
@mjbvz mjbvz self-assigned this Apr 13, 2018
@mjbvz mjbvz added the api label Apr 13, 2018
mjbvz added a commit to mjbvz/vscode that referenced this issue Apr 17, 2018
Fixes microsoft#47845
Fixes microsoft#46647

- Defines a new standard `SourceOrganizeImports` `CodeActionKind` to be used to implement organize imports in a consistent way.
- Add a new `Organize imports` command and keybinding that executes these actions.
- Move over the existing js/ts organize imports command to use the new code action kind
mjbvz added a commit that referenced this issue Apr 18, 2018
)

* Move TS/JS to use organize imports code action

Fixes #47845
Fixes #46647

- Defines a new standard `SourceOrganizeImports` `CodeActionKind` to be used to implement organize imports in a consistent way.
- Add a new `Organize imports` command and keybinding that executes these actions.
- Move over the existing js/ts organize imports command to use the new code action kind

* Use supportedCodeActions context key

* Document code action kind values

* Fix regular expression

Make sure we only match whole scopes and not `unicorn.source.organizeImports`
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant