-
Notifications
You must be signed in to change notification settings - Fork 28.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
code actions on save for autosave afterDelay
#221785
Conversation
src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts
Outdated
Show resolved
Hide resolved
} | ||
|
||
private async triggerCodeActionsCommand() { | ||
if (this.configurationService.getValue<boolean>('editor.codeActions.triggerOnFocusChange') && this.configurationService.getValue<string>('files.autoSave') === 'afterDelay') { |
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.
Are there any constants we can use for these setting IDs instead?
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.
we don't atm
'editor.codeActions.triggerOnFocusChange': { | ||
type: 'boolean', | ||
scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, |
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.
Should this be restricted
?
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.
"value of this configuration will be read only from trusted sources." not entirely sure what this means? our other code actions on save aren't restricted
iirc, but unsure if this needs or not
src/vs/editor/contrib/codeAction/browser/codeActionContributions.ts
Outdated
Show resolved
Hide resolved
Thanks for the updates 👍 |
ref: #200881
This will trigger code actions for organize imports when the following conditions are applied:
afterDelay
source.organizeImports
) is set toalways
editor.codeActions.triggerOnFocusChange
istrue
(default is false)note: will still be triggered when
afterDelay
is on and we manually trigger a safe (same as current behavior)TLDR: we match the behavior of
onFocusChange
oronWindowChange
save styles when code actions arealways
and our save style isafterDelay