@codingame/monaco-vscode-view-common-service-override 11.1.2 → 12.0.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.
- package/index.d.ts +3 -1
- package/index.js +110 -1
- package/package.json +64 -10
- package/service-override/tools/editorAssets.d.ts +1 -0
- package/service-override/tools/editorAssets.js +5 -0
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.d.ts +21 -0
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.js +2 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.d.ts +2 -0
- package/vscode/src/vs/platform/webview/common/mimeTypes.js +1 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.d.ts +18 -0
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +1 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.d.ts +7 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +116 -115
- package/vscode/src/vs/workbench/browser/actions/listCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +120 -125
- package/vscode/src/vs/workbench/browser/actions/navigationActions.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +81 -74
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -250
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.d.ts +21 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +26 -25
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.d.ts +32 -0
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +10 -8
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +58 -64
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +48 -38
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +19 -40
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/media/callHierarchy.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +7 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +6 -4
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +6 -4
- package/vscode/src/vs/workbench/contrib/customEditor/browser/media/customEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +16 -16
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +15 -10
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +27 -25
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +4 -2
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +6 -386
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.js +385 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.d.ts +105 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +50 -62
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +16 -15
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +15 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +15 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +3 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +37 -39
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +22 -21
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +3 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.d.ts +117 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +57 -53
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +27 -25
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +15 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +4 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +28 -28
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -5
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +54 -56
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +48 -38
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +19 -30
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +3 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.d.ts +139 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +58 -56
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +4 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +2 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +28 -28
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInputSerializer.js +3 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +15 -13
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +10 -8
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.d.ts +6 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +3 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.d.ts +60 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +64 -63
- package/vscode/src/vs/workbench/services/history/browser/historyService.d.ts +184 -0
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +154 -148
- package/vscode/src/vs/workbench/services/progress/browser/media/progressService.css.js +1 -1
- package/vscode/src/vs/workbench/services/progress/browser/progressService.d.ts +36 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +59 -54
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.d.ts +34 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +4 -3
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +71 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.d.ts +122 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +86 -90
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.d.ts +80 -0
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +58 -64
- package/override/vs/workbench/browser/parts/editor/textEditor.js +0 -5
- package/override/vs/workbench/browser/parts/editor/textEditor.weak.js +0 -11
- package/tools/editorAssets.js +0 -4
- package/tools/url.js +0 -10
- package/viewCommon.js +0 -109
package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js
CHANGED
|
@@ -1,387 +1,7 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import './media/languageStatus.css.js';
|
|
3
|
-
import { getWindow, isHTMLElement, addDisposableListener, append } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
|
-
import { renderLabelWithIcons } from 'vscode/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
5
|
-
import { Disposable, DisposableStore, dispose, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
7
|
-
import { getCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
8
|
-
import { localize, localize2 } 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.service';
|
|
13
|
-
import { ILanguageStatusService } from 'vscode/vscode/vs/workbench/services/languageStatus/common/languageStatusService.service';
|
|
14
|
-
import { ShowTooltipCommand } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
15
|
-
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
16
|
-
import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
|
|
17
|
-
import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
|
|
18
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
19
|
-
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
20
|
-
import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
21
|
-
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
22
|
-
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
23
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
24
|
-
import { equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
25
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
26
|
-
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
27
|
-
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
28
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
29
|
-
import { nativeHoverDelegate } from 'vscode/vscode/vs/platform/hover/browser/hover';
|
|
30
|
-
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
31
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
32
|
-
import { joinStrings } from 'vscode/vscode/vs/base/common/strings';
|
|
33
1
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
isEqual(other) {
|
|
41
|
-
return equals(this.combined, other.combined) && equals(this.dedicated, other.dedicated);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
let StoredCounter = class StoredCounter {
|
|
45
|
-
constructor(_storageService, _key) {
|
|
46
|
-
this._storageService = _storageService;
|
|
47
|
-
this._key = _key;
|
|
48
|
-
}
|
|
49
|
-
get value() {
|
|
50
|
-
return this._storageService.getNumber(this._key, 0 , 0);
|
|
51
|
-
}
|
|
52
|
-
increment() {
|
|
53
|
-
const n = this.value + 1;
|
|
54
|
-
this._storageService.store(this._key, n, 0 , 1 );
|
|
55
|
-
return n;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
StoredCounter = ( (__decorate([
|
|
59
|
-
( (__param(0, IStorageService)))
|
|
60
|
-
], StoredCounter)));
|
|
61
|
-
let LanguageStatusContribution = class LanguageStatusContribution extends Disposable {
|
|
62
|
-
constructor(editorGroupService) {
|
|
63
|
-
super();
|
|
64
|
-
this.editorGroupService = editorGroupService;
|
|
65
|
-
for (const part of editorGroupService.parts) {
|
|
66
|
-
this.createLanguageStatus(part);
|
|
67
|
-
}
|
|
68
|
-
this._register(editorGroupService.onDidCreateAuxiliaryEditorPart(part => this.createLanguageStatus(part)));
|
|
69
|
-
}
|
|
70
|
-
createLanguageStatus(part) {
|
|
71
|
-
const disposables = ( (new DisposableStore()));
|
|
72
|
-
Event.once(part.onWillDispose)(() => disposables.dispose());
|
|
73
|
-
const scopedInstantiationService = this.editorGroupService.getScopedInstantiationService(part);
|
|
74
|
-
disposables.add(scopedInstantiationService.createInstance(LanguageStatus));
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
LanguageStatusContribution = ( (__decorate([
|
|
78
|
-
( (__param(0, IEditorGroupsService)))
|
|
79
|
-
], LanguageStatusContribution)));
|
|
80
|
-
let LanguageStatus = class LanguageStatus {
|
|
81
|
-
static { LanguageStatus_1 = this; }
|
|
82
|
-
static { this._id = 'status.languageStatus'; }
|
|
83
|
-
static { this._keyDedicatedItems = 'languageStatus.dedicated'; }
|
|
84
|
-
constructor(_languageStatusService, _statusBarService, _editorService, _hoverService, _openerService, _storageService) {
|
|
85
|
-
this._languageStatusService = _languageStatusService;
|
|
86
|
-
this._statusBarService = _statusBarService;
|
|
87
|
-
this._editorService = _editorService;
|
|
88
|
-
this._hoverService = _hoverService;
|
|
89
|
-
this._openerService = _openerService;
|
|
90
|
-
this._storageService = _storageService;
|
|
91
|
-
this._disposables = ( (new DisposableStore()));
|
|
92
|
-
this._dedicated = ( (new Set()));
|
|
93
|
-
this._dedicatedEntries = ( (new Map()));
|
|
94
|
-
this._renderDisposables = ( (new DisposableStore()));
|
|
95
|
-
_storageService.onDidChangeValue(0 , LanguageStatus_1._keyDedicatedItems, this._disposables)(this._handleStorageChange, this, this._disposables);
|
|
96
|
-
this._restoreState();
|
|
97
|
-
this._interactionCounter = ( (new StoredCounter(_storageService, 'languageStatus.interactCount')));
|
|
98
|
-
_languageStatusService.onDidChange(this._update, this, this._disposables);
|
|
99
|
-
_editorService.onDidActiveEditorChange(this._update, this, this._disposables);
|
|
100
|
-
this._update();
|
|
101
|
-
_statusBarService.onDidChangeEntryVisibility(e => {
|
|
102
|
-
if (!e.visible && ( (this._dedicated.has(e.id)))) {
|
|
103
|
-
this._dedicated.delete(e.id);
|
|
104
|
-
this._update();
|
|
105
|
-
this._storeState();
|
|
106
|
-
}
|
|
107
|
-
}, undefined, this._disposables);
|
|
108
|
-
}
|
|
109
|
-
dispose() {
|
|
110
|
-
this._disposables.dispose();
|
|
111
|
-
this._combinedEntry?.dispose();
|
|
112
|
-
dispose(( (this._dedicatedEntries.values())));
|
|
113
|
-
this._renderDisposables.dispose();
|
|
114
|
-
}
|
|
115
|
-
_handleStorageChange() {
|
|
116
|
-
this._restoreState();
|
|
117
|
-
this._update();
|
|
118
|
-
}
|
|
119
|
-
_restoreState() {
|
|
120
|
-
const raw = this._storageService.get(LanguageStatus_1._keyDedicatedItems, 0 , '[]');
|
|
121
|
-
try {
|
|
122
|
-
const ids = JSON.parse(raw);
|
|
123
|
-
this._dedicated = ( (new Set(ids)));
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
this._dedicated.clear();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
_storeState() {
|
|
130
|
-
if (this._dedicated.size === 0) {
|
|
131
|
-
this._storageService.remove(LanguageStatus_1._keyDedicatedItems, 0 );
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
const raw = JSON.stringify(Array.from(( (this._dedicated.keys()))));
|
|
135
|
-
this._storageService.store(LanguageStatus_1._keyDedicatedItems, raw, 0 , 0 );
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
_createViewModel(editor) {
|
|
139
|
-
if (!editor?.hasModel()) {
|
|
140
|
-
return (
|
|
141
|
-
(new LanguageStatusViewModel([], []))
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
const all = this._languageStatusService.getLanguageStatus(editor.getModel());
|
|
145
|
-
const combined = [];
|
|
146
|
-
const dedicated = [];
|
|
147
|
-
for (const item of all) {
|
|
148
|
-
if (( (this._dedicated.has(item.id)))) {
|
|
149
|
-
dedicated.push(item);
|
|
150
|
-
}
|
|
151
|
-
combined.push(item);
|
|
152
|
-
}
|
|
153
|
-
return (
|
|
154
|
-
(new LanguageStatusViewModel(combined, dedicated))
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
_update() {
|
|
158
|
-
const editor = getCodeEditor(this._editorService.activeTextEditorControl);
|
|
159
|
-
const model = this._createViewModel(editor);
|
|
160
|
-
if (this._model?.isEqual(model)) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
this._renderDisposables.clear();
|
|
164
|
-
this._model = model;
|
|
165
|
-
editor?.onDidChangeModelLanguage(this._update, this, this._renderDisposables);
|
|
166
|
-
if (model.combined.length === 0) {
|
|
167
|
-
this._combinedEntry?.dispose();
|
|
168
|
-
this._combinedEntry = undefined;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
const [first] = model.combined;
|
|
172
|
-
const showSeverity = first.severity >= Severity$1.Warning;
|
|
173
|
-
const text = LanguageStatus_1._severityToComboCodicon(first.severity);
|
|
174
|
-
let isOneBusy = false;
|
|
175
|
-
const ariaLabels = [];
|
|
176
|
-
const element = document.createElement('div');
|
|
177
|
-
for (const status of model.combined) {
|
|
178
|
-
const isPinned = model.dedicated.includes(status);
|
|
179
|
-
element.appendChild(this._renderStatus(status, showSeverity, isPinned, this._renderDisposables));
|
|
180
|
-
ariaLabels.push(LanguageStatus_1._accessibilityInformation(status).label);
|
|
181
|
-
isOneBusy = isOneBusy || (!isPinned && status.busy);
|
|
182
|
-
}
|
|
183
|
-
const props = {
|
|
184
|
-
name: ( localize(4430, "Editor Language Status")),
|
|
185
|
-
ariaLabel: ( localize(4431, "Editor Language Status: {0}", ariaLabels.join(', next: '))),
|
|
186
|
-
tooltip: element,
|
|
187
|
-
command: ShowTooltipCommand,
|
|
188
|
-
text: computeText(text, isOneBusy),
|
|
189
|
-
};
|
|
190
|
-
if (!this._combinedEntry) {
|
|
191
|
-
this._combinedEntry = this._statusBarService.addEntry(props, LanguageStatus_1._id, 1 , { id: 'status.editor.mode', alignment: 0 , compact: true });
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
this._combinedEntry.update(props);
|
|
195
|
-
}
|
|
196
|
-
const userHasInteractedWithStatus = this._interactionCounter.value >= 3;
|
|
197
|
-
const targetWindow = getWindow(editor?.getContainerDomNode());
|
|
198
|
-
const node = targetWindow.document.querySelector('.monaco-workbench .statusbar DIV#status\\.languageStatus A>SPAN.codicon');
|
|
199
|
-
const container = targetWindow.document.querySelector('.monaco-workbench .statusbar DIV#status\\.languageStatus');
|
|
200
|
-
if (isHTMLElement(node) && container) {
|
|
201
|
-
const _wiggle = 'wiggle';
|
|
202
|
-
const _flash = 'flash';
|
|
203
|
-
if (!isOneBusy) {
|
|
204
|
-
node.classList.toggle(_wiggle, showSeverity || !userHasInteractedWithStatus);
|
|
205
|
-
this._renderDisposables.add(addDisposableListener(node, 'animationend', _e => node.classList.remove(_wiggle)));
|
|
206
|
-
container.classList.toggle(_flash, showSeverity);
|
|
207
|
-
this._renderDisposables.add(addDisposableListener(container, 'animationend', _e => container.classList.remove(_flash)));
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
node.classList.remove(_wiggle);
|
|
211
|
-
container.classList.remove(_flash);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (!userHasInteractedWithStatus) {
|
|
215
|
-
const hoverTarget = targetWindow.document.querySelector('.monaco-workbench .context-view');
|
|
216
|
-
if (isHTMLElement(hoverTarget)) {
|
|
217
|
-
const observer = ( (new MutationObserver(() => {
|
|
218
|
-
if (targetWindow.document.contains(element)) {
|
|
219
|
-
this._interactionCounter.increment();
|
|
220
|
-
observer.disconnect();
|
|
221
|
-
}
|
|
222
|
-
})));
|
|
223
|
-
observer.observe(hoverTarget, { childList: true, subtree: true });
|
|
224
|
-
this._renderDisposables.add(toDisposable(() => observer.disconnect()));
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const newDedicatedEntries = ( (new Map()));
|
|
229
|
-
for (const status of model.dedicated) {
|
|
230
|
-
const props = LanguageStatus_1._asStatusbarEntry(status);
|
|
231
|
-
let entry = this._dedicatedEntries.get(status.id);
|
|
232
|
-
if (!entry) {
|
|
233
|
-
entry = this._statusBarService.addEntry(props, status.id, 1 , { id: 'status.editor.mode', alignment: 1 });
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
entry.update(props);
|
|
237
|
-
this._dedicatedEntries.delete(status.id);
|
|
238
|
-
}
|
|
239
|
-
newDedicatedEntries.set(status.id, entry);
|
|
240
|
-
}
|
|
241
|
-
dispose(( (this._dedicatedEntries.values())));
|
|
242
|
-
this._dedicatedEntries = newDedicatedEntries;
|
|
243
|
-
}
|
|
244
|
-
_renderStatus(status, showSeverity, isPinned, store) {
|
|
245
|
-
const parent = document.createElement('div');
|
|
246
|
-
parent.classList.add('hover-language-status');
|
|
247
|
-
const severity = document.createElement('div');
|
|
248
|
-
severity.classList.add('severity', `sev${status.severity}`);
|
|
249
|
-
severity.classList.toggle('show', showSeverity);
|
|
250
|
-
const severityText = LanguageStatus_1._severityToSingleCodicon(status.severity);
|
|
251
|
-
append(severity, ...renderLabelWithIcons(severityText));
|
|
252
|
-
parent.appendChild(severity);
|
|
253
|
-
const element = document.createElement('div');
|
|
254
|
-
element.classList.add('element');
|
|
255
|
-
parent.appendChild(element);
|
|
256
|
-
const left = document.createElement('div');
|
|
257
|
-
left.classList.add('left');
|
|
258
|
-
element.appendChild(left);
|
|
259
|
-
const label = document.createElement('span');
|
|
260
|
-
label.classList.add('label');
|
|
261
|
-
const labelValue = typeof status.label === 'string' ? status.label : status.label.value;
|
|
262
|
-
append(label, ...renderLabelWithIcons(computeText(labelValue, status.busy)));
|
|
263
|
-
left.appendChild(label);
|
|
264
|
-
const detail = document.createElement('span');
|
|
265
|
-
detail.classList.add('detail');
|
|
266
|
-
this._renderTextPlus(detail, status.detail, store);
|
|
267
|
-
left.appendChild(detail);
|
|
268
|
-
const right = document.createElement('div');
|
|
269
|
-
right.classList.add('right');
|
|
270
|
-
element.appendChild(right);
|
|
271
|
-
const { command } = status;
|
|
272
|
-
if (command) {
|
|
273
|
-
store.add(( (new Link(right, {
|
|
274
|
-
label: command.title,
|
|
275
|
-
title: command.tooltip,
|
|
276
|
-
href: ( (( (URI.from({
|
|
277
|
-
scheme: 'command', path: command.id, query: command.arguments && JSON.stringify(command.arguments)
|
|
278
|
-
}))).toString()))
|
|
279
|
-
}, { hoverDelegate: nativeHoverDelegate }, this._hoverService, this._openerService))));
|
|
280
|
-
}
|
|
281
|
-
const actionBar = ( (new ActionBar(right, { hoverDelegate: nativeHoverDelegate })));
|
|
282
|
-
const actionLabel = isPinned ? ( localize(4432, "Remove from Status Bar")) : ( localize(4433, "Add to Status Bar"));
|
|
283
|
-
actionBar.setAriaLabel(actionLabel);
|
|
284
|
-
store.add(actionBar);
|
|
285
|
-
let action;
|
|
286
|
-
if (!isPinned) {
|
|
287
|
-
action = ( (new Action('pin', actionLabel, ThemeIcon.asClassName(Codicon.pin), true, () => {
|
|
288
|
-
this._dedicated.add(status.id);
|
|
289
|
-
this._statusBarService.updateEntryVisibility(status.id, true);
|
|
290
|
-
this._update();
|
|
291
|
-
this._storeState();
|
|
292
|
-
})));
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
action = ( (new Action('unpin', actionLabel, ThemeIcon.asClassName(Codicon.pinned), true, () => {
|
|
296
|
-
this._dedicated.delete(status.id);
|
|
297
|
-
this._statusBarService.updateEntryVisibility(status.id, false);
|
|
298
|
-
this._update();
|
|
299
|
-
this._storeState();
|
|
300
|
-
})));
|
|
301
|
-
}
|
|
302
|
-
actionBar.push(action, { icon: true, label: false });
|
|
303
|
-
store.add(action);
|
|
304
|
-
return parent;
|
|
305
|
-
}
|
|
306
|
-
static _severityToComboCodicon(sev) {
|
|
307
|
-
switch (sev) {
|
|
308
|
-
case Severity$1.Error: return '$(bracket-error)';
|
|
309
|
-
case Severity$1.Warning: return '$(bracket-dot)';
|
|
310
|
-
default: return '$(bracket)';
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
static _severityToSingleCodicon(sev) {
|
|
314
|
-
switch (sev) {
|
|
315
|
-
case Severity$1.Error: return '$(error)';
|
|
316
|
-
case Severity$1.Warning: return '$(info)';
|
|
317
|
-
default: return '$(check)';
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
_renderTextPlus(target, text, store) {
|
|
321
|
-
for (const node of parseLinkedText(text).nodes) {
|
|
322
|
-
if (typeof node === 'string') {
|
|
323
|
-
const parts = renderLabelWithIcons(node);
|
|
324
|
-
append(target, ...parts);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
store.add(( (new Link(target, node, undefined, this._hoverService, this._openerService))));
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
static _accessibilityInformation(status) {
|
|
332
|
-
if (status.accessibilityInfo) {
|
|
333
|
-
return status.accessibilityInfo;
|
|
334
|
-
}
|
|
335
|
-
const textValue = typeof status.label === 'string' ? status.label : status.label.value;
|
|
336
|
-
if (status.detail) {
|
|
337
|
-
return { label: ( localize(4434, '{0}, {1}', textValue, status.detail)) };
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
return { label: ( localize(4435, '{0}', textValue)) };
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
static _asStatusbarEntry(item) {
|
|
344
|
-
let kind;
|
|
345
|
-
if (item.severity === Severity$1.Warning) {
|
|
346
|
-
kind = 'warning';
|
|
347
|
-
}
|
|
348
|
-
else if (item.severity === Severity$1.Error) {
|
|
349
|
-
kind = 'error';
|
|
350
|
-
}
|
|
351
|
-
const textValue = typeof item.label === 'string' ? item.label : item.label.shortValue;
|
|
352
|
-
return {
|
|
353
|
-
name: ( localize(4436, '{0} (Language Status)', item.name)),
|
|
354
|
-
text: computeText(textValue, item.busy),
|
|
355
|
-
ariaLabel: LanguageStatus_1._accessibilityInformation(item).label,
|
|
356
|
-
role: item.accessibilityInfo?.role,
|
|
357
|
-
tooltip: item.command?.tooltip || ( (new MarkdownString(item.detail, { isTrusted: true, supportThemeIcons: true }))),
|
|
358
|
-
kind,
|
|
359
|
-
command: item.command
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
LanguageStatus = LanguageStatus_1 = ( (__decorate([
|
|
364
|
-
( (__param(0, ILanguageStatusService))),
|
|
365
|
-
( (__param(1, IStatusbarService))),
|
|
366
|
-
( (__param(2, IEditorService))),
|
|
367
|
-
( (__param(3, IHoverService))),
|
|
368
|
-
( (__param(4, IOpenerService))),
|
|
369
|
-
( (__param(5, IStorageService)))
|
|
370
|
-
], LanguageStatus)));
|
|
371
|
-
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(LanguageStatusContribution, 3 );
|
|
372
|
-
registerAction2(class extends Action2 {
|
|
373
|
-
constructor() {
|
|
374
|
-
super({
|
|
375
|
-
id: 'editor.inlayHints.Reset',
|
|
376
|
-
title: ( localize2(4437, "Reset Language Status Interaction Counter")),
|
|
377
|
-
category: Categories.View,
|
|
378
|
-
f1: true
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
run(accessor) {
|
|
382
|
-
accessor.get(IStorageService).remove('languageStatus.interactCount', 0 );
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
function computeText(text, loading) {
|
|
386
|
-
return joinStrings([text !== '' && text, loading && '$(loading~spin)'], '\u00A0\u00A0');
|
|
387
|
-
}
|
|
2
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
+
import { LanguageStatusContribution, ResetAction } from './languageStatus.js';
|
|
5
|
+
|
|
6
|
+
registerWorkbenchContribution2(LanguageStatusContribution.Id, LanguageStatusContribution, WorkbenchPhase.AfterRestored);
|
|
7
|
+
registerAction2(ResetAction);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
|
|
3
|
+
import { Action2 } from "vscode/vscode/vs/platform/actions/common/actions";
|
|
4
|
+
import { ServicesAccessor } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { IEditorGroupsService } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
6
|
+
export declare class LanguageStatusContribution extends Disposable implements IWorkbenchContribution {
|
|
7
|
+
private readonly editorGroupService;
|
|
8
|
+
static readonly Id = "status.languageStatus";
|
|
9
|
+
constructor(editorGroupService: IEditorGroupsService);
|
|
10
|
+
private createLanguageStatus;
|
|
11
|
+
}
|
|
12
|
+
export declare class ResetAction extends Action2 {
|
|
13
|
+
constructor();
|
|
14
|
+
run(accessor: ServicesAccessor): void;
|
|
15
|
+
}
|