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AAOsD,GACrBrI,KAAKU,KAAOA,EACZV,KAAK+E,MAAQA,EACb/E,KAAKqI,UAAYA,CACrB,EAEG,MAAM+U,EACT,WAAAlhB,CAAYwD,EAAQuC,EAAUob,GAC1Brd,KAAKN,OAASA,EACdM,KAAKiC,SAAWA,EAChBjC,KAAKqd,eAAiBA,CAC1B,CACA,aAAMlf,CAAQkD,GACV,IAAIxD,EACJ,IAA8B,QAAxBA,EAAKmC,KAAKiC,gBAA6B,IAAPpE,OAAgB,EAASA,EAAGyf,qBAAuBtd,KAAKN,OAAOmF,KAAM,CACvG,IAAInF,EACJ,IACIA,QAAeM,KAAKiC,SAASqb,kBAAkBtd,KAAKN,OAAQ2B,EAChE,CACA,MAAO2B,IACH,QAA0BA,EAC9B,CACItD,IACAM,KAAKN,OAAOmF,KAAOnF,EAAOmF,KAElC,CACA,OAAO7E,IACX,E","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/clipboard/browser/clipboard.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeAction.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionCommands.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionContributions.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionKeybindingResolver.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionMenu.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionController.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/codeActionModel.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/browser/lightBulbWidget.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/editor/contrib/codeAction/common/types.js"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as browser from '../../../../base/browser/browser.js';\nimport { getActiveDocument } from '../../../../base/browser/dom.js';\nimport * as platform from '../../../../base/common/platform.js';\nimport { CopyOptions, InMemoryClipboardMetadataManager } from '../../../browser/controller/textAreaInput.js';\nimport { EditorAction, MultiCommand, registerEditorAction } from '../../../browser/editorExtensions.js';\nimport { ICodeEditorService } from '../../../browser/services/codeEditorService.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { CopyPasteController } from '../../dropOrPasteInto/browser/copyPasteController.js';\nimport * as nls from '../../../../nls.js';\nimport { MenuId, MenuRegistry } from '../../../../platform/actions/common/actions.js';\nimport { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nconst CLIPBOARD_CONTEXT_MENU_GROUP = '9_cutcopypaste';\nconst supportsCut = (platform.isNative || document.queryCommandSupported('cut'));\nconst supportsCopy = (platform.isNative || document.queryCommandSupported('copy'));\n// Firefox only supports navigator.clipboard.readText() in browser extensions.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/readText#Browser_compatibility\n// When loading over http, navigator.clipboard can be undefined. See https://github.com/microsoft/monaco-editor/issues/2313\nconst supportsPaste = (typeof navigator.clipboard === 'undefined' || browser.isFirefox) ? document.queryCommandSupported('paste') : true;\nfunction registerCommand(command) {\n command.register();\n return command;\n}\nexport const CutAction = supportsCut ? registerCommand(new MultiCommand({\n id: 'editor.action.clipboardCutAction',\n precondition: undefined,\n kbOpts: (\n // Do not bind cut keybindings in the browser,\n // since browsers do that for us and it avoids security prompts\n platform.isNative ? {\n primary: 2048 /* KeyMod.CtrlCmd */ | 54 /* KeyCode.KeyX */,\n win: { primary: 2048 /* KeyMod.CtrlCmd */ | 54 /* KeyCode.KeyX */, secondary: [1024 /* KeyMod.Shift */ | 20 /* KeyCode.Delete */] },\n weight: 100 /* KeybindingWeight.EditorContrib */\n } : undefined),\n menuOpts: [{\n menuId: MenuId.MenubarEditMenu,\n group: '2_ccp',\n title: nls.localize({ key: 'miCut', comment: ['&& denotes a mnemonic'] }, \"Cu&&t\"),\n order: 1\n }, {\n menuId: MenuId.EditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n when: EditorContextKeys.writable,\n order: 1,\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n order: 1\n }, {\n menuId: MenuId.SimpleEditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.cutLabel', \"Cut\"),\n when: EditorContextKeys.writable,\n order: 1,\n }]\n})) : undefined;\nexport const CopyAction = supportsCopy ? registerCommand(new MultiCommand({\n id: 'editor.action.clipboardCopyAction',\n precondition: undefined,\n kbOpts: (\n // Do not bind copy keybindings in the browser,\n // since browsers do that for us and it avoids security prompts\n platform.isNative ? {\n primary: 2048 /* KeyMod.CtrlCmd */ | 33 /* KeyCode.KeyC */,\n win: { primary: 2048 /* KeyMod.CtrlCmd */ | 33 /* KeyCode.KeyC */, secondary: [2048 /* KeyMod.CtrlCmd */ | 19 /* KeyCode.Insert */] },\n weight: 100 /* KeybindingWeight.EditorContrib */\n } : undefined),\n menuOpts: [{\n menuId: MenuId.MenubarEditMenu,\n group: '2_ccp',\n title: nls.localize({ key: 'miCopy', comment: ['&& denotes a mnemonic'] }, \"&&Copy\"),\n order: 2\n }, {\n menuId: MenuId.EditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n order: 2,\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n order: 1\n }, {\n menuId: MenuId.SimpleEditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.copyLabel', \"Copy\"),\n order: 2,\n }]\n})) : undefined;\nMenuRegistry.appendMenuItem(MenuId.MenubarEditMenu, { submenu: MenuId.MenubarCopy, title: nls.localize2('copy as', \"Copy As\"), group: '2_ccp', order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextCopy, title: nls.localize2('copy as', \"Copy As\"), group: CLIPBOARD_CONTEXT_MENU_GROUP, order: 3 });\nMenuRegistry.appendMenuItem(MenuId.EditorContext, { submenu: MenuId.EditorContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1, when: ContextKeyExpr.and(ContextKeyExpr.notEquals('resourceScheme', 'output'), EditorContextKeys.editorTextFocus) });\nMenuRegistry.appendMenuItem(MenuId.ExplorerContext, { submenu: MenuId.ExplorerContextShare, title: nls.localize2('share', \"Share\"), group: '11_share', order: -1 });\nexport const PasteAction = supportsPaste ? registerCommand(new MultiCommand({\n id: 'editor.action.clipboardPasteAction',\n precondition: undefined,\n kbOpts: (\n // Do not bind paste keybindings in the browser,\n // since browsers do that for us and it avoids security prompts\n platform.isNative ? {\n primary: 2048 /* KeyMod.CtrlCmd */ | 52 /* KeyCode.KeyV */,\n win: { primary: 2048 /* KeyMod.CtrlCmd */ | 52 /* KeyCode.KeyV */, secondary: [1024 /* KeyMod.Shift */ | 19 /* KeyCode.Insert */] },\n linux: { primary: 2048 /* KeyMod.CtrlCmd */ | 52 /* KeyCode.KeyV */, secondary: [1024 /* KeyMod.Shift */ | 19 /* KeyCode.Insert */] },\n weight: 100 /* KeybindingWeight.EditorContrib */\n } : undefined),\n menuOpts: [{\n menuId: MenuId.MenubarEditMenu,\n group: '2_ccp',\n title: nls.localize({ key: 'miPaste', comment: ['&& denotes a mnemonic'] }, \"&&Paste\"),\n order: 4\n }, {\n menuId: MenuId.EditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n when: EditorContextKeys.writable,\n order: 4,\n }, {\n menuId: MenuId.CommandPalette,\n group: '',\n title: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n order: 1\n }, {\n menuId: MenuId.SimpleEditorContext,\n group: CLIPBOARD_CONTEXT_MENU_GROUP,\n title: nls.localize('actions.clipboard.pasteLabel', \"Paste\"),\n when: EditorContextKeys.writable,\n order: 4,\n }]\n})) : undefined;\nclass ExecCommandCopyWithSyntaxHighlightingAction extends EditorAction {\n constructor() {\n super({\n id: 'editor.action.clipboardCopyWithSyntaxHighlightingAction',\n label: nls.localize('actions.clipboard.copyWithSyntaxHighlightingLabel', \"Copy With Syntax Highlighting\"),\n alias: 'Copy With Syntax Highlighting',\n precondition: undefined,\n kbOpts: {\n kbExpr: EditorContextKeys.textInputFocus,\n primary: 0,\n weight: 100 /* KeybindingWeight.EditorContrib */\n }\n });\n }\n run(accessor, editor) {\n if (!editor.hasModel()) {\n return;\n }\n const emptySelectionClipboard = editor.getOption(37 /* EditorOption.emptySelectionClipboard */);\n if (!emptySelectionClipboard && editor.getSelection().isEmpty()) {\n return;\n }\n CopyOptions.forceCopyWithSyntaxHighlighting = true;\n editor.focus();\n editor.getContainerDomNode().ownerDocument.execCommand('copy');\n CopyOptions.forceCopyWithSyntaxHighlighting = false;\n }\n}\nfunction registerExecCommandImpl(target, browserCommand) {\n if (!target) {\n return;\n }\n // 1. handle case when focus is in editor.\n target.addImplementation(10000, 'code-editor', (accessor, args) => {\n // Only if editor text focus (i.e. not if editor has widget focus).\n const focusedEditor = accessor.get(ICodeEditorService).getFocusedCodeEditor();\n if (focusedEditor && focusedEditor.hasTextFocus()) {\n // Do not execute if there is no selection and empty selection clipboard is off\n const emptySelectionClipboard = focusedEditor.getOption(37 /* EditorOption.emptySelectionClipboard */);\n const selection = focusedEditor.getSelection();\n if (selection && selection.isEmpty() && !emptySelectionClipboard) {\n return true;\n }\n focusedEditor.getContainerDomNode().ownerDocument.execCommand(browserCommand);\n return true;\n }\n return false;\n });\n // 2. (default) handle case when focus is somewhere else.\n target.addImplementation(0, 'generic-dom', (accessor, args) => {\n getActiveDocument().execCommand(browserCommand);\n return true;\n });\n}\nregisterExecCommandImpl(CutAction, 'cut');\nregisterExecCommandImpl(CopyAction, 'copy');\nif (PasteAction) {\n // 1. Paste: handle case when focus is in editor.\n PasteAction.addImplementation(10000, 'code-editor', (accessor, args) => {\n var _a, _b;\n const codeEditorService = accessor.get(ICodeEditorService);\n const clipboardService = accessor.get(IClipboardService);\n // Only if editor text focus (i.e. not if editor has widget focus).\n const focusedEditor = codeEditorService.getFocusedCodeEditor();\n if (focusedEditor && focusedEditor.hasTextFocus()) {\n const result = focusedEditor.getContainerDomNode().ownerDocument.execCommand('paste');\n if (result) {\n return (_b = (_a = CopyPasteController.get(focusedEditor)) === null || _a === void 0 ? void 0 : _a.finishedPaste()) !== null && _b !== void 0 ? _b : Promise.resolve();\n }\n else if (platform.isWeb) {\n // Use the clipboard service if document.execCommand('paste') was not successful\n return (async () => {\n const clipboardText = await clipboardService.readText();\n if (clipboardText !== '') {\n const metadata = InMemoryClipboardMetadataManager.INSTANCE.get(clipboardText);\n let pasteOnNewLine = false;\n let multicursorText = null;\n let mode = null;\n if (metadata) {\n pasteOnNewLine = (focusedEditor.getOption(37 /* EditorOption.emptySelectionClipboard */) && !!metadata.isFromEmptySelection);\n multicursorText = (typeof metadata.multicursorText !== 'undefined' ? metadata.multicursorText : null);\n mode = metadata.mode;\n }\n focusedEditor.trigger('keyboard', \"paste\" /* Handler.Paste */, {\n text: clipboardText,\n pasteOnNewLine,\n multicursorText,\n mode\n });\n }\n })();\n }\n return true;\n }\n return false;\n });\n // 2. Paste: (default) handle case when focus is somewhere else.\n PasteAction.addImplementation(0, 'generic-dom', (accessor, args) => {\n getActiveDocument().execCommand('paste');\n return true;\n });\n}\nif (supportsCopy) {\n registerEditorAction(ExecCommandCopyWithSyntaxHighlightingAction);\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { coalesce, equals, isNonEmptyArray } from '../../../../base/common/arrays.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { illegalArgument, isCancellationError, onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { URI } from '../../../../base/common/uri.js';\nimport { IBulkEditService } from '../../../browser/services/bulkEditService.js';\nimport { Range } from '../../../common/core/range.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { IModelService } from '../../../common/services/model.js';\nimport { TextModelCancellationTokenSource } from '../../editorState/browser/editorState.js';\nimport * as nls from '../../../../nls.js';\nimport { CommandsRegistry, ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { INotificationService } from '../../../../platform/notification/common/notification.js';\nimport { Progress } from '../../../../platform/progress/common/progress.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nimport { CodeActionItem, CodeActionKind, CodeActionTriggerSource, filtersAction, mayIncludeActionsOfKind } from '../common/types.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nexport const codeActionCommandId = 'editor.action.codeAction';\nexport const quickFixCommandId = 'editor.action.quickFix';\nexport const autoFixCommandId = 'editor.action.autoFix';\nexport const refactorCommandId = 'editor.action.refactor';\nexport const sourceActionCommandId = 'editor.action.sourceAction';\nexport const organizeImportsCommandId = 'editor.action.organizeImports';\nexport const fixAllCommandId = 'editor.action.fixAll';\nclass ManagedCodeActionSet extends Disposable {\n static codeActionsPreferredComparator(a, b) {\n if (a.isPreferred && !b.isPreferred) {\n return -1;\n }\n else if (!a.isPreferred && b.isPreferred) {\n return 1;\n }\n else {\n return 0;\n }\n }\n static codeActionsComparator({ action: a }, { action: b }) {\n if (a.isAI && !b.isAI) {\n return 1;\n }\n else if (!a.isAI && b.isAI) {\n return -1;\n }\n if (isNonEmptyArray(a.diagnostics)) {\n return isNonEmptyArray(b.diagnostics) ? ManagedCodeActionSet.codeActionsPreferredComparator(a, b) : -1;\n }\n else if (isNonEmptyArray(b.diagnostics)) {\n return 1;\n }\n else {\n return ManagedCodeActionSet.codeActionsPreferredComparator(a, b); // both have no diagnostics\n }\n }\n constructor(actions, documentation, disposables) {\n super();\n this.documentation = documentation;\n this._register(disposables);\n this.allActions = [...actions].sort(ManagedCodeActionSet.codeActionsComparator);\n this.validActions = this.allActions.filter(({ action }) => !action.disabled);\n }\n get hasAutoFix() {\n return this.validActions.some(({ action: fix }) => !!fix.kind && CodeActionKind.QuickFix.contains(new HierarchicalKind(fix.kind)) && !!fix.isPreferred);\n }\n get hasAIFix() {\n return this.validActions.some(({ action: fix }) => !!fix.isAI);\n }\n get allAIFixes() {\n return this.validActions.every(({ action: fix }) => !!fix.isAI);\n }\n}\nconst emptyCodeActionsResponse = { actions: [], documentation: undefined };\nexport async function getCodeActions(registry, model, rangeOrSelection, trigger, progress, token) {\n var _a;\n const filter = trigger.filter || {};\n const notebookFilter = {\n ...filter,\n excludes: [...(filter.excludes || []), CodeActionKind.Notebook],\n };\n const codeActionContext = {\n only: (_a = filter.include) === null || _a === void 0 ? void 0 : _a.value,\n trigger: trigger.type,\n };\n const cts = new TextModelCancellationTokenSource(model, token);\n // if the trigger is auto (autosave, lightbulb, etc), we should exclude notebook codeActions\n const excludeNotebookCodeActions = (trigger.type === 2 /* languages.CodeActionTriggerType.Auto */);\n const providers = getCodeActionProviders(registry, model, (excludeNotebookCodeActions) ? notebookFilter : filter);\n const disposables = new DisposableStore();\n const promises = providers.map(async (provider) => {\n try {\n progress.report(provider);\n const providedCodeActions = await provider.provideCodeActions(model, rangeOrSelection, codeActionContext, cts.token);\n if (providedCodeActions) {\n disposables.add(providedCodeActions);\n }\n if (cts.token.isCancellationRequested) {\n return emptyCodeActionsResponse;\n }\n const filteredActions = ((providedCodeActions === null || providedCodeActions === void 0 ? void 0 : providedCodeActions.actions) || []).filter(action => action && filtersAction(filter, action));\n const documentation = getDocumentationFromProvider(provider, filteredActions, filter.include);\n return {\n actions: filteredActions.map(action => new CodeActionItem(action, provider)),\n documentation\n };\n }\n catch (err) {\n if (isCancellationError(err)) {\n throw err;\n }\n onUnexpectedExternalError(err);\n return emptyCodeActionsResponse;\n }\n });\n const listener = registry.onDidChange(() => {\n const newProviders = registry.all(model);\n if (!equals(newProviders, providers)) {\n cts.cancel();\n }\n });\n try {\n const actions = await Promise.all(promises);\n const allActions = actions.map(x => x.actions).flat();\n const allDocumentation = [\n ...coalesce(actions.map(x => x.documentation)),\n ...getAdditionalDocumentationForShowingActions(registry, model, trigger, allActions)\n ];\n return new ManagedCodeActionSet(allActions, allDocumentation, disposables);\n }\n finally {\n listener.dispose();\n cts.dispose();\n }\n}\nfunction getCodeActionProviders(registry, model, filter) {\n return registry.all(model)\n // Don't include providers that we know will not return code actions of interest\n .filter(provider => {\n if (!provider.providedCodeActionKinds) {\n // We don't know what type of actions this provider will return.\n return true;\n }\n return provider.providedCodeActionKinds.some(kind => mayIncludeActionsOfKind(filter, new HierarchicalKind(kind)));\n });\n}\nfunction* getAdditionalDocumentationForShowingActions(registry, model, trigger, actionsToShow) {\n var _a, _b, _c;\n if (model && actionsToShow.length) {\n for (const provider of registry.all(model)) {\n if (provider._getAdditionalMenuItems) {\n yield* (_a = provider._getAdditionalMenuItems) === null || _a === void 0 ? void 0 : _a.call(provider, { trigger: trigger.type, only: (_c = (_b = trigger.filter) === null || _b === void 0 ? void 0 : _b.include) === null || _c === void 0 ? void 0 : _c.value }, actionsToShow.map(item => item.action));\n }\n }\n }\n}\nfunction getDocumentationFromProvider(provider, providedCodeActions, only) {\n if (!provider.documentation) {\n return undefined;\n }\n const documentation = provider.documentation.map(entry => ({ kind: new HierarchicalKind(entry.kind), command: entry.command }));\n if (only) {\n let currentBest;\n for (const entry of documentation) {\n if (entry.kind.contains(only)) {\n if (!currentBest) {\n currentBest = entry;\n }\n else {\n // Take best match\n if (currentBest.kind.contains(entry.kind)) {\n currentBest = entry;\n }\n }\n }\n }\n if (currentBest) {\n return currentBest === null || currentBest === void 0 ? void 0 : currentBest.command;\n }\n }\n // Otherwise, check to see if any of the provided actions match.\n for (const action of providedCodeActions) {\n if (!action.kind) {\n continue;\n }\n for (const entry of documentation) {\n if (entry.kind.contains(new HierarchicalKind(action.kind))) {\n return entry.command;\n }\n }\n }\n return undefined;\n}\nexport var ApplyCodeActionReason;\n(function (ApplyCodeActionReason) {\n ApplyCodeActionReason[\"OnSave\"] = \"onSave\";\n ApplyCodeActionReason[\"FromProblemsView\"] = \"fromProblemsView\";\n ApplyCodeActionReason[\"FromCodeActions\"] = \"fromCodeActions\";\n ApplyCodeActionReason[\"FromAILightbulb\"] = \"fromAILightbulb\"; // direct invocation when clicking on the AI lightbulb\n})(ApplyCodeActionReason || (ApplyCodeActionReason = {}));\nexport async function applyCodeAction(accessor, item, codeActionReason, options, token = CancellationToken.None) {\n var _a;\n const bulkEditService = accessor.get(IBulkEditService);\n const commandService = accessor.get(ICommandService);\n const telemetryService = accessor.get(ITelemetryService);\n const notificationService = accessor.get(INotificationService);\n telemetryService.publicLog2('codeAction.applyCodeAction', {\n codeActionTitle: item.action.title,\n codeActionKind: item.action.kind,\n codeActionIsPreferred: !!item.action.isPreferred,\n reason: codeActionReason,\n });\n await item.resolve(token);\n if (token.isCancellationRequested) {\n return;\n }\n if ((_a = item.action.edit) === null || _a === void 0 ? void 0 : _a.edits.length) {\n const result = await bulkEditService.apply(item.action.edit, {\n editor: options === null || options === void 0 ? void 0 : options.editor,\n label: item.action.title,\n quotableLabel: item.action.title,\n code: 'undoredo.codeAction',\n respectAutoSaveConfig: codeActionReason !== ApplyCodeActionReason.OnSave,\n showPreview: options === null || options === void 0 ? void 0 : options.preview,\n });\n if (!result.isApplied) {\n return;\n }\n }\n if (item.action.command) {\n try {\n await commandService.executeCommand(item.action.command.id, ...(item.action.command.arguments || []));\n }\n catch (err) {\n const message = asMessage(err);\n notificationService.error(typeof message === 'string'\n ? message\n : nls.localize('applyCodeActionFailed', \"An unknown error occurred while applying the code action\"));\n }\n }\n}\nfunction asMessage(err) {\n if (typeof err === 'string') {\n return err;\n }\n else if (err instanceof Error && typeof err.message === 'string') {\n return err.message;\n }\n else {\n return undefined;\n }\n}\nCommandsRegistry.registerCommand('_executeCodeActionProvider', async function (accessor, resource, rangeOrSelection, kind, itemResolveCount) {\n if (!(resource instanceof URI)) {\n throw illegalArgument();\n }\n const { codeActionProvider } = accessor.get(ILanguageFeaturesService);\n const model = accessor.get(IModelService).getModel(resource);\n if (!model) {\n throw illegalArgument();\n }\n const validatedRangeOrSelection = Selection.isISelection(rangeOrSelection)\n ? Selection.liftSelection(rangeOrSelection)\n : Range.isIRange(rangeOrSelection)\n ? model.validateRange(rangeOrSelection)\n : undefined;\n if (!validatedRangeOrSelection) {\n throw illegalArgument();\n }\n const include = typeof kind === 'string' ? new HierarchicalKind(kind) : undefined;\n const codeActionSet = await getCodeActions(codeActionProvider, model, validatedRangeOrSelection, { type: 1 /* languages.CodeActionTriggerType.Invoke */, triggerAction: CodeActionTriggerSource.Default, filter: { includeSourceActions: true, include } }, Progress.None, CancellationToken.None);\n const resolving = [];\n const resolveCount = Math.min(codeActionSet.validActions.length, typeof itemResolveCount === 'number' ? itemResolveCount : 0);\n for (let i = 0; i < resolveCount; i++) {\n resolving.push(codeActionSet.validActions[i].resolve(CancellationToken.None));\n }\n try {\n await Promise.all(resolving);\n return codeActionSet.validActions.map(item => item.action);\n }\n finally {\n setTimeout(() => codeActionSet.dispose(), 100);\n }\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { escapeRegExpCharacters } from '../../../../base/common/strings.js';\nimport { EditorAction, EditorCommand } from '../../../browser/editorExtensions.js';\nimport { EditorContextKeys } from '../../../common/editorContextKeys.js';\nimport { autoFixCommandId, codeActionCommandId, fixAllCommandId, organizeImportsCommandId, quickFixCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js';\nimport * as nls from '../../../../nls.js';\nimport { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';\nimport { CodeActionCommandArgs, CodeActionKind, CodeActionTriggerSource } from '../common/types.js';\nimport { CodeActionController } from './codeActionController.js';\nimport { SUPPORTED_CODE_ACTIONS } from './codeActionModel.js';\nfunction contextKeyForSupportedActions(kind) {\n return ContextKeyExpr.regex(SUPPORTED_CODE_ACTIONS.keys()[0], new RegExp('(\\\\s|^)' + escapeRegExpCharacters(kind.value) + '\\\\b'));\n}\nconst argsSchema = {\n type: 'object',\n defaultSnippets: [{ body: { kind: '' } }],\n properties: {\n 'kind': {\n type: 'string',\n description: nls.localize('args.schema.kind', \"Kind of the code action to run.\"),\n },\n 'apply': {\n type: 'string',\n description: nls.localize('args.schema.apply', \"Controls when the returned actions are applied.\"),\n default: \"ifSingle\" /* CodeActionAutoApply.IfSingle */,\n enum: [\"first\" /* CodeActionAutoApply.First */, \"ifSingle\" /* CodeActionAutoApply.IfSingle */, \"never\" /* CodeActionAutoApply.Never */],\n enumDescriptions: [\n nls.localize('args.schema.apply.first', \"Always apply the first returned code action.\"),\n nls.localize('args.schema.apply.ifSingle', \"Apply the first returned code action if it is the only one.\"),\n nls.localize('args.schema.apply.never', \"Do not apply the returned code actions.\"),\n ]\n },\n 'preferred': {\n type: 'boolean',\n default: false,\n description: nls.localize('args.schema.preferred', \"Controls if only preferred code actions should be returned.\"),\n }\n }\n};\nfunction triggerCodeActionsForEditorSelection(editor, notAvailableMessage, filter, autoApply, triggerAction = CodeActionTriggerSource.Default) {\n if (editor.hasModel()) {\n const controller = CodeActionController.get(editor);\n controller === null || controller === void 0 ? void 0 : controller.manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply);\n }\n}\nexport class QuickFixAction extends EditorAction {\n constructor() {\n super({\n id: quickFixCommandId,\n label: nls.localize('quickfix.trigger.label', \"Quick Fix...\"),\n alias: 'Quick Fix...',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n kbOpts: {\n kbExpr: EditorContextKeys.textInputFocus,\n primary: 2048 /* KeyMod.CtrlCmd */ | 89 /* KeyCode.Period */,\n weight: 100 /* KeybindingWeight.EditorContrib */\n }\n });\n }\n run(_accessor, editor) {\n return triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', \"No code actions available\"), undefined, undefined, CodeActionTriggerSource.QuickFix);\n }\n}\nexport class CodeActionCommand extends EditorCommand {\n constructor() {\n super({\n id: codeActionCommandId,\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n metadata: {\n description: 'Trigger a code action',\n args: [{ name: 'args', schema: argsSchema, }]\n }\n });\n }\n runEditorCommand(_accessor, editor, userArgs) {\n const args = CodeActionCommandArgs.fromUser(userArgs, {\n kind: HierarchicalKind.Empty,\n apply: \"ifSingle\" /* CodeActionAutoApply.IfSingle */,\n });\n return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string'\n ? args.preferred\n ? nls.localize('editor.action.codeAction.noneMessage.preferred.kind', \"No preferred code actions for '{0}' available\", userArgs.kind)\n : nls.localize('editor.action.codeAction.noneMessage.kind', \"No code actions for '{0}' available\", userArgs.kind)\n : args.preferred\n ? nls.localize('editor.action.codeAction.noneMessage.preferred', \"No preferred code actions available\")\n : nls.localize('editor.action.codeAction.noneMessage', \"No code actions available\"), {\n include: args.kind,\n includeSourceActions: true,\n onlyIncludePreferredActions: args.preferred,\n }, args.apply);\n }\n}\nexport class RefactorAction extends EditorAction {\n constructor() {\n super({\n id: refactorCommandId,\n label: nls.localize('refactor.label', \"Refactor...\"),\n alias: 'Refactor...',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n kbOpts: {\n kbExpr: EditorContextKeys.textInputFocus,\n primary: 2048 /* KeyMod.CtrlCmd */ | 1024 /* KeyMod.Shift */ | 48 /* KeyCode.KeyR */,\n mac: {\n primary: 256 /* KeyMod.WinCtrl */ | 1024 /* KeyMod.Shift */ | 48 /* KeyCode.KeyR */\n },\n weight: 100 /* KeybindingWeight.EditorContrib */\n },\n contextMenuOpts: {\n group: '1_modification',\n order: 2,\n when: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.Refactor)),\n },\n metadata: {\n description: 'Refactor...',\n args: [{ name: 'args', schema: argsSchema }]\n }\n });\n }\n run(_accessor, editor, userArgs) {\n const args = CodeActionCommandArgs.fromUser(userArgs, {\n kind: CodeActionKind.Refactor,\n apply: \"never\" /* CodeActionAutoApply.Never */\n });\n return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string'\n ? args.preferred\n ? nls.localize('editor.action.refactor.noneMessage.preferred.kind', \"No preferred refactorings for '{0}' available\", userArgs.kind)\n : nls.localize('editor.action.refactor.noneMessage.kind', \"No refactorings for '{0}' available\", userArgs.kind)\n : args.preferred\n ? nls.localize('editor.action.refactor.noneMessage.preferred', \"No preferred refactorings available\")\n : nls.localize('editor.action.refactor.noneMessage', \"No refactorings available\"), {\n include: CodeActionKind.Refactor.contains(args.kind) ? args.kind : HierarchicalKind.None,\n onlyIncludePreferredActions: args.preferred\n }, args.apply, CodeActionTriggerSource.Refactor);\n }\n}\nexport class SourceAction extends EditorAction {\n constructor() {\n super({\n id: sourceActionCommandId,\n label: nls.localize('source.label', \"Source Action...\"),\n alias: 'Source Action...',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasCodeActionsProvider),\n contextMenuOpts: {\n group: '1_modification',\n order: 2.1,\n when: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.Source)),\n },\n metadata: {\n description: 'Source Action...',\n args: [{ name: 'args', schema: argsSchema }]\n }\n });\n }\n run(_accessor, editor, userArgs) {\n const args = CodeActionCommandArgs.fromUser(userArgs, {\n kind: CodeActionKind.Source,\n apply: \"never\" /* CodeActionAutoApply.Never */\n });\n return triggerCodeActionsForEditorSelection(editor, typeof (userArgs === null || userArgs === void 0 ? void 0 : userArgs.kind) === 'string'\n ? args.preferred\n ? nls.localize('editor.action.source.noneMessage.preferred.kind', \"No preferred source actions for '{0}' available\", userArgs.kind)\n : nls.localize('editor.action.source.noneMessage.kind', \"No source actions for '{0}' available\", userArgs.kind)\n : args.preferred\n ? nls.localize('editor.action.source.noneMessage.preferred', \"No preferred source actions available\")\n : nls.localize('editor.action.source.noneMessage', \"No source actions available\"), {\n include: CodeActionKind.Source.contains(args.kind) ? args.kind : HierarchicalKind.None,\n includeSourceActions: true,\n onlyIncludePreferredActions: args.preferred,\n }, args.apply, CodeActionTriggerSource.SourceAction);\n }\n}\nexport class OrganizeImportsAction extends EditorAction {\n constructor() {\n super({\n id: organizeImportsCommandId,\n label: nls.localize('organizeImports.label', \"Organize Imports\"),\n alias: 'Organize Imports',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceOrganizeImports)),\n kbOpts: {\n kbExpr: EditorContextKeys.textInputFocus,\n primary: 1024 /* KeyMod.Shift */ | 512 /* KeyMod.Alt */ | 45 /* KeyCode.KeyO */,\n weight: 100 /* KeybindingWeight.EditorContrib */\n },\n });\n }\n run(_accessor, editor) {\n return triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.organize.noneMessage', \"No organize imports action available\"), { include: CodeActionKind.SourceOrganizeImports, includeSourceActions: true }, \"ifSingle\" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.OrganizeImports);\n }\n}\nexport class FixAllAction extends EditorAction {\n constructor() {\n super({\n id: fixAllCommandId,\n label: nls.localize('fixAll.label', \"Fix All\"),\n alias: 'Fix All',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.SourceFixAll))\n });\n }\n run(_accessor, editor) {\n return triggerCodeActionsForEditorSelection(editor, nls.localize('fixAll.noneMessage', \"No fix all action available\"), { include: CodeActionKind.SourceFixAll, includeSourceActions: true }, \"ifSingle\" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.FixAll);\n }\n}\nexport class AutoFixAction extends EditorAction {\n constructor() {\n super({\n id: autoFixCommandId,\n label: nls.localize('autoFix.label', \"Auto Fix...\"),\n alias: 'Auto Fix...',\n precondition: ContextKeyExpr.and(EditorContextKeys.writable, contextKeyForSupportedActions(CodeActionKind.QuickFix)),\n kbOpts: {\n kbExpr: EditorContextKeys.textInputFocus,\n primary: 512 /* KeyMod.Alt */ | 1024 /* KeyMod.Shift */ | 89 /* KeyCode.Period */,\n mac: {\n primary: 2048 /* KeyMod.CtrlCmd */ | 512 /* KeyMod.Alt */ | 89 /* KeyCode.Period */\n },\n weight: 100 /* KeybindingWeight.EditorContrib */\n }\n });\n }\n run(_accessor, editor) {\n return triggerCodeActionsForEditorSelection(editor, nls.localize('editor.action.autoFix.noneMessage', \"No auto fixes available\"), {\n include: CodeActionKind.QuickFix,\n onlyIncludePreferredActions: true\n }, \"ifSingle\" /* CodeActionAutoApply.IfSingle */, CodeActionTriggerSource.AutoFix);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { registerEditorAction, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js';\nimport { editorConfigurationBaseNode } from '../../../common/config/editorConfigurationSchema.js';\nimport { AutoFixAction, CodeActionCommand, FixAllAction, OrganizeImportsAction, QuickFixAction, RefactorAction, SourceAction } from './codeActionCommands.js';\nimport { CodeActionController } from './codeActionController.js';\nimport { LightBulbWidget } from './lightBulbWidget.js';\nimport * as nls from '../../../../nls.js';\nimport { Extensions } from '../../../../platform/configuration/common/configurationRegistry.js';\nimport { Registry } from '../../../../platform/registry/common/platform.js';\nregisterEditorContribution(CodeActionController.ID, CodeActionController, 3 /* EditorContributionInstantiation.Eventually */);\nregisterEditorContribution(LightBulbWidget.ID, LightBulbWidget, 4 /* EditorContributionInstantiation.Lazy */);\nregisterEditorAction(QuickFixAction);\nregisterEditorAction(RefactorAction);\nregisterEditorAction(SourceAction);\nregisterEditorAction(OrganizeImportsAction);\nregisterEditorAction(AutoFixAction);\nregisterEditorAction(FixAllAction);\nregisterEditorCommand(new CodeActionCommand());\nRegistry.as(Extensions.Configuration).registerConfiguration({\n ...editorConfigurationBaseNode,\n properties: {\n 'editor.codeActionWidget.showHeaders': {\n type: 'boolean',\n scope: 5 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,\n description: nls.localize('showCodeActionHeaders', \"Enable/disable showing group headers in the Code Action menu.\"),\n default: true,\n },\n }\n});\nRegistry.as(Extensions.Configuration).registerConfiguration({\n ...editorConfigurationBaseNode,\n properties: {\n 'editor.codeActionWidget.includeNearbyQuickFixes': {\n type: 'boolean',\n scope: 5 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,\n description: nls.localize('includeNearbyQuickFixes', \"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.\"),\n default: true,\n },\n }\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar CodeActionKeybindingResolver_1;\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { Lazy } from '../../../../base/common/lazy.js';\nimport { codeActionCommandId, fixAllCommandId, organizeImportsCommandId, refactorCommandId, sourceActionCommandId } from './codeAction.js';\nimport { CodeActionCommandArgs, CodeActionKind } from '../common/types.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nlet CodeActionKeybindingResolver = CodeActionKeybindingResolver_1 = class CodeActionKeybindingResolver {\n constructor(keybindingService) {\n this.keybindingService = keybindingService;\n }\n getResolver() {\n // Lazy since we may not actually ever read the value\n const allCodeActionBindings = new Lazy(() => this.keybindingService.getKeybindings()\n .filter(item => CodeActionKeybindingResolver_1.codeActionCommands.indexOf(item.command) >= 0)\n .filter(item => item.resolvedKeybinding)\n .map((item) => {\n // Special case these commands since they come built-in with VS Code and don't use 'commandArgs'\n let commandArgs = item.commandArgs;\n if (item.command === organizeImportsCommandId) {\n commandArgs = { kind: CodeActionKind.SourceOrganizeImports.value };\n }\n else if (item.command === fixAllCommandId) {\n commandArgs = { kind: CodeActionKind.SourceFixAll.value };\n }\n return {\n resolvedKeybinding: item.resolvedKeybinding,\n ...CodeActionCommandArgs.fromUser(commandArgs, {\n kind: HierarchicalKind.None,\n apply: \"never\" /* CodeActionAutoApply.Never */\n })\n };\n }));\n return (action) => {\n if (action.kind) {\n const binding = this.bestKeybindingForCodeAction(action, allCodeActionBindings.value);\n return binding === null || binding === void 0 ? void 0 : binding.resolvedKeybinding;\n }\n return undefined;\n };\n }\n bestKeybindingForCodeAction(action, candidates) {\n if (!action.kind) {\n return undefined;\n }\n const kind = new HierarchicalKind(action.kind);\n return candidates\n .filter(candidate => candidate.kind.contains(kind))\n .filter(candidate => {\n if (candidate.preferred) {\n // If the candidate keybinding only applies to preferred actions, the this action must also be preferred\n return action.isPreferred;\n }\n return true;\n })\n .reduceRight((currentBest, candidate) => {\n if (!currentBest) {\n return candidate;\n }\n // Select the more specific binding\n return currentBest.kind.contains(candidate.kind) ? candidate : currentBest;\n }, undefined);\n }\n};\nCodeActionKeybindingResolver.codeActionCommands = [\n refactorCommandId,\n codeActionCommandId,\n sourceActionCommandId,\n organizeImportsCommandId,\n fixAllCommandId\n];\nCodeActionKeybindingResolver = CodeActionKeybindingResolver_1 = __decorate([\n __param(0, IKeybindingService)\n], CodeActionKeybindingResolver);\nexport { CodeActionKeybindingResolver };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport '../../../../base/browser/ui/codicons/codiconStyles.js'; // The codicon symbol styles are defined here and must be loaded\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { CodeActionKind } from '../common/types.js';\nimport '../../symbolIcons/browser/symbolIcons.js'; // The codicon symbol colors are defined here and must be loaded to get colors\nimport { localize } from '../../../../nls.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nconst uncategorizedCodeActionGroup = Object.freeze({ kind: HierarchicalKind.Empty, title: localize('codeAction.widget.id.more', 'More Actions...') });\nconst codeActionGroups = Object.freeze([\n { kind: CodeActionKind.QuickFix, title: localize('codeAction.widget.id.quickfix', 'Quick Fix') },\n { kind: CodeActionKind.RefactorExtract, title: localize('codeAction.widget.id.extract', 'Extract'), icon: Codicon.wrench },\n { kind: CodeActionKind.RefactorInline, title: localize('codeAction.widget.id.inline', 'Inline'), icon: Codicon.wrench },\n { kind: CodeActionKind.RefactorRewrite, title: localize('codeAction.widget.id.convert', 'Rewrite'), icon: Codicon.wrench },\n { kind: CodeActionKind.RefactorMove, title: localize('codeAction.widget.id.move', 'Move'), icon: Codicon.wrench },\n { kind: CodeActionKind.SurroundWith, title: localize('codeAction.widget.id.surround', 'Surround With'), icon: Codicon.surroundWith },\n { kind: CodeActionKind.Source, title: localize('codeAction.widget.id.source', 'Source Action'), icon: Codicon.symbolFile },\n uncategorizedCodeActionGroup,\n]);\nexport function toMenuItems(inputCodeActions, showHeaders, keybindingResolver) {\n if (!showHeaders) {\n return inputCodeActions.map((action) => {\n var _a;\n return {\n kind: \"action\" /* ActionListItemKind.Action */,\n item: action,\n group: uncategorizedCodeActionGroup,\n disabled: !!action.action.disabled,\n label: action.action.disabled || action.action.title,\n canPreview: !!((_a = action.action.edit) === null || _a === void 0 ? void 0 : _a.edits.length),\n };\n });\n }\n // Group code actions\n const menuEntries = codeActionGroups.map(group => ({ group, actions: [] }));\n for (const action of inputCodeActions) {\n const kind = action.action.kind ? new HierarchicalKind(action.action.kind) : HierarchicalKind.None;\n for (const menuEntry of menuEntries) {\n if (menuEntry.group.kind.contains(kind)) {\n menuEntry.actions.push(action);\n break;\n }\n }\n }\n const allMenuItems = [];\n for (const menuEntry of menuEntries) {\n if (menuEntry.actions.length) {\n allMenuItems.push({ kind: \"header\" /* ActionListItemKind.Header */, group: menuEntry.group });\n for (const action of menuEntry.actions) {\n const group = menuEntry.group;\n allMenuItems.push({\n kind: \"action\" /* ActionListItemKind.Action */,\n item: action,\n group: action.action.isAI ? { title: group.title, kind: group.kind, icon: Codicon.sparkle } : group,\n label: action.action.title,\n disabled: !!action.action.disabled,\n keybinding: keybindingResolver(action.action),\n });\n }\n }\n }\n return allMenuItems;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar CodeActionController_1;\nimport { getDomNodePagePosition } from '../../../../base/browser/dom.js';\nimport * as aria from '../../../../base/browser/ui/aria/aria.js';\nimport { onUnexpectedError } from '../../../../base/common/errors.js';\nimport { Lazy } from '../../../../base/common/lazy.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { Position } from '../../../common/core/position.js';\nimport { ModelDecorationOptions } from '../../../common/model/textModel.js';\nimport { ILanguageFeaturesService } from '../../../common/services/languageFeatures.js';\nimport { ApplyCodeActionReason, applyCodeAction } from './codeAction.js';\nimport { CodeActionKeybindingResolver } from './codeActionKeybindingResolver.js';\nimport { toMenuItems } from './codeActionMenu.js';\nimport { LightBulbWidget } from './lightBulbWidget.js';\nimport { MessageController } from '../../message/browser/messageController.js';\nimport { localize } from '../../../../nls.js';\nimport { IActionWidgetService } from '../../../../platform/actionWidget/browser/actionWidget.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';\nimport { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';\nimport { IMarkerService } from '../../../../platform/markers/common/markers.js';\nimport { IEditorProgressService } from '../../../../platform/progress/common/progress.js';\nimport { editorFindMatchHighlight, editorFindMatchHighlightBorder } from '../../../../platform/theme/common/colorRegistry.js';\nimport { isHighContrast } from '../../../../platform/theme/common/theme.js';\nimport { registerThemingParticipant } from '../../../../platform/theme/common/themeService.js';\nimport { CodeActionKind, CodeActionTriggerSource } from '../common/types.js';\nimport { CodeActionModel } from './codeActionModel.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nimport { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js';\nconst DECORATION_CLASS_NAME = 'quickfix-edit-highlight';\nlet CodeActionController = CodeActionController_1 = class CodeActionController extends Disposable {\n static get(editor) {\n return editor.getContribution(CodeActionController_1.ID);\n }\n constructor(editor, markerService, contextKeyService, instantiationService, languageFeaturesService, progressService, _commandService, _configurationService, _actionWidgetService, _instantiationService, _telemetryService) {\n super();\n this._commandService = _commandService;\n this._configurationService = _configurationService;\n this._actionWidgetService = _actionWidgetService;\n this._instantiationService = _instantiationService;\n this._telemetryService = _telemetryService;\n this._activeCodeActions = this._register(new MutableDisposable());\n this._showDisabled = false;\n this._disposed = false;\n this._editor = editor;\n this._model = this._register(new CodeActionModel(this._editor, languageFeaturesService.codeActionProvider, markerService, contextKeyService, progressService, _configurationService));\n this._register(this._model.onDidChangeState(newState => this.update(newState)));\n this._lightBulbWidget = new Lazy(() => {\n const widget = this._editor.getContribution(LightBulbWidget.ID);\n if (widget) {\n this._register(widget.onClick(e => this.showCodeActionsFromLightbulb(e.actions, e)));\n }\n return widget;\n });\n this._resolver = instantiationService.createInstance(CodeActionKeybindingResolver);\n this._register(this._editor.onDidLayoutChange(() => this._actionWidgetService.hide()));\n }\n dispose() {\n this._disposed = true;\n super.dispose();\n }\n async showCodeActionsFromLightbulb(actions, at) {\n this._telemetryService.publicLog2('codeAction.showCodeActionsFromLightbulb', {\n codeActionListLength: actions.validActions.length,\n codeActions: actions.validActions.map(action => action.action.title),\n codeActionProviders: actions.validActions.map(action => { var _a, _b; return (_b = (_a = action.provider) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : ''; }),\n });\n if (actions.allAIFixes && actions.validActions.length === 1) {\n const actionItem = actions.validActions[0];\n const command = actionItem.action.command;\n if (command && command.id === 'inlineChat.start') {\n if (command.arguments && command.arguments.length >= 1) {\n command.arguments[0] = { ...command.arguments[0], autoSend: false };\n }\n }\n await this._applyCodeAction(actionItem, false, false, ApplyCodeActionReason.FromAILightbulb);\n return;\n }\n await this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: true });\n }\n showCodeActions(_trigger, actions, at) {\n return this.showCodeActionList(actions, at, { includeDisabledActions: false, fromLightbulb: false });\n }\n manualTriggerAtCurrentPosition(notAvailableMessage, triggerAction, filter, autoApply) {\n var _a;\n if (!this._editor.hasModel()) {\n return;\n }\n (_a = MessageController.get(this._editor)) === null || _a === void 0 ? void 0 : _a.closeMessage();\n const triggerPosition = this._editor.getPosition();\n this._trigger({ type: 1 /* CodeActionTriggerType.Invoke */, triggerAction, filter, autoApply, context: { notAvailableMessage, position: triggerPosition } });\n }\n _trigger(trigger) {\n return this._model.trigger(trigger);\n }\n async _applyCodeAction(action, retrigger, preview, actionReason) {\n try {\n await this._instantiationService.invokeFunction(applyCodeAction, action, actionReason, { preview, editor: this._editor });\n }\n finally {\n if (retrigger) {\n this._trigger({ type: 2 /* CodeActionTriggerType.Auto */, triggerAction: CodeActionTriggerSource.QuickFix, filter: {} });\n }\n }\n }\n async update(newState) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (newState.type !== 1 /* CodeActionsState.Type.Triggered */) {\n (_a = this._lightBulbWidget.rawValue) === null || _a === void 0 ? void 0 : _a.hide();\n return;\n }\n let actions;\n try {\n actions = await newState.actions;\n }\n catch (e) {\n onUnexpectedError(e);\n return;\n }\n if (this._disposed) {\n return;\n }\n (_b = this._lightBulbWidget.value) === null || _b === void 0 ? void 0 : _b.update(actions, newState.trigger, newState.position);\n if (newState.trigger.type === 1 /* CodeActionTriggerType.Invoke */) {\n if ((_c = newState.trigger.filter) === null || _c === void 0 ? void 0 : _c.include) { // Triggered for specific scope\n // Check to see if we want to auto apply.\n const validActionToApply = this.tryGetValidActionToApply(newState.trigger, actions);\n if (validActionToApply) {\n try {\n (_d = this._lightBulbWidget.value) === null || _d === void 0 ? void 0 : _d.hide();\n await this._applyCodeAction(validActionToApply, false, false, ApplyCodeActionReason.FromCodeActions);\n }\n finally {\n actions.dispose();\n }\n return;\n }\n // Check to see if there is an action that we would have applied were it not invalid\n if (newState.trigger.context) {\n const invalidAction = this.getInvalidActionThatWouldHaveBeenApplied(newState.trigger, actions);\n if (invalidAction && invalidAction.action.disabled) {\n (_e = MessageController.get(this._editor)) === null || _e === void 0 ? void 0 : _e.showMessage(invalidAction.action.disabled, newState.trigger.context.position);\n actions.dispose();\n return;\n }\n }\n }\n const includeDisabledActions = !!((_f = newState.trigger.filter) === null || _f === void 0 ? void 0 : _f.include);\n if (newState.trigger.context) {\n if (!actions.allActions.length || !includeDisabledActions && !actions.validActions.length) {\n (_g = MessageController.get(this._editor)) === null || _g === void 0 ? void 0 : _g.showMessage(newState.trigger.context.notAvailableMessage, newState.trigger.context.position);\n this._activeCodeActions.value = actions;\n actions.dispose();\n return;\n }\n }\n this._activeCodeActions.value = actions;\n this.showCodeActionList(actions, this.toCoords(newState.position), { includeDisabledActions, fromLightbulb: false });\n }\n else {\n // auto magically triggered\n if (this._actionWidgetService.isVisible) {\n // TODO: Figure out if we should update the showing menu?\n actions.dispose();\n }\n else {\n this._activeCodeActions.value = actions;\n }\n }\n }\n getInvalidActionThatWouldHaveBeenApplied(trigger, actions) {\n if (!actions.allActions.length) {\n return undefined;\n }\n if ((trigger.autoApply === \"first\" /* CodeActionAutoApply.First */ && actions.validActions.length === 0)\n || (trigger.autoApply === \"ifSingle\" /* CodeActionAutoApply.IfSingle */ && actions.allActions.length === 1)) {\n return actions.allActions.find(({ action }) => action.disabled);\n }\n return undefined;\n }\n tryGetValidActionToApply(trigger, actions) {\n if (!actions.validActions.length) {\n return undefined;\n }\n if ((trigger.autoApply === \"first\" /* CodeActionAutoApply.First */ && actions.validActions.length > 0)\n || (trigger.autoApply === \"ifSingle\" /* CodeActionAutoApply.IfSingle */ && actions.validActions.length === 1)) {\n return actions.validActions[0];\n }\n return undefined;\n }\n async showCodeActionList(actions, at, options) {\n const currentDecorations = this._editor.createDecorationsCollection();\n const editorDom = this._editor.getDomNode();\n if (!editorDom) {\n return;\n }\n const actionsToShow = options.includeDisabledActions && (this._showDisabled || actions.validActions.length === 0) ? actions.allActions : actions.validActions;\n if (!actionsToShow.length) {\n return;\n }\n const anchor = Position.isIPosition(at) ? this.toCoords(at) : at;\n const delegate = {\n onSelect: async (action, preview) => {\n this._applyCodeAction(action, /* retrigger */ true, !!preview, options.fromLightbulb ? ApplyCodeActionReason.FromAILightbulb : ApplyCodeActionReason.FromCodeActions);\n this._actionWidgetService.hide(false);\n currentDecorations.clear();\n },\n onHide: (didCancel) => {\n var _a;\n (_a = this._editor) === null || _a === void 0 ? void 0 : _a.focus();\n currentDecorations.clear();\n // Telemetry for showing code actions here. only log on `showLightbulb`. Logs when code action list is quit out.\n if (options.fromLightbulb && didCancel !== undefined) {\n this._telemetryService.publicLog2('codeAction.showCodeActionList.onHide', {\n codeActionListLength: actions.validActions.length,\n didCancel: didCancel,\n codeActions: actions.validActions.map(action => action.action.title),\n });\n }\n },\n onHover: async (action, token) => {\n var _a;\n if (token.isCancellationRequested) {\n return;\n }\n let canPreview = false;\n const actionKind = action.action.kind;\n if (actionKind) {\n const hierarchicalKind = new HierarchicalKind(actionKind);\n const refactorKinds = [\n CodeActionKind.RefactorExtract,\n CodeActionKind.RefactorInline,\n CodeActionKind.RefactorRewrite,\n CodeActionKind.RefactorMove,\n CodeActionKind.Source\n ];\n canPreview = refactorKinds.some(refactorKind => refactorKind.contains(hierarchicalKind));\n }\n return { canPreview: canPreview || !!((_a = action.action.edit) === null || _a === void 0 ? void 0 : _a.edits.length) };\n },\n onFocus: (action) => {\n var _a, _b;\n if (action && action.action) {\n const ranges = action.action.ranges;\n const diagnostics = action.action.diagnostics;\n currentDecorations.clear();\n if (ranges && ranges.length > 0) {\n // Handles case for `fix all` where there are multiple diagnostics.\n const decorations = (diagnostics && (diagnostics === null || diagnostics === void 0 ? void 0 : diagnostics.length) > 1)\n ? diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController_1.DECORATION }))\n : ranges.map(range => ({ range, options: CodeActionController_1.DECORATION }));\n currentDecorations.set(decorations);\n }\n else if (diagnostics && diagnostics.length > 0) {\n const decorations = diagnostics.map(diagnostic => ({ range: diagnostic, options: CodeActionController_1.DECORATION }));\n currentDecorations.set(decorations);\n const diagnostic = diagnostics[0];\n if (diagnostic.startLineNumber && diagnostic.startColumn) {\n const selectionText = (_b = (_a = this._editor.getModel()) === null || _a === void 0 ? void 0 : _a.getWordAtPosition({ lineNumber: diagnostic.startLineNumber, column: diagnostic.startColumn })) === null || _b === void 0 ? void 0 : _b.word;\n aria.status(localize('editingNewSelection', \"Context: {0} at line {1} and column {2}.\", selectionText, diagnostic.startLineNumber, diagnostic.startColumn));\n }\n }\n }\n else {\n currentDecorations.clear();\n }\n }\n };\n this._actionWidgetService.show('codeActionWidget', true, toMenuItems(actionsToShow, this._shouldShowHeaders(), this._resolver.getResolver()), delegate, anchor, editorDom, this._getActionBarActions(actions, at, options));\n }\n toCoords(position) {\n if (!this._editor.hasModel()) {\n return { x: 0, y: 0 };\n }\n this._editor.revealPosition(position, 1 /* ScrollType.Immediate */);\n this._editor.render();\n // Translate to absolute editor position\n const cursorCoords = this._editor.getScrolledVisiblePosition(position);\n const editorCoords = getDomNodePagePosition(this._editor.getDomNode());\n const x = editorCoords.left + cursorCoords.left;\n const y = editorCoords.top + cursorCoords.top + cursorCoords.height;\n return { x, y };\n }\n _shouldShowHeaders() {\n var _a;\n const model = (_a = this._editor) === null || _a === void 0 ? void 0 : _a.getModel();\n return this._configurationService.getValue('editor.codeActionWidget.showHeaders', { resource: model === null || model === void 0 ? void 0 : model.uri });\n }\n _getActionBarActions(actions, at, options) {\n if (options.fromLightbulb) {\n return [];\n }\n const resultActions = actions.documentation.map((command) => {\n var _a;\n return ({\n id: command.id,\n label: command.title,\n tooltip: (_a = command.tooltip) !== null && _a !== void 0 ? _a : '',\n class: undefined,\n enabled: true,\n run: () => { var _a; return this._commandService.executeCommand(command.id, ...((_a = command.arguments) !== null && _a !== void 0 ? _a : [])); },\n });\n });\n if (options.includeDisabledActions && actions.validActions.length > 0 && actions.allActions.length !== actions.validActions.length) {\n resultActions.push(this._showDisabled ? {\n id: 'hideMoreActions',\n label: localize('hideMoreActions', 'Hide Disabled'),\n enabled: true,\n tooltip: '',\n class: undefined,\n run: () => {\n this._showDisabled = false;\n return this.showCodeActionList(actions, at, options);\n }\n } : {\n id: 'showMoreActions',\n label: localize('showMoreActions', 'Show Disabled'),\n enabled: true,\n tooltip: '',\n class: undefined,\n run: () => {\n this._showDisabled = true;\n return this.showCodeActionList(actions, at, options);\n }\n });\n }\n return resultActions;\n }\n};\nCodeActionController.ID = 'editor.contrib.codeActionController';\nCodeActionController.DECORATION = ModelDecorationOptions.register({\n description: 'quickfix-highlight',\n className: DECORATION_CLASS_NAME\n});\nCodeActionController = CodeActionController_1 = __decorate([\n __param(1, IMarkerService),\n __param(2, IContextKeyService),\n __param(3, IInstantiationService),\n __param(4, ILanguageFeaturesService),\n __param(5, IEditorProgressService),\n __param(6, ICommandService),\n __param(7, IConfigurationService),\n __param(8, IActionWidgetService),\n __param(9, IInstantiationService),\n __param(10, ITelemetryService)\n], CodeActionController);\nexport { CodeActionController };\nregisterThemingParticipant((theme, collector) => {\n const addBackgroundColorRule = (selector, color) => {\n if (color) {\n collector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`);\n }\n };\n addBackgroundColorRule('.quickfix-edit-highlight', theme.getColor(editorFindMatchHighlight));\n const findMatchHighlightBorder = theme.getColor(editorFindMatchHighlightBorder);\n if (findMatchHighlightBorder) {\n collector.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${isHighContrast(theme.type) ? 'dotted' : 'solid'} ${findMatchHighlightBorder}; box-sizing: border-box; }`);\n }\n});\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { createCancelablePromise, TimeoutTimer } from '../../../../base/common/async.js';\nimport { isCancellationError } from '../../../../base/common/errors.js';\nimport { Emitter } from '../../../../base/common/event.js';\nimport { Disposable, MutableDisposable } from '../../../../base/common/lifecycle.js';\nimport { isEqual } from '../../../../base/common/resources.js';\nimport { ShowLightbulbIconMode } from '../../../common/config/editorOptions.js';\nimport { Position } from '../../../common/core/position.js';\nimport { Selection } from '../../../common/core/selection.js';\nimport { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';\nimport { Progress } from '../../../../platform/progress/common/progress.js';\nimport { CodeActionKind, CodeActionTriggerSource } from '../common/types.js';\nimport { getCodeActions } from './codeAction.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nexport const SUPPORTED_CODE_ACTIONS = new RawContextKey('supportedCodeAction', '');\nexport const APPLY_FIX_ALL_COMMAND_ID = '_typescript.applyFixAllCodeAction';\nclass CodeActionOracle extends Disposable {\n constructor(_editor, _markerService, _signalChange, _delay = 250) {\n super();\n this._editor = _editor;\n this._markerService = _markerService;\n this._signalChange = _signalChange;\n this._delay = _delay;\n this._autoTriggerTimer = this._register(new TimeoutTimer());\n this._register(this._markerService.onMarkerChanged(e => this._onMarkerChanges(e)));\n this._register(this._editor.onDidChangeCursorPosition(() => this._tryAutoTrigger()));\n }\n trigger(trigger) {\n const selection = this._getRangeOfSelectionUnlessWhitespaceEnclosed(trigger);\n this._signalChange(selection ? { trigger, selection } : undefined);\n }\n _onMarkerChanges(resources) {\n const model = this._editor.getModel();\n if (model && resources.some(resource => isEqual(resource, model.uri))) {\n this._tryAutoTrigger();\n }\n }\n _tryAutoTrigger() {\n this._autoTriggerTimer.cancelAndSet(() => {\n this.trigger({ type: 2 /* CodeActionTriggerType.Auto */, triggerAction: CodeActionTriggerSource.Default });\n }, this._delay);\n }\n _getRangeOfSelectionUnlessWhitespaceEnclosed(trigger) {\n if (!this._editor.hasModel()) {\n return undefined;\n }\n const selection = this._editor.getSelection();\n if (trigger.type === 1 /* CodeActionTriggerType.Invoke */) {\n return selection;\n }\n const enabled = this._editor.getOption(65 /* EditorOption.lightbulb */).enabled;\n if (enabled === ShowLightbulbIconMode.Off) {\n return undefined;\n }\n else if (enabled === ShowLightbulbIconMode.On) {\n return selection;\n }\n else if (enabled === ShowLightbulbIconMode.OnCode) {\n const isSelectionEmpty = selection.isEmpty();\n if (!isSelectionEmpty) {\n return selection;\n }\n const model = this._editor.getModel();\n const { lineNumber, column } = selection.getPosition();\n const line = model.getLineContent(lineNumber);\n if (line.length === 0) {\n // empty line\n return undefined;\n }\n else if (column === 1) {\n // look only right\n if (/\\s/.test(line[0])) {\n return undefined;\n }\n }\n else if (column === model.getLineMaxColumn(lineNumber)) {\n // look only left\n if (/\\s/.test(line[line.length - 1])) {\n return undefined;\n }\n }\n else {\n // look left and right\n if (/\\s/.test(line[column - 2]) && /\\s/.test(line[column - 1])) {\n return undefined;\n }\n }\n }\n return selection;\n }\n}\nexport var CodeActionsState;\n(function (CodeActionsState) {\n CodeActionsState.Empty = { type: 0 /* Type.Empty */ };\n class Triggered {\n constructor(trigger, position, _cancellablePromise) {\n this.trigger = trigger;\n this.position = position;\n this._cancellablePromise = _cancellablePromise;\n this.type = 1 /* Type.Triggered */;\n this.actions = _cancellablePromise.catch((e) => {\n if (isCancellationError(e)) {\n return emptyCodeActionSet;\n }\n throw e;\n });\n }\n cancel() {\n this._cancellablePromise.cancel();\n }\n }\n CodeActionsState.Triggered = Triggered;\n})(CodeActionsState || (CodeActionsState = {}));\nconst emptyCodeActionSet = Object.freeze({\n allActions: [],\n validActions: [],\n dispose: () => { },\n documentation: [],\n hasAutoFix: false,\n hasAIFix: false,\n allAIFixes: false,\n});\nexport class CodeActionModel extends Disposable {\n constructor(_editor, _registry, _markerService, contextKeyService, _progressService, _configurationService) {\n super();\n this._editor = _editor;\n this._registry = _registry;\n this._markerService = _markerService;\n this._progressService = _progressService;\n this._configurationService = _configurationService;\n this._codeActionOracle = this._register(new MutableDisposable());\n this._state = CodeActionsState.Empty;\n this._onDidChangeState = this._register(new Emitter());\n this.onDidChangeState = this._onDidChangeState.event;\n this._disposed = false;\n this._supportedCodeActions = SUPPORTED_CODE_ACTIONS.bindTo(contextKeyService);\n this._register(this._editor.onDidChangeModel(() => this._update()));\n this._register(this._editor.onDidChangeModelLanguage(() => this._update()));\n this._register(this._registry.onDidChange(() => this._update()));\n this._register(this._editor.onDidChangeConfiguration((e) => {\n if (e.hasChanged(65 /* EditorOption.lightbulb */)) {\n this._update();\n }\n }));\n this._update();\n }\n dispose() {\n if (this._disposed) {\n return;\n }\n this._disposed = true;\n super.dispose();\n this.setState(CodeActionsState.Empty, true);\n }\n _settingEnabledNearbyQuickfixes() {\n var _a;\n const model = (_a = this._editor) === null || _a === void 0 ? void 0 : _a.getModel();\n return this._configurationService ? this._configurationService.getValue('editor.codeActionWidget.includeNearbyQuickFixes', { resource: model === null || model === void 0 ? void 0 : model.uri }) : false;\n }\n _update() {\n if (this._disposed) {\n return;\n }\n this._codeActionOracle.value = undefined;\n this.setState(CodeActionsState.Empty);\n const model = this._editor.getModel();\n if (model\n && this._registry.has(model)\n && !this._editor.getOption(91 /* EditorOption.readOnly */)) {\n const supportedActions = this._registry.all(model).flatMap(provider => { var _a; return (_a = provider.providedCodeActionKinds) !== null && _a !== void 0 ? _a : []; });\n this._supportedCodeActions.set(supportedActions.join(' '));\n this._codeActionOracle.value = new CodeActionOracle(this._editor, this._markerService, trigger => {\n var _a;\n if (!trigger) {\n this.setState(CodeActionsState.Empty);\n return;\n }\n const startPosition = trigger.selection.getStartPosition();\n const actions = createCancelablePromise(async (token) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n if (this._settingEnabledNearbyQuickfixes() && trigger.trigger.type === 1 /* CodeActionTriggerType.Invoke */ && (trigger.trigger.triggerAction === CodeActionTriggerSource.QuickFix || ((_b = (_a = trigger.trigger.filter) === null || _a === void 0 ? void 0 : _a.include) === null || _b === void 0 ? void 0 : _b.contains(CodeActionKind.QuickFix)))) {\n const codeActionSet = await getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token);\n const allCodeActions = [...codeActionSet.allActions];\n if (token.isCancellationRequested) {\n return emptyCodeActionSet;\n }\n // Search for quickfixes in the curret code action set.\n const foundQuickfix = (_c = codeActionSet.validActions) === null || _c === void 0 ? void 0 : _c.some(action => action.action.kind ? CodeActionKind.QuickFix.contains(new HierarchicalKind(action.action.kind)) : false);\n const allMarkers = this._markerService.read({ resource: model.uri });\n if (foundQuickfix) {\n for (const action of codeActionSet.validActions) {\n if ((_e = (_d = action.action.command) === null || _d === void 0 ? void 0 : _d.arguments) === null || _e === void 0 ? void 0 : _e.some(arg => typeof arg === 'string' && arg.includes(APPLY_FIX_ALL_COMMAND_ID))) {\n action.action.diagnostics = [...allMarkers.filter(marker => marker.relatedInformation)];\n }\n }\n return { validActions: codeActionSet.validActions, allActions: allCodeActions, documentation: codeActionSet.documentation, hasAutoFix: codeActionSet.hasAutoFix, hasAIFix: codeActionSet.hasAIFix, allAIFixes: codeActionSet.allAIFixes, dispose: () => { codeActionSet.dispose(); } };\n }\n else if (!foundQuickfix) {\n // If markers exists, and there are no quickfixes found or length is zero, check for quickfixes on that line.\n if (allMarkers.length > 0) {\n const currPosition = trigger.selection.getPosition();\n let trackedPosition = currPosition;\n let distance = Number.MAX_VALUE;\n const currentActions = [...codeActionSet.validActions];\n for (const marker of allMarkers) {\n const col = marker.endColumn;\n const row = marker.endLineNumber;\n const startRow = marker.startLineNumber;\n // Found quickfix on the same line and check relative distance to other markers\n if ((row === currPosition.lineNumber || startRow === currPosition.lineNumber)) {\n trackedPosition = new Position(row, col);\n const newCodeActionTrigger = {\n type: trigger.trigger.type,\n triggerAction: trigger.trigger.triggerAction,\n filter: { include: ((_f = trigger.trigger.filter) === null || _f === void 0 ? void 0 : _f.include) ? (_g = trigger.trigger.filter) === null || _g === void 0 ? void 0 : _g.include : CodeActionKind.QuickFix },\n autoApply: trigger.trigger.autoApply,\n context: { notAvailableMessage: ((_h = trigger.trigger.context) === null || _h === void 0 ? void 0 : _h.notAvailableMessage) || '', position: trackedPosition }\n };\n const selectionAsPosition = new Selection(trackedPosition.lineNumber, trackedPosition.column, trackedPosition.lineNumber, trackedPosition.column);\n const actionsAtMarker = await getCodeActions(this._registry, model, selectionAsPosition, newCodeActionTrigger, Progress.None, token);\n if (actionsAtMarker.validActions.length !== 0) {\n for (const action of actionsAtMarker.validActions) {\n if ((_k = (_j = action.action.command) === null || _j === void 0 ? void 0 : _j.arguments) === null || _k === void 0 ? void 0 : _k.some(arg => typeof arg === 'string' && arg.includes(APPLY_FIX_ALL_COMMAND_ID))) {\n action.action.diagnostics = [...allMarkers.filter(marker => marker.relatedInformation)];\n }\n }\n if (codeActionSet.allActions.length === 0) {\n allCodeActions.push(...actionsAtMarker.allActions);\n }\n // Already filtered through to only get quickfixes, so no need to filter again.\n if (Math.abs(currPosition.column - col) < distance) {\n currentActions.unshift(...actionsAtMarker.validActions);\n }\n else {\n currentActions.push(...actionsAtMarker.validActions);\n }\n }\n distance = Math.abs(currPosition.column - col);\n }\n }\n const filteredActions = currentActions.filter((action, index, self) => self.findIndex((a) => a.action.title === action.action.title) === index);\n filteredActions.sort((a, b) => {\n if (a.action.isPreferred && !b.action.isPreferred) {\n return -1;\n }\n else if (!a.action.isPreferred && b.action.isPreferred) {\n return 1;\n }\n else if (a.action.isAI && !b.action.isAI) {\n return 1;\n }\n else if (!a.action.isAI && b.action.isAI) {\n return -1;\n }\n else {\n return 0;\n }\n });\n // Only retriggers if actually found quickfix on the same line as cursor\n return { validActions: filteredActions, allActions: allCodeActions, documentation: codeActionSet.documentation, hasAutoFix: codeActionSet.hasAutoFix, hasAIFix: codeActionSet.hasAIFix, allAIFixes: codeActionSet.allAIFixes, dispose: () => { codeActionSet.dispose(); } };\n }\n }\n }\n // temporarilly hiding here as this is enabled/disabled behind a setting.\n return getCodeActions(this._registry, model, trigger.selection, trigger.trigger, Progress.None, token);\n });\n if (trigger.trigger.type === 1 /* CodeActionTriggerType.Invoke */) {\n (_a = this._progressService) === null || _a === void 0 ? void 0 : _a.showWhile(actions, 250);\n }\n const newState = new CodeActionsState.Triggered(trigger.trigger, startPosition, actions);\n let isManualToAutoTransition = false;\n if (this._state.type === 1 /* CodeActionsState.Type.Triggered */) {\n // Check if the current state is manual and the new state is automatic\n isManualToAutoTransition = this._state.trigger.type === 1 /* CodeActionTriggerType.Invoke */ &&\n newState.type === 1 /* CodeActionsState.Type.Triggered */ &&\n newState.trigger.type === 2 /* CodeActionTriggerType.Auto */ &&\n this._state.position !== newState.position;\n }\n // Do not trigger state if current state is manual and incoming state is automatic\n if (!isManualToAutoTransition) {\n this.setState(newState);\n }\n else {\n // Reset the new state after getting code actions back.\n setTimeout(() => {\n this.setState(newState);\n }, 500);\n }\n }, undefined);\n this._codeActionOracle.value.trigger({ type: 2 /* CodeActionTriggerType.Auto */, triggerAction: CodeActionTriggerSource.Default });\n }\n else {\n this._supportedCodeActions.reset();\n }\n }\n trigger(trigger) {\n var _a;\n (_a = this._codeActionOracle.value) === null || _a === void 0 ? void 0 : _a.trigger(trigger);\n }\n setState(newState, skipNotify) {\n if (newState === this._state) {\n return;\n }\n // Cancel old request\n if (this._state.type === 1 /* CodeActionsState.Type.Triggered */) {\n this._state.cancel();\n }\n this._state = newState;\n if (!skipNotify && !this._disposed) {\n this._onDidChangeState.fire(newState);\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar LightBulbWidget_1;\nimport * as dom from '../../../../base/browser/dom.js';\nimport { Gesture } from '../../../../base/browser/touch.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Emitter, Event } from '../../../../base/common/event.js';\nimport { Disposable } from '../../../../base/common/lifecycle.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\nimport './lightBulbWidget.css';\nimport { computeIndentLevel } from '../../../common/model/utils.js';\nimport { autoFixCommandId, quickFixCommandId } from './codeAction.js';\nimport * as nls from '../../../../nls.js';\nimport { ICommandService } from '../../../../platform/commands/common/commands.js';\nimport { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';\nvar LightBulbState;\n(function (LightBulbState) {\n LightBulbState.Hidden = { type: 0 /* Type.Hidden */ };\n class Showing {\n constructor(actions, trigger, editorPosition, widgetPosition) {\n this.actions = actions;\n this.trigger = trigger;\n this.editorPosition = editorPosition;\n this.widgetPosition = widgetPosition;\n this.type = 1 /* Type.Showing */;\n }\n }\n LightBulbState.Showing = Showing;\n})(LightBulbState || (LightBulbState = {}));\nlet LightBulbWidget = LightBulbWidget_1 = class LightBulbWidget extends Disposable {\n constructor(_editor, _keybindingService, commandService) {\n super();\n this._editor = _editor;\n this._keybindingService = _keybindingService;\n this._onClick = this._register(new Emitter());\n this.onClick = this._onClick.event;\n this._state = LightBulbState.Hidden;\n this._iconClasses = [];\n this._domNode = dom.$('div.lightBulbWidget');\n this._domNode.role = 'listbox';\n this._register(Gesture.ignoreTarget(this._domNode));\n this._editor.addContentWidget(this);\n this._register(this._editor.onDidChangeModelContent(_ => {\n // cancel when the line in question has been removed\n const editorModel = this._editor.getModel();\n if (this.state.type !== 1 /* LightBulbState.Type.Showing */ || !editorModel || this.state.editorPosition.lineNumber >= editorModel.getLineCount()) {\n this.hide();\n }\n }));\n this._register(dom.addStandardDisposableGenericMouseDownListener(this._domNode, e => {\n if (this.state.type !== 1 /* LightBulbState.Type.Showing */) {\n return;\n }\n // Make sure that focus / cursor location is not lost when clicking widget icon\n this._editor.focus();\n e.preventDefault();\n // a bit of extra work to make sure the menu\n // doesn't cover the line-text\n const { top, height } = dom.getDomNodePagePosition(this._domNode);\n const lineHeight = this._editor.getOption(67 /* EditorOption.lineHeight */);\n let pad = Math.floor(lineHeight / 3);\n if (this.state.widgetPosition.position !== null && this.state.widgetPosition.position.lineNumber < this.state.editorPosition.lineNumber) {\n pad += lineHeight;\n }\n this._onClick.fire({\n x: e.posx,\n y: top + height + pad,\n actions: this.state.actions,\n trigger: this.state.trigger,\n });\n }));\n this._register(dom.addDisposableListener(this._domNode, 'mouseenter', (e) => {\n if ((e.buttons & 1) !== 1) {\n return;\n }\n // mouse enters lightbulb while the primary/left button\n // is being pressed -> hide the lightbulb\n this.hide();\n }));\n this._register(Event.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings, () => {\n var _a, _b, _c, _d;\n this._preferredKbLabel = (_b = (_a = this._keybindingService.lookupKeybinding(autoFixCommandId)) === null || _a === void 0 ? void 0 : _a.getLabel()) !== null && _b !== void 0 ? _b : undefined;\n this._quickFixKbLabel = (_d = (_c = this._keybindingService.lookupKeybinding(quickFixCommandId)) === null || _c === void 0 ? void 0 : _c.getLabel()) !== null && _d !== void 0 ? _d : undefined;\n this._updateLightBulbTitleAndIcon();\n }));\n }\n dispose() {\n super.dispose();\n this._editor.removeContentWidget(this);\n }\n getId() {\n return 'LightBulbWidget';\n }\n getDomNode() {\n return this._domNode;\n }\n getPosition() {\n return this._state.type === 1 /* LightBulbState.Type.Showing */ ? this._state.widgetPosition : null;\n }\n update(actions, trigger, atPosition) {\n if (actions.validActions.length <= 0) {\n return this.hide();\n }\n const options = this._editor.getOptions();\n if (!options.get(65 /* EditorOption.lightbulb */).enabled) {\n return this.hide();\n }\n const model = this._editor.getModel();\n if (!model) {\n return this.hide();\n }\n const { lineNumber, column } = model.validatePosition(atPosition);\n const tabSize = model.getOptions().tabSize;\n const fontInfo = this._editor.getOptions().get(50 /* EditorOption.fontInfo */);\n const lineContent = model.getLineContent(lineNumber);\n const indent = computeIndentLevel(lineContent, tabSize);\n const lineHasSpace = fontInfo.spaceWidth * indent > 22;\n const isFolded = (lineNumber) => {\n return lineNumber > 2 && this._editor.getTopForLineNumber(lineNumber) === this._editor.getTopForLineNumber(lineNumber - 1);\n };\n let effectiveLineNumber = lineNumber;\n let effectiveColumnNumber = 1;\n if (!lineHasSpace) {\n if (lineNumber > 1 && !isFolded(lineNumber - 1)) {\n effectiveLineNumber -= 1;\n }\n else if ((lineNumber < model.getLineCount()) && !isFolded(lineNumber + 1)) {\n effectiveLineNumber += 1;\n }\n else if (column * fontInfo.spaceWidth < 22) {\n // cannot show lightbulb above/below and showing\n // it inline would overlay the cursor...\n return this.hide();\n }\n effectiveColumnNumber = /^\\S\\s*$/.test(model.getLineContent(effectiveLineNumber)) ? 2 : 1;\n }\n this.state = new LightBulbState.Showing(actions, trigger, atPosition, {\n position: { lineNumber: effectiveLineNumber, column: effectiveColumnNumber },\n preference: LightBulbWidget_1._posPref\n });\n const validActions = actions.validActions;\n const actionKind = actions.validActions[0].action.kind;\n if (validActions.length !== 1 || !actionKind) {\n this._editor.layoutContentWidget(this);\n return;\n }\n this._editor.layoutContentWidget(this);\n }\n hide() {\n if (this.state === LightBulbState.Hidden) {\n return;\n }\n this.state = LightBulbState.Hidden;\n this._editor.layoutContentWidget(this);\n }\n get state() { return this._state; }\n set state(value) {\n this._state = value;\n this._updateLightBulbTitleAndIcon();\n }\n _updateLightBulbTitleAndIcon() {\n this._domNode.classList.remove(...this._iconClasses);\n this._iconClasses = [];\n if (this.state.type !== 1 /* LightBulbState.Type.Showing */) {\n return;\n }\n let icon;\n let autoRun = false;\n if (this.state.actions.allAIFixes) {\n icon = Codicon.sparkleFilled;\n if (this.state.actions.validActions.length === 1) {\n autoRun = true;\n }\n }\n else if (this.state.actions.hasAutoFix) {\n if (this.state.actions.hasAIFix) {\n icon = Codicon.lightbulbSparkleAutofix;\n }\n else {\n icon = Codicon.lightbulbAutofix;\n }\n }\n else if (this.state.actions.hasAIFix) {\n icon = Codicon.lightbulbSparkle;\n }\n else {\n icon = Codicon.lightBulb;\n }\n this._updateLightbulbTitle(this.state.actions.hasAutoFix, autoRun);\n this._iconClasses = ThemeIcon.asClassNameArray(icon);\n this._domNode.classList.add(...this._iconClasses);\n }\n _updateLightbulbTitle(autoFix, autoRun) {\n if (this.state.type !== 1 /* LightBulbState.Type.Showing */) {\n return;\n }\n if (autoRun) {\n this.title = nls.localize('codeActionAutoRun', \"Run: {0}\", this.state.actions.validActions[0].action.title);\n }\n else if (autoFix && this._preferredKbLabel) {\n this.title = nls.localize('preferredcodeActionWithKb', \"Show Code Actions. Preferred Quick Fix Available ({0})\", this._preferredKbLabel);\n }\n else if (!autoFix && this._quickFixKbLabel) {\n this.title = nls.localize('codeActionWithKb', \"Show Code Actions ({0})\", this._quickFixKbLabel);\n }\n else if (!autoFix) {\n this.title = nls.localize('codeAction', \"Show Code Actions\");\n }\n }\n set title(value) {\n this._domNode.title = value;\n }\n};\nLightBulbWidget.ID = 'editor.contrib.lightbulbWidget';\nLightBulbWidget._posPref = [0 /* ContentWidgetPositionPreference.EXACT */];\nLightBulbWidget = LightBulbWidget_1 = __decorate([\n __param(1, IKeybindingService),\n __param(2, ICommandService)\n], LightBulbWidget);\nexport { LightBulbWidget };\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { onUnexpectedExternalError } from '../../../../base/common/errors.js';\nimport { HierarchicalKind } from '../../../../base/common/hierarchicalKind.js';\nexport const CodeActionKind = new class {\n constructor() {\n this.QuickFix = new HierarchicalKind('quickfix');\n this.Refactor = new HierarchicalKind('refactor');\n this.RefactorExtract = this.Refactor.append('extract');\n this.RefactorInline = this.Refactor.append('inline');\n this.RefactorMove = this.Refactor.append('move');\n this.RefactorRewrite = this.Refactor.append('rewrite');\n this.Notebook = new HierarchicalKind('notebook');\n this.Source = new HierarchicalKind('source');\n this.SourceOrganizeImports = this.Source.append('organizeImports');\n this.SourceFixAll = this.Source.append('fixAll');\n this.SurroundWith = this.Refactor.append('surround');\n }\n};\nexport var CodeActionTriggerSource;\n(function (CodeActionTriggerSource) {\n CodeActionTriggerSource[\"Refactor\"] = \"refactor\";\n CodeActionTriggerSource[\"RefactorPreview\"] = \"refactor preview\";\n CodeActionTriggerSource[\"Lightbulb\"] = \"lightbulb\";\n CodeActionTriggerSource[\"Default\"] = \"other (default)\";\n CodeActionTriggerSource[\"SourceAction\"] = \"source action\";\n CodeActionTriggerSource[\"QuickFix\"] = \"quick fix action\";\n CodeActionTriggerSource[\"FixAll\"] = \"fix all\";\n CodeActionTriggerSource[\"OrganizeImports\"] = \"organize imports\";\n CodeActionTriggerSource[\"AutoFix\"] = \"auto fix\";\n CodeActionTriggerSource[\"QuickFixHover\"] = \"quick fix hover window\";\n CodeActionTriggerSource[\"OnSave\"] = \"save participants\";\n CodeActionTriggerSource[\"ProblemsView\"] = \"problems view\";\n})(CodeActionTriggerSource || (CodeActionTriggerSource = {}));\nexport function mayIncludeActionsOfKind(filter, providedKind) {\n // A provided kind may be a subset or superset of our filtered kind.\n if (filter.include && !filter.include.intersects(providedKind)) {\n return false;\n }\n if (filter.excludes) {\n if (filter.excludes.some(exclude => excludesAction(providedKind, exclude, filter.include))) {\n return false;\n }\n }\n // Don't return source actions unless they are explicitly requested\n if (!filter.includeSourceActions && CodeActionKind.Source.contains(providedKind)) {\n return false;\n }\n return true;\n}\nexport function filtersAction(filter, action) {\n const actionKind = action.kind ? new HierarchicalKind(action.kind) : undefined;\n // Filter out actions by kind\n if (filter.include) {\n if (!actionKind || !filter.include.contains(actionKind)) {\n return false;\n }\n }\n if (filter.excludes) {\n if (actionKind && filter.excludes.some(exclude => excludesAction(actionKind, exclude, filter.include))) {\n return false;\n }\n }\n // Don't return source actions unless they are explicitly requested\n if (!filter.includeSourceActions) {\n if (actionKind && CodeActionKind.Source.contains(actionKind)) {\n return false;\n }\n }\n if (filter.onlyIncludePreferredActions) {\n if (!action.isPreferred) {\n return false;\n }\n }\n return true;\n}\nfunction excludesAction(providedKind, exclude, include) {\n if (!exclude.contains(providedKind)) {\n return false;\n }\n if (include && exclude.contains(include)) {\n // The include is more specific, don't filter out\n return false;\n }\n return true;\n}\nexport class CodeActionCommandArgs {\n static fromUser(arg, defaults) {\n if (!arg || typeof arg !== 'object') {\n return new CodeActionCommandArgs(defaults.kind, defaults.apply, false);\n }\n return new CodeActionCommandArgs(CodeActionCommandArgs.getKindFromUser(arg, defaults.kind), CodeActionCommandArgs.getApplyFromUser(arg, defaults.apply), CodeActionCommandArgs.getPreferredUser(arg));\n }\n static getApplyFromUser(arg, defaultAutoApply) {\n switch (typeof arg.apply === 'string' ? arg.apply.toLowerCase() : '') {\n case 'first': return \"first\" /* CodeActionAutoApply.First */;\n case 'never': return \"never\" /* CodeActionAutoApply.Never */;\n case 'ifsingle': return \"ifSingle\" /* CodeActionAutoApply.IfSingle */;\n default: return defaultAutoApply;\n }\n }\n static getKindFromUser(arg, defaultKind) {\n return typeof arg.kind === 'string'\n ? new HierarchicalKind(arg.kind)\n : defaultKind;\n }\n static getPreferredUser(arg) {\n return typeof arg.preferred === 'boolean'\n ? arg.preferred\n : false;\n }\n constructor(kind, apply, preferred) {\n this.kind = kind;\n this.apply = apply;\n this.preferred = preferred;\n }\n}\nexport class CodeActionItem {\n constructor(action, provider, highlightRange) {\n this.action = action;\n this.provider = provider;\n this.highlightRange = highlightRange;\n }\n async resolve(token) {\n var _a;\n if (((_a = this.provider) === null || _a === void 0 ? void 0 : _a.resolveCodeAction) && !this.action.edit) {\n let action;\n try {\n action = await this.provider.resolveCodeAction(this.action, token);\n }\n catch (err) {\n onUnexpectedExternalError(err);\n }\n if (action) {\n this.action.edit = action.edit;\n }\n }\n return this;\n }\n}\n"],"names":["CLIPBOARD_CONTEXT_MENU_GROUP","supportsCut","document","queryCommandSupported","supportsCopy","supportsPaste","navigator","clipboard","registerCommand","command","register","CutAction","id","precondition","undefined","kbOpts","primary","win","secondary","weight","menuOpts","menuId","group","title","key","comment","order","when","CopyAction","submenu","PasteAction","linux","ExecCommandCopyWithSyntaxHighlightingAction","constructor","super","label","alias","kbExpr","run","accessor","editor","hasModel","getOption","getSelection","isEmpty","focus","getContainerDomNode","ownerDocument","execCommand","registerExecCommandImpl","target","browserCommand","addImplementation","args","focusedEditor","get","getFocusedCodeEditor","hasTextFocus","emptySelectionClipboard","selection","_a","_b","codeEditorService","clipboardService","finishedPaste","Promise","resolve","clipboardText","readText","metadata","pasteOnNewLine","multicursorText","mode","isFromEmptySelection","trigger","text","codeActionCommandId","quickFixCommandId","autoFixCommandId","refactorCommandId","sourceActionCommandId","organizeImportsCommandId","fixAllCommandId","ManagedCodeActionSet","codeActionsPreferredComparator","a","b","isPreferred","codeActionsComparator","action","isAI","diagnostics","actions","documentation","disposables","this","_register","allActions","sort","validActions","filter","disabled","hasAutoFix","some","fix","kind","hasAIFix","allAIFixes","every","emptyCodeActionsResponse","async","getCodeActions","registry","model","rangeOrSelection","progress","token","notebookFilter","excludes","codeActionContext","only","include","value","type","cts","excludeNotebookCodeActions","providers","all","provider","providedCodeActionKinds","getCodeActionProviders","promises","map","report","providedCodeActions","provideCodeActions","add","isCancellationRequested","filteredActions","entry","currentBest","contains","getDocumentationFromProvider","err","listener","onDidChange","newProviders","cancel","x","flat","allDocumentation","getAdditionalDocumentationForShowingActions","dispose","actionsToShow","_c","length","_getAdditionalMenuItems","call","item","ApplyCodeActionReason","applyCodeAction","codeActionReason","options","bulkEditService","commandService","telemetryService","notificationService","publicLog2","codeActionTitle","codeActionKind","codeActionIsPreferred","reason","edit","edits","apply","quotableLabel","code","respectAutoSaveConfig","OnSave","showPreview","preview","isApplied","executeCommand","arguments","message","Error","asMessage","error","resource","itemResolveCount","codeActionProvider","getModel","validatedRangeOrSelection","validateRange","codeActionSet","triggerAction","includeSourceActions","resolving","resolveCount","Math","min","i","push","setTimeout","contextKeyForSupportedActions","RegExp","argsSchema","defaultSnippets","body","properties","description","nls","default","enum","enumDescriptions","triggerCodeActionsForEditorSelection","notAvailableMessage","autoApply","controller","manualTriggerAtCurrentPosition","QuickFixAction","_accessor","CodeActionCommand","codeAction","name","schema","runEditorCommand","userArgs","preferred","onlyIncludePreferredActions","RefactorAction","mac","contextMenuOpts","SourceAction","OrganizeImportsAction","FixAllAction","AutoFixAction","registerConfiguration","scope","CodeActionKeybindingResolver_1","__decorate","decorators","desc","d","c","r","Object","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","CodeActionKeybindingResolver","keybindingService","getResolver","allCodeActionBindings","getKeybindings","codeActionCommands","indexOf","resolvedKeybinding","commandArgs","binding","bestKeybindingForCodeAction","candidates","candidate","reduceRight","uncategorizedCodeActionGroup","freeze","codeActionGroups","icon","CodeActionController_1","CodeActionController","getContribution","ID","markerService","contextKeyService","instantiationService","languageFeaturesService","progressService","_commandService","_configurationService","_actionWidgetService","_instantiationService","_telemetryService","_activeCodeActions","_showDisabled","_disposed","_editor","_model","onDidChangeState","newState","update","_lightBulbWidget","widget","onClick","e","showCodeActionsFromLightbulb","_resolver","createInstance","onDidLayoutChange","hide","at","codeActionListLength","codeActions","codeActionProviders","displayName","actionItem","autoSend","_applyCodeAction","showCodeActionList","includeDisabledActions","fromLightbulb","showCodeActions","_trigger","closeMessage","triggerPosition","getPosition","context","position","retrigger","actionReason","invokeFunction","_d","_e","_f","_g","rawValue","validActionToApply","tryGetValidActionToApply","invalidAction","getInvalidActionThatWouldHaveBeenApplied","showMessage","toCoords","isVisible","find","currentDecorations","createDecorationsCollection","editorDom","getDomNode","anchor","delegate","onSelect","clear","onHide","didCancel","onHover","canPreview","actionKind","hierarchicalKind","refactorKind","onFocus","ranges","decorations","diagnostic","range","DECORATION","set","startLineNumber","startColumn","selectionText","getWordAtPosition","lineNumber","column","word","aria","show","inputCodeActions","showHeaders","keybindingResolver","menuEntries","menuEntry","allMenuItems","keybinding","toMenuItems","_shouldShowHeaders","_getActionBarActions","y","revealPosition","render","cursorCoords","getScrolledVisiblePosition","editorCoords","left","top","height","getValue","uri","resultActions","tooltip","class","enabled","className","theme","collector","selector","color","getColor","addRule","findMatchHighlightBorder","SUPPORTED_CODE_ACTIONS","APPLY_FIX_ALL_COMMAND_ID","CodeActionOracle","_markerService","_signalChange","_delay","_autoTriggerTimer","onMarkerChanged","_onMarkerChanges","onDidChangeCursorPosition","_tryAutoTrigger","_getRangeOfSelectionUnlessWhitespaceEnclosed","resources","cancelAndSet","line","getLineContent","test","getLineMaxColumn","CodeActionsState","Empty","Triggered","_cancellablePromise","catch","emptyCodeActionSet","CodeActionModel","_registry","_progressService","_codeActionOracle","_state","_onDidChangeState","event","_supportedCodeActions","bindTo","onDidChangeModel","_update","onDidChangeModelLanguage","onDidChangeConfiguration","hasChanged","setState","_settingEnabledNearbyQuickfixes","has","supportedActions","flatMap","join","startPosition","getStartPosition","_h","_j","_k","allCodeActions","foundQuickfix","allMarkers","read","arg","includes","marker","relatedInformation","currPosition","trackedPosition","distance","Number","MAX_VALUE","currentActions","col","endColumn","row","endLineNumber","startRow","newCodeActionTrigger","selectionAsPosition","actionsAtMarker","abs","unshift","index","self","findIndex","showWhile","isManualToAutoTransition","reset","skipNotify","fire","LightBulbWidget_1","LightBulbState","Hidden","Showing","editorPosition","widgetPosition","LightBulbWidget","_keybindingService","_onClick","_iconClasses","_domNode","role","addContentWidget","onDidChangeModelContent","_","editorModel","state","getLineCount","preventDefault","lineHeight","pad","floor","posx","buttons","onDidUpdateKeybindings","_preferredKbLabel","lookupKeybinding","getLabel","_quickFixKbLabel","_updateLightBulbTitleAndIcon","removeContentWidget","getId","atPosition","getOptions","validatePosition","tabSize","fontInfo","lineContent","indent","isFolded","getTopForLineNumber","effectiveLineNumber","effectiveColumnNumber","spaceWidth","preference","_posPref","layoutContentWidget","classList","remove","autoRun","_updateLightbulbTitle","autoFix","CodeActionKind","QuickFix","Refactor","RefactorExtract","append","RefactorInline","RefactorMove","RefactorRewrite","Notebook","Source","SourceOrganizeImports","SourceFixAll","SurroundWith","CodeActionTriggerSource","mayIncludeActionsOfKind","providedKind","intersects","exclude","excludesAction","filtersAction","CodeActionCommandArgs","fromUser","defaults","getKindFromUser","getApplyFromUser","getPreferredUser","defaultAutoApply","toLowerCase","defaultKind","CodeActionItem","highlightRange","resolveCodeAction"],"sourceRoot":""}