@codingame/monaco-vscode-api 1.79.9-next.0 → 1.79.9-next.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.
|
@@ -5,10 +5,13 @@ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/r
|
|
|
5
5
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
6
6
|
import { CodeEditorService } from '../vscode/vs/workbench/services/editor/browser/codeEditorService.js';
|
|
7
7
|
import { IEditorService } from '../vscode/vs/workbench/services/editor/common/editorService.js';
|
|
8
|
+
import { EditorExtensions } from '../vscode/vs/workbench/common/editor.js';
|
|
8
9
|
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
9
10
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
10
11
|
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
11
12
|
import { ITextEditorService, TextEditorService } from '../vscode/vs/workbench/services/textfile/common/textEditorService.js';
|
|
13
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
14
|
+
import { FILE_EDITOR_INPUT_ID } from '../vscode/vs/workbench/contrib/files/common/files.js';
|
|
12
15
|
import { wrapOpenEditor } from './tools/editor.js';
|
|
13
16
|
import { unsupported } from '../tools.js';
|
|
14
17
|
import '../vscode/vs/workbench/browser/parts/editor/editor.contribution.js';
|
|
@@ -64,6 +67,11 @@ let EditorService = class EditorService extends Disposable {
|
|
|
64
67
|
EditorService = __decorate([
|
|
65
68
|
( __param(1, ITextModelService))
|
|
66
69
|
], EditorService);
|
|
70
|
+
( Registry.as(EditorExtensions.EditorFactory)).registerFileEditorFactory({
|
|
71
|
+
typeId: FILE_EDITOR_INPUT_ID,
|
|
72
|
+
createFileEditor: unsupported,
|
|
73
|
+
isFileEditor: (obj) => false
|
|
74
|
+
});
|
|
67
75
|
function getServiceOverride(openEditor) {
|
|
68
76
|
return {
|
|
69
77
|
[( ICodeEditorService.toString())]: new SyncDescriptor(CodeEditorService, undefined, true),
|
|
@@ -2,6 +2,10 @@ import { I as IEditorOverrideServices } from '../standaloneServices.js';
|
|
|
2
2
|
import '../instantiation.js';
|
|
3
3
|
import 'monaco-editor';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface QuickAccessProps {
|
|
6
|
+
isKeybindingConfigurationVisible?: () => boolean;
|
|
7
|
+
shouldUseGlobalPicker?: () => boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function getServiceOverride({ isKeybindingConfigurationVisible: _isKeybindingConfigurationVisible, shouldUseGlobalPicker: _shouldUseGlobalPicker }?: QuickAccessProps): IEditorOverrideServices;
|
|
6
10
|
|
|
7
11
|
export { getServiceOverride as default };
|
|
@@ -9,9 +9,27 @@ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiati
|
|
|
9
9
|
import { QuickInputService } from '../vscode/vs/workbench/services/quickinput/browser/quickInputService.js';
|
|
10
10
|
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
11
11
|
import { StandaloneCodeEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
|
|
12
|
+
import { CommandsQuickAccessProvider } from '../vscode/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js';
|
|
12
13
|
import '../vscode/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoLineQuickAccess.js';
|
|
13
14
|
import '../vscode/vs/workbench/browser/actions/quickAccessActions.js';
|
|
14
15
|
import '../vscode/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js';
|
|
16
|
+
let isKeybindingConfigurationVisible = () => {
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
let shouldUseGlobalPicker = () => {
|
|
20
|
+
return true;
|
|
21
|
+
};
|
|
22
|
+
const original = CommandsQuickAccessProvider.prototype['getCommandPicks'];
|
|
23
|
+
CommandsQuickAccessProvider.prototype['getCommandPicks'] = async function (token) {
|
|
24
|
+
let result = await original.call(this, token);
|
|
25
|
+
if (!isKeybindingConfigurationVisible()) {
|
|
26
|
+
result = ( result.map(picks => ({
|
|
27
|
+
...picks,
|
|
28
|
+
buttons: picks.buttons?.filter(button => button.tooltip !== 'Configure Keybinding')
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
15
33
|
let DelegateQuickInputService = class DelegateQuickInputService {
|
|
16
34
|
constructor(instantiationService) {
|
|
17
35
|
this.instantiationService = instantiationService;
|
|
@@ -19,7 +37,7 @@ let DelegateQuickInputService = class DelegateQuickInputService {
|
|
|
19
37
|
}
|
|
20
38
|
get activeService() {
|
|
21
39
|
const activeCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor();
|
|
22
|
-
if (!(activeCodeEditor instanceof StandaloneCodeEditor)) {
|
|
40
|
+
if (!(activeCodeEditor instanceof StandaloneCodeEditor) && shouldUseGlobalPicker()) {
|
|
23
41
|
return this.workbenchQuickInputService;
|
|
24
42
|
}
|
|
25
43
|
this.standaloneQuickInputService ?? (this.standaloneQuickInputService = this.instantiationService.createInstance(StandaloneQuickInputService));
|
|
@@ -63,7 +81,13 @@ let DelegateQuickInputService = class DelegateQuickInputService {
|
|
|
63
81
|
DelegateQuickInputService = __decorate([
|
|
64
82
|
( __param(0, IInstantiationService))
|
|
65
83
|
], DelegateQuickInputService);
|
|
66
|
-
function getServiceOverride() {
|
|
84
|
+
function getServiceOverride({ isKeybindingConfigurationVisible: _isKeybindingConfigurationVisible, shouldUseGlobalPicker: _shouldUseGlobalPicker } = {}) {
|
|
85
|
+
if (_isKeybindingConfigurationVisible != null) {
|
|
86
|
+
isKeybindingConfigurationVisible = _isKeybindingConfigurationVisible;
|
|
87
|
+
}
|
|
88
|
+
if (_shouldUseGlobalPicker != null) {
|
|
89
|
+
shouldUseGlobalPicker = _shouldUseGlobalPicker;
|
|
90
|
+
}
|
|
67
91
|
return {
|
|
68
92
|
[( IQuickInputService.toString())]: new SyncDescriptor(DelegateQuickInputService)
|
|
69
93
|
};
|
|
@@ -586,6 +586,7 @@ interface CustomViewOption {
|
|
|
586
586
|
}[];
|
|
587
587
|
}
|
|
588
588
|
declare function registerCustomView(options: CustomViewOption): IDisposable;
|
|
589
|
+
declare function isEditorPartVisible(): boolean;
|
|
589
590
|
declare function getServiceOverride(openEditorFallback?: OpenEditor): IEditorOverrideServices;
|
|
590
591
|
|
|
591
|
-
export { CustomViewOption, OpenEditor, ViewContainerLocation, getServiceOverride as default, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
592
|
+
export { CustomViewOption, OpenEditor, ViewContainerLocation, getServiceOverride as default, isEditorPartVisible, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
@@ -275,18 +275,20 @@ let EditorDropService = class EditorDropService {
|
|
|
275
275
|
EditorDropService = __decorate([
|
|
276
276
|
( __param(0, IEditorGroupsService))
|
|
277
277
|
], EditorDropService);
|
|
278
|
+
function isEditorPartVisible() {
|
|
279
|
+
const editorPart = StandaloneServices.get(IEditorGroupsService);
|
|
280
|
+
return editorPart.getContainer()?.isConnected ?? false;
|
|
281
|
+
}
|
|
278
282
|
let MonacoEditorService = class MonacoEditorService extends EditorService {
|
|
279
283
|
constructor(_openEditorFallback, _editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService, textModelService) {
|
|
280
284
|
super(_editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService);
|
|
281
|
-
this._editorGroupService = _editorGroupService;
|
|
282
285
|
this.openEditor = wrapOpenEditor(textModelService, this.openEditor.bind(this), _openEditorFallback);
|
|
283
286
|
}
|
|
284
287
|
get activeTextEditorControl() {
|
|
285
288
|
return super.activeTextEditorControl ?? StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor() ?? undefined;
|
|
286
289
|
}
|
|
287
290
|
async openEditor(editor, optionsOrPreferredGroup, preferredGroup) {
|
|
288
|
-
|
|
289
|
-
if (!(editorPart.getContainer()?.isConnected ?? false)) {
|
|
291
|
+
if (!isEditorPartVisible()) {
|
|
290
292
|
return undefined;
|
|
291
293
|
}
|
|
292
294
|
return super.openEditor(editor, optionsOrPreferredGroup, preferredGroup);
|
|
@@ -334,4 +336,4 @@ function getServiceOverride(openEditorFallback) {
|
|
|
334
336
|
[( IWebviewWorkbenchService.toString())]: new SyncDescriptor(WebviewEditorService)
|
|
335
337
|
};
|
|
336
338
|
}
|
|
337
|
-
export { getServiceOverride as default, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|
|
339
|
+
export { getServiceOverride as default, isEditorPartVisible, registerCustomView, renderActivitybarPar, renderEditorPart, renderPanelPart, renderSidebarPart, renderStatusBarPart };
|