-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Conversation
There was a problem hiding this 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(); | ||
} |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
8962065
to
613a85b
Compare
Thanks for the feedback. I've updated the PR to only enable/disable the lightbulb instead of all code actions. I went with the |
Adds a
editor.codeActions
setting to enable/disable code actions.Fixes #27961