@codingame/monaco-vscode-views-service-override 2.1.0 → 2.1.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-views-service-override",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@2.1.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.1.2",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-bulk-edit-service-override": "2.1.
|
|
24
|
-
"@codingame/monaco-vscode-layout-service-override": "2.1.
|
|
25
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "2.1.
|
|
26
|
-
"@codingame/monaco-vscode-keybindings-service-override": "2.1.
|
|
27
|
-
"@codingame/monaco-vscode-files-service-override": "2.1.
|
|
28
|
-
"@codingame/monaco-vscode-extensions-service-override": "2.1.
|
|
29
|
-
"@codingame/monaco-vscode-environment-service-override": "2.1.
|
|
30
|
-
"@codingame/monaco-vscode-host-service-override": "2.1.
|
|
31
|
-
"@codingame/monaco-vscode-base-service-override": "2.1.
|
|
23
|
+
"@codingame/monaco-vscode-bulk-edit-service-override": "2.1.2",
|
|
24
|
+
"@codingame/monaco-vscode-layout-service-override": "2.1.2",
|
|
25
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.1.2",
|
|
26
|
+
"@codingame/monaco-vscode-keybindings-service-override": "2.1.2",
|
|
27
|
+
"@codingame/monaco-vscode-files-service-override": "2.1.2",
|
|
28
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.1.2",
|
|
29
|
+
"@codingame/monaco-vscode-environment-service-override": "2.1.2",
|
|
30
|
+
"@codingame/monaco-vscode-host-service-override": "2.1.2",
|
|
31
|
+
"@codingame/monaco-vscode-base-service-override": "2.1.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
|
+
import { toErrorMessage } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
2
|
+
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
3
|
+
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
5
|
+
import { isWeb, isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
6
|
+
import { basename, joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
7
|
+
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
8
|
+
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
1
9
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
-
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
3
|
-
import { SideBySideEditorInput } from 'vscode/vscode/vs/workbench/common/editor/sideBySideEditorInput';
|
|
4
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
6
|
-
import { ExplorerFocusCondition, FilesExplorerFocusCondition, ExplorerFolderContext, TextFileContentProvider, VIEW_ID, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, VIEWLET_ID, ExplorerCompressedLastFocusContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
7
10
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
|
|
8
|
-
import { toErrorMessage } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
9
|
-
import { IListService } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
10
11
|
import { CommandsRegistry, ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
12
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
11
13
|
import { ContextKeyExpr, IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
15
|
+
import { EditorResolution, EditorOpenSource } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
12
16
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
17
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
18
|
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
14
|
-
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
15
|
-
import { isWeb, isWindows } from 'vscode/vscode/vs/base/common/platform';
|
|
16
|
-
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
17
|
-
import { IExplorerService, getMultiSelectedResources, getResourceForCommand, getOpenEditorsViewMultiSelection } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
|
|
18
|
-
import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing';
|
|
19
|
-
import { getMultiSelectedEditorContexts } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
20
|
-
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
21
|
-
import { INotificationService, Severity } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
22
|
-
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
23
|
-
import { IEditorService, SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
24
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
25
19
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
29
|
-
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
30
|
-
import { EmbeddedCodeEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/embeddedCodeEditorWidget';
|
|
31
|
-
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
20
|
+
import { IListService } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
21
|
+
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
32
22
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
33
|
-
import {
|
|
34
|
-
import { toAction } from 'vscode/vscode/vs/base/common/actions';
|
|
35
|
-
import { EditorResolution, EditorOpenSource } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
36
|
-
import { hash } from 'vscode/vscode/vs/base/common/hash';
|
|
37
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
38
|
-
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
|
|
39
|
-
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
40
|
-
import { OPEN_TO_SIDE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, COMPARE_SELECTED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, PREVIOUS_COMPRESSED_FOLDER, NEXT_COMPRESSED_FOLDER, FIRST_COMPRESSED_FOLDER, LAST_COMPRESSED_FOLDER, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_FILE_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
41
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
23
|
+
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
42
24
|
import { RemoveRootFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
|
|
25
|
+
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
26
|
+
import { IExplorerService, getMultiSelectedResources, getResourceForCommand, getOpenEditorsViewMultiSelection } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
|
|
43
27
|
import { OpenEditorsView } from 'vscode/vscode/vs/workbench/contrib/files/browser/views/openEditorsView';
|
|
28
|
+
import { ExplorerFocusCondition, FilesExplorerFocusCondition, ExplorerFolderContext, TextFileContentProvider, VIEW_ID, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, VIEWLET_ID, ExplorerCompressedLastFocusContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
29
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
30
|
+
import { IEditorService, SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
31
|
+
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
|
|
32
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
|
|
33
|
+
import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing';
|
|
34
|
+
import { OPEN_TO_SIDE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, COMPARE_SELECTED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REVERT_FILE_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, PREVIOUS_COMPRESSED_FOLDER, NEXT_COMPRESSED_FOLDER, FIRST_COMPRESSED_FOLDER, LAST_COMPRESSED_FOLDER, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_FILE_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
35
|
+
import 'vscode/vscode/vs/workbench/contrib/files/browser/fileCommands.save';
|
|
44
36
|
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
45
37
|
|
|
46
38
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
@@ -301,146 +293,6 @@ CommandsRegistry.registerCommand({
|
|
|
301
293
|
return undefined;
|
|
302
294
|
}
|
|
303
295
|
});
|
|
304
|
-
async function saveSelectedEditors(accessor, options) {
|
|
305
|
-
const listService = accessor.get(IListService);
|
|
306
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
307
|
-
const codeEditorService = accessor.get(ICodeEditorService);
|
|
308
|
-
const textFileService = accessor.get(ITextFileService);
|
|
309
|
-
let editors = getOpenEditorsViewMultiSelection(listService);
|
|
310
|
-
if (!editors) {
|
|
311
|
-
const activeGroup = editorGroupService.activeGroup;
|
|
312
|
-
if (activeGroup.activeEditor) {
|
|
313
|
-
editors = [];
|
|
314
|
-
if (activeGroup.activeEditor instanceof SideBySideEditorInput &&
|
|
315
|
-
!options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(4 ) || activeGroup.activeEditor.secondary.hasCapability(4 )) &&
|
|
316
|
-
activeGroup.activeEditor.secondary.isModified()) {
|
|
317
|
-
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary });
|
|
318
|
-
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary });
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor });
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
if (!editors || editors.length === 0) {
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
await doSaveEditors(accessor, editors, options);
|
|
329
|
-
const focusedCodeEditor = codeEditorService.getFocusedCodeEditor();
|
|
330
|
-
if (focusedCodeEditor instanceof EmbeddedCodeEditorWidget && !focusedCodeEditor.isSimpleWidget) {
|
|
331
|
-
const resource = focusedCodeEditor.getModel()?.uri;
|
|
332
|
-
if (resource && !( editors.some(
|
|
333
|
-
({ editor }) => isEqual(EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY }), resource)
|
|
334
|
-
))) {
|
|
335
|
-
const model = textFileService.files.get(resource);
|
|
336
|
-
if (!model?.isReadonly()) {
|
|
337
|
-
await textFileService.save(resource, options);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
function saveDirtyEditorsOfGroups(accessor, groups, options) {
|
|
343
|
-
const dirtyEditors = [];
|
|
344
|
-
for (const group of groups) {
|
|
345
|
-
for (const editor of group.getEditors(0 )) {
|
|
346
|
-
if (editor.isDirty()) {
|
|
347
|
-
dirtyEditors.push({ groupId: group.id, editor });
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
return doSaveEditors(accessor, dirtyEditors, options);
|
|
352
|
-
}
|
|
353
|
-
async function doSaveEditors(accessor, editors, options) {
|
|
354
|
-
const editorService = accessor.get(IEditorService);
|
|
355
|
-
const notificationService = accessor.get(INotificationService);
|
|
356
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
357
|
-
try {
|
|
358
|
-
await editorService.save(editors, options);
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
if (!isCancellationError(error)) {
|
|
362
|
-
notificationService.notify({
|
|
363
|
-
id: ( editors.map(({ editor }) => hash(editor.resource?.toString()))).join(),
|
|
364
|
-
severity: Severity.Error,
|
|
365
|
-
message: ( localizeWithPath(
|
|
366
|
-
'vs/workbench/contrib/files/browser/fileCommands',
|
|
367
|
-
{ key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] },
|
|
368
|
-
"Failed to save '{0}': {1}",
|
|
369
|
-
( editors.map(({ editor }) => editor.getName())).join(', '),
|
|
370
|
-
toErrorMessage(error, false)
|
|
371
|
-
)),
|
|
372
|
-
actions: {
|
|
373
|
-
primary: [
|
|
374
|
-
toAction({ id: 'workbench.action.files.saveEditors', label: ( localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'retry', "Retry")), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) }),
|
|
375
|
-
toAction({ id: 'workbench.action.files.revertEditors', label: ( localizeWithPath('vs/workbench/contrib/files/browser/fileCommands', 'discard', "Discard")), run: () => editorService.revert(editors) })
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
383
|
-
when: undefined,
|
|
384
|
-
weight: 200 ,
|
|
385
|
-
primary: 2048 | 49 ,
|
|
386
|
-
id: SAVE_FILE_COMMAND_ID,
|
|
387
|
-
handler: accessor => {
|
|
388
|
-
return saveSelectedEditors(accessor, { reason: 1 , force: true });
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
392
|
-
when: undefined,
|
|
393
|
-
weight: 200 ,
|
|
394
|
-
primary: KeyChord(2048 | 41 , 49 ),
|
|
395
|
-
win: { primary: KeyChord(2048 | 41 , 2048 | 1024 | 49 ) },
|
|
396
|
-
id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID,
|
|
397
|
-
handler: accessor => {
|
|
398
|
-
return saveSelectedEditors(accessor, { reason: 1 , force: true , skipSaveParticipants: true });
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
402
|
-
id: SAVE_FILE_AS_COMMAND_ID,
|
|
403
|
-
weight: 200 ,
|
|
404
|
-
when: undefined,
|
|
405
|
-
primary: 2048 | 1024 | 49 ,
|
|
406
|
-
handler: accessor => {
|
|
407
|
-
return saveSelectedEditors(accessor, { reason: 1 , saveAs: true });
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
411
|
-
when: undefined,
|
|
412
|
-
weight: 200 ,
|
|
413
|
-
primary: undefined,
|
|
414
|
-
mac: { primary: 2048 | 512 | 49 },
|
|
415
|
-
win: { primary: KeyChord(2048 | 41 , 49 ) },
|
|
416
|
-
id: SAVE_ALL_COMMAND_ID,
|
|
417
|
-
handler: accessor => {
|
|
418
|
-
return saveDirtyEditorsOfGroups(accessor, accessor.get(IEditorGroupsService).getGroups(1 ), { reason: 1 });
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
CommandsRegistry.registerCommand({
|
|
422
|
-
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
423
|
-
handler: (accessor, _, editorContext) => {
|
|
424
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
425
|
-
const contexts = getMultiSelectedEditorContexts(editorContext, accessor.get(IListService), accessor.get(IEditorGroupsService));
|
|
426
|
-
let groups = undefined;
|
|
427
|
-
if (!contexts.length) {
|
|
428
|
-
groups = editorGroupService.getGroups(1 );
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
groups = coalesce(( contexts.map(context => editorGroupService.getGroup(context.groupId))));
|
|
432
|
-
}
|
|
433
|
-
return saveDirtyEditorsOfGroups(accessor, groups, { reason: 1 });
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
CommandsRegistry.registerCommand({
|
|
437
|
-
id: SAVE_FILES_COMMAND_ID,
|
|
438
|
-
handler: async (accessor) => {
|
|
439
|
-
const editorService = accessor.get(IEditorService);
|
|
440
|
-
const res = await editorService.saveAll({ includeUntitled: false, reason: 1 });
|
|
441
|
-
return res.success;
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
296
|
CommandsRegistry.registerCommand({
|
|
445
297
|
id: REVERT_FILE_COMMAND_ID,
|
|
446
298
|
handler: async (accessor) => {
|