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

Add trigger type to CodeActionContext #34595

Closed
mjbvz opened this issue Sep 18, 2017 · 2 comments
Closed

Add trigger type to CodeActionContext #34595

mjbvz opened this issue Sep 18, 2017 · 2 comments
Assignees
Labels
api editor-code-actions Editor inplace actions (Ctrl + .) feature-request Request for new features or functionality

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 18, 2017

Part of #33555

Problems
Extensions currently do not know how a code actions request was triggered. Code actions may be requested automatically by vscode or when the user requests them

Proposal
Add a trigger type to CodeActionContext:

export interface CodeActionContext {
    readonly diagnostics: Diagnostic[];
    readonly trigger: 'auto' | 'manual';
}
  • auto: Code actions requested by VS Code automatically
  • manual: Code actions requested by user / command

Extensions could use this to determine which code actions they want to compute / show. For example, an extension may decide to only compute refactorings when a user requests them

// @jrieken

@mjbvz mjbvz added the api label Sep 18, 2017
@mjbvz mjbvz self-assigned this Sep 18, 2017
@jrieken jrieken assigned jrieken and unassigned mjbvz Sep 19, 2017
@jrieken jrieken added feature-request Request for new features or functionality editor-code-actions Editor inplace actions (Ctrl + .) labels Sep 19, 2017
@jrieken
Copy link
Member

jrieken commented Sep 19, 2017

or example, an extension may decide to only compute refactorings when a user requests them

Not yet sure about that because one user might like that and another might not like that. I would solve the "noise" problem by richer code action information that allows for better sorting/filtering etc

@jrieken
Copy link
Member

jrieken commented Mar 1, 2018

I'd say we have something even better now

@jrieken jrieken closed this as completed Mar 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api editor-code-actions Editor inplace actions (Ctrl + .) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants