monaco-editor-core 0.55.0-dev-20251020 → 0.55.0-dev-20251021

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/esm/nls.messages.cs.js +1 -1
  2. package/esm/nls.messages.de.js +1 -1
  3. package/esm/nls.messages.es.js +1 -1
  4. package/esm/nls.messages.fr.js +1 -1
  5. package/esm/nls.messages.it.js +1 -1
  6. package/esm/nls.messages.ja.js +1 -1
  7. package/esm/nls.messages.ko.js +1 -1
  8. package/esm/nls.messages.pl.js +1 -1
  9. package/esm/nls.messages.pt-br.js +1 -1
  10. package/esm/nls.messages.ru.js +1 -1
  11. package/esm/nls.messages.tr.js +1 -1
  12. package/esm/nls.messages.zh-cn.js +1 -1
  13. package/esm/nls.messages.zh-tw.js +1 -1
  14. package/esm/vs/base/common/actions.js +5 -0
  15. package/esm/vs/base/common/actions.js.map +1 -1
  16. package/esm/vs/base/common/async.js +5 -5
  17. package/esm/vs/base/common/async.js.map +1 -1
  18. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js +20 -12
  19. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContext.js.map +1 -1
  20. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +0 -2
  21. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  22. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +6 -0
  23. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  24. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +1 -0
  25. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
  26. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +22 -2
  27. package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
  28. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +0 -1
  29. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  30. package/esm/vs/editor/contrib/inlineCompletions/browser/telemetry.js.map +1 -1
  31. package/esm/vs/editor/contrib/rename/browser/renameWidget.js +1 -4
  32. package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
  33. package/package.json +2 -2
  34. package/version.txt +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Version: 0.55.0-dev-20251020(7102eff2098bf09217a0b0fb256f17964d9f79da)
3
+ * Version: 0.55.0-dev-20251021(c0063aedfa06cf3d2f77d9cbf0c7cdf69303bae4)
4
4
  * Released under the MIT license
5
5
  * https://github.com/microsoft/vscode/blob/main/LICENSE.txt
6
6
  *-----------------------------------------------------------*/
@@ -5,6 +5,11 @@
5
5
  import { Emitter } from './event.js';
6
6
  import { Disposable } from './lifecycle.js';
7
7
  import * as nls from '../../nls.js';
8
+ /**
9
+ * A concrete implementation of {@link IAction}.
10
+ *
11
+ * Note that in most cases you should use the lighter-weight {@linkcode toAction} function instead.
12
+ */
8
13
  export class Action extends Disposable {
9
14
  get onDidChange() { return this._onDidChange.event; }
10
15
  constructor(id, label = '', cssClass = '', enabled = true, actionCallback) {
@@ -1 +1 @@
1
- {"version":3,"sources":["vs/base/common/actions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAS,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAe,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AA6CpC,MAAM,OAAO,MAAO,SAAQ,UAAU;IAGrC,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAUrD,YAAY,EAAU,EAAE,QAAgB,EAAE,EAAE,WAAmB,EAAE,EAAE,UAAmB,IAAI,EAAE,cAA6C;QACxI,KAAK,EAAE,CAAC;QAZC,iBAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,EAAsB,CAAC,CAAC;QAOjE,aAAQ,GAAY,IAAI,CAAC;QAMlC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC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CAAC,KAAK;QACrC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,KAAK,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;KACrD,CAAC;AACH,CAAC","file":"actions.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","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 *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from './event.js';\nimport { Disposable, IDisposable } from './lifecycle.js';\nimport * as nls from '../../nls.js';\n\nexport interface ITelemetryData {\n\t[key: string]: unknown;\n}\n\nexport type WorkbenchActionExecutedClassification = {\n\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier of the action that was run.' };\n\tfrom: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The name of the component the action was run from.' };\n\tdetail?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Optional details about how the action was run, e.g which keybinding was used.' };\n\towner: 'isidorn';\n\tcomment: 'Provides insight into actions that are executed within the workbench.';\n};\n\nexport type WorkbenchActionExecutedEvent = {\n\tid: string;\n\tfrom: string;\n\tdetail?: string;\n};\n\nexport interface IAction {\n\treadonly id: string;\n\tlabel: string;\n\ttooltip: string;\n\tclass: string | undefined;\n\tenabled: boolean;\n\tchecked?: boolean;\n\trun(...args: unknown[]): unknown;\n}\n\nexport interface IActionRunner extends IDisposable {\n\treadonly onDidRun: Event<IRunEvent>;\n\treadonly onWillRun: Event<IRunEvent>;\n\n\trun(action: IAction, context?: unknown): unknown;\n}\n\nexport interface IActionChangeEvent {\n\treadonly label?: string;\n\treadonly tooltip?: string;\n\treadonly class?: string;\n\treadonly enabled?: boolean;\n\treadonly checked?: boolean;\n}\n\nexport class Action extends Disposable implements IAction {\n\n\tprotected _onDidChange = this._register(new Emitter<IActionChangeEvent>());\n\tget onDidChange() { return this._onDidChange.event; }\n\n\tprotected readonly _id: string;\n\tprotected _label: string;\n\tprotected _tooltip: string | undefined;\n\tprotected _cssClass: string | undefined;\n\tprotected _enabled: boolean = true;\n\tprotected _checked?: boolean;\n\tprotected readonly _actionCallback?: (event?: unknown) => unknown;\n\n\tconstructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: unknown) => unknown) {\n\t\tsuper();\n\t\tthis._id = id;\n\t\tthis._label = label;\n\t\tthis._cssClass = cssClass;\n\t\tthis._enabled = enabled;\n\t\tthis._actionCallback = actionCallback;\n\t}\n\n\tget id(): string {\n\t\treturn this._id;\n\t}\n\n\tget label(): string {\n\t\treturn this._label;\n\t}\n\n\tset label(value: string) {\n\t\tthis._setLabel(value);\n\t}\n\n\tprivate _setLabel(value: string): void {\n\t\tif (this._label !== value) {\n\t\t\tthis._label = value;\n\t\t\tthis._onDidChange.fire({ label: value });\n\t\t}\n\t}\n\n\tget tooltip(): string {\n\t\treturn this._tooltip || '';\n\t}\n\n\tset tooltip(value: string) {\n\t\tthis._setTooltip(value);\n\t}\n\n\tprotected _setTooltip(value: string): void {\n\t\tif (this._tooltip !== value) {\n\t\t\tthis._tooltip = value;\n\t\t\tthis._onDidChange.fire({ tooltip: value });\n\t\t}\n\t}\n\n\tget class(): string | undefined {\n\t\treturn this._cssClass;\n\t}\n\n\tset class(value: string | undefined) {\n\t\tthis._setClass(value);\n\t}\n\n\tprotected _setClass(value: string | undefined): void {\n\t\tif (this._cssClass !== value) {\n\t\t\tthis._cssClass = value;\n\t\t\tthis._onDidChange.fire({ class: value });\n\t\t}\n\t}\n\n\tget enabled(): boolean {\n\t\treturn this._enabled;\n\t}\n\n\tset enabled(value: boolean) {\n\t\tthis._setEnabled(value);\n\t}\n\n\tprotected _setEnabled(value: boolean): void {\n\t\tif (this._enabled !== value) {\n\t\t\tthis._enabled = value;\n\t\t\tthis._onDidChange.fire({ enabled: value });\n\t\t}\n\t}\n\n\tget checked(): boolean | undefined {\n\t\treturn this._checked;\n\t}\n\n\tset checked(value: boolean | undefined) {\n\t\tthis._setChecked(value);\n\t}\n\n\tprotected _setChecked(value: boolean | undefined): void {\n\t\tif (this._checked !== value) {\n\t\t\tthis._checked = value;\n\t\t\tthis._onDidChange.fire({ checked: value });\n\t\t}\n\t}\n\n\tasync run(event?: unknown, data?: ITelemetryData): Promise<void> {\n\t\tif (this._actionCallback) {\n\t\t\tawait this._actionCallback(event);\n\t\t}\n\t}\n}\n\nexport interface IRunEvent {\n\treadonly action: IAction;\n\treadonly error?: Error;\n}\n\nexport class ActionRunner extends Disposable implements IActionRunner {\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tif (!action.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onWillRun.fire({ action });\n\n\t\tlet error: Error | undefined = undefined;\n\t\ttry {\n\t\t\tawait this.runAction(action, context);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\n\t\tthis._onDidRun.fire({ action, error });\n\t}\n\n\tprotected async runAction(action: IAction, context?: unknown): Promise<void> {\n\t\tawait action.run(context);\n\t}\n}\n\nexport class Separator implements IAction {\n\n\t/**\n\t * Joins all non-empty lists of actions with separators.\n\t */\n\tpublic static join(...actionLists: readonly IAction[][]) {\n\t\tlet out: IAction[] = [];\n\t\tfor (const list of actionLists) {\n\t\t\tif (!list.length) {\n\t\t\t\t// skip\n\t\t\t} else if (out.length) {\n\t\t\t\tout = [...out, new Separator(), ...list];\n\t\t\t} else {\n\t\t\t\tout = list;\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tstatic readonly ID = 'vs.actions.separator';\n\n\treadonly id: string = Separator.ID;\n\n\treadonly label: string = '';\n\treadonly tooltip: string = '';\n\treadonly class: string = 'separator';\n\treadonly enabled: boolean = false;\n\treadonly checked: boolean = false;\n\tasync run() { }\n}\n\nexport class SubmenuAction implements IAction {\n\n\treadonly id: string;\n\treadonly label: string;\n\treadonly class: string | undefined;\n\treadonly tooltip: string = '';\n\treadonly enabled: boolean = true;\n\treadonly checked: undefined = undefined;\n\n\tprivate readonly _actions: readonly IAction[];\n\tget actions(): readonly IAction[] { return this._actions; }\n\n\tconstructor(id: string, label: string, actions: readonly IAction[], cssClass?: string) {\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.class = cssClass;\n\t\tthis._actions = actions;\n\t}\n\n\tasync run(): Promise<void> { }\n}\n\nexport class EmptySubmenuAction extends Action {\n\n\tstatic readonly ID = 'vs.actions.empty';\n\n\tconstructor() {\n\t\tsuper(EmptySubmenuAction.ID, nls.localize('submenu.empty', '(empty)'), undefined, false);\n\t}\n}\n\nexport function toAction(props: { id: string; label: string; tooltip?: string; enabled?: boolean; checked?: boolean; class?: string; run: Function }): IAction {\n\treturn {\n\t\tid: props.id,\n\t\tlabel: props.label,\n\t\ttooltip: props.tooltip ?? props.label,\n\t\tclass: props.class,\n\t\tenabled: props.enabled ?? true,\n\t\tchecked: props.checked,\n\t\trun: async (...args: unknown[]) => props.run(...args),\n\t};\n}\n"]}
1
+ {"version":3,"sources":["vs/base/common/actions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,OAAO,EAAS,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAe,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AA6CpC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IAGrC,IAAI,WAAW,KAAK,OAAO,IAAI,CAAC,YAA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;aAE7B,OAAE,GAAG,kBAAkB,CAAC;IAExC;QACC,KAAK,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAe,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1F,CAAC;;AAGF,MAAM,UAAU,QAAQ,CAAC,KAA2H;IACnJ,OAAO;QACN,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK;QACrC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,KAAK,EAAE,GAAG,IAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;KACrD,CAAC;AACH,CAAC","file":"actions.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","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 *--------------------------------------------------------------------------------------------*/\n\nimport { Emitter, Event } from './event.js';\nimport { Disposable, IDisposable } from './lifecycle.js';\nimport * as nls from '../../nls.js';\n\nexport interface ITelemetryData {\n\t[key: string]: unknown;\n}\n\nexport type WorkbenchActionExecutedClassification = {\n\tid: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The identifier of the action that was run.' };\n\tfrom: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The name of the component the action was run from.' };\n\tdetail?: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'Optional details about how the action was run, e.g which keybinding was used.' };\n\towner: 'isidorn';\n\tcomment: 'Provides insight into actions that are executed within the workbench.';\n};\n\nexport type WorkbenchActionExecutedEvent = {\n\tid: string;\n\tfrom: string;\n\tdetail?: string;\n};\n\nexport interface IAction {\n\treadonly id: string;\n\tlabel: string;\n\ttooltip: string;\n\tclass: string | undefined;\n\tenabled: boolean;\n\tchecked?: boolean;\n\trun(...args: unknown[]): unknown;\n}\n\nexport interface IActionRunner extends IDisposable {\n\treadonly onDidRun: Event<IRunEvent>;\n\treadonly onWillRun: Event<IRunEvent>;\n\n\trun(action: IAction, context?: unknown): unknown;\n}\n\nexport interface IActionChangeEvent {\n\treadonly label?: string;\n\treadonly tooltip?: string;\n\treadonly class?: string;\n\treadonly enabled?: boolean;\n\treadonly checked?: boolean;\n}\n\n/**\n * A concrete implementation of {@link IAction}.\n *\n * Note that in most cases you should use the lighter-weight {@linkcode toAction} function instead.\n */\nexport class Action extends Disposable implements IAction {\n\n\tprotected _onDidChange = this._register(new Emitter<IActionChangeEvent>());\n\tget onDidChange() { return this._onDidChange.event; }\n\n\tprotected readonly _id: string;\n\tprotected _label: string;\n\tprotected _tooltip: string | undefined;\n\tprotected _cssClass: string | undefined;\n\tprotected _enabled: boolean = true;\n\tprotected _checked?: boolean;\n\tprotected readonly _actionCallback?: (event?: unknown) => unknown;\n\n\tconstructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: unknown) => unknown) {\n\t\tsuper();\n\t\tthis._id = id;\n\t\tthis._label = label;\n\t\tthis._cssClass = cssClass;\n\t\tthis._enabled = enabled;\n\t\tthis._actionCallback = actionCallback;\n\t}\n\n\tget id(): string {\n\t\treturn this._id;\n\t}\n\n\tget label(): string {\n\t\treturn this._label;\n\t}\n\n\tset label(value: string) {\n\t\tthis._setLabel(value);\n\t}\n\n\tprivate _setLabel(value: string): void {\n\t\tif (this._label !== value) {\n\t\t\tthis._label = value;\n\t\t\tthis._onDidChange.fire({ label: value });\n\t\t}\n\t}\n\n\tget tooltip(): string {\n\t\treturn this._tooltip || '';\n\t}\n\n\tset tooltip(value: string) {\n\t\tthis._setTooltip(value);\n\t}\n\n\tprotected _setTooltip(value: string): void {\n\t\tif (this._tooltip !== value) {\n\t\t\tthis._tooltip = value;\n\t\t\tthis._onDidChange.fire({ tooltip: value });\n\t\t}\n\t}\n\n\tget class(): string | undefined {\n\t\treturn this._cssClass;\n\t}\n\n\tset class(value: string | undefined) {\n\t\tthis._setClass(value);\n\t}\n\n\tprotected _setClass(value: string | undefined): void {\n\t\tif (this._cssClass !== value) {\n\t\t\tthis._cssClass = value;\n\t\t\tthis._onDidChange.fire({ class: value });\n\t\t}\n\t}\n\n\tget enabled(): boolean {\n\t\treturn this._enabled;\n\t}\n\n\tset enabled(value: boolean) {\n\t\tthis._setEnabled(value);\n\t}\n\n\tprotected _setEnabled(value: boolean): void {\n\t\tif (this._enabled !== value) {\n\t\t\tthis._enabled = value;\n\t\t\tthis._onDidChange.fire({ enabled: value });\n\t\t}\n\t}\n\n\tget checked(): boolean | undefined {\n\t\treturn this._checked;\n\t}\n\n\tset checked(value: boolean | undefined) {\n\t\tthis._setChecked(value);\n\t}\n\n\tprotected _setChecked(value: boolean | undefined): void {\n\t\tif (this._checked !== value) {\n\t\t\tthis._checked = value;\n\t\t\tthis._onDidChange.fire({ checked: value });\n\t\t}\n\t}\n\n\tasync run(event?: unknown, data?: ITelemetryData): Promise<void> {\n\t\tif (this._actionCallback) {\n\t\t\tawait this._actionCallback(event);\n\t\t}\n\t}\n}\n\nexport interface IRunEvent {\n\treadonly action: IAction;\n\treadonly error?: Error;\n}\n\nexport class ActionRunner extends Disposable implements IActionRunner {\n\n\tprivate readonly _onWillRun = this._register(new Emitter<IRunEvent>());\n\tget onWillRun() { return this._onWillRun.event; }\n\n\tprivate readonly _onDidRun = this._register(new Emitter<IRunEvent>());\n\tget onDidRun() { return this._onDidRun.event; }\n\n\tasync run(action: IAction, context?: unknown): Promise<void> {\n\t\tif (!action.enabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._onWillRun.fire({ action });\n\n\t\tlet error: Error | undefined = undefined;\n\t\ttry {\n\t\t\tawait this.runAction(action, context);\n\t\t} catch (e) {\n\t\t\terror = e;\n\t\t}\n\n\t\tthis._onDidRun.fire({ action, error });\n\t}\n\n\tprotected async runAction(action: IAction, context?: unknown): Promise<void> {\n\t\tawait action.run(context);\n\t}\n}\n\nexport class Separator implements IAction {\n\n\t/**\n\t * Joins all non-empty lists of actions with separators.\n\t */\n\tpublic static join(...actionLists: readonly IAction[][]) {\n\t\tlet out: IAction[] = [];\n\t\tfor (const list of actionLists) {\n\t\t\tif (!list.length) {\n\t\t\t\t// skip\n\t\t\t} else if (out.length) {\n\t\t\t\tout = [...out, new Separator(), ...list];\n\t\t\t} else {\n\t\t\t\tout = list;\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}\n\n\tstatic readonly ID = 'vs.actions.separator';\n\n\treadonly id: string = Separator.ID;\n\n\treadonly label: string = '';\n\treadonly tooltip: string = '';\n\treadonly class: string = 'separator';\n\treadonly enabled: boolean = false;\n\treadonly checked: boolean = false;\n\tasync run() { }\n}\n\nexport class SubmenuAction implements IAction {\n\n\treadonly id: string;\n\treadonly label: string;\n\treadonly class: string | undefined;\n\treadonly tooltip: string = '';\n\treadonly enabled: boolean = true;\n\treadonly checked: undefined = undefined;\n\n\tprivate readonly _actions: readonly IAction[];\n\tget actions(): readonly IAction[] { return this._actions; }\n\n\tconstructor(id: string, label: string, actions: readonly IAction[], cssClass?: string) {\n\t\tthis.id = id;\n\t\tthis.label = label;\n\t\tthis.class = cssClass;\n\t\tthis._actions = actions;\n\t}\n\n\tasync run(): Promise<void> { }\n}\n\nexport class EmptySubmenuAction extends Action {\n\n\tstatic readonly ID = 'vs.actions.empty';\n\n\tconstructor() {\n\t\tsuper(EmptySubmenuAction.ID, nls.localize('submenu.empty', '(empty)'), undefined, false);\n\t}\n}\n\nexport function toAction(props: { id: string; label: string; tooltip?: string; enabled?: boolean; checked?: boolean; class?: string; run: Function }): IAction {\n\treturn {\n\t\tid: props.id,\n\t\tlabel: props.label,\n\t\ttooltip: props.tooltip ?? props.label,\n\t\tclass: props.class,\n\t\tenabled: props.enabled ?? true,\n\t\tchecked: props.checked,\n\t\trun: async (...args: unknown[]) => props.run(...args),\n\t};\n}\n"]}
@@ -113,13 +113,13 @@ export function raceCancellationError(promise, token) {
113
113
  */
114
114
  export class Throttler {
115
115
  constructor() {
116
- this.isDisposed = false;
117
116
  this.activePromise = null;
118
117
  this.queuedPromise = null;
119
118
  this.queuedPromiseFactory = null;
119
+ this.cancellationTokenSource = new CancellationTokenSource();
120
120
  }
121
121
  queue(promiseFactory) {
122
- if (this.isDisposed) {
122
+ if (this.cancellationTokenSource.token.isCancellationRequested) {
123
123
  return Promise.reject(new Error('Throttler is disposed'));
124
124
  }
125
125
  if (this.activePromise) {
@@ -127,7 +127,7 @@ export class Throttler {
127
127
  if (!this.queuedPromise) {
128
128
  const onComplete = () => {
129
129
  this.queuedPromise = null;
130
- if (this.isDisposed) {
130
+ if (this.cancellationTokenSource.token.isCancellationRequested) {
131
131
  return;
132
132
  }
133
133
  const result = this.queue(this.queuedPromiseFactory);
@@ -142,7 +142,7 @@ export class Throttler {
142
142
  this.queuedPromise.then(resolve, reject);
143
143
  });
144
144
  }
145
- this.activePromise = promiseFactory();
145
+ this.activePromise = promiseFactory(this.cancellationTokenSource.token);
146
146
  return new Promise((resolve, reject) => {
147
147
  this.activePromise.then((result) => {
148
148
  this.activePromise = null;
@@ -154,7 +154,7 @@ export class Throttler {
154
154
  });
155
155
  }
156
156
  dispose() {
157
- this.isDisposed = true;
157
+ this.cancellationTokenSource.cancel();
158
158
  }
159
159
  }
160
160
  const timeoutDeferred = (timeout, fn) => {