Skip to content

Commit d5c578c

Browse files
authored
Changed Participate for Code actions on save for notebook (microsoft#194443)
changed participate to update
1 parent 411d298 commit d5c578c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ class CodeActionOnSaveParticipant implements IStoredFileWorkingCopySaveParticipa
328328

329329
const notebookModel = workingCopy.model.notebookModel;
330330

331-
const setting = this.configurationService.getValue<{ [kind: string]: string }>(NotebookSetting.codeActionsOnSave);
331+
const setting = this.configurationService.getValue<{ [kind: string]: string | boolean }>(NotebookSetting.codeActionsOnSave);
332332
if (!setting) {
333333
return undefined;
334334
}
@@ -341,9 +341,9 @@ class CodeActionOnSaveParticipant implements IStoredFileWorkingCopySaveParticipa
341341

342342
const allCodeActions = this.createCodeActionsOnSave(settingItems);
343343
const excludedActions = allCodeActions
344-
.filter(x => setting[x.value] === 'never');
344+
.filter(x => setting[x.value] === 'never' || setting[x.value] === false);
345345
const includedActions = allCodeActions
346-
.filter(x => setting[x.value] === saveTrigger);
346+
.filter(x => setting[x.value] === saveTrigger || setting[x.value] === true);
347347

348348
const editorCodeActionsOnSave = includedActions.filter(x => !CodeActionKind.Notebook.contains(x));
349349
const notebookCodeActionsOnSave = includedActions.filter(x => CodeActionKind.Notebook.contains(x));

src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ configurationRegistry.registerConfiguration({
964964
default: false
965965
},
966966
[NotebookSetting.codeActionsOnSave]: {
967-
markdownDescription: nls.localize('notebook.codeActionsOnSave', 'Run a series of CodeActions for a notebook on save. CodeActions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"source.fixAll": "explicit"`'),
967+
markdownDescription: nls.localize('notebook.codeActionsOnSave', 'Run a series of CodeActions for a notebook on save. CodeActions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'),
968968
type: 'object',
969969
additionalProperties: {
970970
type: ['string', 'boolean'],

0 commit comments

Comments
 (0)