monaco-languageclient 6.4.6 → 6.5.0-next.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/CHANGELOG.md +10 -6
- package/lib/monaco-vscode-api-services.d.ts +11 -46
- package/lib/monaco-vscode-api-services.d.ts.map +1 -1
- package/lib/monaco-vscode-api-services.js +32 -142
- package/lib/monaco-vscode-api-services.js.map +1 -1
- package/package.json +10 -8
- package/src/monaco-vscode-api-services.ts +35 -185
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this npm module are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [6.5.0] - 2023-09-2x
|
|
6
|
+
|
|
7
|
+
- Updated to `monaco-editor` `0.43.0` and `monaco-vscode-api` `1.82.0`
|
|
8
|
+
|
|
5
9
|
## [6.4.6] - 2023-09-05
|
|
6
10
|
|
|
7
|
-
-
|
|
11
|
+
- Updated to `monaco-vscode-api` `1.81.7`
|
|
8
12
|
|
|
9
13
|
## [6.4.5] - 2023-08-30
|
|
10
14
|
|
|
@@ -13,16 +17,16 @@ All notable changes to this npm module are documented in this file.
|
|
|
13
17
|
|
|
14
18
|
## [6.4.4] - 2023-08-24
|
|
15
19
|
|
|
16
|
-
-
|
|
20
|
+
- Updated to `monaco-vscode-api` `1.81.5`
|
|
17
21
|
- Added python language client and language server (pyright) examples
|
|
18
22
|
|
|
19
23
|
## [6.4.3] - 2023-08-22
|
|
20
24
|
|
|
21
|
-
-
|
|
25
|
+
- Updated to `monaco-vscode-api` `1.81.3`
|
|
22
26
|
|
|
23
27
|
## [6.4.2] - 2023-08-19
|
|
24
28
|
|
|
25
|
-
-
|
|
29
|
+
- Updated to `monaco-vscode-api` `1.81.2`
|
|
26
30
|
|
|
27
31
|
## [6.4.1] - 2023-08-18
|
|
28
32
|
|
|
@@ -32,11 +36,11 @@ All notable changes to this npm module are documented in this file.
|
|
|
32
36
|
|
|
33
37
|
## [6.4.0] - 2023-08-10
|
|
34
38
|
|
|
35
|
-
-
|
|
39
|
+
- Updated to `monaco-editor` `0.41.0` and `monaco-vscode-api` `1.81.0` [#520](https://github.com/TypeFox/monaco-languageclient/pull/520)
|
|
36
40
|
|
|
37
41
|
## [6.3.0] - 2023-08-04
|
|
38
42
|
|
|
39
|
-
-
|
|
43
|
+
- Updated to `monaco-editor` `0.40.0` and `monaco-vscode-api` `1.80.2` [#513](https://github.com/TypeFox/monaco-languageclient/pull/513)
|
|
40
44
|
- vscode api services have been cleaned-up and fully aligned with `monaco-vscode-api
|
|
41
45
|
|
|
42
46
|
## [6.2.0] - 2023-06-16
|
|
@@ -1,60 +1,25 @@
|
|
|
1
1
|
import { editor } from 'monaco-editor';
|
|
2
2
|
import { LogLevel } from 'vscode/services';
|
|
3
|
-
import
|
|
4
|
-
import { ITerminalBackend, SimpleTerminalBackend } from 'vscode/service-override/terminal';
|
|
5
|
-
import { IStorageProvider } from 'vscode/service-override/storage';
|
|
3
|
+
import { OpenEditor } from '@codingame/monaco-vscode-editor-service-override';
|
|
6
4
|
export type InitializeServiceConfig = {
|
|
7
|
-
enableDialogService?: boolean;
|
|
8
|
-
enableNotificationService?: boolean;
|
|
9
|
-
enableModelService?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* editor service is the default. If you want to use the views service, set enableViewsService to true.
|
|
12
|
-
*/
|
|
13
|
-
configureEditorOrViewsService?: {
|
|
14
|
-
enableViewsService?: boolean;
|
|
15
|
-
openEditorFunc?: OpenEditor;
|
|
16
|
-
};
|
|
17
|
-
configureConfigurationService?: {
|
|
18
|
-
defaultWorkspaceUri: string;
|
|
19
|
-
};
|
|
20
|
-
enableThemeService?: boolean;
|
|
21
|
-
enableKeybindingsService?: boolean;
|
|
22
|
-
enableTextmateService?: boolean;
|
|
23
|
-
enableLanguagesService?: boolean;
|
|
24
|
-
enableAudioCueService?: boolean;
|
|
25
|
-
enableDebugService?: boolean;
|
|
26
|
-
enablePreferencesService?: boolean;
|
|
27
|
-
enableSnippetsService?: boolean;
|
|
28
|
-
enableOutputService?: boolean;
|
|
29
|
-
configureTerminalService?: {
|
|
30
|
-
backendImpl: SimpleTerminalBackend | ITerminalBackend;
|
|
31
|
-
};
|
|
32
|
-
enableSearchService?: boolean;
|
|
33
|
-
enableMarkersService?: boolean;
|
|
34
|
-
enableAccessibilityService?: boolean;
|
|
35
|
-
enableLanguageDetectionWorkerService?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* If no provider is specified, the default BrowserStorageService is used.
|
|
38
|
-
*/
|
|
39
|
-
configureStorageService?: {
|
|
40
|
-
provider?: IStorageProvider;
|
|
41
|
-
};
|
|
42
5
|
userServices?: editor.IEditorOverrideServices;
|
|
43
6
|
debugLogging?: boolean;
|
|
44
7
|
logLevel?: LogLevel;
|
|
45
8
|
};
|
|
46
9
|
export declare const wasVscodeApiInitialized: () => boolean;
|
|
47
10
|
export declare const initServices: (config?: InitializeServiceConfig) => Promise<void>;
|
|
48
|
-
export
|
|
49
|
-
default: (x?: any) => editor.IEditorOverrideServices;
|
|
50
|
-
};
|
|
11
|
+
export declare const useOpenEditorStub: OpenEditor;
|
|
51
12
|
/**
|
|
52
13
|
* monaco-vscode-api automatically loads the following services:
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
14
|
+
* - layout
|
|
15
|
+
* - environment
|
|
16
|
+
* - extension
|
|
17
|
+
* - files
|
|
18
|
+
* - quickAccess
|
|
19
|
+
*
|
|
20
|
+
* monaco-languageclient always adds the following services:
|
|
21
|
+
* - languages
|
|
22
|
+
* - model
|
|
58
23
|
*/
|
|
59
24
|
export declare const importAllServices: (config?: InitializeServiceConfig) => Promise<void>;
|
|
60
25
|
//# sourceMappingURL=monaco-vscode-api-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-vscode-api-services.d.ts","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"monaco-vscode-api-services.d.ts","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AACpD,OAAO,EAA2B,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAQ9E,MAAM,MAAM,uBAAuB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC,uBAAuB,CAAC;IAC9C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAEnC,CAAC;AAEF,eAAO,MAAM,YAAY,YAAmB,uBAAuB,kBAclE,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,UAG/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,YAAmB,uBAAuB,kBA2CvE,CAAC"}
|
|
@@ -2,121 +2,51 @@
|
|
|
2
2
|
* Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
|
-
import {
|
|
6
|
-
import { ILogService, initialize as initializeMonacoService, StandaloneServices } from 'vscode/services';
|
|
5
|
+
import { ILogService, initialize, StandaloneServices } from 'vscode/services';
|
|
7
6
|
import { initialize as initializeVscodeExtensions } from 'vscode/extensions';
|
|
7
|
+
import getLanguagesServiceOverride from '@codingame/monaco-vscode-languages-service-override';
|
|
8
|
+
import getModelServiceOverride from '@codingame/monaco-vscode-model-service-override';
|
|
8
9
|
export const wasVscodeApiInitialized = () => {
|
|
9
10
|
return window.MonacoEnvironment?.vscodeApiInitialised === true;
|
|
10
11
|
};
|
|
11
12
|
export const initServices = async (config) => {
|
|
12
13
|
await importAllServices(config);
|
|
13
14
|
if (config?.debugLogging === true) {
|
|
14
|
-
console.log('
|
|
15
|
+
console.log('initialize completed successfully');
|
|
15
16
|
}
|
|
16
17
|
await initializeVscodeExtensions();
|
|
17
18
|
if (config?.debugLogging === true) {
|
|
18
19
|
console.log('initializeVscodeExtensions completed successfully');
|
|
19
20
|
}
|
|
20
21
|
if (!window.MonacoEnvironment) {
|
|
21
|
-
window.MonacoEnvironment = {
|
|
22
|
-
createTrustedTypesPolicy: (_policyName) => {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
22
|
+
window.MonacoEnvironment = {};
|
|
26
23
|
}
|
|
27
24
|
window.MonacoEnvironment.vscodeApiInitialised = true;
|
|
28
25
|
};
|
|
26
|
+
export const useOpenEditorStub = async (modelRef, options, sideBySide) => {
|
|
27
|
+
console.log('Received open editor call with parameters: ', modelRef, options, sideBySide);
|
|
28
|
+
return undefined;
|
|
29
|
+
};
|
|
29
30
|
/**
|
|
30
31
|
* monaco-vscode-api automatically loads the following services:
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* - layout
|
|
33
|
+
* - environment
|
|
34
|
+
* - extension
|
|
35
|
+
* - files
|
|
36
|
+
* - quickAccess
|
|
37
|
+
*
|
|
38
|
+
* monaco-languageclient always adds the following services:
|
|
39
|
+
* - languages
|
|
40
|
+
* - model
|
|
36
41
|
*/
|
|
37
42
|
export const importAllServices = async (config) => {
|
|
38
43
|
const serviceNames = [];
|
|
39
|
-
const promises = [];
|
|
40
44
|
const lc = config ?? {};
|
|
41
45
|
const userServices = lc.userServices ?? {};
|
|
42
|
-
const
|
|
43
|
-
serviceNames.push(name);
|
|
44
|
-
promises.push(promise);
|
|
45
|
-
};
|
|
46
|
-
if (lc.enableModelService === true) {
|
|
47
|
-
addService('model', import('vscode/service-override/model'));
|
|
48
|
-
}
|
|
49
|
-
if (lc.configureEditorOrViewsService !== undefined) {
|
|
50
|
-
if (lc.configureEditorOrViewsService.enableViewsService === true) {
|
|
51
|
-
addService('views', import('vscode/service-override/views'));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
addService('editor', import('vscode/service-override/editor'));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (lc.configureConfigurationService !== undefined) {
|
|
58
|
-
addService('configuration', import('vscode/service-override/configuration'));
|
|
59
|
-
}
|
|
60
|
-
if (lc.enableDialogService === true) {
|
|
61
|
-
addService('dialogs', import('vscode/service-override/dialogs'));
|
|
62
|
-
}
|
|
63
|
-
if (lc.enableNotificationService === true) {
|
|
64
|
-
addService('notifications', import('vscode/service-override/notifications'));
|
|
65
|
-
}
|
|
66
|
-
if (lc.enableThemeService === true) {
|
|
67
|
-
addService('theme', import('vscode/service-override/theme'));
|
|
68
|
-
}
|
|
69
|
-
if (lc.enableTextmateService === true) {
|
|
70
|
-
addService('textmate', import('vscode/service-override/textmate'));
|
|
71
|
-
}
|
|
72
|
-
if (lc.enableKeybindingsService === true) {
|
|
73
|
-
addService('keybindings', import('vscode/service-override/keybindings'));
|
|
74
|
-
}
|
|
75
|
-
if (lc.enableLanguagesService === true) {
|
|
76
|
-
addService('languages', import('vscode/service-override/languages'));
|
|
77
|
-
}
|
|
78
|
-
if (lc.enableAudioCueService === true) {
|
|
79
|
-
addService('audioCue', import('vscode/service-override/audioCue'));
|
|
80
|
-
}
|
|
81
|
-
if (lc.enableDebugService === true) {
|
|
82
|
-
addService('debug', import('vscode/service-override/debug'));
|
|
83
|
-
}
|
|
84
|
-
if (lc.enablePreferencesService === true) {
|
|
85
|
-
addService('preferences', import('vscode/service-override/preferences'));
|
|
86
|
-
}
|
|
87
|
-
if (lc.enableSnippetsService === true) {
|
|
88
|
-
addService('snippets', import('vscode/service-override/snippets'));
|
|
89
|
-
}
|
|
90
|
-
if (lc.enableOutputService === true) {
|
|
91
|
-
addService('output', import('vscode/service-override/output'));
|
|
92
|
-
}
|
|
93
|
-
if (lc.configureTerminalService !== undefined) {
|
|
94
|
-
addService('terminal', import('vscode/service-override/terminal'));
|
|
95
|
-
}
|
|
96
|
-
if (lc.enableSearchService === true) {
|
|
97
|
-
addService('search', import('vscode/service-override/search'));
|
|
98
|
-
}
|
|
99
|
-
if (lc.enableMarkersService === true) {
|
|
100
|
-
addService('markers', import('vscode/service-override/markers'));
|
|
101
|
-
}
|
|
102
|
-
if (lc.enableAccessibilityService === true) {
|
|
103
|
-
addService('accessibility', import('vscode/service-override/accessibility'));
|
|
104
|
-
}
|
|
105
|
-
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
106
|
-
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
107
|
-
}
|
|
108
|
-
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
109
|
-
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
110
|
-
}
|
|
111
|
-
const reportServiceLoading = (services, debugLogging, origin) => {
|
|
46
|
+
const reportServiceLoading = (services, debugLogging) => {
|
|
112
47
|
for (const serviceName of Object.keys(services)) {
|
|
113
48
|
if (debugLogging) {
|
|
114
|
-
|
|
115
|
-
console.log(`Loading ${origin} service: ${serviceName}`);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
console.log(`Loading service: ${serviceName}`);
|
|
119
|
-
}
|
|
49
|
+
console.log(`Loading service: ${serviceName}`);
|
|
120
50
|
}
|
|
121
51
|
}
|
|
122
52
|
};
|
|
@@ -125,65 +55,25 @@ export const importAllServices = async (config) => {
|
|
|
125
55
|
overrideServices[name] = service;
|
|
126
56
|
}
|
|
127
57
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
const haveTextmateService = serviceNames.includes('textmate') || Object.keys(overrideServices).includes('textMateTokenizationFeature');
|
|
58
|
+
const mlcDefautServices = {
|
|
59
|
+
...getLanguagesServiceOverride(),
|
|
60
|
+
...getModelServiceOverride()
|
|
61
|
+
};
|
|
62
|
+
mergeServices(mlcDefautServices, userServices);
|
|
63
|
+
reportServiceLoading(userServices, lc.debugLogging === true);
|
|
64
|
+
const haveThemeService = serviceNames.includes('theme') || Object.keys(userServices).includes('themeService');
|
|
65
|
+
const haveTextmateService = serviceNames.includes('textmate') || Object.keys(userServices).includes('textMateTokenizationFeature');
|
|
137
66
|
const haveMarkersService = serviceNames.includes('markers');
|
|
138
|
-
const haveViewsService = serviceNames.includes('views') || Object.keys(
|
|
67
|
+
const haveViewsService = serviceNames.includes('views') || Object.keys(userServices).includes('viewsService');
|
|
139
68
|
// theme requires textmate
|
|
140
69
|
if (haveThemeService && !haveTextmateService) {
|
|
141
|
-
throw new Error('"theme" requires "textmate" service. Please add it to the "
|
|
70
|
+
throw new Error('"theme" requires "textmate" service. Please add it to the "userServices".');
|
|
142
71
|
}
|
|
143
72
|
// markers service requires views service
|
|
144
73
|
if (haveMarkersService && !haveViewsService) {
|
|
145
|
-
throw new Error('"markers" requires "views" service. Please add it to the "
|
|
146
|
-
}
|
|
147
|
-
for (const loadedImport of loadedImports) {
|
|
148
|
-
const serviceName = serviceNames[count];
|
|
149
|
-
if (lc.debugLogging === true) {
|
|
150
|
-
console.log(`Initialising provided service: ${serviceName}`);
|
|
151
|
-
}
|
|
152
|
-
let services = {};
|
|
153
|
-
if (serviceName === 'editor' || serviceName === 'views') {
|
|
154
|
-
if (lc.configureEditorOrViewsService?.openEditorFunc) {
|
|
155
|
-
services = loadedImport.default(lc.configureEditorOrViewsService.openEditorFunc);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
const defaultOpenEditorFunc = async (model, options, sideBySide) => {
|
|
159
|
-
console.log('Trying to open a model', model, options, sideBySide);
|
|
160
|
-
return undefined;
|
|
161
|
-
};
|
|
162
|
-
services = loadedImport.default(defaultOpenEditorFunc);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
else if (serviceName === 'configuration') {
|
|
166
|
-
if (lc.configureConfigurationService?.defaultWorkspaceUri) {
|
|
167
|
-
const uri = Uri.file(lc.configureConfigurationService.defaultWorkspaceUri);
|
|
168
|
-
services = loadedImport.default(uri);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
else if (serviceName === 'terminal') {
|
|
172
|
-
if (lc.configureTerminalService?.backendImpl) {
|
|
173
|
-
services = loadedImport.default(lc.configureTerminalService.backendImpl);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
else if (serviceName === 'storage') {
|
|
177
|
-
services = loadedImport.default(lc.configureStorageService?.provider);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
services = loadedImport.default();
|
|
181
|
-
}
|
|
182
|
-
mergeServices(services, overrideServices);
|
|
183
|
-
reportServiceLoading(services, lc.debugLogging === true);
|
|
184
|
-
count++;
|
|
74
|
+
throw new Error('"markers" requires "views" service. Please add it to the "userServices".');
|
|
185
75
|
}
|
|
186
|
-
await
|
|
76
|
+
await initialize(userServices);
|
|
187
77
|
if (lc.logLevel) {
|
|
188
78
|
StandaloneServices.get(ILogService).setLevel(lc.logLevel);
|
|
189
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-vscode-api-services.js","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"monaco-vscode-api-services.js","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAY,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,UAAU,IAAI,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,2BAA2B,MAAM,qDAAqD,CAAC;AAC9F,OAAO,uBAAuB,MAAM,iDAAiD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ChG;IAED,yCAAyC;IACzC,IAAI,kBAAkB,IAAI,CAAC,gBAAgB,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;KAC/F;IAED,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,QAAQ,EAAE;QACb,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;KAC7D;AACL,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monaco-languageclient",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0-next.0",
|
|
4
4
|
"description": "Monaco Language client implementation",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TypeFox GmbH",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/TypeFox/monaco-languageclient",
|
|
13
|
+
"url": "git+https://github.com/TypeFox/monaco-languageclient.git",
|
|
14
14
|
"directory": "packages/client"
|
|
15
15
|
},
|
|
16
16
|
"bugs": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"npm": ">=9.0.0"
|
|
38
38
|
},
|
|
39
39
|
"volta": {
|
|
40
|
-
"node": "18.
|
|
41
|
-
"npm": "9.
|
|
40
|
+
"node": "18.18.0",
|
|
41
|
+
"npm": "9.8.1"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"lib",
|
|
@@ -48,14 +48,16 @@
|
|
|
48
48
|
"License.txt"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"monaco-editor": "~0.
|
|
52
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
51
|
+
"monaco-editor": "~0.43.0",
|
|
52
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.0-next.0",
|
|
53
|
+
"@codingame/monaco-vscode-languages-service-override": "1.82.0-next.0",
|
|
54
|
+
"@codingame/monaco-vscode-model-service-override": "1.82.0-next.0",
|
|
53
55
|
"vscode-jsonrpc": "~8.1.0",
|
|
54
56
|
"vscode-languageclient": "~8.1.0"
|
|
55
57
|
},
|
|
56
58
|
"peerDependencies": {
|
|
57
|
-
"monaco-editor": "~0.
|
|
58
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
59
|
+
"monaco-editor": "~0.43.0",
|
|
60
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.0-next.0"
|
|
59
61
|
},
|
|
60
62
|
"peerDependenciesMeta": {
|
|
61
63
|
"monaco-editor": {
|
|
@@ -3,53 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
5
|
|
|
6
|
-
import { editor, Environment
|
|
7
|
-
import { ILogService, initialize
|
|
6
|
+
import { editor, Environment } from 'monaco-editor';
|
|
7
|
+
import { ILogService, initialize, LogLevel, StandaloneServices } from 'vscode/services';
|
|
8
8
|
import { initialize as initializeVscodeExtensions } from 'vscode/extensions';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import { OpenEditor } from '@codingame/monaco-vscode-editor-service-override';
|
|
10
|
+
import getLanguagesServiceOverride from '@codingame/monaco-vscode-languages-service-override';
|
|
11
|
+
import getModelServiceOverride from '@codingame/monaco-vscode-model-service-override';
|
|
12
12
|
|
|
13
13
|
interface MonacoEnvironmentEnhanced extends Environment {
|
|
14
14
|
vscodeApiInitialised: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export type InitializeServiceConfig = {
|
|
18
|
-
enableDialogService?: boolean;
|
|
19
|
-
enableNotificationService?: boolean;
|
|
20
|
-
enableModelService?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* editor service is the default. If you want to use the views service, set enableViewsService to true.
|
|
23
|
-
*/
|
|
24
|
-
configureEditorOrViewsService?: {
|
|
25
|
-
enableViewsService?: boolean;
|
|
26
|
-
openEditorFunc?: OpenEditor
|
|
27
|
-
};
|
|
28
|
-
configureConfigurationService?: {
|
|
29
|
-
defaultWorkspaceUri: string;
|
|
30
|
-
};
|
|
31
|
-
enableThemeService?: boolean;
|
|
32
|
-
enableKeybindingsService?: boolean;
|
|
33
|
-
enableTextmateService?: boolean;
|
|
34
|
-
enableLanguagesService?: boolean;
|
|
35
|
-
enableAudioCueService?: boolean;
|
|
36
|
-
enableDebugService?: boolean;
|
|
37
|
-
enablePreferencesService?: boolean;
|
|
38
|
-
enableSnippetsService?: boolean;
|
|
39
|
-
enableOutputService?: boolean;
|
|
40
|
-
configureTerminalService?: {
|
|
41
|
-
backendImpl: SimpleTerminalBackend | ITerminalBackend
|
|
42
|
-
}
|
|
43
|
-
enableSearchService?: boolean;
|
|
44
|
-
enableMarkersService?: boolean;
|
|
45
|
-
enableAccessibilityService?: boolean;
|
|
46
|
-
enableLanguageDetectionWorkerService?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If no provider is specified, the default BrowserStorageService is used.
|
|
49
|
-
*/
|
|
50
|
-
configureStorageService?: {
|
|
51
|
-
provider?: IStorageProvider
|
|
52
|
-
},
|
|
53
18
|
userServices?: editor.IEditorOverrideServices;
|
|
54
19
|
debugLogging?: boolean;
|
|
55
20
|
logLevel?: LogLevel
|
|
@@ -62,7 +27,7 @@ export const wasVscodeApiInitialized = () => {
|
|
|
62
27
|
export const initServices = async (config?: InitializeServiceConfig) => {
|
|
63
28
|
await importAllServices(config);
|
|
64
29
|
if (config?.debugLogging === true) {
|
|
65
|
-
console.log('
|
|
30
|
+
console.log('initialize completed successfully');
|
|
66
31
|
}
|
|
67
32
|
await initializeVscodeExtensions();
|
|
68
33
|
if (config?.debugLogging === true) {
|
|
@@ -70,183 +35,68 @@ export const initServices = async (config?: InitializeServiceConfig) => {
|
|
|
70
35
|
}
|
|
71
36
|
|
|
72
37
|
if (!window.MonacoEnvironment) {
|
|
73
|
-
window.MonacoEnvironment = {
|
|
74
|
-
createTrustedTypesPolicy: (_policyName: string) => {
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
38
|
+
window.MonacoEnvironment = {};
|
|
78
39
|
}
|
|
79
40
|
(window.MonacoEnvironment as MonacoEnvironmentEnhanced).vscodeApiInitialised = true;
|
|
80
41
|
};
|
|
81
42
|
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
43
|
+
export const useOpenEditorStub: OpenEditor = async (modelRef, options, sideBySide) => {
|
|
44
|
+
console.log('Received open editor call with parameters: ', modelRef, options, sideBySide);
|
|
45
|
+
return undefined;
|
|
46
|
+
};
|
|
85
47
|
|
|
86
48
|
/**
|
|
87
49
|
* monaco-vscode-api automatically loads the following services:
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
50
|
+
* - layout
|
|
51
|
+
* - environment
|
|
52
|
+
* - extension
|
|
53
|
+
* - files
|
|
54
|
+
* - quickAccess
|
|
55
|
+
*
|
|
56
|
+
* monaco-languageclient always adds the following services:
|
|
57
|
+
* - languages
|
|
58
|
+
* - model
|
|
93
59
|
*/
|
|
94
60
|
export const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
95
61
|
const serviceNames: string[] = [];
|
|
96
|
-
const promises: Promise<ModuleWithDefaultExport>[] = [];
|
|
97
62
|
const lc: InitializeServiceConfig = config ?? {};
|
|
98
|
-
const userServices = lc.userServices ?? {};
|
|
99
|
-
|
|
100
|
-
const addService = (name: string, promise: Promise<ModuleWithDefaultExport>) => {
|
|
101
|
-
serviceNames.push(name);
|
|
102
|
-
promises.push(promise);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
if (lc.enableModelService === true) {
|
|
106
|
-
addService('model', import('vscode/service-override/model'));
|
|
107
|
-
}
|
|
108
|
-
if (lc.configureEditorOrViewsService !== undefined) {
|
|
109
|
-
if (lc.configureEditorOrViewsService.enableViewsService === true) {
|
|
110
|
-
addService('views', import('vscode/service-override/views'));
|
|
111
|
-
} else {
|
|
112
|
-
addService('editor', import('vscode/service-override/editor'));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (lc.configureConfigurationService !== undefined) {
|
|
116
|
-
addService('configuration', import('vscode/service-override/configuration'));
|
|
117
|
-
}
|
|
118
|
-
if (lc.enableDialogService === true) {
|
|
119
|
-
addService('dialogs', import('vscode/service-override/dialogs'));
|
|
120
|
-
}
|
|
121
|
-
if (lc.enableNotificationService === true) {
|
|
122
|
-
addService('notifications', import('vscode/service-override/notifications'));
|
|
123
|
-
}
|
|
124
|
-
if (lc.enableThemeService === true) {
|
|
125
|
-
addService('theme', import('vscode/service-override/theme'));
|
|
126
|
-
}
|
|
127
|
-
if (lc.enableTextmateService === true) {
|
|
128
|
-
addService('textmate', import('vscode/service-override/textmate'));
|
|
129
|
-
}
|
|
130
|
-
if (lc.enableKeybindingsService === true) {
|
|
131
|
-
addService('keybindings', import('vscode/service-override/keybindings'));
|
|
132
|
-
}
|
|
133
|
-
if (lc.enableLanguagesService === true) {
|
|
134
|
-
addService('languages', import('vscode/service-override/languages'));
|
|
135
|
-
}
|
|
136
|
-
if (lc.enableAudioCueService === true) {
|
|
137
|
-
addService('audioCue', import('vscode/service-override/audioCue'));
|
|
138
|
-
}
|
|
139
|
-
if (lc.enableDebugService === true) {
|
|
140
|
-
addService('debug', import('vscode/service-override/debug'));
|
|
141
|
-
}
|
|
142
|
-
if (lc.enablePreferencesService === true) {
|
|
143
|
-
addService('preferences', import('vscode/service-override/preferences'));
|
|
144
|
-
}
|
|
145
|
-
if (lc.enableSnippetsService === true) {
|
|
146
|
-
addService('snippets', import('vscode/service-override/snippets'));
|
|
147
|
-
}
|
|
148
|
-
if (lc.enableOutputService === true) {
|
|
149
|
-
addService('output', import('vscode/service-override/output'));
|
|
150
|
-
}
|
|
151
|
-
if (lc.configureTerminalService !== undefined) {
|
|
152
|
-
addService('terminal', import('vscode/service-override/terminal'));
|
|
153
|
-
}
|
|
154
|
-
if (lc.enableSearchService === true) {
|
|
155
|
-
addService('search', import('vscode/service-override/search'));
|
|
156
|
-
}
|
|
157
|
-
if (lc.enableMarkersService === true) {
|
|
158
|
-
addService('markers', import('vscode/service-override/markers'));
|
|
159
|
-
}
|
|
160
|
-
if (lc.enableAccessibilityService === true) {
|
|
161
|
-
addService('accessibility', import('vscode/service-override/accessibility'));
|
|
162
|
-
}
|
|
163
|
-
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
164
|
-
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
165
|
-
}
|
|
166
|
-
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
167
|
-
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
168
|
-
}
|
|
63
|
+
const userServices: editor.IEditorOverrideServices = lc.userServices ?? {};
|
|
169
64
|
|
|
170
|
-
const reportServiceLoading = (services: editor.IEditorOverrideServices, debugLogging: boolean
|
|
65
|
+
const reportServiceLoading = (services: editor.IEditorOverrideServices, debugLogging: boolean) => {
|
|
171
66
|
for (const serviceName of Object.keys(services)) {
|
|
172
67
|
if (debugLogging) {
|
|
173
|
-
|
|
174
|
-
console.log(`Loading ${origin} service: ${serviceName}`);
|
|
175
|
-
} else {
|
|
176
|
-
console.log(`Loading service: ${serviceName}`);
|
|
177
|
-
}
|
|
68
|
+
console.log(`Loading service: ${serviceName}`);
|
|
178
69
|
}
|
|
179
70
|
}
|
|
180
71
|
};
|
|
181
|
-
|
|
182
72
|
const mergeServices = (services: editor.IEditorOverrideServices, overrideServices: editor.IEditorOverrideServices) => {
|
|
183
73
|
for (const [name, service] of Object.entries(services)) {
|
|
184
74
|
overrideServices[name] = service;
|
|
185
75
|
}
|
|
186
76
|
};
|
|
77
|
+
const mlcDefautServices = {
|
|
78
|
+
...getLanguagesServiceOverride(),
|
|
79
|
+
...getModelServiceOverride()
|
|
80
|
+
};
|
|
81
|
+
mergeServices(mlcDefautServices, userServices);
|
|
82
|
+
reportServiceLoading(userServices, lc.debugLogging === true);
|
|
187
83
|
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
const overrideServices: editor.IEditorOverrideServices = {};
|
|
191
|
-
if (userServices) {
|
|
192
|
-
mergeServices(userServices, overrideServices);
|
|
193
|
-
reportServiceLoading(userServices, lc.debugLogging === true, 'user');
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const haveThemeService = serviceNames.includes('theme') || Object.keys(overrideServices).includes('themeService');
|
|
197
|
-
const haveTextmateService = serviceNames.includes('textmate') || Object.keys(overrideServices).includes('textMateTokenizationFeature');
|
|
84
|
+
const haveThemeService = serviceNames.includes('theme') || Object.keys(userServices).includes('themeService');
|
|
85
|
+
const haveTextmateService = serviceNames.includes('textmate') || Object.keys(userServices).includes('textMateTokenizationFeature');
|
|
198
86
|
const haveMarkersService = serviceNames.includes('markers');
|
|
199
|
-
const haveViewsService = serviceNames.includes('views') || Object.keys(
|
|
87
|
+
const haveViewsService = serviceNames.includes('views') || Object.keys(userServices).includes('viewsService');
|
|
200
88
|
|
|
201
89
|
// theme requires textmate
|
|
202
90
|
if (haveThemeService && !haveTextmateService) {
|
|
203
|
-
throw new Error('"theme" requires "textmate" service. Please add it to the "
|
|
91
|
+
throw new Error('"theme" requires "textmate" service. Please add it to the "userServices".');
|
|
204
92
|
}
|
|
205
93
|
|
|
206
94
|
// markers service requires views service
|
|
207
95
|
if (haveMarkersService && !haveViewsService) {
|
|
208
|
-
throw new Error('"markers" requires "views" service. Please add it to the "
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
for (const loadedImport of loadedImports) {
|
|
212
|
-
const serviceName = serviceNames[count];
|
|
213
|
-
if (lc.debugLogging === true) {
|
|
214
|
-
console.log(`Initialising provided service: ${serviceName}`);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
let services: editor.IEditorOverrideServices = {};
|
|
218
|
-
if (serviceName === 'editor' || serviceName === 'views') {
|
|
219
|
-
if (lc.configureEditorOrViewsService?.openEditorFunc) {
|
|
220
|
-
services = loadedImport.default(lc.configureEditorOrViewsService.openEditorFunc);
|
|
221
|
-
} else {
|
|
222
|
-
const defaultOpenEditorFunc: OpenEditor = async (model, options, sideBySide) => {
|
|
223
|
-
console.log('Trying to open a model', model, options, sideBySide);
|
|
224
|
-
return undefined;
|
|
225
|
-
};
|
|
226
|
-
services = loadedImport.default(defaultOpenEditorFunc);
|
|
227
|
-
}
|
|
228
|
-
} else if (serviceName === 'configuration') {
|
|
229
|
-
if (lc.configureConfigurationService?.defaultWorkspaceUri) {
|
|
230
|
-
const uri = Uri.file(lc.configureConfigurationService!.defaultWorkspaceUri);
|
|
231
|
-
services = loadedImport.default(uri);
|
|
232
|
-
}
|
|
233
|
-
} else if (serviceName === 'terminal') {
|
|
234
|
-
if (lc.configureTerminalService?.backendImpl) {
|
|
235
|
-
services = loadedImport.default(lc.configureTerminalService.backendImpl);
|
|
236
|
-
}
|
|
237
|
-
} else if (serviceName === 'storage') {
|
|
238
|
-
services = loadedImport.default(lc.configureStorageService?.provider);
|
|
239
|
-
} else {
|
|
240
|
-
services = loadedImport.default();
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
mergeServices(services, overrideServices);
|
|
244
|
-
reportServiceLoading(services, lc.debugLogging === true);
|
|
245
|
-
|
|
246
|
-
count++;
|
|
96
|
+
throw new Error('"markers" requires "views" service. Please add it to the "userServices".');
|
|
247
97
|
}
|
|
248
98
|
|
|
249
|
-
await
|
|
99
|
+
await initialize(userServices);
|
|
250
100
|
if (lc.logLevel) {
|
|
251
101
|
StandaloneServices.get(ILogService).setLevel(lc.logLevel);
|
|
252
102
|
}
|