@codingame/monaco-vscode-api 3.0.0 → 3.1.1

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 (40) hide show
  1. package/api.js +1 -1
  2. package/assets/continue-tb.png +0 -0
  3. package/assets/pause-tb.png +0 -0
  4. package/assets/restart-tb.png +0 -0
  5. package/assets/run-with-debugging-tb.png +0 -0
  6. package/assets/stepinto-tb.png +0 -0
  7. package/assets/stepout-tb.png +0 -0
  8. package/assets/stepover-tb.png +0 -0
  9. package/assets/stop-tb.png +0 -0
  10. package/contributions.js +2 -0
  11. package/l10n.js +4 -1
  12. package/missing-services.js +17 -2
  13. package/package.json +8 -8
  14. package/service-override/tools/editorAssets.js +3 -0
  15. package/services.d.ts +6 -3
  16. package/services.js +17 -3
  17. package/vscode/src/vs/base/common/lifecycle.js +158 -1
  18. package/vscode/src/vs/base/common/observableInternal/autorun.js +3 -1
  19. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
  20. package/vscode/src/vs/nls.js +8 -1
  21. package/vscode/src/vs/platform/tunnel/common/tunnel.js +267 -1
  22. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +1 -1
  23. package/vscode/src/vs/workbench/api/common/extHostNotebookDocument.js +1 -11
  24. package/vscode/src/vs/workbench/browser/actions/developerActions.js +703 -0
  25. package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +4 -0
  26. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +300 -0
  27. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +83 -0
  28. package/vscode/src/vs/workbench/browser/dnd.js +2 -1
  29. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +323 -8
  30. package/vscode/src/vs/workbench/common/contributions.d.ts +44 -1
  31. package/vscode/src/vs/workbench/common/contributions.js +8 -1
  32. package/vscode/src/vs/workbench/common/views.js +1 -3
  33. package/vscode/src/vs/workbench/contrib/debug/browser/media/all.png.js +11 -0
  34. package/vscode/src/vs/workbench/contrib/files/browser/files.editorPane.contribution.js +67 -0
  35. package/vscode/src/vs/workbench/contrib/logs/common/defaultLogLevels.js +140 -0
  36. package/vscode/src/vs/workbench/services/workspaces/common/workspaceIdentityService.js +102 -0
  37. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -430
  38. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  39. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -510
  40. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
@@ -0,0 +1,4 @@
1
+ import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
+ var css = ".monaco-workbench .quick-input-list .quick-input-list-entry.has-actions:hover .quick-input-list-entry-action-bar .action-label.dirty-workspace:before{content:\"\\ea76\"}.monaco-workbench .screencast-mouse{border-radius:50%;border-style:solid;border-width:2px;content:\" \";display:none;pointer-events:none;position:absolute;z-index:100000}.monaco-workbench .screencast-keyboard{background-color:rgba(0,0,0,.5);color:#eee;left:0;line-height:1.75em;overflow:hidden;pointer-events:none;position:absolute;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%;z-index:100000}.monaco-workbench:not(.reduce-motion) .screencast-keyboard{transition:opacity .3s ease-out}.monaco-workbench .screencast-keyboard:empty{opacity:0}.monaco-workbench .screencast-keyboard>.key{background-color:hsla(0,0%,100%,.05);border:1px solid hsla(0,0%,80%,.4);border-radius:5px;box-shadow:inset 0 -3px 0 hsla(0,0%,73%,.4);margin-right:6px;padding:0 8px}.monaco-workbench .screencast-keyboard>.title{font-weight:600}";
3
+ n(css,{});
4
+ export { css, css as default };
@@ -0,0 +1,300 @@
1
+ import { localize2WithPath } from '../../../nls.js';
2
+ import { IEditorGroupsService } from '../../services/editor/common/editorGroupsService.js';
3
+ import { IWorkbenchLayoutService } from '../../services/layout/browser/layoutService.js';
4
+ import { registerAction2, Action2 } from '../../../platform/actions/common/actions.js';
5
+ import { Categories } from '../../../platform/action/common/actionCommonCategories.js';
6
+ import { IEditorService } from '../../services/editor/common/editorService.js';
7
+ import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js';
8
+ import { getActiveWindow } from '../../../base/browser/dom.js';
9
+ import { isAuxiliaryWindow } from '../../../base/browser/window.js';
10
+ class BaseNavigationAction extends Action2 {
11
+ constructor(options, direction) {
12
+ super(options);
13
+ this.direction = direction;
14
+ }
15
+ run(accessor) {
16
+ const layoutService = accessor.get(IWorkbenchLayoutService);
17
+ const editorGroupService = accessor.get(IEditorGroupsService);
18
+ const paneCompositeService = accessor.get(IPaneCompositePartService);
19
+ const isEditorFocus = layoutService.hasFocus("workbench.parts.editor" );
20
+ const isPanelFocus = layoutService.hasFocus("workbench.parts.panel" );
21
+ const isSidebarFocus = layoutService.hasFocus("workbench.parts.sidebar" );
22
+ const isAuxiliaryBarFocus = layoutService.hasFocus("workbench.parts.auxiliarybar" );
23
+ let neighborPart;
24
+ if (isEditorFocus) {
25
+ const didNavigate = this.navigateAcrossEditorGroup(this.toGroupDirection(this.direction), editorGroupService);
26
+ if (didNavigate) {
27
+ return;
28
+ }
29
+ neighborPart = layoutService.getVisibleNeighborPart("workbench.parts.editor" , this.direction);
30
+ }
31
+ if (isPanelFocus) {
32
+ neighborPart = layoutService.getVisibleNeighborPart("workbench.parts.panel" , this.direction);
33
+ }
34
+ if (isSidebarFocus) {
35
+ neighborPart = layoutService.getVisibleNeighborPart("workbench.parts.sidebar" , this.direction);
36
+ }
37
+ if (isAuxiliaryBarFocus) {
38
+ neighborPart = neighborPart = layoutService.getVisibleNeighborPart("workbench.parts.auxiliarybar" , this.direction);
39
+ }
40
+ if (neighborPart === "workbench.parts.editor" ) {
41
+ if (!this.navigateBackToEditorGroup(this.toGroupDirection(this.direction), editorGroupService)) {
42
+ this.navigateToEditorGroup(this.direction === 3 ? 0 : 1 , editorGroupService);
43
+ }
44
+ }
45
+ else if (neighborPart === "workbench.parts.sidebar" ) {
46
+ this.navigateToSidebar(layoutService, paneCompositeService);
47
+ }
48
+ else if (neighborPart === "workbench.parts.panel" ) {
49
+ this.navigateToPanel(layoutService, paneCompositeService);
50
+ }
51
+ else if (neighborPart === "workbench.parts.auxiliarybar" ) {
52
+ this.navigateToAuxiliaryBar(layoutService, paneCompositeService);
53
+ }
54
+ }
55
+ async navigateToPanel(layoutService, paneCompositeService) {
56
+ if (!layoutService.isVisible("workbench.parts.panel" )) {
57
+ return false;
58
+ }
59
+ const activePanel = paneCompositeService.getActivePaneComposite(1 );
60
+ if (!activePanel) {
61
+ return false;
62
+ }
63
+ const activePanelId = activePanel.getId();
64
+ const res = await paneCompositeService.openPaneComposite(activePanelId, 1 , true);
65
+ if (!res) {
66
+ return false;
67
+ }
68
+ return res;
69
+ }
70
+ async navigateToSidebar(layoutService, paneCompositeService) {
71
+ if (!layoutService.isVisible("workbench.parts.sidebar" )) {
72
+ return false;
73
+ }
74
+ const activeViewlet = paneCompositeService.getActivePaneComposite(0 );
75
+ if (!activeViewlet) {
76
+ return false;
77
+ }
78
+ const activeViewletId = activeViewlet.getId();
79
+ const viewlet = await paneCompositeService.openPaneComposite(activeViewletId, 0 , true);
80
+ return !!viewlet;
81
+ }
82
+ async navigateToAuxiliaryBar(layoutService, paneCompositeService) {
83
+ if (!layoutService.isVisible("workbench.parts.auxiliarybar" )) {
84
+ return false;
85
+ }
86
+ const activePanel = paneCompositeService.getActivePaneComposite(2 );
87
+ if (!activePanel) {
88
+ return false;
89
+ }
90
+ const activePanelId = activePanel.getId();
91
+ const res = await paneCompositeService.openPaneComposite(activePanelId, 2 , true);
92
+ if (!res) {
93
+ return false;
94
+ }
95
+ return res;
96
+ }
97
+ navigateAcrossEditorGroup(direction, editorGroupService) {
98
+ return this.doNavigateToEditorGroup({ direction }, editorGroupService);
99
+ }
100
+ navigateToEditorGroup(location, editorGroupService) {
101
+ return this.doNavigateToEditorGroup({ location }, editorGroupService);
102
+ }
103
+ navigateBackToEditorGroup(direction, editorGroupService) {
104
+ if (!editorGroupService.activeGroup) {
105
+ return false;
106
+ }
107
+ const oppositeDirection = this.toOppositeDirection(direction);
108
+ const groupInBetween = editorGroupService.findGroup({ direction: oppositeDirection }, editorGroupService.activeGroup);
109
+ if (!groupInBetween) {
110
+ editorGroupService.activeGroup.focus();
111
+ return true;
112
+ }
113
+ return false;
114
+ }
115
+ toGroupDirection(direction) {
116
+ switch (direction) {
117
+ case 1 : return 1 ;
118
+ case 2 : return 2 ;
119
+ case 3 : return 3 ;
120
+ case 0 : return 0 ;
121
+ }
122
+ }
123
+ toOppositeDirection(direction) {
124
+ switch (direction) {
125
+ case 0 : return 1 ;
126
+ case 3 : return 2 ;
127
+ case 2 : return 3 ;
128
+ case 1 : return 0 ;
129
+ }
130
+ }
131
+ doNavigateToEditorGroup(scope, editorGroupService) {
132
+ const targetGroup = editorGroupService.findGroup(scope, editorGroupService.activeGroup);
133
+ if (targetGroup) {
134
+ targetGroup.focus();
135
+ return true;
136
+ }
137
+ return false;
138
+ }
139
+ }
140
+ registerAction2(class extends BaseNavigationAction {
141
+ constructor() {
142
+ super({
143
+ id: 'workbench.action.navigateLeft',
144
+ title: ( localize2WithPath(
145
+ 'vs/workbench/browser/actions/navigationActions',
146
+ 'navigateLeft',
147
+ 'Navigate to the View on the Left'
148
+ )),
149
+ category: Categories.View,
150
+ f1: true
151
+ }, 2 );
152
+ }
153
+ });
154
+ registerAction2(class extends BaseNavigationAction {
155
+ constructor() {
156
+ super({
157
+ id: 'workbench.action.navigateRight',
158
+ title: ( localize2WithPath(
159
+ 'vs/workbench/browser/actions/navigationActions',
160
+ 'navigateRight',
161
+ 'Navigate to the View on the Right'
162
+ )),
163
+ category: Categories.View,
164
+ f1: true
165
+ }, 3 );
166
+ }
167
+ });
168
+ registerAction2(class extends BaseNavigationAction {
169
+ constructor() {
170
+ super({
171
+ id: 'workbench.action.navigateUp',
172
+ title: ( localize2WithPath(
173
+ 'vs/workbench/browser/actions/navigationActions',
174
+ 'navigateUp',
175
+ 'Navigate to the View Above'
176
+ )),
177
+ category: Categories.View,
178
+ f1: true
179
+ }, 0 );
180
+ }
181
+ });
182
+ registerAction2(class extends BaseNavigationAction {
183
+ constructor() {
184
+ super({
185
+ id: 'workbench.action.navigateDown',
186
+ title: ( localize2WithPath(
187
+ 'vs/workbench/browser/actions/navigationActions',
188
+ 'navigateDown',
189
+ 'Navigate to the View Below'
190
+ )),
191
+ category: Categories.View,
192
+ f1: true
193
+ }, 1 );
194
+ }
195
+ });
196
+ class BaseFocusAction extends Action2 {
197
+ constructor(options, focusNext) {
198
+ super(options);
199
+ this.focusNext = focusNext;
200
+ }
201
+ run(accessor) {
202
+ const layoutService = accessor.get(IWorkbenchLayoutService);
203
+ const editorService = accessor.get(IEditorService);
204
+ this.focusNextOrPreviousPart(layoutService, editorService, this.focusNext);
205
+ }
206
+ findVisibleNeighbour(layoutService, part, next) {
207
+ const activeWindow = getActiveWindow();
208
+ const windowIsAuxiliary = isAuxiliaryWindow(activeWindow);
209
+ let neighbour;
210
+ if (windowIsAuxiliary) {
211
+ switch (part) {
212
+ case "workbench.parts.editor" :
213
+ neighbour = "workbench.parts.statusbar" ;
214
+ break;
215
+ default:
216
+ neighbour = "workbench.parts.editor" ;
217
+ }
218
+ }
219
+ else {
220
+ switch (part) {
221
+ case "workbench.parts.editor" :
222
+ neighbour = next ? "workbench.parts.panel" : "workbench.parts.sidebar" ;
223
+ break;
224
+ case "workbench.parts.panel" :
225
+ neighbour = next ? "workbench.parts.statusbar" : "workbench.parts.editor" ;
226
+ break;
227
+ case "workbench.parts.statusbar" :
228
+ neighbour = next ? "workbench.parts.activitybar" : "workbench.parts.panel" ;
229
+ break;
230
+ case "workbench.parts.activitybar" :
231
+ neighbour = next ? "workbench.parts.sidebar" : "workbench.parts.statusbar" ;
232
+ break;
233
+ case "workbench.parts.sidebar" :
234
+ neighbour = next ? "workbench.parts.editor" : "workbench.parts.activitybar" ;
235
+ break;
236
+ default:
237
+ neighbour = "workbench.parts.editor" ;
238
+ }
239
+ }
240
+ if (layoutService.isVisible(neighbour, activeWindow) || neighbour === "workbench.parts.editor" ) {
241
+ return neighbour;
242
+ }
243
+ return this.findVisibleNeighbour(layoutService, neighbour, next);
244
+ }
245
+ focusNextOrPreviousPart(layoutService, editorService, next) {
246
+ let currentlyFocusedPart;
247
+ if (editorService.activeEditorPane?.hasFocus() || layoutService.hasFocus("workbench.parts.editor" )) {
248
+ currentlyFocusedPart = "workbench.parts.editor" ;
249
+ }
250
+ else if (layoutService.hasFocus("workbench.parts.activitybar" )) {
251
+ currentlyFocusedPart = "workbench.parts.activitybar" ;
252
+ }
253
+ else if (layoutService.hasFocus("workbench.parts.statusbar" )) {
254
+ currentlyFocusedPart = "workbench.parts.statusbar" ;
255
+ }
256
+ else if (layoutService.hasFocus("workbench.parts.sidebar" )) {
257
+ currentlyFocusedPart = "workbench.parts.sidebar" ;
258
+ }
259
+ else if (layoutService.hasFocus("workbench.parts.panel" )) {
260
+ currentlyFocusedPart = "workbench.parts.panel" ;
261
+ }
262
+ layoutService.focusPart(currentlyFocusedPart ? this.findVisibleNeighbour(layoutService, currentlyFocusedPart, next) : "workbench.parts.editor" , getActiveWindow());
263
+ }
264
+ }
265
+ registerAction2(class extends BaseFocusAction {
266
+ constructor() {
267
+ super({
268
+ id: 'workbench.action.focusNextPart',
269
+ title: ( localize2WithPath(
270
+ 'vs/workbench/browser/actions/navigationActions',
271
+ 'focusNextPart',
272
+ 'Focus Next Part'
273
+ )),
274
+ category: Categories.View,
275
+ f1: true,
276
+ keybinding: {
277
+ primary: 64 ,
278
+ weight: 200
279
+ }
280
+ }, true);
281
+ }
282
+ });
283
+ registerAction2(class extends BaseFocusAction {
284
+ constructor() {
285
+ super({
286
+ id: 'workbench.action.focusPreviousPart',
287
+ title: ( localize2WithPath(
288
+ 'vs/workbench/browser/actions/navigationActions',
289
+ 'focusPreviousPart',
290
+ 'Focus Previous Part'
291
+ )),
292
+ category: Categories.View,
293
+ f1: true,
294
+ keybinding: {
295
+ primary: 1024 | 64 ,
296
+ weight: 200
297
+ }
298
+ }, false);
299
+ }
300
+ });
@@ -0,0 +1,83 @@
1
+ import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
2
+ import { Action, Separator } from '../../../base/common/actions.js';
3
+ import { localizeWithPath } from '../../../nls.js';
4
+ import { IWorkbenchLayoutService } from '../../services/layout/browser/layoutService.js';
5
+ import { IContextMenuService } from '../../../platform/contextview/browser/contextView.js';
6
+ import { Disposable } from '../../../base/common/lifecycle.js';
7
+ import { getActiveDocument, addDisposableListener, EventHelper, getWindow } from '../../../base/browser/dom.js';
8
+ import { registerWorkbenchContribution2 } from '../../common/contributions.js';
9
+ import { isNative } from '../../../base/common/platform.js';
10
+ import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js';
11
+ import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';
12
+ import { Event as Event$1 } from '../../../base/common/event.js';
13
+ import { Lazy } from '../../../base/common/lazy.js';
14
+ let TextInputActionsProvider = class TextInputActionsProvider extends Disposable {
15
+ static { this.ID = 'workbench.contrib.textInputActionsProvider'; }
16
+ constructor(layoutService, contextMenuService, clipboardService) {
17
+ super();
18
+ this.layoutService = layoutService;
19
+ this.contextMenuService = contextMenuService;
20
+ this.clipboardService = clipboardService;
21
+ this.textInputActions = ( new Lazy(() => this.createActions()));
22
+ this.registerListeners();
23
+ }
24
+ createActions() {
25
+ return [
26
+ (
27
+ new Action('undo', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'undo', "Undo")), undefined, true, async () => getActiveDocument().execCommand('undo'))),
28
+ ( new Action('redo', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'redo', "Redo")), undefined, true, async () => getActiveDocument().execCommand('redo'))),
29
+ ( new Separator()),
30
+ (
31
+ new Action('editor.action.clipboardCutAction', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'cut', "Cut")), undefined, true, async () => getActiveDocument().execCommand('cut'))),
32
+ ( new Action('editor.action.clipboardCopyAction', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'copy', "Copy")), undefined, true, async () => getActiveDocument().execCommand('copy'))),
33
+ ( new Action('editor.action.clipboardPasteAction', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'paste', "Paste")), undefined, true, async (element) => {
34
+ if (isNative) {
35
+ getActiveDocument().execCommand('paste');
36
+ }
37
+ else {
38
+ const clipboardText = await this.clipboardService.readText();
39
+ if (element instanceof HTMLTextAreaElement ||
40
+ element instanceof HTMLInputElement) {
41
+ const selectionStart = element.selectionStart || 0;
42
+ const selectionEnd = element.selectionEnd || 0;
43
+ element.value = `${element.value.substring(0, selectionStart)}${clipboardText}${element.value.substring(selectionEnd, element.value.length)}`;
44
+ element.selectionStart = selectionStart + clipboardText.length;
45
+ element.selectionEnd = element.selectionStart;
46
+ element.dispatchEvent(( new Event('input', { bubbles: true, cancelable: true })));
47
+ }
48
+ }
49
+ })),
50
+ ( new Separator()),
51
+ (
52
+ new Action('editor.action.selectAll', ( localizeWithPath('vs/workbench/browser/actions/textInputActions', 'selectAll', "Select All")), undefined, true, async () => getActiveDocument().execCommand('selectAll')))
53
+ ];
54
+ }
55
+ registerListeners() {
56
+ this._register(Event$1.runAndSubscribe(this.layoutService.onDidAddContainer, ({ container, disposables }) => {
57
+ disposables.add(addDisposableListener(container, 'contextmenu', e => this.onContextMenu(getWindow(container), e)));
58
+ }, { container: this.layoutService.mainContainer, disposables: this._store }));
59
+ }
60
+ onContextMenu(targetWindow, e) {
61
+ if (e.defaultPrevented) {
62
+ return;
63
+ }
64
+ const target = e.target;
65
+ if (!(target instanceof HTMLElement) || (target.nodeName.toLowerCase() !== 'input' && target.nodeName.toLowerCase() !== 'textarea')) {
66
+ return;
67
+ }
68
+ EventHelper.stop(e, true);
69
+ const event = ( new StandardMouseEvent(targetWindow, e));
70
+ this.contextMenuService.showContextMenu({
71
+ getAnchor: () => event,
72
+ getActions: () => this.textInputActions.value,
73
+ getActionsContext: () => target,
74
+ });
75
+ }
76
+ };
77
+ TextInputActionsProvider = ( __decorate([
78
+ ( __param(0, IWorkbenchLayoutService)),
79
+ ( __param(1, IContextMenuService)),
80
+ ( __param(2, IClipboardService))
81
+ ], TextInputActionsProvider));
82
+ registerWorkbenchContribution2(TextInputActionsProvider.ID, TextInputActionsProvider, 2 );
83
+ export { TextInputActionsProvider };
@@ -4,7 +4,7 @@ import { onDidRegisterWindow, addDisposableListener, DragAndDropObserver, EventT
4
4
  import { coalesce } from '../../base/common/arrays.js';
5
5
  import { UriList } from '../../base/common/dataTransfer.js';
6
6
  import { Event, Emitter } from '../../base/common/event.js';
7
- import { Disposable, DisposableStore } from '../../base/common/lifecycle.js';
7
+ import { Disposable, DisposableStore, markAsSingleton } from '../../base/common/lifecycle.js';
8
8
  import { stringify } from '../../base/common/marshalling.js';
9
9
  import { Mimes } from '../../base/common/mime.js';
10
10
  import { Schemas, FileAccess } from '../../base/common/network.js';
@@ -286,6 +286,7 @@ class CompositeDragAndDropObserver extends Disposable {
286
286
  static get INSTANCE() {
287
287
  if (!CompositeDragAndDropObserver.instance) {
288
288
  CompositeDragAndDropObserver.instance = ( new CompositeDragAndDropObserver());
289
+ markAsSingleton(CompositeDragAndDropObserver.instance);
289
290
  }
290
291
  return CompositeDragAndDropObserver.instance;
291
292
  }