@codingame/monaco-vscode-api 1.76.1 → 1.76.3-next.0

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 (59) hide show
  1. package/README.md +2 -1
  2. package/dist/api.js +3 -860
  3. package/dist/{extHost.js → api2.js} +16555 -13467
  4. package/dist/async.js +107 -2
  5. package/dist/audioCue.js +105 -103
  6. package/dist/button.js +1 -1
  7. package/dist/cancellation.js +3 -0
  8. package/dist/configuration.js +7 -344
  9. package/dist/configuration2.js +339 -0
  10. package/dist/configurationRegistry.js +441 -0
  11. package/dist/contextkeys.js +211 -0
  12. package/dist/debug.d.ts +22 -0
  13. package/dist/debug.js +15842 -0
  14. package/dist/dialogs.js +855 -9
  15. package/dist/extensionResourceLoader.js +96 -0
  16. package/dist/extensions.d.ts +491 -0
  17. package/dist/extensions.js +70 -0
  18. package/dist/{tools.js → extensionsRegistry.js} +2 -30
  19. package/dist/files.js +1407 -334
  20. package/dist/iconv.js +43 -0
  21. package/dist/injection.js +1 -1
  22. package/dist/jschardet.js +7 -0
  23. package/dist/keybindings.d.ts +1 -485
  24. package/dist/keybindings.js +666 -679
  25. package/dist/labels.js +14 -0
  26. package/dist/languageConfiguration.d.ts +1 -2
  27. package/dist/languageConfiguration.js +9 -16
  28. package/dist/languageService.js +112 -8
  29. package/dist/languages.d.ts +1 -473
  30. package/dist/languages.js +2 -12
  31. package/dist/layout.js +4 -3
  32. package/dist/layoutService.js +1 -1
  33. package/dist/missing-services.js +4710 -74
  34. package/dist/modelEditor.d.ts +324 -2
  35. package/dist/modelEditor.js +15 -228
  36. package/dist/monaco.js +7 -72
  37. package/dist/notifications.js +75 -232
  38. package/dist/polyfill.js +10715 -2459
  39. package/dist/resources.js +197 -0
  40. package/dist/services.d.ts +924 -3
  41. package/dist/services.js +1 -2
  42. package/dist/services2.js +2436 -18
  43. package/dist/snippets.d.ts +1 -473
  44. package/dist/snippets.js +8 -867
  45. package/dist/snippetsService.js +868 -0
  46. package/dist/textFileEditorModel.js +2985 -0
  47. package/dist/textmate.d.ts +3 -475
  48. package/dist/textmate.js +19 -29
  49. package/dist/theme.d.ts +1 -3
  50. package/dist/theme.js +24 -70
  51. package/dist/tokenClassification.d.ts +1 -475
  52. package/dist/tokenClassification.js +11 -37
  53. package/dist/tokenClassificationRegistry.js +8 -4
  54. package/dist/variableResolver.js +1711 -0
  55. package/dist/workbenchThemeService.js +1 -1
  56. package/dist/workspaceContext.js +1 -3
  57. package/package.json +27 -12
  58. package/dist/contextkey.js +0 -419
  59. package/dist/dialog.web.contribution.js +0 -945
package/dist/monaco.js CHANGED
@@ -1,11 +1,11 @@
1
- import { _ as __decorate, a as __param } from './contextkey.js';
2
- export { C as ContextKeyExprType } from './contextkey.js';
3
- import './polyfill.js';
1
+ import { _ as __decorate, a as __param } from './services2.js';
2
+ export { C as ContextKeyExprType } from './services2.js';
3
+ import { a0 as distinct } from './polyfill.js';
4
4
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
5
5
  export { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
6
6
  import { c as createInjectedClass } from './injection.js';
7
7
  import { editorOptionsRegistry } from 'monaco-editor/esm/vs/editor/common/config/editorOptions.js';
8
- import { equals as equals$1 } from 'monaco-editor/esm/vs/base/common/arrays.js';
8
+ import { equals } from 'monaco-editor/esm/vs/base/common/arrays.js';
9
9
  import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
10
10
  export { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
11
11
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
@@ -21,71 +21,6 @@ export { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
21
21
  export { FoldingController } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js';
22
22
  export { FoldingModel, setCollapseStateForMatchingLines } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/foldingModel.js';
23
23
  export { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
24
- function equals(one, other) {
25
- if (one === other) {
26
- return true;
27
- }
28
- if (one === null || one === undefined || other === null || other === undefined) {
29
- return false;
30
- }
31
- if (typeof one !== typeof other) {
32
- return false;
33
- }
34
- if (typeof one !== 'object') {
35
- return false;
36
- }
37
- if ((Array.isArray(one)) !== (Array.isArray(other))) {
38
- return false;
39
- }
40
- let i;
41
- let key;
42
- if (Array.isArray(one)) {
43
- if (one.length !== other.length) {
44
- return false;
45
- }
46
- for (i = 0; i < one.length; i++) {
47
- if (!equals(one[i], other[i])) {
48
- return false;
49
- }
50
- }
51
- }
52
- else {
53
- const oneKeys = [];
54
- for (key in one) {
55
- oneKeys.push(key);
56
- }
57
- oneKeys.sort();
58
- const otherKeys = [];
59
- for (key in other) {
60
- otherKeys.push(key);
61
- }
62
- otherKeys.sort();
63
- if (!equals(oneKeys, otherKeys)) {
64
- return false;
65
- }
66
- for (i = 0; i < oneKeys.length; i++) {
67
- if (!equals(one[oneKeys[i]], other[oneKeys[i]])) {
68
- return false;
69
- }
70
- }
71
- }
72
- return true;
73
- }
74
- function distinct(base, target) {
75
- const result = Object.create(null);
76
- if (!base || !target) {
77
- return result;
78
- }
79
- const targetKeys = ( (Object.keys(target)));
80
- targetKeys.forEach(k => {
81
- const baseValue = base[k];
82
- const targetValue = target[k];
83
- if (!equals(baseValue, targetValue)) {
84
- result[k] = targetValue;
85
- }
86
- });
87
- return result;
88
- }
89
24
  const ConfigurationChangedEvent = monaco.editor.ConfigurationChangedEvent;
90
25
  class ValidatedEditorOptions {
91
26
  constructor() {
@@ -139,7 +74,7 @@ class EditorOptionsUtil {
139
74
  return a === b;
140
75
  }
141
76
  if (Array.isArray(a) || Array.isArray(b)) {
142
- return (Array.isArray(a) && Array.isArray(b) ? equals$1(a, b) : false);
77
+ return (Array.isArray(a) && Array.isArray(b) ? equals(a, b) : false);
143
78
  }
144
79
  if (( (Object.keys(a))).length !== ( (Object.keys(b))).length) {
145
80
  return false;
@@ -247,7 +182,7 @@ const Extensions = {
247
182
  };
248
183
  const registry = ( Registry.as(Extensions.JSONContribution));
249
184
  function getJsonSchemas(fileMatchs = {}) {
250
- return Object.entries(registry.getSchemaContributions().schemas)
185
+ return ( Object.entries(registry.getSchemaContributions().schemas)
251
186
  .filter(([uri]) => uri !== 'vscode://schemas/vscode-extensions')
252
187
  .map(([uri, schema]) => {
253
188
  const path = monaco.Uri.parse(uri).path;
@@ -257,7 +192,7 @@ function getJsonSchemas(fileMatchs = {}) {
257
192
  schema,
258
193
  fileMatch: schemaName != null ? fileMatchs[schemaName] : undefined
259
194
  };
260
- });
195
+ }));
261
196
  }
262
197
  const onDidChangeJsonSchema = registry.onDidChangeSchema;
263
198
  export { Extensions, createConfiguredDiffEditor, createConfiguredEditor, getJsonSchemas, onDidChangeJsonSchema };
@@ -1,8 +1,7 @@
1
- import { n, a as assertAllDefined } from './polyfill.js';
2
- import { I as ILifecycleService } from './missing-services.js';
3
- import { _ as __decorate, E as Emitter, N as NotificationsFilter, a as __param, b as NeverShowAgainScope } from './contextkey.js';
4
- import { widgetShadow, registerColor, widgetBorder, contrastBorder, editorWidgetBackground, lighten, darken } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
5
- import { localize } from 'monaco-editor/esm/vs/nls.js';
1
+ import { n, b as assertAllDefined, o as onServicesInitialized } from './polyfill.js';
2
+ import { bL as ILifecycleService } from './missing-services.js';
3
+ import { _ as __decorate, E as Emitter, N as NotificationsFilter, a as __param, G as NeverShowAgainScope, d as IEditorGroupsService, t as IHostService } from './services2.js';
4
+ import { N as NotificationsToastsVisibleContext, a as NOTIFICATIONS_BACKGROUND, b as NOTIFICATIONS_TOAST_BORDER, c as NotificationsCenterVisibleContext, d as NOTIFICATIONS_CENTER_BORDER, e as NOTIFICATIONS_CENTER_HEADER_FOREGROUND, f as NOTIFICATIONS_CENTER_HEADER_BACKGROUND, i as isErrorWithActions, g as NotificationFocusedContext } from './contextkeys.js';
6
5
  import { Disposable, toDisposable, DisposableStore, dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
7
6
  import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
8
7
  import { NoOpNotification, Severity, INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
@@ -13,20 +12,16 @@ import { equals, isNonEmptyArray } from 'monaco-editor/esm/vs/base/common/arrays
13
12
  import { Action, ActionRunner } from 'monaco-editor/esm/vs/base/common/actions.js';
14
13
  import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
15
14
  import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
16
- import { c as IFileService, I as IEditorGroupsService, d as IHostService } from './services2.js';
17
- import { RawContextKey, IContextKeyService, ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
18
- import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
19
- import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
20
- import { isEqual, basename, dirname, extname } from 'monaco-editor/esm/vs/base/common/resources.js';
21
- import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
22
- import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
15
+ import { ICommandService, CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
23
16
  import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
24
17
  import { WorkbenchList, IListService } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
18
+ import { IContextKeyService, ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
25
19
  import { MenuRegistry, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
26
- import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
27
- import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
20
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
28
21
  import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
29
22
  import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
23
+ import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
24
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
30
25
  import { B as ButtonBar } from './button.js';
31
26
  import { Dimension, addDisposableListener, EventType, EventHelper, clearNode, scheduleAtNextAnimationFrame, isAncestor, $, trackFocus, getClientArea, isEventLike } from 'monaco-editor/esm/vs/base/browser/dom.js';
32
27
  import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
@@ -43,67 +38,18 @@ import { StandardKeyboardEvent } from 'monaco-editor/esm/vs/base/browser/keyboar
43
38
  import { DropdownMenuActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/dropdown/dropdownActionViewItem.js';
44
39
  import { assertIsDefined } from 'monaco-editor/esm/vs/base/common/types.js';
45
40
  import { I as IWorkbenchLayoutService } from './layoutService.js';
41
+ import { widgetShadow } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
46
42
  import { I as IntervalCounter } from './async.js';
47
43
  import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
48
44
  import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
49
45
  import { alert } from 'monaco-editor/esm/vs/base/browser/ui/aria/aria.js';
50
46
  import { g as getServiceOverride$1 } from './layout.js';
51
- import { o as onServicesInitialized } from './tools.js';
52
47
  import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
53
48
  import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
54
- function isErrorWithActions(obj) {
55
- const candidate = obj;
56
- return candidate instanceof Error && Array.isArray(candidate.actions);
57
- }
58
49
  var css$3 = ".monaco-workbench>.notifications-toasts{bottom:26px;display:none;overflow:hidden;position:absolute;right:3px;z-index:1000}.monaco-workbench.nostatusbar>.notifications-toasts{bottom:3px}.monaco-workbench>.notifications-toasts.visible{display:flex;flex-direction:column}.monaco-workbench>.notifications-toasts .notification-toast-container{overflow:hidden}.monaco-workbench>.notifications-toasts .notification-toast-container>.notification-toast{border-radius:4px;margin:8px;opacity:0;transform:translate3d(0,100%,0);transition:transform .3s ease-out,opacity .3s ease-out}.monaco-workbench.reduce-motion>.notifications-toasts .notification-toast-container>.notification-toast{transition:transform 0ms ease-out,opacity 0ms ease-out}.monaco-workbench>.notifications-toasts .notification-toast-container>.notification-toast.notification-fade-in{opacity:1;transform:none}.monaco-workbench>.notifications-toasts .notification-toast-container>.notification-toast.notification-fade-in-done{opacity:1;transform:none;transition:none}.monaco-workbench>.notifications-toasts .codicon.codicon-error{color:var(--vscode-notificationsErrorIcon-foreground)!important}.monaco-workbench>.notifications-toasts .codicon.codicon-warning{color:var(--vscode-notificationsWarningIcon-foreground)!important}.monaco-workbench>.notifications-toasts .codicon.codicon-info{color:var(--vscode-notificationsInfoIcon-foreground)!important}";
59
50
  n(css$3,{});
60
51
  var css$2 = ".monaco-workbench .notifications-list-container{background:var(--vscode-notifications-background);border-radius:inherit;color:var(--vscode-notifications-foreground);outline-color:var(--vscode-contrastBorder)}.monaco-workbench .notifications-list-container .notification-list-item{border-radius:4px;box-sizing:border-box;display:flex;flex-direction:column;flex-direction:column-reverse;height:100%;padding:10px 5px}.monaco-workbench .notifications-list-container .notification-offset-helper{word-wrap:break-word;line-height:22px;opacity:0;position:absolute}.monaco-workbench .notifications-list-container .monaco-scrollable-element{border-radius:4px}.monaco-workbench .notifications-list-container .notification-list-item>.notification-list-item-main-row{display:flex;flex-grow:1}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-icon{align-items:center;background-position:50%;background-repeat:no-repeat;display:flex;flex:0 0 16px;font-size:18px;height:22px;margin-left:4px;margin-right:4px}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-message{flex:1;line-height:22px;overflow:hidden;text-overflow:ellipsis;user-select:text;-webkit-user-select:text}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-message a{color:var(--vscode-notificationLink-foreground)}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-message a:focus{outline-color:var(--vscode-focusBorder);outline-style:solid;outline-width:1px}.monaco-workbench .notifications-list-container .notification-list-item.expanded .notification-list-item-message{word-wrap:break-word;white-space:normal}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-toolbar-container{display:none;height:22px}.monaco-workbench .notifications-list-container .monaco-list-row.focused .notification-list-item .notification-list-item-toolbar-container,.monaco-workbench .notifications-list-container .notification-list-item.expanded .notification-list-item-toolbar-container,.monaco-workbench .notifications-list-container .notification-list-item:hover .notification-list-item-toolbar-container{display:block}.monaco-workbench .notifications-list-container .notification-list-item>.notification-list-item-details-row{align-items:center;display:none;overflow:hidden;padding-left:5px}.monaco-workbench .notifications-list-container .notification-list-item.expanded>.notification-list-item-details-row{display:flex}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-source{flex:1;font-size:12px;overflow:hidden;text-overflow:ellipsis}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container{display:flex;overflow:hidden}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container>.monaco-button,.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container>.monaco-button-dropdown{margin:4px 5px}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container .monaco-button{outline-offset:2px!important}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container .monaco-text-button{display:inline-block;font-size:12px;overflow:hidden;padding:4px 10px;text-overflow:ellipsis;width:fit-content}.monaco-workbench .notifications-list-container .notification-list-item .notification-list-item-buttons-container .monaco-dropdown-button{padding:5px}.monaco-workbench .notifications-list-container .progress-bit{bottom:0;height:2px}";
61
52
  n(css$2,{});
62
- const NOTIFICATIONS_CENTER_BORDER = ( (registerColor('notificationCenter.border', {
63
- dark: widgetBorder,
64
- light: widgetBorder,
65
- hcDark: contrastBorder,
66
- hcLight: contrastBorder
67
- }, (localize(
68
- 'notificationCenterBorder',
69
- "Notifications center border color. Notifications slide in from the bottom right of the window."
70
- )))));
71
- const NOTIFICATIONS_TOAST_BORDER = ( (registerColor('notificationToast.border', {
72
- dark: widgetBorder,
73
- light: widgetBorder,
74
- hcDark: contrastBorder,
75
- hcLight: contrastBorder
76
- }, (localize(
77
- 'notificationToastBorder',
78
- "Notification toast border color. Notifications slide in from the bottom right of the window."
79
- )))));
80
- const NOTIFICATIONS_BACKGROUND = ( (registerColor('notifications.background', {
81
- dark: editorWidgetBackground,
82
- light: editorWidgetBackground,
83
- hcDark: editorWidgetBackground,
84
- hcLight: editorWidgetBackground
85
- }, (localize(
86
- 'notificationsBackground',
87
- "Notifications background color. Notifications slide in from the bottom right of the window."
88
- )))));
89
- const NOTIFICATIONS_CENTER_HEADER_FOREGROUND = ( (registerColor('notificationCenterHeader.foreground', {
90
- dark: null,
91
- light: null,
92
- hcDark: null,
93
- hcLight: null
94
- }, (localize(
95
- 'notificationCenterHeaderForeground',
96
- "Notifications center header foreground color. Notifications slide in from the bottom right of the window."
97
- )))));
98
- const NOTIFICATIONS_CENTER_HEADER_BACKGROUND = ( (registerColor('notificationCenterHeader.background', {
99
- dark: ( (lighten(NOTIFICATIONS_BACKGROUND, 0.3))),
100
- light: ( (darken(NOTIFICATIONS_BACKGROUND, 0.05))),
101
- hcDark: NOTIFICATIONS_BACKGROUND,
102
- hcLight: NOTIFICATIONS_BACKGROUND
103
- }, (localize(
104
- 'notificationCenterHeaderBackground',
105
- "Notifications center header background color. Notifications slide in from the bottom right of the window."
106
- )))));
107
53
  class NotificationHandle extends Disposable {
108
54
  constructor(item, onClose) {
109
55
  super();
@@ -516,7 +462,7 @@ class ChoiceAction extends Action {
516
462
  this._onDidRun = this._register(( (new Emitter())));
517
463
  this.onDidRun = this._onDidRun.event;
518
464
  this._keepOpen = !!choice.keepOpen;
519
- this._menu = !choice.isSecondary && choice.menu ? choice.menu.map((c, index) => ( (new ChoiceAction(`${id}.${index}`, c)))) : undefined;
465
+ this._menu = !choice.isSecondary && choice.menu ? ( (choice.menu.map((c, index) => ( (new ChoiceAction(`${id}.${index}`, c)))))) : undefined;
520
466
  }
521
467
  get menu() {
522
468
  return this._menu;
@@ -574,168 +520,9 @@ NotificationsTelemetry = ( (__decorate([
574
520
  ( (__param(0, ITelemetryService))),
575
521
  ( (__param(1, INotificationService)))
576
522
  ], NotificationsTelemetry)));
577
- const MultipleEditorGroupsContext = ( (new RawContextKey(
578
- 'multipleEditorGroups',
579
- false,
580
- (localize('multipleEditorGroups', "Whether there are multiple editor groups opened"))
581
- )));
582
- MultipleEditorGroupsContext.toNegated();
583
- const NotificationFocusedContext = ( (new RawContextKey(
584
- 'notificationFocus',
585
- true,
586
- (localize('notificationFocus', "Whether a notification has keyboard focus"))
587
- )));
588
- const NotificationsCenterVisibleContext = ( (new RawContextKey(
589
- 'notificationCenterVisible',
590
- false,
591
- (localize('notificationCenterVisible', "Whether the notifications center is visible"))
592
- )));
593
- const NotificationsToastsVisibleContext = ( (new RawContextKey(
594
- 'notificationToastsVisible',
595
- false,
596
- (localize('notificationToastsVisible', "Whether a notification toast is visible"))
597
- )));
598
- let ResourceContextKey = class ResourceContextKey {
599
- constructor(_contextKeyService, _fileService, _languageService, _modelService) {
600
- this._contextKeyService = _contextKeyService;
601
- this._fileService = _fileService;
602
- this._languageService = _languageService;
603
- this._modelService = _modelService;
604
- this._disposables = ( (new DisposableStore()));
605
- this._schemeKey = ResourceContextKey.Scheme.bindTo(this._contextKeyService);
606
- this._filenameKey = ResourceContextKey.Filename.bindTo(this._contextKeyService);
607
- this._dirnameKey = ResourceContextKey.Dirname.bindTo(this._contextKeyService);
608
- this._pathKey = ResourceContextKey.Path.bindTo(this._contextKeyService);
609
- this._langIdKey = ResourceContextKey.LangId.bindTo(this._contextKeyService);
610
- this._resourceKey = ResourceContextKey.Resource.bindTo(this._contextKeyService);
611
- this._extensionKey = ResourceContextKey.Extension.bindTo(this._contextKeyService);
612
- this._hasResource = ResourceContextKey.HasResource.bindTo(this._contextKeyService);
613
- this._isFileSystemResource = ResourceContextKey.IsFileSystemResource.bindTo(this._contextKeyService);
614
- this._disposables.add(_fileService.onDidChangeFileSystemProviderRegistrations(() => {
615
- const resource = this.get();
616
- this._isFileSystemResource.set(Boolean(resource && _fileService.hasProvider(resource)));
617
- }));
618
- this._disposables.add(_modelService.onModelAdded(model => {
619
- if (isEqual(model.uri, this.get())) {
620
- this._setLangId();
621
- }
622
- }));
623
- this._disposables.add(_modelService.onModelLanguageChanged(e => {
624
- if (isEqual(e.model.uri, this.get())) {
625
- this._setLangId();
626
- }
627
- }));
628
- }
629
- dispose() {
630
- this._disposables.dispose();
631
- }
632
- _setLangId() {
633
- const value = this.get();
634
- if (!value) {
635
- this._langIdKey.set(null);
636
- return;
637
- }
638
- const langId = this._modelService.getModel(value)?.getLanguageId() ?? this._languageService.guessLanguageIdByFilepathOrFirstLine(value);
639
- this._langIdKey.set(langId);
640
- }
641
- set(value) {
642
- value = value ?? undefined;
643
- if (isEqual(this._value, value)) {
644
- return;
645
- }
646
- this._value = value;
647
- this._contextKeyService.bufferChangeEvents(() => {
648
- this._resourceKey.set(value ? ( (value.toString())) : null);
649
- this._schemeKey.set(value ? value.scheme : null);
650
- this._filenameKey.set(value ? basename(value) : null);
651
- this._dirnameKey.set(value ? this.uriToPath(dirname(value)) : null);
652
- this._pathKey.set(value ? this.uriToPath(value) : null);
653
- this._setLangId();
654
- this._extensionKey.set(value ? extname(value) : null);
655
- this._hasResource.set(Boolean(value));
656
- this._isFileSystemResource.set(value ? this._fileService.hasProvider(value) : false);
657
- });
658
- }
659
- uriToPath(uri) {
660
- if (uri.scheme === Schemas.file) {
661
- return uri.fsPath;
662
- }
663
- return uri.path;
664
- }
665
- reset() {
666
- this._value = undefined;
667
- this._contextKeyService.bufferChangeEvents(() => {
668
- this._resourceKey.reset();
669
- this._schemeKey.reset();
670
- this._filenameKey.reset();
671
- this._dirnameKey.reset();
672
- this._pathKey.reset();
673
- this._langIdKey.reset();
674
- this._extensionKey.reset();
675
- this._hasResource.reset();
676
- this._isFileSystemResource.reset();
677
- });
678
- }
679
- get() {
680
- return this._value;
681
- }
682
- };
683
- ResourceContextKey.Scheme = ( (new RawContextKey(
684
- 'resourceScheme',
685
- undefined,
686
- { type: 'string', description: ( (localize('resourceScheme', "The scheme of the resource"))) }
687
- )));
688
- ResourceContextKey.Filename = ( (new RawContextKey(
689
- 'resourceFilename',
690
- undefined,
691
- { type: 'string', description: ( (localize('resourceFilename', "The file name of the resource"))) }
692
- )));
693
- ResourceContextKey.Dirname = ( (new RawContextKey(
694
- 'resourceDirname',
695
- undefined,
696
- { type: 'string', description: ( (localize('resourceDirname', "The folder name the resource is contained in"))) }
697
- )));
698
- ResourceContextKey.Path = ( (new RawContextKey(
699
- 'resourcePath',
700
- undefined,
701
- { type: 'string', description: ( (localize('resourcePath', "The full path of the resource"))) }
702
- )));
703
- ResourceContextKey.LangId = ( (new RawContextKey(
704
- 'resourceLangId',
705
- undefined,
706
- { type: 'string', description: ( (localize('resourceLangId', "The language identifier of the resource"))) }
707
- )));
708
- ResourceContextKey.Resource = ( (new RawContextKey(
709
- 'resource',
710
- undefined,
711
- { type: 'URI', description: ( (localize('resource', "The full value of the resource including scheme and path"))) }
712
- )));
713
- ResourceContextKey.Extension = ( (new RawContextKey(
714
- 'resourceExtname',
715
- undefined,
716
- { type: 'string', description: ( (localize('resourceExtname', "The extension name of the resource"))) }
717
- )));
718
- ResourceContextKey.HasResource = ( (new RawContextKey(
719
- 'resourceSet',
720
- undefined,
721
- { type: 'boolean', description: ( (localize('resourceSet', "Whether a resource is present or not"))) }
722
- )));
723
- ResourceContextKey.IsFileSystemResource = ( (new RawContextKey(
724
- 'isFileSystemResource',
725
- undefined,
726
- { type: 'boolean', description: ( (localize(
727
- 'isFileSystemResource',
728
- "Whether the resource is backed by a file system provider"
729
- ))) }
730
- )));
731
- ResourceContextKey = ( (__decorate([
732
- ( (__param(0, IContextKeyService))),
733
- ( (__param(1, IFileService))),
734
- ( (__param(2, ILanguageService))),
735
- ( (__param(3, IModelService)))
736
- ], ResourceContextKey)));
737
523
  const SHOW_NOTIFICATIONS_CENTER = 'notifications.showList';
738
524
  const HIDE_NOTIFICATIONS_CENTER = 'notifications.hideList';
525
+ const TOGGLE_NOTIFICATIONS_CENTER = 'notifications.toggleList';
739
526
  const HIDE_NOTIFICATION_TOAST = 'notifications.hideToasts';
740
527
  const FOCUS_NOTIFICATION_TOAST = 'notifications.focusToasts';
741
528
  const FOCUS_NEXT_NOTIFICATION_TOAST = 'notifications.focusNextToast';
@@ -762,6 +549,10 @@ function registerNotificationCommands(center, toasts, model) {
762
549
  }
763
550
  return undefined;
764
551
  }
552
+ CommandsRegistry.registerCommand(SHOW_NOTIFICATIONS_CENTER, () => {
553
+ toasts.hide();
554
+ center.show();
555
+ });
765
556
  KeybindingsRegistry.registerCommandAndKeybindingRule({
766
557
  id: HIDE_NOTIFICATIONS_CENTER,
767
558
  weight: 200 + 50,
@@ -777,6 +568,15 @@ function registerNotificationCommands(center, toasts, model) {
777
568
  center.hide();
778
569
  }
779
570
  });
571
+ CommandsRegistry.registerCommand(TOGGLE_NOTIFICATIONS_CENTER, accessor => {
572
+ if (center.isVisible) {
573
+ center.hide();
574
+ }
575
+ else {
576
+ toasts.hide();
577
+ center.show();
578
+ }
579
+ });
780
580
  KeybindingsRegistry.registerCommandAndKeybindingRule({
781
581
  id: CLEAR_NOTIFICATION,
782
582
  weight: 200 ,
@@ -823,6 +623,15 @@ function registerNotificationCommands(center, toasts, model) {
823
623
  notification?.toggle();
824
624
  }
825
625
  });
626
+ CommandsRegistry.registerCommand(HIDE_NOTIFICATION_TOAST, accessor => {
627
+ const telemetryService = accessor.get(ITelemetryService);
628
+ for (const notification of model.notifications) {
629
+ if (notification.visible) {
630
+ telemetryService.publicLog2('notification:hide', notificationToMetrics(notification.message.original, notification.sourceId, notification.silent));
631
+ }
632
+ }
633
+ toasts.hide();
634
+ });
826
635
  KeybindingsRegistry.registerKeybindingRule({
827
636
  id: HIDE_NOTIFICATION_TOAST,
828
637
  weight: 200 - 50,
@@ -835,6 +644,7 @@ function registerNotificationCommands(center, toasts, model) {
835
644
  when: ( (ContextKeyExpr.and(NotificationsToastsVisibleContext, NotificationFocusedContext))),
836
645
  primary: 9
837
646
  });
647
+ CommandsRegistry.registerCommand(FOCUS_NOTIFICATION_TOAST, () => toasts.focus());
838
648
  KeybindingsRegistry.registerCommandAndKeybindingRule({
839
649
  id: FOCUS_NEXT_NOTIFICATION_TOAST,
840
650
  weight: 200 ,
@@ -873,6 +683,11 @@ function registerNotificationCommands(center, toasts, model) {
873
683
  toasts.focusLast();
874
684
  }
875
685
  });
686
+ CommandsRegistry.registerCommand(CLEAR_ALL_NOTIFICATIONS, () => center.clearAll());
687
+ CommandsRegistry.registerCommand(TOGGLE_DO_NOT_DISTURB_MODE, accessor => {
688
+ const notificationService = accessor.get(INotificationService);
689
+ notificationService.doNotDisturbMode = !notificationService.doNotDisturbMode;
690
+ });
876
691
  const category = { value: ( (localize('notifications', "Notifications"))), original: 'Notifications' };
877
692
  MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: SHOW_NOTIFICATIONS_CENTER, title: { value: ( (localize('showNotifications', "Show Notifications"))), original: 'Show Notifications' }, category } });
878
693
  MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: HIDE_NOTIFICATIONS_CENTER, title: { value: ( (localize('hideNotifications', "Hide Notifications"))), original: 'Hide Notifications' }, category }, when: NotificationsCenterVisibleContext });
@@ -880,13 +695,41 @@ function registerNotificationCommands(center, toasts, model) {
880
695
  MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: TOGGLE_DO_NOT_DISTURB_MODE, title: { value: ( (localize('toggleDoNotDisturbMode', "Toggle Do Not Disturb Mode"))), original: 'Toggle Do Not Disturb Mode' }, category } });
881
696
  MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: FOCUS_NOTIFICATION_TOAST, title: { value: ( (localize('focusNotificationToasts', "Focus Notification Toast"))), original: 'Focus Notification Toast' }, category }, when: NotificationsToastsVisibleContext });
882
697
  }
883
- const clearIcon = registerIcon('notifications-clear', Codicon.close, ( (localize('clearIcon', 'Icon for the clear action in notifications.'))));
884
- const clearAllIcon = registerIcon('notifications-clear-all', Codicon.clearAll, ( (localize('clearAllIcon', 'Icon for the clear all action in notifications.'))));
885
- const hideIcon = registerIcon('notifications-hide', Codicon.chevronDown, ( (localize('hideIcon', 'Icon for the hide action in notifications.'))));
886
- const expandIcon = registerIcon('notifications-expand', Codicon.chevronUp, ( (localize('expandIcon', 'Icon for the expand action in notifications.'))));
887
- const collapseIcon = registerIcon('notifications-collapse', Codicon.chevronDown, ( (localize('collapseIcon', 'Icon for the collapse action in notifications.'))));
888
- const configureIcon = registerIcon('notifications-configure', Codicon.gear, ( (localize('configureIcon', 'Icon for the configure action in notifications.'))));
889
- const doNotDisturbIcon = registerIcon('notifications-do-not-disturb', Codicon.bellSlash, ( (localize('doNotDisturbIcon', 'Icon for the mute all action in notifications.'))));
698
+ const clearIcon = ( (registerIcon(
699
+ 'notifications-clear',
700
+ Codicon.close,
701
+ (localize('clearIcon', 'Icon for the clear action in notifications.'))
702
+ )));
703
+ const clearAllIcon = ( (registerIcon(
704
+ 'notifications-clear-all',
705
+ Codicon.clearAll,
706
+ (localize('clearAllIcon', 'Icon for the clear all action in notifications.'))
707
+ )));
708
+ const hideIcon = ( (registerIcon(
709
+ 'notifications-hide',
710
+ Codicon.chevronDown,
711
+ (localize('hideIcon', 'Icon for the hide action in notifications.'))
712
+ )));
713
+ const expandIcon = ( (registerIcon(
714
+ 'notifications-expand',
715
+ Codicon.chevronUp,
716
+ (localize('expandIcon', 'Icon for the expand action in notifications.'))
717
+ )));
718
+ const collapseIcon = ( (registerIcon(
719
+ 'notifications-collapse',
720
+ Codicon.chevronDown,
721
+ (localize('collapseIcon', 'Icon for the collapse action in notifications.'))
722
+ )));
723
+ const configureIcon = ( (registerIcon(
724
+ 'notifications-configure',
725
+ Codicon.gear,
726
+ (localize('configureIcon', 'Icon for the configure action in notifications.'))
727
+ )));
728
+ const doNotDisturbIcon = ( (registerIcon(
729
+ 'notifications-do-not-disturb',
730
+ Codicon.bellSlash,
731
+ (localize('doNotDisturbIcon', 'Icon for the mute all action in notifications.'))
732
+ )));
890
733
  let ClearNotificationAction = class ClearNotificationAction extends Action {
891
734
  constructor(id, label, commandService) {
892
735
  super(id, label, ThemeIcon.asClassName(clearIcon));