@codingame/monaco-vscode-views-service-override 2.0.3 → 2.1.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 +1 -1
- package/index.js +1 -1
- package/package.json +11 -11
- package/tools/editor.js +14 -0
- package/views.js +12 -5
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +160 -4
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +14 -19
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +59 -21
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +23 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +77 -45
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +131 -5
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.d.ts +1 -3
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +8 -16
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +3 -4
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +17 -16
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +2 -2
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +2 -1
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +18 -4
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +2 -2
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +15 -4
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorHandler.js +2 -2
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +6 -2
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.css.js +0 -6
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.js +0 -290
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +0 -801
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +0 -142
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +0 -412
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +0 -1315
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +0 -186
- package/vscode/src/vs/workbench/browser/parts/editor/editorPanes.js +0 -346
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +0 -154
- package/vscode/src/vs/workbench/browser/parts/editor/media/breadcrumbscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorgroupview.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +0 -1623
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +0 -152
- package/vscode/src/vs/workbench/browser/parts/editor/noEditorTabsControl.js +0 -54
- package/vscode/src/vs/workbench/browser/parts/editor/singleEditorTabsControl.js +0 -259
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +0 -109
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +0 -195
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +0 -528
- package/vscode/src/vs/workbench/services/hover/browser/media/hover.css.js +0 -6
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import './media/hover.css.js';
|
|
3
|
-
import { registerThemingParticipant } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
4
|
-
import { editorHoverBorder } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
5
|
-
import { IContextViewService, IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
6
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
-
import { HoverWidget } from './hoverWidget.js';
|
|
8
|
-
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
|
-
import { getActiveElement, isAncestorOfActiveElement, getWindow, addDisposableListener, EventType, isAncestor } from 'vscode/vscode/vs/base/browser/dom';
|
|
10
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
11
|
-
import { StandardKeyboardEvent } from 'vscode/vscode/vs/base/browser/keyboardEvent';
|
|
12
|
-
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
13
|
-
import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService';
|
|
14
|
-
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
15
|
-
|
|
16
|
-
let HoverService = class HoverService {
|
|
17
|
-
constructor(_instantiationService, _contextViewService, contextMenuService, _keybindingService, _layoutService, _accessibilityService) {
|
|
18
|
-
this._instantiationService = _instantiationService;
|
|
19
|
-
this._contextViewService = _contextViewService;
|
|
20
|
-
this._keybindingService = _keybindingService;
|
|
21
|
-
this._layoutService = _layoutService;
|
|
22
|
-
this._accessibilityService = _accessibilityService;
|
|
23
|
-
contextMenuService.onDidShowContextMenu(() => this.hideHover());
|
|
24
|
-
}
|
|
25
|
-
showHover(options, focus, skipLastFocusedUpdate) {
|
|
26
|
-
if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
if (this._currentHover && this._currentHoverOptions?.persistence?.sticky) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
this._currentHoverOptions = options;
|
|
33
|
-
this._lastHoverOptions = options;
|
|
34
|
-
const trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();
|
|
35
|
-
const activeElement = getActiveElement();
|
|
36
|
-
if (!skipLastFocusedUpdate) {
|
|
37
|
-
if (trapFocus && activeElement) {
|
|
38
|
-
this._lastFocusedElementBeforeOpen = activeElement;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this._lastFocusedElementBeforeOpen = undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const hoverDisposables = ( new DisposableStore());
|
|
45
|
-
const hover = this._instantiationService.createInstance(HoverWidget, options);
|
|
46
|
-
if (options.persistence?.sticky) {
|
|
47
|
-
hover.isLocked = true;
|
|
48
|
-
}
|
|
49
|
-
hover.onDispose(() => {
|
|
50
|
-
const hoverWasFocused = this._currentHover?.domNode && isAncestorOfActiveElement(this._currentHover.domNode);
|
|
51
|
-
if (hoverWasFocused) {
|
|
52
|
-
this._lastFocusedElementBeforeOpen?.focus();
|
|
53
|
-
}
|
|
54
|
-
if (this._currentHoverOptions === options) {
|
|
55
|
-
this._currentHoverOptions = undefined;
|
|
56
|
-
}
|
|
57
|
-
hoverDisposables.dispose();
|
|
58
|
-
});
|
|
59
|
-
if (!options.container) {
|
|
60
|
-
const targetElement = options.target instanceof HTMLElement ? options.target : options.target.targetElements[0];
|
|
61
|
-
options.container = this._layoutService.getContainer(getWindow(targetElement));
|
|
62
|
-
}
|
|
63
|
-
const provider = this._contextViewService;
|
|
64
|
-
provider.showContextView(( new HoverContextViewDelegate(hover, focus)), options.container);
|
|
65
|
-
hover.onRequestLayout(() => provider.layout());
|
|
66
|
-
if (options.persistence?.sticky) {
|
|
67
|
-
hoverDisposables.add(addDisposableListener(getWindow(options.container).document, EventType.MOUSE_DOWN, e => {
|
|
68
|
-
if (!isAncestor(e.target, hover.domNode)) {
|
|
69
|
-
this.doHideHover();
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
if ('targetElements' in options.target) {
|
|
75
|
-
for (const element of options.target.targetElements) {
|
|
76
|
-
hoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover()));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
hoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover()));
|
|
81
|
-
}
|
|
82
|
-
const focusedElement = getActiveElement();
|
|
83
|
-
if (focusedElement) {
|
|
84
|
-
const focusedElementDocument = getWindow(focusedElement).document;
|
|
85
|
-
hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));
|
|
86
|
-
hoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.persistence?.hideOnKeyDown)));
|
|
87
|
-
hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover)));
|
|
88
|
-
hoverDisposables.add(addDisposableListener(focusedElementDocument, EventType.KEY_UP, e => this._keyUp(e, hover)));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if ('IntersectionObserver' in mainWindow) {
|
|
92
|
-
const observer = ( new IntersectionObserver(e => this._intersectionChange(e, hover), { threshold: 0 }));
|
|
93
|
-
const firstTargetElement = 'targetElements' in options.target ? options.target.targetElements[0] : options.target;
|
|
94
|
-
observer.observe(firstTargetElement);
|
|
95
|
-
hoverDisposables.add(toDisposable(() => observer.disconnect()));
|
|
96
|
-
}
|
|
97
|
-
this._currentHover = hover;
|
|
98
|
-
return hover;
|
|
99
|
-
}
|
|
100
|
-
hideHover() {
|
|
101
|
-
if (this._currentHover?.isLocked || !this._currentHoverOptions) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
this.doHideHover();
|
|
105
|
-
}
|
|
106
|
-
doHideHover() {
|
|
107
|
-
this._currentHover = undefined;
|
|
108
|
-
this._currentHoverOptions = undefined;
|
|
109
|
-
this._contextViewService.hideContextView();
|
|
110
|
-
}
|
|
111
|
-
_intersectionChange(entries, hover) {
|
|
112
|
-
const entry = entries[entries.length - 1];
|
|
113
|
-
if (!entry.isIntersecting) {
|
|
114
|
-
hover.dispose();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
showAndFocusLastHover() {
|
|
118
|
-
if (!this._lastHoverOptions) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.showHover(this._lastHoverOptions, true, true);
|
|
122
|
-
}
|
|
123
|
-
_keyDown(e, hover, hideOnKeyDown) {
|
|
124
|
-
if (e.key === 'Alt') {
|
|
125
|
-
hover.isLocked = true;
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const event = ( new StandardKeyboardEvent(e));
|
|
129
|
-
const keybinding = this._keybindingService.resolveKeyboardEvent(event);
|
|
130
|
-
if (( keybinding.getSingleModifierDispatchChords().some(value => !!value)) || this._keybindingService.softDispatch(event, event.target).kind !== 0 ) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (hideOnKeyDown && (!this._currentHoverOptions?.trapFocus || e.key !== 'Tab')) {
|
|
134
|
-
this.hideHover();
|
|
135
|
-
this._lastFocusedElementBeforeOpen?.focus();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
_keyUp(e, hover) {
|
|
139
|
-
if (e.key === 'Alt') {
|
|
140
|
-
hover.isLocked = false;
|
|
141
|
-
if (!hover.isMouseIn) {
|
|
142
|
-
this.hideHover();
|
|
143
|
-
this._lastFocusedElementBeforeOpen?.focus();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
HoverService = ( __decorate([
|
|
149
|
-
( __param(0, IInstantiationService)),
|
|
150
|
-
( __param(1, IContextViewService)),
|
|
151
|
-
( __param(2, IContextMenuService)),
|
|
152
|
-
( __param(3, IKeybindingService)),
|
|
153
|
-
( __param(4, ILayoutService)),
|
|
154
|
-
( __param(5, IAccessibilityService))
|
|
155
|
-
], HoverService));
|
|
156
|
-
function getHoverOptionsIdentity(options) {
|
|
157
|
-
if (options === undefined) {
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
return options?.id ?? options;
|
|
161
|
-
}
|
|
162
|
-
class HoverContextViewDelegate {
|
|
163
|
-
get anchorPosition() {
|
|
164
|
-
return this._hover.anchor;
|
|
165
|
-
}
|
|
166
|
-
constructor(_hover, _focus = false) {
|
|
167
|
-
this._hover = _hover;
|
|
168
|
-
this._focus = _focus;
|
|
169
|
-
}
|
|
170
|
-
render(container) {
|
|
171
|
-
this._hover.render(container);
|
|
172
|
-
if (this._focus) {
|
|
173
|
-
this._hover.focus();
|
|
174
|
-
}
|
|
175
|
-
return this._hover;
|
|
176
|
-
}
|
|
177
|
-
getAnchor() {
|
|
178
|
-
return {
|
|
179
|
-
x: this._hover.x,
|
|
180
|
-
y: this._hover.y
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
layout() {
|
|
184
|
-
this._hover.layout();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
registerThemingParticipant((theme, collector) => {
|
|
188
|
-
const hoverBorder = theme.getColor(editorHoverBorder);
|
|
189
|
-
if (hoverBorder) {
|
|
190
|
-
collector.addRule(`.monaco-workbench .workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${( hoverBorder.transparent(0.5))}; }`);
|
|
191
|
-
collector.addRule(`.monaco-workbench .workbench-hover hr { border-top: 1px solid ${( hoverBorder.transparent(0.5))}; }`);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
export { HoverService };
|