Change:
Testing I have the following set: When using the sample extension at I expect this to not trigger the code action on save but it does do it. Because there is no auto-complete I tried a bunch of other things also to no avail.

Discussion:
import { DocumentationExtensionPoint, documentationExtensionPointDescriptor } from 'vs/workbench/contrib/codeActions/common/documentationExtensionPoint'; import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; <del> import { CodeActionsContribution, editorConfiguration } from './codeActionsContribution'; </del> <ins> import { CodeActionsContribution, editorConfiguration, notebookEditorConfiguration } from './codeActionsContribution'; </ins> import { CodeActionDocumentationContribution } from './documentationContribution'; const codeActionsExtensionPoint = ExtensionsRegistry.registerExtensionPoint<CodeActionsExtensionPoint[]>(codeActionsExtensionPointDescriptor);

Registry.as<IConfigurationRegistry>(Extensions.Configuration) .registerConfiguration(editorConfiguration); <ins> Registry.as<IConfigurationRegistry>(Extensions.Configuration) .registerConfiguration(notebookEditorConfiguration); </ins> class WorkbenchConfigurationContribution { constructor( @IInstantiationService instantiationService: IInstantiationService,

}; }; <ins> const createNotebookCodeActionsAutoSave = (description: string): IJSONSchema => { return { type: ['string', 'boolean'], enum: ['explicit', 'never', true, false], enumDescriptions: [ nls.localize('explicit', 'Triggers Code Actions only when explicitly saved.'), nls.localize('never', 'Never triggers Code Actions on save.'), nls.localize('explicitBoolean', 'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'), nls.localize('neverBoolean', 'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".') ], default: 'explicit', description: description }; }; </ins> const codeActionsOnSaveSchema: IConfigurationPropertySchema = { oneOf: [

} }); <ins> const notebookCodeActionsOnSaveSchema: IConfigurationPropertySchema = { oneOf: [ { type: 'object', additionalProperties: { type: 'string' }, }, { type: 'array', items: { type: 'string' } } ], markdownDescription: nls.localize('notebook.codeActionsOnSave', 'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'), type: 'object', additionalProperties: { type: ['string', 'boolean'], enum: ['explicit', 'never', true, false], // enum: ['explicit', 'always', 'never'], -- autosave support needs to be built first // nls.localize('always', 'Always triggers Code Actions on save, including autosave, focus, and window change events.'), }, default: {} }; export const notebookEditorConfiguration = Object.freeze<IConfigurationNode>({ ...editorConfigurationBaseNode, properties: { 'notebook.codeActionsOnSave': notebookCodeActionsOnSaveSchema } }); </ins> export class CodeActionsContribution extends Disposable implements IWorkbenchContribution { private _contributedCodeActions: CodeActionsExtensionPoint[] = [];

super(); // TODO: @justschen caching of code actions based on extensions loaded: https://github.com/microsoft/vscode/issues/216019 languageFeatures.codeActionProvider.onDidChange(() => { this.updateSettingsFromCodeActionProviders(); this.updateConfigurationSchemaFromContribs();

private updateConfigurationSchema(codeActionContributions: readonly CodeActionsExtensionPoint[]) { const newProperties: IJSONSchemaMap = {}; <ins> const newNotebookProperties: IJSONSchemaMap = {}; </ins> for (const [sourceAction, props] of this.getSourceActions(codeActionContributions)) { this.settings.add(sourceAction); newProperties[sourceAction] = createCodeActionsAutoSave(nls.localize('codeActionsOnSave.generic', "Controls whether '{0}' actions should be run on file save.", props.title)); <ins> newNotebookProperties[sourceAction] = createNotebookCodeActionsAutoSave(nls.localize('codeActionsOnSave.generic', "Controls whether '{0}' actions should be run on file save.", props.title)); </ins> } codeActionsOnSaveSchema.properties = newProperties; <ins> notebookCodeActionsOnSaveSchema.properties = newNotebookProperties; </ins> Registry.as<IConfigurationRegistry>(Extensions.Configuration) .notifyConfigurationSchemaUpdated(editorConfiguration); } private updateConfigurationSchemaFromContribs() { const properties: IJSONSchemaMap = { ...codeActionsOnSaveSchema.properties }; <ins> const notebookProperties: IJSONSchemaMap = { ...notebookCodeActionsOnSaveSchema.properties }; </ins> for (const codeActionKind of this.settings) { if (!properties[codeActionKind]) { properties[codeActionKind] = createCodeActionsAutoSave(nls.localize('codeActionsOnSave.generic', "Controls whether '{0}' actions should be run on file save.", codeActionKind)); <ins> notebookProperties[codeActionKind] = createNotebookCodeActionsAutoSave(nls.localize('codeActionsOnSave.generic', "Controls whether '{0}' actions should be run on file save.", codeActionKind)); </ins> } } codeActionsOnSaveSchema.properties = properties; <ins> notebookCodeActionsOnSaveSchema.properties = notebookProperties; </ins> Registry.as<IConfigurationRegistry>(Extensions.Configuration) .notifyConfigurationSchemaUpdated(editorConfiguration); }

tags: ['notebookLayout'], default: false }, <del> [NotebookSetting.codeActionsOnSave]: { markdownDescription: nls.localize('notebook.codeActionsOnSave', 'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'), type: 'object', additionalProperties: { type: ['string', 'boolean'], enum: ['explicit', 'never', true, false], // enum: ['explicit', 'always', 'never'], -- autosave support needs to be built first // nls.localize('always', 'Always triggers Code Actions on save, including autosave, focus, and window change events.'), enumDescriptions: [nls.localize('explicit', 'Triggers Code Actions only when explicitly saved.'), nls.localize('never', 'Never triggers Code Actions on save.'), nls.localize('explicitBoolean', 'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'), nls.localize('neverBoolean', 'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".')], }, default: {} }, </del> [NotebookSetting.formatOnCellExecution]: { markdownDescription: nls.localize('notebook.formatOnCellExecution', "Format a notebook cell upon execution. A formatter must be available."), type: 'boolean',