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 editor.codeActions to enable/disable code actions #33982

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Sep 8, 2017

Adds a editor.codeActions setting to enable/disable code actions.

Fixes #27961

@mjbvz mjbvz self-assigned this Sep 8, 2017
@mjbvz mjbvz requested a review from jrieken September 8, 2017 02:45
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not call it like that because you don't disable/enable code actions but the lightbulb. Also, I would give the potential for future settings by using the .enable-pattern. That could/would make it

editor.lightbulb.enable: true/false
editor.lightbulb.onProblems: true/false
editor.lightbulb.delay: number
...

Or some kind of enum, like so

editor.lightbulb = ['on', 'off', 'onForProblems', 'onForSelections']

which needs more thinking because a third value won't fit

this._model.dispose();
if (this._model) {
this._model.dispose();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dispose(this._model) will look much nice

}

public triggerFromEditorSelection(): void {
this._model.trigger('manual');
if (this._model) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, don't do this. Keep the model, enable/disable the lightbulb. The manual invocation should always work

Fixes microsoft#27961

Adds a new `editor.lightbulb.enabled` setting to enable/disable the code actions lighbulb. You can still trigger code actions manually
@mjbvz
Copy link
Contributor Author

mjbvz commented Sep 8, 2017

Thanks for the feedback. I've updated the PR to only enable/disable the lightbulb instead of all code actions. I went with the .enabled syntax for the setting

@jrieken jrieken added this to the September 2017 milestone Sep 11, 2017
@mjbvz mjbvz merged commit 75c1feb into microsoft:master Sep 13, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable quick fix
3 participants