@codingame/monaco-vscode-views-service-override 2.1.4 → 2.2.0-next.2

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 (107) hide show
  1. package/index.d.ts +11 -9
  2. package/index.js +8 -6
  3. package/package.json +11 -11
  4. package/tools/views.d.ts +102 -0
  5. package/tools/views.js +253 -0
  6. package/views.d.ts +4 -99
  7. package/views.js +52 -280
  8. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
  9. package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +0 -180
  10. package/vscode/src/vs/base/browser/ui/grid/grid.js +0 -494
  11. package/vscode/src/vs/base/browser/ui/grid/gridview.css.js +0 -6
  12. package/vscode/src/vs/base/browser/ui/grid/gridview.js +0 -1112
  13. package/vscode/src/vs/base/common/codicons.d.ts +0 -579
  14. package/vscode/src/vs/platform/webview/common/mimeTypes.js +0 -24
  15. package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +0 -64
  16. package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +0 -790
  17. package/vscode/src/vs/workbench/browser/actions/listCommands.js +0 -764
  18. package/vscode/src/vs/workbench/browser/layout.d.ts +0 -26
  19. package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +0 -612
  20. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +0 -6
  21. package/vscode/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css.js +0 -6
  22. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +0 -150
  23. package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +0 -6
  24. package/vscode/src/vs/workbench/browser/parts/compositeBar.js +0 -605
  25. package/vscode/src/vs/workbench/browser/parts/compositePart.js +0 -335
  26. package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +0 -223
  27. package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +0 -1407
  28. package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +0 -186
  29. package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +0 -511
  30. package/vscode/src/vs/workbench/browser/parts/editor/editorPane.d.ts +0 -112
  31. package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +0 -1020
  32. package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +0 -391
  33. package/vscode/src/vs/workbench/browser/parts/editor/media/editordroptarget.css.js +0 -6
  34. package/vscode/src/vs/workbench/browser/parts/media/compositepart.css.js +0 -6
  35. package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +0 -6
  36. package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +0 -645
  37. package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +0 -379
  38. package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +0 -68
  39. package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +0 -146
  40. package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +0 -6
  41. package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +0 -222
  42. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +0 -299
  43. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +0 -365
  44. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +0 -135
  45. package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +0 -6
  46. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +0 -17
  47. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +0 -145
  48. package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +0 -214
  49. package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +0 -6
  50. package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +0 -78
  51. package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +0 -63
  52. package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +0 -119
  53. package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -6
  54. package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +0 -79
  55. package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorHandler.js +0 -74
  56. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +0 -256
  57. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +0 -99
  58. package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +0 -444
  59. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -432
  60. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  61. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -488
  62. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
  63. package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +0 -152
  64. package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +0 -63
  65. package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +0 -409
  66. package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +0 -6
  67. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +0 -693
  68. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +0 -240
  69. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +0 -77
  70. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +0 -42
  71. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +0 -71
  72. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +0 -348
  73. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +0 -98
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +0 -146
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +0 -105
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +0 -401
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +0 -197
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +0 -41
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +0 -128
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +0 -6
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +0 -612
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +0 -158
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +0 -264
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +0 -173
  85. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +0 -6
  86. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +0 -282
  87. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +0 -360
  88. package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +0 -133
  89. package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +0 -290
  90. package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +0 -96
  91. package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +0 -88
  92. package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +0 -79
  93. package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +0 -648
  94. package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +0 -65
  95. package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +0 -59
  96. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +0 -142
  97. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +0 -121
  98. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +0 -68
  99. package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +0 -235
  100. package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -145
  101. package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +0 -670
  102. package/vscode/src/vs/workbench/services/history/browser/historyService.js +0 -1484
  103. package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +0 -6
  104. package/vscode/src/vs/workbench/services/progress/browser/progressService.js +0 -523
  105. package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +0 -101
  106. package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +0 -713
  107. package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +0 -598
@@ -1,152 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { Disposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import { URI } from 'vscode/vscode/vs/base/common/uri';
5
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
6
- import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
7
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
8
- import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
9
- import { Severity, NeverShowAgainScope, NotificationPriority, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
10
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
11
- import { isAbsolute } from 'vscode/vscode/vs/base/common/path';
12
- import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
13
- import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
14
-
15
- let WorkspaceWatcher = class WorkspaceWatcher extends Disposable {
16
- constructor(fileService, configurationService, contextService, notificationService, openerService, uriIdentityService, hostService) {
17
- super();
18
- this.fileService = fileService;
19
- this.configurationService = configurationService;
20
- this.contextService = contextService;
21
- this.notificationService = notificationService;
22
- this.openerService = openerService;
23
- this.uriIdentityService = uriIdentityService;
24
- this.hostService = hostService;
25
- this.watchedWorkspaces = ( new ResourceMap(resource => this.uriIdentityService.extUri.getComparisonKey(resource)));
26
- this.registerListeners();
27
- this.refresh();
28
- }
29
- registerListeners() {
30
- this._register(this.contextService.onDidChangeWorkspaceFolders(e => this.onDidChangeWorkspaceFolders(e)));
31
- this._register(this.contextService.onDidChangeWorkbenchState(() => this.onDidChangeWorkbenchState()));
32
- this._register(this.configurationService.onDidChangeConfiguration(e => this.onDidChangeConfiguration(e)));
33
- this._register(this.fileService.onDidWatchError(error => this.onDidWatchError(error)));
34
- }
35
- onDidChangeWorkspaceFolders(e) {
36
- for (const removed of e.removed) {
37
- this.unwatchWorkspace(removed);
38
- }
39
- for (const added of e.added) {
40
- this.watchWorkspace(added);
41
- }
42
- }
43
- onDidChangeWorkbenchState() {
44
- this.refresh();
45
- }
46
- onDidChangeConfiguration(e) {
47
- if (e.affectsConfiguration('files.watcherExclude') || e.affectsConfiguration('files.watcherInclude')) {
48
- this.refresh();
49
- }
50
- }
51
- onDidWatchError(error) {
52
- const msg = ( error.toString());
53
- if (msg.indexOf('ENOSPC') >= 0) {
54
- this.notificationService.prompt(Severity.Warning, ( localizeWithPath(
55
- 'vs/workbench/contrib/files/browser/workspaceWatcher',
56
- 'enospcError',
57
- "Unable to watch for file changes. Please follow the instructions link to resolve this issue."
58
- )), [{
59
- label: ( localizeWithPath(
60
- 'vs/workbench/contrib/files/browser/workspaceWatcher',
61
- 'learnMore',
62
- "Instructions"
63
- )),
64
- run: () => this.openerService.open(( URI.parse('https://go.microsoft.com/fwlink/?linkid=867693')))
65
- }], {
66
- sticky: true,
67
- neverShowAgain: { id: 'ignoreEnospcError', isSecondary: true, scope: NeverShowAgainScope.WORKSPACE }
68
- });
69
- }
70
- else if (msg.indexOf('EUNKNOWN') >= 0) {
71
- this.notificationService.prompt(Severity.Warning, ( localizeWithPath(
72
- 'vs/workbench/contrib/files/browser/workspaceWatcher',
73
- 'eshutdownError',
74
- "File changes watcher stopped unexpectedly. A reload of the window may enable the watcher again unless the workspace cannot be watched for file changes."
75
- )), [{
76
- label: ( localizeWithPath('vs/workbench/contrib/files/browser/workspaceWatcher', 'reload', "Reload")),
77
- run: () => this.hostService.reload()
78
- }], {
79
- sticky: true,
80
- priority: NotificationPriority.SILENT
81
- });
82
- }
83
- }
84
- watchWorkspace(workspace) {
85
- const excludes = [];
86
- const config = this.configurationService.getValue({ resource: workspace.uri });
87
- if (config.files?.watcherExclude) {
88
- for (const key in config.files.watcherExclude) {
89
- if (config.files.watcherExclude[key] === true) {
90
- excludes.push(key);
91
- }
92
- }
93
- }
94
- const pathsToWatch = ( new ResourceMap(uri => this.uriIdentityService.extUri.getComparisonKey(uri)));
95
- pathsToWatch.set(workspace.uri, workspace.uri);
96
- if (config.files?.watcherInclude) {
97
- for (const includePath of config.files.watcherInclude) {
98
- if (!includePath) {
99
- continue;
100
- }
101
- if (isAbsolute(includePath)) {
102
- const candidate = URI.file(includePath).with({ scheme: workspace.uri.scheme });
103
- if (this.uriIdentityService.extUri.isEqualOrParent(candidate, workspace.uri)) {
104
- pathsToWatch.set(candidate, candidate);
105
- }
106
- }
107
- else {
108
- const candidate = workspace.toResource(includePath);
109
- pathsToWatch.set(candidate, candidate);
110
- }
111
- }
112
- }
113
- const disposables = ( new DisposableStore());
114
- for (const [, pathToWatch] of pathsToWatch) {
115
- disposables.add(this.fileService.watch(pathToWatch, { recursive: true, excludes }));
116
- }
117
- this.watchedWorkspaces.set(workspace.uri, disposables);
118
- }
119
- unwatchWorkspace(workspace) {
120
- if (( this.watchedWorkspaces.has(workspace.uri))) {
121
- dispose(this.watchedWorkspaces.get(workspace.uri));
122
- this.watchedWorkspaces.delete(workspace.uri);
123
- }
124
- }
125
- refresh() {
126
- this.unwatchWorkspaces();
127
- for (const folder of this.contextService.getWorkspace().folders) {
128
- this.watchWorkspace(folder);
129
- }
130
- }
131
- unwatchWorkspaces() {
132
- for (const [, disposable] of this.watchedWorkspaces) {
133
- disposable.dispose();
134
- }
135
- this.watchedWorkspaces.clear();
136
- }
137
- dispose() {
138
- super.dispose();
139
- this.unwatchWorkspaces();
140
- }
141
- };
142
- WorkspaceWatcher = ( __decorate([
143
- ( __param(0, IFileService)),
144
- ( __param(1, IConfigurationService)),
145
- ( __param(2, IWorkspaceContextService)),
146
- ( __param(3, INotificationService)),
147
- ( __param(4, IOpenerService)),
148
- ( __param(5, IUriIdentityService)),
149
- ( __param(6, IHostService))
150
- ], WorkspaceWatcher));
151
-
152
- export { WorkspaceWatcher };
@@ -1,63 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
4
- import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
5
- import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
6
- import { NumberBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
7
- import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService';
8
- import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
9
-
10
- let DirtyFilesIndicator = class DirtyFilesIndicator extends Disposable {
11
- constructor(lifecycleService, activityService, workingCopyService, filesConfigurationService) {
12
- super();
13
- this.lifecycleService = lifecycleService;
14
- this.activityService = activityService;
15
- this.workingCopyService = workingCopyService;
16
- this.filesConfigurationService = filesConfigurationService;
17
- this.badgeHandle = this._register(( new MutableDisposable()));
18
- this.lastKnownDirtyCount = 0;
19
- this.updateActivityBadge();
20
- this.registerListeners();
21
- }
22
- registerListeners() {
23
- this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.onWorkingCopyDidChangeDirty(workingCopy)));
24
- this.lifecycleService.onDidShutdown(() => this.dispose());
25
- }
26
- onWorkingCopyDidChangeDirty(workingCopy) {
27
- const gotDirty = workingCopy.isDirty();
28
- if (gotDirty && !((workingCopy.capabilities & 2) ) && this.filesConfigurationService.hasShortAutoSaveDelay(workingCopy.resource)) {
29
- return;
30
- }
31
- if (gotDirty || this.lastKnownDirtyCount > 0) {
32
- this.updateActivityBadge();
33
- }
34
- }
35
- updateActivityBadge() {
36
- const dirtyCount = this.lastKnownDirtyCount = this.workingCopyService.dirtyCount;
37
- if (dirtyCount > 0) {
38
- this.badgeHandle.value = this.activityService.showViewContainerActivity(VIEWLET_ID, {
39
- badge: ( new NumberBadge(dirtyCount, num => num === 1 ? ( localizeWithPath(
40
- 'vs/workbench/contrib/files/common/dirtyFilesIndicator',
41
- 'dirtyFile',
42
- "1 unsaved file"
43
- )) : ( localizeWithPath(
44
- 'vs/workbench/contrib/files/common/dirtyFilesIndicator',
45
- 'dirtyFiles',
46
- "{0} unsaved files",
47
- dirtyCount
48
- )))),
49
- });
50
- }
51
- else {
52
- this.badgeHandle.clear();
53
- }
54
- }
55
- };
56
- DirtyFilesIndicator = ( __decorate([
57
- ( __param(0, ILifecycleService)),
58
- ( __param(1, IActivityService)),
59
- ( __param(2, IWorkingCopyService)),
60
- ( __param(3, IFilesConfigurationService))
61
- ], DirtyFilesIndicator));
62
-
63
- export { DirtyFilesIndicator };
@@ -1,409 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import './media/languageStatus.css.js';
3
- import { getWindow, addDisposableListener, append } from 'vscode/vscode/vs/base/browser/dom';
4
- import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
5
- import { DisposableStore, dispose, toDisposable, Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
6
- import Severity from 'vscode/vscode/vs/base/common/severity';
7
- import { getCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
8
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
9
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
10
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
11
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
12
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
13
- import { ILanguageStatusService } from 'vscode/vscode/vs/workbench/services/languageStatus/common/languageStatusService';
14
- import { ShowTooltipCommand, IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
15
- import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
16
- import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
17
- import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
18
- import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
19
- import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
20
- import { Action } from 'vscode/vscode/vs/base/common/actions';
21
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
22
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
23
- import { equals } from 'vscode/vscode/vs/base/common/arrays';
24
- import { URI } from 'vscode/vscode/vs/base/common/uri';
25
- import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
26
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
27
- import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
28
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
29
- import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
30
-
31
- var LanguageStatus_1;
32
- class LanguageStatusViewModel {
33
- constructor(combined, dedicated) {
34
- this.combined = combined;
35
- this.dedicated = dedicated;
36
- }
37
- isEqual(other) {
38
- return equals(this.combined, other.combined) && equals(this.dedicated, other.dedicated);
39
- }
40
- }
41
- let StoredCounter = class StoredCounter {
42
- constructor(_storageService, _key) {
43
- this._storageService = _storageService;
44
- this._key = _key;
45
- }
46
- get value() {
47
- return this._storageService.getNumber(this._key, 0 , 0);
48
- }
49
- increment() {
50
- const n = this.value + 1;
51
- this._storageService.store(this._key, n, 0 , 1 );
52
- return n;
53
- }
54
- };
55
- StoredCounter = ( __decorate([
56
- ( __param(0, IStorageService))
57
- ], StoredCounter));
58
- let LanguageStatusContribution = class LanguageStatusContribution extends Disposable {
59
- constructor(instantiationService, editorGroupService, editorService) {
60
- super();
61
- const mainInstantiationService = instantiationService.createChild(( new ServiceCollection([IEditorService, editorService.createScoped('main', this._store)])));
62
- this._register(mainInstantiationService.createInstance(LanguageStatus));
63
- this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(({ instantiationService, disposables }) => {
64
- disposables.add(instantiationService.createInstance(LanguageStatus));
65
- }));
66
- }
67
- };
68
- LanguageStatusContribution = ( __decorate([
69
- ( __param(0, IInstantiationService)),
70
- ( __param(1, IEditorGroupsService)),
71
- ( __param(2, IEditorService))
72
- ], LanguageStatusContribution));
73
- let LanguageStatus = class LanguageStatus {
74
- static { LanguageStatus_1 = this; }
75
- static { this._id = 'status.languageStatus'; }
76
- static { this._keyDedicatedItems = 'languageStatus.dedicated'; }
77
- constructor(_languageStatusService, _statusBarService, _editorService, _openerService, _storageService) {
78
- this._languageStatusService = _languageStatusService;
79
- this._statusBarService = _statusBarService;
80
- this._editorService = _editorService;
81
- this._openerService = _openerService;
82
- this._storageService = _storageService;
83
- this._disposables = ( new DisposableStore());
84
- this._dedicated = ( new Set());
85
- this._dedicatedEntries = ( new Map());
86
- this._renderDisposables = ( new DisposableStore());
87
- _storageService.onDidChangeValue(0 , LanguageStatus_1._keyDedicatedItems, this._disposables)(this._handleStorageChange, this, this._disposables);
88
- this._restoreState();
89
- this._interactionCounter = ( new StoredCounter(_storageService, 'languageStatus.interactCount'));
90
- _languageStatusService.onDidChange(this._update, this, this._disposables);
91
- _editorService.onDidActiveEditorChange(this._update, this, this._disposables);
92
- this._update();
93
- _statusBarService.onDidChangeEntryVisibility(e => {
94
- if (!e.visible && ( this._dedicated.has(e.id))) {
95
- this._dedicated.delete(e.id);
96
- this._update();
97
- this._storeState();
98
- }
99
- }, this._disposables);
100
- }
101
- dispose() {
102
- this._disposables.dispose();
103
- this._combinedEntry?.dispose();
104
- dispose(( this._dedicatedEntries.values()));
105
- this._renderDisposables.dispose();
106
- }
107
- _handleStorageChange() {
108
- this._restoreState();
109
- this._update();
110
- }
111
- _restoreState() {
112
- const raw = this._storageService.get(LanguageStatus_1._keyDedicatedItems, 0 , '[]');
113
- try {
114
- const ids = JSON.parse(raw);
115
- this._dedicated = ( new Set(ids));
116
- }
117
- catch {
118
- this._dedicated.clear();
119
- }
120
- }
121
- _storeState() {
122
- if (this._dedicated.size === 0) {
123
- this._storageService.remove(LanguageStatus_1._keyDedicatedItems, 0 );
124
- }
125
- else {
126
- const raw = JSON.stringify(Array.from(( this._dedicated.keys())));
127
- this._storageService.store(LanguageStatus_1._keyDedicatedItems, raw, 0 , 0 );
128
- }
129
- }
130
- _createViewModel(editor) {
131
- if (!editor?.hasModel()) {
132
- return ( new LanguageStatusViewModel([], []));
133
- }
134
- const all = this._languageStatusService.getLanguageStatus(editor.getModel());
135
- const combined = [];
136
- const dedicated = [];
137
- for (const item of all) {
138
- if (( this._dedicated.has(item.id))) {
139
- dedicated.push(item);
140
- }
141
- combined.push(item);
142
- }
143
- return ( new LanguageStatusViewModel(combined, dedicated));
144
- }
145
- _update() {
146
- const editor = getCodeEditor(this._editorService.activeTextEditorControl);
147
- const model = this._createViewModel(editor);
148
- if (this._model?.isEqual(model)) {
149
- return;
150
- }
151
- this._renderDisposables.clear();
152
- this._model = model;
153
- editor?.onDidChangeModelLanguage(this._update, this, this._renderDisposables);
154
- if (model.combined.length === 0) {
155
- this._combinedEntry?.dispose();
156
- this._combinedEntry = undefined;
157
- }
158
- else {
159
- const [first] = model.combined;
160
- const showSeverity = first.severity >= Severity.Warning;
161
- const text = LanguageStatus_1._severityToComboCodicon(first.severity);
162
- let isOneBusy = false;
163
- const ariaLabels = [];
164
- const element = document.createElement('div');
165
- for (const status of model.combined) {
166
- const isPinned = model.dedicated.includes(status);
167
- element.appendChild(this._renderStatus(status, showSeverity, isPinned, this._renderDisposables));
168
- ariaLabels.push(LanguageStatus_1._accessibilityInformation(status).label);
169
- isOneBusy = isOneBusy || (!isPinned && status.busy);
170
- }
171
- const props = {
172
- name: ( localizeWithPath(
173
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
174
- 'langStatus.name',
175
- "Editor Language Status"
176
- )),
177
- ariaLabel: ( localizeWithPath(
178
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
179
- 'langStatus.aria',
180
- "Editor Language Status: {0}",
181
- ariaLabels.join(', next: ')
182
- )),
183
- tooltip: element,
184
- command: ShowTooltipCommand,
185
- text: isOneBusy ? `${text}\u00A0\u00A0$(sync~spin)` : text,
186
- };
187
- if (!this._combinedEntry) {
188
- this._combinedEntry = this._statusBarService.addEntry(props, LanguageStatus_1._id, 1 , { id: 'status.editor.mode', alignment: 0 , compact: true });
189
- }
190
- else {
191
- this._combinedEntry.update(props);
192
- }
193
- const userHasInteractedWithStatus = this._interactionCounter.value >= 3;
194
- const targetWindow = getWindow(editor?.getContainerDomNode());
195
- const node = targetWindow.document.querySelector('.monaco-workbench .statusbar DIV#status\\.languageStatus A>SPAN.codicon');
196
- const container = targetWindow.document.querySelector('.monaco-workbench .statusbar DIV#status\\.languageStatus');
197
- if (node instanceof HTMLElement && container) {
198
- const _wiggle = 'wiggle';
199
- const _flash = 'flash';
200
- if (!isOneBusy) {
201
- node.classList.toggle(_wiggle, showSeverity || !userHasInteractedWithStatus);
202
- this._renderDisposables.add(addDisposableListener(node, 'animationend', _e => node.classList.remove(_wiggle)));
203
- container.classList.toggle(_flash, showSeverity);
204
- this._renderDisposables.add(addDisposableListener(container, 'animationend', _e => container.classList.remove(_flash)));
205
- }
206
- else {
207
- node.classList.remove(_wiggle);
208
- container.classList.remove(_flash);
209
- }
210
- }
211
- if (!userHasInteractedWithStatus) {
212
- const hoverTarget = targetWindow.document.querySelector('.monaco-workbench .context-view');
213
- if (hoverTarget instanceof HTMLElement) {
214
- const observer = ( new MutationObserver(() => {
215
- if (targetWindow.document.contains(element)) {
216
- this._interactionCounter.increment();
217
- observer.disconnect();
218
- }
219
- }));
220
- observer.observe(hoverTarget, { childList: true, subtree: true });
221
- this._renderDisposables.add(toDisposable(() => observer.disconnect()));
222
- }
223
- }
224
- }
225
- const newDedicatedEntries = ( new Map());
226
- for (const status of model.dedicated) {
227
- const props = LanguageStatus_1._asStatusbarEntry(status);
228
- let entry = this._dedicatedEntries.get(status.id);
229
- if (!entry) {
230
- entry = this._statusBarService.addEntry(props, status.id, 1 , { id: 'status.editor.mode', alignment: 1 });
231
- }
232
- else {
233
- entry.update(props);
234
- this._dedicatedEntries.delete(status.id);
235
- }
236
- newDedicatedEntries.set(status.id, entry);
237
- }
238
- dispose(( this._dedicatedEntries.values()));
239
- this._dedicatedEntries = newDedicatedEntries;
240
- }
241
- _renderStatus(status, showSeverity, isPinned, store) {
242
- const parent = document.createElement('div');
243
- parent.classList.add('hover-language-status');
244
- const severity = document.createElement('div');
245
- severity.classList.add('severity', `sev${status.severity}`);
246
- severity.classList.toggle('show', showSeverity);
247
- const severityText = LanguageStatus_1._severityToSingleCodicon(status.severity);
248
- append(severity, ...renderLabelWithIcons(severityText));
249
- parent.appendChild(severity);
250
- const element = document.createElement('div');
251
- element.classList.add('element');
252
- parent.appendChild(element);
253
- const left = document.createElement('div');
254
- left.classList.add('left');
255
- element.appendChild(left);
256
- const label = document.createElement('span');
257
- label.classList.add('label');
258
- const labelValue = typeof status.label === 'string' ? status.label : status.label.value;
259
- append(label, ...renderLabelWithIcons(status.busy ? `$(sync~spin)\u00A0\u00A0${labelValue}` : labelValue));
260
- left.appendChild(label);
261
- const detail = document.createElement('span');
262
- detail.classList.add('detail');
263
- this._renderTextPlus(detail, status.detail, store);
264
- left.appendChild(detail);
265
- const right = document.createElement('div');
266
- right.classList.add('right');
267
- element.appendChild(right);
268
- const { command } = status;
269
- if (command) {
270
- store.add(( new Link(right, {
271
- label: command.title,
272
- title: command.tooltip,
273
- href: ( ( URI.from({
274
- scheme: 'command', path: command.id, query: command.arguments && JSON.stringify(command.arguments)
275
- })).toString())
276
- }, undefined, this._openerService)));
277
- }
278
- const actionBar = ( new ActionBar(right, {}));
279
- store.add(actionBar);
280
- let action;
281
- if (!isPinned) {
282
- action = ( new Action('pin', ( localizeWithPath(
283
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
284
- 'pin',
285
- "Add to Status Bar"
286
- )), ThemeIcon.asClassName(Codicon.pin), true, () => {
287
- this._dedicated.add(status.id);
288
- this._statusBarService.updateEntryVisibility(status.id, true);
289
- this._update();
290
- this._storeState();
291
- }));
292
- }
293
- else {
294
- action = ( new Action('unpin', ( localizeWithPath(
295
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
296
- 'unpin',
297
- "Remove from Status Bar"
298
- )), ThemeIcon.asClassName(Codicon.pinned), true, () => {
299
- this._dedicated.delete(status.id);
300
- this._statusBarService.updateEntryVisibility(status.id, false);
301
- this._update();
302
- this._storeState();
303
- }));
304
- }
305
- actionBar.push(action, { icon: true, label: false });
306
- store.add(action);
307
- return parent;
308
- }
309
- static _severityToComboCodicon(sev) {
310
- switch (sev) {
311
- case Severity.Error: return '$(bracket-error)';
312
- case Severity.Warning: return '$(bracket-dot)';
313
- default: return '$(bracket)';
314
- }
315
- }
316
- static _severityToSingleCodicon(sev) {
317
- switch (sev) {
318
- case Severity.Error: return '$(error)';
319
- case Severity.Warning: return '$(info)';
320
- default: return '$(check)';
321
- }
322
- }
323
- _renderTextPlus(target, text, store) {
324
- for (const node of parseLinkedText(text).nodes) {
325
- if (typeof node === 'string') {
326
- const parts = renderLabelWithIcons(node);
327
- append(target, ...parts);
328
- }
329
- else {
330
- store.add(( new Link(target, node, undefined, this._openerService)));
331
- }
332
- }
333
- }
334
- static _accessibilityInformation(status) {
335
- if (status.accessibilityInfo) {
336
- return status.accessibilityInfo;
337
- }
338
- const textValue = typeof status.label === 'string' ? status.label : status.label.value;
339
- if (status.detail) {
340
- return { label: ( localizeWithPath(
341
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
342
- 'aria.1',
343
- '{0}, {1}',
344
- textValue,
345
- status.detail
346
- )) };
347
- }
348
- else {
349
- return { label: ( localizeWithPath(
350
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
351
- 'aria.2',
352
- '{0}',
353
- textValue
354
- )) };
355
- }
356
- }
357
- static _asStatusbarEntry(item) {
358
- let kind;
359
- if (item.severity === Severity.Warning) {
360
- kind = 'warning';
361
- }
362
- else if (item.severity === Severity.Error) {
363
- kind = 'error';
364
- }
365
- const textValue = typeof item.label === 'string' ? item.label : item.label.shortValue;
366
- return {
367
- name: ( localizeWithPath(
368
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
369
- 'name.pattern',
370
- '{0} (Language Status)',
371
- item.name
372
- )),
373
- text: item.busy ? `${textValue}\u00A0\u00A0$(sync~spin)` : textValue,
374
- ariaLabel: LanguageStatus_1._accessibilityInformation(item).label,
375
- role: item.accessibilityInfo?.role,
376
- tooltip: item.command?.tooltip || ( new MarkdownString(item.detail, { isTrusted: true, supportThemeIcons: true })),
377
- kind,
378
- command: item.command
379
- };
380
- }
381
- };
382
- LanguageStatus = LanguageStatus_1 = ( __decorate([
383
- ( __param(0, ILanguageStatusService)),
384
- ( __param(1, IStatusbarService)),
385
- ( __param(2, IEditorService)),
386
- ( __param(3, IOpenerService)),
387
- ( __param(4, IStorageService))
388
- ], LanguageStatus));
389
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(LanguageStatusContribution, 3 );
390
- registerAction2(class extends Action2 {
391
- constructor() {
392
- super({
393
- id: 'editor.inlayHints.Reset',
394
- title: {
395
- value: ( localizeWithPath(
396
- 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution',
397
- 'reset',
398
- 'Reset Language Status Interaction Counter'
399
- )),
400
- original: 'Reset Language Status Interaction Counter'
401
- },
402
- category: Categories.View,
403
- f1: true
404
- });
405
- }
406
- run(accessor) {
407
- accessor.get(IStorageService).remove('languageStatus.interactCount', 0 );
408
- }
409
- });
@@ -1,6 +0,0 @@
1
- import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
-
3
- var css = "@keyframes wiggle{0%{transform:rotate(0) scale(1)}15%,45%{transform:rotate(.04turn) scale(1.1)}30%,60%{transform:rotate(-.04turn) scale(1.2)}to{transform:rotate(0) scale(1)}}.monaco-workbench .statusbar DIV#status\\.languageStatus A>SPAN.codicon.wiggle{animation-duration:.8s;animation-iteration-count:1;animation-name:wiggle}@keyframes flash{0%{background-color:initial}50%{background-color:var(--vscode-statusBarItem-prominentBackground)}to{background-color:initial}}.monaco-workbench .statusbar DIV#status\\.languageStatus.flash A{animation-duration:.8s;animation-iteration-count:1;animation-name:flash}.monaco-workbench .hover-language-status{display:flex;padding:4px 8px}.monaco-workbench .hover-language-status:not(:last-child){border-bottom:1px solid var(--vscode-notifications-border)}.monaco-workbench .hover-language-status>.severity{display:none;flex:1;margin:auto;padding-right:8px}.monaco-workbench .hover-language-status>.severity.sev3{color:var(--vscode-notificationsErrorIcon-foreground)}.monaco-workbench .hover-language-status>.severity.sev2{color:var(--vscode-notificationsInfoIcon-foreground)}.monaco-workbench .hover-language-status>.severity.show{display:inherit}.monaco-workbench .hover-language-status>.element{display:flex;flex-grow:100;justify-content:space-between;vertical-align:middle}.monaco-workbench .hover-language-status>.element>.left>.detail:not(:empty):before{content:\"\\2013\";opacity:.6;padding:0 4px}.monaco-workbench .hover-language-status>.element>.left>.label:empty{display:none}.monaco-workbench .hover-language-status>.element .left{margin:auto 0}.monaco-workbench .hover-language-status>.element .right{display:flex;margin:auto 0}.monaco-workbench .hover-language-status>.element .right:not(:empty){padding-left:16px}.monaco-workbench .hover-language-status>.element .right .monaco-link{margin:auto 0;white-space:nowrap}.monaco-workbench .hover-language-status>.element .right .monaco-action-bar:not(:first-child){padding-left:8px}";
4
- n(css,{});
5
-
6
- export { css, css as default };