monaco-languageclient 6.3.0-next.0 → 6.3.0-next.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/CHANGELOG.md +4 -0
- package/README.md +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/monaco-language-client.d.ts +7 -15
- package/lib/monaco-language-client.d.ts.map +1 -1
- package/lib/monaco-language-client.js +1 -117
- package/lib/monaco-language-client.js.map +1 -1
- package/lib/monaco-vscode-api-services.d.ts +9 -8
- package/lib/monaco-vscode-api-services.d.ts.map +1 -1
- package/lib/monaco-vscode-api-services.js +20 -20
- package/lib/monaco-vscode-api-services.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/monaco-language-client.ts +9 -132
- package/src/monaco-vscode-api-services.ts +24 -30
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this npm module are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [6.3.0] - 2023-08-0x
|
|
6
|
+
|
|
7
|
+
- Update to `monaco-editor` `0.40.0` and `monaco-vscode-api` `1.80.2` [#513](https://github.com/TypeFox/monaco-languageclient/pull/513)
|
|
8
|
+
|
|
5
9
|
## [6.2.0] - 2023-06-16
|
|
6
10
|
|
|
7
11
|
- Updated `monaco-vscode-api` to version `1.79.3`, `monaco-editor` to version `0.39.0` and `monaco-editor-workers` to version `0.39.1` [#503](https://github.com/TypeFox/monaco-languageclient/pull/503)
|
package/README.md
CHANGED
|
@@ -12,7 +12,6 @@ See [here](https://github.com/TypeFox/monaco-languageclient/blob/main/README.md)
|
|
|
12
12
|
|
|
13
13
|
## History
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
For the history please see the [README](https://github.com/TypeFox/monaco-languageclient/blob/main/README.md#latest-important-project-changes) and [CHANGELOG](https://github.com/TypeFox/monaco-languageclient/blob/main/CHANGELOG.md).
|
|
17
16
|
|
|
18
17
|
## License
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AACpG,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
|
|
@@ -2,24 +2,16 @@ import { BaseLanguageClient, MessageTransports, LanguageClientOptions } from 'vs
|
|
|
2
2
|
export interface IConnectionProvider {
|
|
3
3
|
get(encoding: string): Promise<MessageTransports>;
|
|
4
4
|
}
|
|
5
|
+
export type MonacoLanguageClientOptions = {
|
|
6
|
+
name: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
clientOptions: LanguageClientOptions;
|
|
9
|
+
connectionProvider: IConnectionProvider;
|
|
10
|
+
};
|
|
5
11
|
export declare class MonacoLanguageClient extends BaseLanguageClient {
|
|
6
12
|
protected readonly connectionProvider: IConnectionProvider;
|
|
7
|
-
constructor({ id, name, clientOptions, connectionProvider }:
|
|
13
|
+
constructor({ id, name, clientOptions, connectionProvider }: MonacoLanguageClientOptions);
|
|
8
14
|
protected createMessageTransports(encoding: string): Promise<MessageTransports>;
|
|
9
15
|
protected getLocale(): string;
|
|
10
|
-
protected registerBuiltinFeatures(): void;
|
|
11
|
-
/**
|
|
12
|
-
* These are all contained in BaseLanguageClient#registerBuiltinFeatures but not registered
|
|
13
|
-
* in MonacoLanguageClient. This method is not called!
|
|
14
|
-
*/
|
|
15
|
-
registerNotUsedFeatures(): void;
|
|
16
|
-
}
|
|
17
|
-
export declare namespace MonacoLanguageClient {
|
|
18
|
-
interface Options {
|
|
19
|
-
name: string;
|
|
20
|
-
id?: string;
|
|
21
|
-
clientOptions: LanguageClientOptions;
|
|
22
|
-
connectionProvider: IConnectionProvider;
|
|
23
|
-
}
|
|
24
16
|
}
|
|
25
17
|
//# sourceMappingURL=monaco-language-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-language-client.d.ts","sourceRoot":"","sources":["../src/monaco-language-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"monaco-language-client.d.ts","sourceRoot":"","sources":["../src/monaco-language-client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAE1H,MAAM,WAAW,mBAAmB;IAChC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACrD;AAED,MAAM,MAAM,2BAA2B,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,qBAAqB,CAAC;IACrC,kBAAkB,EAAE,mBAAmB,CAAC;CAC3C,CAAA;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IACxD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;gBAE/C,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,2BAA2B;IAKxF,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;cAI5D,SAAS,IAAI,MAAM;CAGzC"}
|
|
@@ -2,134 +2,18 @@
|
|
|
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
|
-
/* eslint-disable @typescript-eslint/dot-notation */
|
|
6
5
|
import { BaseLanguageClient } from 'vscode-languageclient/lib/common/client.js';
|
|
7
|
-
import { ConfigurationFeature, SyncConfigurationFeature } from 'vscode-languageclient/lib/common/configuration.js';
|
|
8
|
-
import { DidChangeTextDocumentFeature, DidCloseTextDocumentFeature, DidOpenTextDocumentFeature, DidSaveTextDocumentFeature, WillSaveFeature, WillSaveWaitUntilFeature } from 'vscode-languageclient/lib/common/textSynchronization.js';
|
|
9
|
-
import { CompletionItemFeature } from 'vscode-languageclient/lib/common/completion.js';
|
|
10
|
-
import { HoverFeature } from 'vscode-languageclient/lib/common/hover.js';
|
|
11
|
-
import { SignatureHelpFeature } from 'vscode-languageclient/lib/common/signatureHelp.js';
|
|
12
|
-
import { DefinitionFeature } from 'vscode-languageclient/lib/common/definition.js';
|
|
13
|
-
import { ReferencesFeature } from 'vscode-languageclient/lib/common/reference.js';
|
|
14
|
-
import { DocumentHighlightFeature } from 'vscode-languageclient/lib/common/documentHighlight.js';
|
|
15
|
-
import { DocumentSymbolFeature } from 'vscode-languageclient/lib/common/documentSymbol.js';
|
|
16
|
-
import { CodeActionFeature } from 'vscode-languageclient/lib/common/codeAction.js';
|
|
17
|
-
import { CodeLensFeature } from 'vscode-languageclient/lib/common/codeLens.js';
|
|
18
|
-
import { DocumentFormattingFeature, DocumentOnTypeFormattingFeature, DocumentRangeFormattingFeature } from 'vscode-languageclient/lib/common/formatting.js';
|
|
19
|
-
import { RenameFeature } from 'vscode-languageclient/lib/common/rename.js';
|
|
20
|
-
import { DocumentLinkFeature } from 'vscode-languageclient/lib/common/documentLink.js';
|
|
21
|
-
import { ExecuteCommandFeature } from 'vscode-languageclient/lib/common/executeCommand.js';
|
|
22
|
-
import { TypeDefinitionFeature } from 'vscode-languageclient/lib/common/typeDefinition.js';
|
|
23
|
-
import { ImplementationFeature } from 'vscode-languageclient/lib/common/implementation.js';
|
|
24
|
-
import { ColorProviderFeature } from 'vscode-languageclient/lib/common/colorProvider.js';
|
|
25
|
-
import { WorkspaceFoldersFeature } from 'vscode-languageclient/lib/common/workspaceFolder.js';
|
|
26
|
-
import { FoldingRangeFeature } from 'vscode-languageclient/lib/common/foldingRange.js';
|
|
27
|
-
import { DeclarationFeature } from 'vscode-languageclient/lib/common/declaration.js';
|
|
28
|
-
import { SelectionRangeFeature } from 'vscode-languageclient/lib/common/selectionRange.js';
|
|
29
|
-
import { SemanticTokensFeature } from 'vscode-languageclient/lib/common/semanticTokens.js';
|
|
30
|
-
import { LinkedEditingFeature } from 'vscode-languageclient/lib/common/linkedEditingRange.js';
|
|
31
|
-
import { InlayHintsFeature } from 'vscode-languageclient/lib/common/inlayHint.js';
|
|
32
|
-
import { DiagnosticFeature } from 'vscode-languageclient/lib/common/diagnostic.js';
|
|
33
|
-
import { ProgressFeature } from 'vscode-languageclient/lib/common/progress.js';
|
|
34
|
-
import { WorkspaceSymbolFeature } from 'vscode-languageclient/lib/common/workspaceSymbol.js';
|
|
35
|
-
import { CallHierarchyFeature } from 'vscode-languageclient/lib/common/callHierarchy.js';
|
|
36
|
-
import { DidCreateFilesFeature, DidDeleteFilesFeature, DidRenameFilesFeature, WillCreateFilesFeature, WillDeleteFilesFeature, WillRenameFilesFeature } from 'vscode-languageclient/lib/common/fileOperations.js';
|
|
37
|
-
import { TypeHierarchyFeature } from 'vscode-languageclient/lib/common/typeHierarchy.js';
|
|
38
|
-
import { InlineValueFeature } from 'vscode-languageclient/lib/common/inlineValue.js';
|
|
39
|
-
import { NotebookDocumentSyncFeature } from 'vscode-languageclient/lib/common/notebook.js';
|
|
40
6
|
export class MonacoLanguageClient extends BaseLanguageClient {
|
|
41
7
|
connectionProvider;
|
|
42
8
|
constructor({ id, name, clientOptions, connectionProvider }) {
|
|
43
9
|
super(id || name.toLowerCase(), name, clientOptions);
|
|
44
10
|
this.connectionProvider = connectionProvider;
|
|
45
|
-
// Hack because vscode-language client rejects the whole registration block if one capability registration has no associated client feature registered
|
|
46
|
-
// Some language servers still send the registration even though the client says it doesn't support it
|
|
47
|
-
const originalHandleRegistrationRequest = this['handleRegistrationRequest'].bind(this);
|
|
48
|
-
this['handleRegistrationRequest'] = (params) => {
|
|
49
|
-
originalHandleRegistrationRequest({
|
|
50
|
-
...params,
|
|
51
|
-
registrations: params.registrations.filter(registration => this.getFeature(registration.method) != null)
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
const originalHandleUnregistrationRequest = this['handleUnregistrationRequest'].bind(this);
|
|
55
|
-
this['handleUnregistrationRequest'] = (params) => {
|
|
56
|
-
originalHandleUnregistrationRequest({
|
|
57
|
-
...params,
|
|
58
|
-
unregisterations: params.unregisterations.filter(unregistration => this.getFeature(unregistration.method) != null)
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
11
|
}
|
|
62
12
|
createMessageTransports(encoding) {
|
|
63
13
|
return this.connectionProvider.get(encoding);
|
|
64
14
|
}
|
|
65
15
|
getLocale() {
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
registerBuiltinFeatures() {
|
|
69
|
-
const pendingFullTextDocumentChanges = new Map();
|
|
70
|
-
this.registerFeature(new ConfigurationFeature(this));
|
|
71
|
-
this.registerFeature(new DidOpenTextDocumentFeature(this, this['_syncedDocuments']));
|
|
72
|
-
this['_didChangeTextDocumentFeature'] = new DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);
|
|
73
|
-
this['_didChangeTextDocumentFeature'].onPendingChangeAdded(() => {
|
|
74
|
-
this['triggerPendingChangeDelivery']();
|
|
75
|
-
});
|
|
76
|
-
this.registerFeature(this['_didChangeTextDocumentFeature']);
|
|
77
|
-
this.registerFeature(new DidCloseTextDocumentFeature(this, this['_syncedDocuments'], pendingFullTextDocumentChanges));
|
|
78
|
-
this.registerFeature(new CompletionItemFeature(this));
|
|
79
|
-
this.registerFeature(new HoverFeature(this));
|
|
80
|
-
this.registerFeature(new SignatureHelpFeature(this));
|
|
81
|
-
this.registerFeature(new DefinitionFeature(this));
|
|
82
|
-
this.registerFeature(new ReferencesFeature(this));
|
|
83
|
-
this.registerFeature(new DocumentHighlightFeature(this));
|
|
84
|
-
this.registerFeature(new DocumentSymbolFeature(this));
|
|
85
|
-
this.registerFeature(new CodeActionFeature(this));
|
|
86
|
-
this.registerFeature(new CodeLensFeature(this));
|
|
87
|
-
this.registerFeature(new DocumentFormattingFeature(this));
|
|
88
|
-
this.registerFeature(new DocumentRangeFormattingFeature(this));
|
|
89
|
-
this.registerFeature(new DocumentOnTypeFormattingFeature(this));
|
|
90
|
-
this.registerFeature(new RenameFeature(this));
|
|
91
|
-
this.registerFeature(new DocumentLinkFeature(this));
|
|
92
|
-
this.registerFeature(new ExecuteCommandFeature(this));
|
|
93
|
-
this.registerFeature(new SyncConfigurationFeature(this));
|
|
94
|
-
this.registerFeature(new TypeDefinitionFeature(this));
|
|
95
|
-
this.registerFeature(new ImplementationFeature(this));
|
|
96
|
-
this.registerFeature(new ColorProviderFeature(this));
|
|
97
|
-
// We only register the workspace folder feature if the client is not locked
|
|
98
|
-
// to a specific workspace folder.
|
|
99
|
-
if (this.clientOptions.workspaceFolder === undefined) {
|
|
100
|
-
this.registerFeature(new WorkspaceFoldersFeature(this));
|
|
101
|
-
}
|
|
102
|
-
this.registerFeature(new FoldingRangeFeature(this));
|
|
103
|
-
this.registerFeature(new DeclarationFeature(this));
|
|
104
|
-
this.registerFeature(new SelectionRangeFeature(this));
|
|
105
|
-
this.registerFeature(new SemanticTokensFeature(this));
|
|
106
|
-
this.registerFeature(new LinkedEditingFeature(this));
|
|
107
|
-
this.registerFeature(new InlayHintsFeature(this));
|
|
108
|
-
this.registerFeature(new DiagnosticFeature(this));
|
|
109
|
-
// enabled since monaco-vscode-api 1.78.5 (PR https://github.com/CodinGame/monaco-vscode-api/pull/109)
|
|
110
|
-
this.registerFeature(new WillSaveFeature(this));
|
|
111
|
-
this.registerFeature(new WillSaveWaitUntilFeature(this));
|
|
112
|
-
this.registerFeature(new DidSaveTextDocumentFeature(this));
|
|
113
|
-
// enabled since monaco-vscode-api 1.79.0 (PR https://github.com/CodinGame/monaco-vscode-api/pull/110)
|
|
114
|
-
this.registerFeature(new WorkspaceSymbolFeature(this));
|
|
115
|
-
this.registerFeature(new DidCreateFilesFeature(this));
|
|
116
|
-
this.registerFeature(new DidRenameFilesFeature(this));
|
|
117
|
-
this.registerFeature(new DidDeleteFilesFeature(this));
|
|
118
|
-
this.registerFeature(new WillCreateFilesFeature(this));
|
|
119
|
-
this.registerFeature(new WillRenameFilesFeature(this));
|
|
120
|
-
this.registerFeature(new WillDeleteFilesFeature(this));
|
|
121
|
-
this.registerFeature(new CallHierarchyFeature(this));
|
|
122
|
-
this.registerFeature(new TypeHierarchyFeature(this));
|
|
123
|
-
this.registerFeature(new InlineValueFeature(this));
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* These are all contained in BaseLanguageClient#registerBuiltinFeatures but not registered
|
|
127
|
-
* in MonacoLanguageClient. This method is not called!
|
|
128
|
-
*/
|
|
129
|
-
registerNotUsedFeatures() {
|
|
130
|
-
// these will stay unsupported for now
|
|
131
|
-
this.registerFeature(new ProgressFeature(this));
|
|
132
|
-
this.registerFeature(new NotebookDocumentSyncFeature(this));
|
|
16
|
+
return super.getLocale() || 'en-US';
|
|
133
17
|
}
|
|
134
18
|
}
|
|
135
19
|
//# sourceMappingURL=monaco-language-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-language-client.js","sourceRoot":"","sources":["../src/monaco-language-client.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,
|
|
1
|
+
{"version":3,"file":"monaco-language-client.js","sourceRoot":"","sources":["../src/monaco-language-client.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAA4C,MAAM,4CAA4C,CAAC;AAa1H,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IACrC,kBAAkB,CAAsB;IAE3D,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAA+B;QACpF,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACrD,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAES,uBAAuB,CAAC,QAAgB;QAC9C,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IAEkB,SAAS;QACxB,OAAO,KAAK,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC;IACxC,CAAC;CACJ"}
|
|
@@ -3,8 +3,6 @@ import { LogLevel } from 'vscode/services';
|
|
|
3
3
|
import type { OpenEditor } from 'vscode/service-override/editor';
|
|
4
4
|
import { ITerminalBackend, SimpleTerminalBackend } from 'vscode/service-override/terminal';
|
|
5
5
|
export type InitializeServiceConfig = {
|
|
6
|
-
enableFilesService?: boolean;
|
|
7
|
-
enableExtensionsService?: boolean;
|
|
8
6
|
enableDialogService?: boolean;
|
|
9
7
|
enableNotificationService?: boolean;
|
|
10
8
|
enableModelService?: boolean;
|
|
@@ -24,10 +22,7 @@ export type InitializeServiceConfig = {
|
|
|
24
22
|
enableDebugService?: boolean;
|
|
25
23
|
enablePreferencesService?: boolean;
|
|
26
24
|
enableSnippetsService?: boolean;
|
|
27
|
-
|
|
28
|
-
isKeybindingConfigurationVisible: boolean;
|
|
29
|
-
shouldUseGlobalPicker: boolean;
|
|
30
|
-
};
|
|
25
|
+
enableQuickaccessService?: boolean;
|
|
31
26
|
enableOutputService?: boolean;
|
|
32
27
|
configureTerminalServiceConfig?: {
|
|
33
28
|
backendImpl: SimpleTerminalBackend | ITerminalBackend;
|
|
@@ -35,12 +30,18 @@ export type InitializeServiceConfig = {
|
|
|
35
30
|
enableSearchService?: boolean;
|
|
36
31
|
enableMarkersService?: boolean;
|
|
37
32
|
enableAccessibilityService?: boolean;
|
|
38
|
-
|
|
39
|
-
enableLayoutService?: boolean;
|
|
33
|
+
enableLanguageDetectionWorkerService?: boolean;
|
|
40
34
|
userServices?: editor.IEditorOverrideServices;
|
|
41
35
|
debugLogging?: boolean;
|
|
42
36
|
logLevel?: LogLevel;
|
|
43
37
|
};
|
|
44
38
|
export declare const wasVscodeApiInitialized: () => boolean;
|
|
45
39
|
export declare const initServices: (config?: InitializeServiceConfig) => Promise<void>;
|
|
40
|
+
export type ModuleWithDefaultExport = {
|
|
41
|
+
default: (x?: any) => editor.IEditorOverrideServices;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* files, extension, environment and layout services are loaded automatically by monaco-vscode-api
|
|
45
|
+
*/
|
|
46
|
+
export declare const importAllServices: (config?: InitializeServiceConfig) => Promise<void>;
|
|
46
47
|
//# 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,EAAoB,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAsD,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAEnH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAM3F,MAAM,MAAM,uBAAuB,GAAG;IAClC,
|
|
1
|
+
{"version":3,"file":"monaco-vscode-api-services.d.ts","sourceRoot":"","sources":["../src/monaco-vscode-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AE,OAAO,CAAC;IAC/C,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,kBAkBlE,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,uBAAuB,CAAA;CACvD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,YAAmB,uBAAuB,kBA6KvE,CAAC"}
|
|
@@ -26,21 +26,18 @@ export const initServices = async (config) => {
|
|
|
26
26
|
}
|
|
27
27
|
window.MonacoEnvironment.vscodeApiInitialised = true;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* files, extension, environment and layout services are loaded automatically by monaco-vscode-api
|
|
31
|
+
*/
|
|
32
|
+
export const importAllServices = async (config) => {
|
|
31
33
|
const serviceNames = [];
|
|
34
|
+
const promises = [];
|
|
32
35
|
const lc = config ?? {};
|
|
33
36
|
const userServices = lc.userServices ?? {};
|
|
34
37
|
const addService = (name, promise) => {
|
|
35
|
-
promises.push(promise);
|
|
36
38
|
serviceNames.push(name);
|
|
39
|
+
promises.push(promise);
|
|
37
40
|
};
|
|
38
|
-
if (lc.enableFilesService === true) {
|
|
39
|
-
addService('files', import('vscode/service-override/files'));
|
|
40
|
-
}
|
|
41
|
-
if (lc.enableExtensionsService === true) {
|
|
42
|
-
addService('extensions', import('vscode/service-override/extensions'));
|
|
43
|
-
}
|
|
44
41
|
if (lc.enableModelService === true) {
|
|
45
42
|
addService('model', import('vscode/service-override/model'));
|
|
46
43
|
}
|
|
@@ -85,7 +82,7 @@ const importAllServices = async (config) => {
|
|
|
85
82
|
if (lc.enableSnippetsService === true) {
|
|
86
83
|
addService('snippets', import('vscode/service-override/snippets'));
|
|
87
84
|
}
|
|
88
|
-
if (lc.
|
|
85
|
+
if (lc.enableQuickaccessService === true) {
|
|
89
86
|
addService('quickaccess', import('vscode/service-override/quickaccess'));
|
|
90
87
|
}
|
|
91
88
|
if (lc.enableOutputService === true) {
|
|
@@ -103,11 +100,8 @@ const importAllServices = async (config) => {
|
|
|
103
100
|
if (lc.enableAccessibilityService === true) {
|
|
104
101
|
addService('accessibility', import('vscode/service-override/accessibility'));
|
|
105
102
|
}
|
|
106
|
-
if (lc.
|
|
107
|
-
addService('
|
|
108
|
-
}
|
|
109
|
-
if (lc.enableLayoutService === true) {
|
|
110
|
-
addService('layout', import('vscode/service-override/layout'));
|
|
103
|
+
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
104
|
+
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
111
105
|
}
|
|
112
106
|
const reportServiceLoading = (services, debugLogging, origin) => {
|
|
113
107
|
for (const serviceName of Object.keys(services)) {
|
|
@@ -133,7 +127,6 @@ const importAllServices = async (config) => {
|
|
|
133
127
|
mergeServices(userServices, overrideServices);
|
|
134
128
|
reportServiceLoading(userServices, lc.debugLogging === true, 'user');
|
|
135
129
|
}
|
|
136
|
-
// files service and extension service are loaded automatically by monaco-vscode-api
|
|
137
130
|
// theme requires textmate
|
|
138
131
|
if ((serviceNames.includes('theme') || Object.keys(overrideServices).includes('themeService')) &&
|
|
139
132
|
!(serviceNames.includes('textmate') || Object.keys(overrideServices).includes('textMateTokenizationFeature'))) {
|
|
@@ -179,10 +172,17 @@ const importAllServices = async (config) => {
|
|
|
179
172
|
}
|
|
180
173
|
}
|
|
181
174
|
else if (serviceName === 'quickaccess') {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
if (lc.configureEditorOrViewsServiceConfig?.enableViewsService === true) {
|
|
176
|
+
const { isEditorPartVisible } = await import('vscode/service-override/views');
|
|
177
|
+
services = loadedImport.default({
|
|
178
|
+
isKeybindingConfigurationVisible: isEditorPartVisible,
|
|
179
|
+
shouldUseGlobalPicker: isEditorPartVisible
|
|
180
|
+
});
|
|
181
|
+
services = loadedImport.default();
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
services = loadedImport.default();
|
|
185
|
+
}
|
|
186
186
|
}
|
|
187
187
|
else {
|
|
188
188
|
services = loadedImport.default();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monaco-vscode-api-services.js","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAuB,GAAG,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,uBAAuB,EAAY,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,UAAU,IAAI,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"monaco-vscode-api-services.js","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAuB,GAAG,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,UAAU,IAAI,uBAAuB,EAAY,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,UAAU,IAAI,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA0C7E,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACxC,OAAQ,MAAM,CAAC,iBAA+C,EAAE,oBAAoB,KAAK,IAAI,CAAC;AAClG,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAgC,EAAE,EAAE;IACnE,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,MAAM,EAAE,YAAY,KAAK,IAAI,EAAE;QAC/B,O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CAAC,CAAC;IAChD,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.0-next.
|
|
3
|
+
"version": "6.3.0-next.2",
|
|
4
4
|
"description": "Monaco Language client implementation",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "TypeFox GmbH",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"monaco-editor": "~0.40.0",
|
|
52
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.80.
|
|
52
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.80.2",
|
|
53
53
|
"vscode-jsonrpc": "~8.1.0",
|
|
54
54
|
"vscode-languageclient": "~8.1.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"monaco-editor": "~0.40.0",
|
|
58
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.80.
|
|
58
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.80.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|
|
61
61
|
"monaco-editor": {
|
package/src/index.ts
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
5
|
|
|
6
|
+
export type { IConnectionProvider, MonacoLanguageClientOptions } from './monaco-language-client.js';
|
|
6
7
|
export * from './monaco-language-client.js';
|
|
7
8
|
export * from './monaco-vscode-api-services.js';
|
|
@@ -3,72 +3,25 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
5
|
|
|
6
|
-
/* eslint-disable @typescript-eslint/dot-notation */
|
|
7
|
-
|
|
8
6
|
import { BaseLanguageClient, MessageTransports, LanguageClientOptions } from 'vscode-languageclient/lib/common/client.js';
|
|
9
|
-
import { ConfigurationFeature, SyncConfigurationFeature } from 'vscode-languageclient/lib/common/configuration.js';
|
|
10
|
-
import { DidChangeTextDocumentFeature, DidCloseTextDocumentFeature, DidOpenTextDocumentFeature, DidSaveTextDocumentFeature, WillSaveFeature, WillSaveWaitUntilFeature } from 'vscode-languageclient/lib/common/textSynchronization.js';
|
|
11
|
-
import { CompletionItemFeature } from 'vscode-languageclient/lib/common/completion.js';
|
|
12
|
-
import { HoverFeature } from 'vscode-languageclient/lib/common/hover.js';
|
|
13
|
-
import { SignatureHelpFeature } from 'vscode-languageclient/lib/common/signatureHelp.js';
|
|
14
|
-
import { DefinitionFeature } from 'vscode-languageclient/lib/common/definition.js';
|
|
15
|
-
import { ReferencesFeature } from 'vscode-languageclient/lib/common/reference.js';
|
|
16
|
-
import { DocumentHighlightFeature } from 'vscode-languageclient/lib/common/documentHighlight.js';
|
|
17
|
-
import { DocumentSymbolFeature } from 'vscode-languageclient/lib/common/documentSymbol.js';
|
|
18
|
-
import { CodeActionFeature } from 'vscode-languageclient/lib/common/codeAction.js';
|
|
19
|
-
import { CodeLensFeature } from 'vscode-languageclient/lib/common/codeLens.js';
|
|
20
|
-
import { DocumentFormattingFeature, DocumentOnTypeFormattingFeature, DocumentRangeFormattingFeature } from 'vscode-languageclient/lib/common/formatting.js';
|
|
21
|
-
import { RenameFeature } from 'vscode-languageclient/lib/common/rename.js';
|
|
22
|
-
import { DocumentLinkFeature } from 'vscode-languageclient/lib/common/documentLink.js';
|
|
23
|
-
import { ExecuteCommandFeature } from 'vscode-languageclient/lib/common/executeCommand.js';
|
|
24
|
-
import { TypeDefinitionFeature } from 'vscode-languageclient/lib/common/typeDefinition.js';
|
|
25
|
-
import { ImplementationFeature } from 'vscode-languageclient/lib/common/implementation.js';
|
|
26
|
-
import { ColorProviderFeature } from 'vscode-languageclient/lib/common/colorProvider.js';
|
|
27
|
-
import { WorkspaceFoldersFeature } from 'vscode-languageclient/lib/common/workspaceFolder.js';
|
|
28
|
-
import { FoldingRangeFeature } from 'vscode-languageclient/lib/common/foldingRange.js';
|
|
29
|
-
import { DeclarationFeature } from 'vscode-languageclient/lib/common/declaration.js';
|
|
30
|
-
import { SelectionRangeFeature } from 'vscode-languageclient/lib/common/selectionRange.js';
|
|
31
|
-
import { SemanticTokensFeature } from 'vscode-languageclient/lib/common/semanticTokens.js';
|
|
32
|
-
import { LinkedEditingFeature } from 'vscode-languageclient/lib/common/linkedEditingRange.js';
|
|
33
|
-
import { InlayHintsFeature } from 'vscode-languageclient/lib/common/inlayHint.js';
|
|
34
|
-
import { DiagnosticFeature } from 'vscode-languageclient/lib/common/diagnostic.js';
|
|
35
|
-
import { ProgressFeature } from 'vscode-languageclient/lib/common/progress.js';
|
|
36
|
-
import { RegistrationParams, UnregistrationParams } from 'vscode-languageclient';
|
|
37
|
-
import { TextDocument } from 'vscode';
|
|
38
|
-
import { WorkspaceSymbolFeature } from 'vscode-languageclient/lib/common/workspaceSymbol.js';
|
|
39
|
-
import { CallHierarchyFeature } from 'vscode-languageclient/lib/common/callHierarchy.js';
|
|
40
|
-
import { DidCreateFilesFeature, DidDeleteFilesFeature, DidRenameFilesFeature, WillCreateFilesFeature, WillDeleteFilesFeature, WillRenameFilesFeature } from 'vscode-languageclient/lib/common/fileOperations.js';
|
|
41
|
-
import { TypeHierarchyFeature } from 'vscode-languageclient/lib/common/typeHierarchy.js';
|
|
42
|
-
import { InlineValueFeature } from 'vscode-languageclient/lib/common/inlineValue.js';
|
|
43
|
-
import { NotebookDocumentSyncFeature } from 'vscode-languageclient/lib/common/notebook.js';
|
|
44
7
|
|
|
45
8
|
export interface IConnectionProvider {
|
|
46
9
|
get(encoding: string): Promise<MessageTransports>;
|
|
47
10
|
}
|
|
48
11
|
|
|
12
|
+
export type MonacoLanguageClientOptions = {
|
|
13
|
+
name: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
clientOptions: LanguageClientOptions;
|
|
16
|
+
connectionProvider: IConnectionProvider;
|
|
17
|
+
}
|
|
18
|
+
|
|
49
19
|
export class MonacoLanguageClient extends BaseLanguageClient {
|
|
50
20
|
protected readonly connectionProvider: IConnectionProvider;
|
|
51
21
|
|
|
52
|
-
constructor({ id, name, clientOptions, connectionProvider }:
|
|
22
|
+
constructor({ id, name, clientOptions, connectionProvider }: MonacoLanguageClientOptions) {
|
|
53
23
|
super(id || name.toLowerCase(), name, clientOptions);
|
|
54
24
|
this.connectionProvider = connectionProvider;
|
|
55
|
-
|
|
56
|
-
// Hack because vscode-language client rejects the whole registration block if one capability registration has no associated client feature registered
|
|
57
|
-
// Some language servers still send the registration even though the client says it doesn't support it
|
|
58
|
-
const originalHandleRegistrationRequest: (params: RegistrationParams) => Promise<void> = this['handleRegistrationRequest'].bind(this);
|
|
59
|
-
this['handleRegistrationRequest'] = (params: RegistrationParams) => {
|
|
60
|
-
originalHandleRegistrationRequest({
|
|
61
|
-
...params,
|
|
62
|
-
registrations: params.registrations.filter(registration => this.getFeature(<any>registration.method) != null)
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
const originalHandleUnregistrationRequest: (params: UnregistrationParams) => Promise<void> = this['handleUnregistrationRequest'].bind(this);
|
|
66
|
-
this['handleUnregistrationRequest'] = (params: UnregistrationParams) => {
|
|
67
|
-
originalHandleUnregistrationRequest({
|
|
68
|
-
...params,
|
|
69
|
-
unregisterations: params.unregisterations.filter(unregistration => this.getFeature(<any>unregistration.method) != null)
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
25
|
}
|
|
73
26
|
|
|
74
27
|
protected createMessageTransports(encoding: string): Promise<MessageTransports> {
|
|
@@ -76,82 +29,6 @@ export class MonacoLanguageClient extends BaseLanguageClient {
|
|
|
76
29
|
}
|
|
77
30
|
|
|
78
31
|
protected override getLocale(): string {
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
protected override registerBuiltinFeatures() {
|
|
83
|
-
const pendingFullTextDocumentChanges: Map<string, TextDocument> = new Map();
|
|
84
|
-
this.registerFeature(new ConfigurationFeature(this));
|
|
85
|
-
this.registerFeature(new DidOpenTextDocumentFeature(this, this['_syncedDocuments']));
|
|
86
|
-
this['_didChangeTextDocumentFeature'] = new DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);
|
|
87
|
-
this['_didChangeTextDocumentFeature'].onPendingChangeAdded(() => {
|
|
88
|
-
this['triggerPendingChangeDelivery']();
|
|
89
|
-
});
|
|
90
|
-
this.registerFeature(this['_didChangeTextDocumentFeature']);
|
|
91
|
-
this.registerFeature(new DidCloseTextDocumentFeature(this, this['_syncedDocuments'], pendingFullTextDocumentChanges));
|
|
92
|
-
this.registerFeature(new CompletionItemFeature(this));
|
|
93
|
-
this.registerFeature(new HoverFeature(this));
|
|
94
|
-
this.registerFeature(new SignatureHelpFeature(this));
|
|
95
|
-
this.registerFeature(new DefinitionFeature(this));
|
|
96
|
-
this.registerFeature(new ReferencesFeature(this));
|
|
97
|
-
this.registerFeature(new DocumentHighlightFeature(this));
|
|
98
|
-
this.registerFeature(new DocumentSymbolFeature(this));
|
|
99
|
-
this.registerFeature(new CodeActionFeature(this));
|
|
100
|
-
this.registerFeature(new CodeLensFeature(this));
|
|
101
|
-
this.registerFeature(new DocumentFormattingFeature(this));
|
|
102
|
-
this.registerFeature(new DocumentRangeFormattingFeature(this));
|
|
103
|
-
this.registerFeature(new DocumentOnTypeFormattingFeature(this));
|
|
104
|
-
this.registerFeature(new RenameFeature(this));
|
|
105
|
-
this.registerFeature(new DocumentLinkFeature(this));
|
|
106
|
-
this.registerFeature(new ExecuteCommandFeature(this));
|
|
107
|
-
this.registerFeature(new SyncConfigurationFeature(this));
|
|
108
|
-
this.registerFeature(new TypeDefinitionFeature(this));
|
|
109
|
-
this.registerFeature(new ImplementationFeature(this));
|
|
110
|
-
this.registerFeature(new ColorProviderFeature(this));
|
|
111
|
-
// We only register the workspace folder feature if the client is not locked
|
|
112
|
-
// to a specific workspace folder.
|
|
113
|
-
if (this.clientOptions.workspaceFolder === undefined) {
|
|
114
|
-
this.registerFeature(new WorkspaceFoldersFeature(this));
|
|
115
|
-
}
|
|
116
|
-
this.registerFeature(new FoldingRangeFeature(this));
|
|
117
|
-
this.registerFeature(new DeclarationFeature(this));
|
|
118
|
-
this.registerFeature(new SelectionRangeFeature(this));
|
|
119
|
-
this.registerFeature(new SemanticTokensFeature(this));
|
|
120
|
-
this.registerFeature(new LinkedEditingFeature(this));
|
|
121
|
-
this.registerFeature(new InlayHintsFeature(this));
|
|
122
|
-
this.registerFeature(new DiagnosticFeature(this));
|
|
123
|
-
// enabled since monaco-vscode-api 1.78.5 (PR https://github.com/CodinGame/monaco-vscode-api/pull/109)
|
|
124
|
-
this.registerFeature(new WillSaveFeature(this));
|
|
125
|
-
this.registerFeature(new WillSaveWaitUntilFeature(this));
|
|
126
|
-
this.registerFeature(new DidSaveTextDocumentFeature(this));
|
|
127
|
-
// enabled since monaco-vscode-api 1.79.0 (PR https://github.com/CodinGame/monaco-vscode-api/pull/110)
|
|
128
|
-
this.registerFeature(new WorkspaceSymbolFeature(this));
|
|
129
|
-
this.registerFeature(new DidCreateFilesFeature(this));
|
|
130
|
-
this.registerFeature(new DidRenameFilesFeature(this));
|
|
131
|
-
this.registerFeature(new DidDeleteFilesFeature(this));
|
|
132
|
-
this.registerFeature(new WillCreateFilesFeature(this));
|
|
133
|
-
this.registerFeature(new WillRenameFilesFeature(this));
|
|
134
|
-
this.registerFeature(new WillDeleteFilesFeature(this));
|
|
135
|
-
this.registerFeature(new CallHierarchyFeature(this));
|
|
136
|
-
this.registerFeature(new TypeHierarchyFeature(this));
|
|
137
|
-
this.registerFeature(new InlineValueFeature(this));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* These are all contained in BaseLanguageClient#registerBuiltinFeatures but not registered
|
|
142
|
-
* in MonacoLanguageClient. This method is not called!
|
|
143
|
-
*/
|
|
144
|
-
public registerNotUsedFeatures() {
|
|
145
|
-
// these will stay unsupported for now
|
|
146
|
-
this.registerFeature(new ProgressFeature(this));
|
|
147
|
-
this.registerFeature(new NotebookDocumentSyncFeature(this));
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
export namespace MonacoLanguageClient {
|
|
151
|
-
export interface Options {
|
|
152
|
-
name: string;
|
|
153
|
-
id?: string;
|
|
154
|
-
clientOptions: LanguageClientOptions;
|
|
155
|
-
connectionProvider: IConnectionProvider;
|
|
32
|
+
return super.getLocale() || 'en-US';
|
|
156
33
|
}
|
|
157
34
|
}
|
|
@@ -14,8 +14,6 @@ interface MonacoEnvironmentEnhanced extends Environment {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type InitializeServiceConfig = {
|
|
17
|
-
enableFilesService?: boolean;
|
|
18
|
-
enableExtensionsService?: boolean;
|
|
19
17
|
enableDialogService?: boolean;
|
|
20
18
|
enableNotificationService?: boolean;
|
|
21
19
|
enableModelService?: boolean;
|
|
@@ -35,10 +33,7 @@ export type InitializeServiceConfig = {
|
|
|
35
33
|
enableDebugService?: boolean;
|
|
36
34
|
enablePreferencesService?: boolean;
|
|
37
35
|
enableSnippetsService?: boolean;
|
|
38
|
-
|
|
39
|
-
isKeybindingConfigurationVisible: boolean,
|
|
40
|
-
shouldUseGlobalPicker: boolean
|
|
41
|
-
};
|
|
36
|
+
enableQuickaccessService?: boolean;
|
|
42
37
|
enableOutputService?: boolean;
|
|
43
38
|
configureTerminalServiceConfig?: {
|
|
44
39
|
backendImpl: SimpleTerminalBackend | ITerminalBackend
|
|
@@ -46,8 +41,7 @@ export type InitializeServiceConfig = {
|
|
|
46
41
|
enableSearchService?: boolean;
|
|
47
42
|
enableMarkersService?: boolean;
|
|
48
43
|
enableAccessibilityService?: boolean;
|
|
49
|
-
|
|
50
|
-
enableLayoutService?: boolean;
|
|
44
|
+
enableLanguageDetectionWorkerService?: boolean;
|
|
51
45
|
userServices?: editor.IEditorOverrideServices;
|
|
52
46
|
debugLogging?: boolean;
|
|
53
47
|
logLevel?: LogLevel
|
|
@@ -77,27 +71,24 @@ export const initServices = async (config?: InitializeServiceConfig) => {
|
|
|
77
71
|
(window.MonacoEnvironment as MonacoEnvironmentEnhanced).vscodeApiInitialised = true;
|
|
78
72
|
};
|
|
79
73
|
|
|
80
|
-
type ModuleWithDefaultExport = {
|
|
74
|
+
export type ModuleWithDefaultExport = {
|
|
81
75
|
default: (x?: any) => editor.IEditorOverrideServices
|
|
82
76
|
}
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
/**
|
|
79
|
+
* files, extension, environment and layout services are loaded automatically by monaco-vscode-api
|
|
80
|
+
*/
|
|
81
|
+
export const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
86
82
|
const serviceNames: string[] = [];
|
|
83
|
+
const promises: Promise<ModuleWithDefaultExport>[] = [];
|
|
87
84
|
const lc: InitializeServiceConfig = config ?? {};
|
|
88
85
|
const userServices = lc.userServices ?? {};
|
|
89
86
|
|
|
90
87
|
const addService = (name: string, promise: Promise<ModuleWithDefaultExport>) => {
|
|
91
|
-
promises.push(promise);
|
|
92
88
|
serviceNames.push(name);
|
|
89
|
+
promises.push(promise);
|
|
93
90
|
};
|
|
94
91
|
|
|
95
|
-
if (lc.enableFilesService === true) {
|
|
96
|
-
addService('files', import('vscode/service-override/files'));
|
|
97
|
-
}
|
|
98
|
-
if (lc.enableExtensionsService === true) {
|
|
99
|
-
addService('extensions', import('vscode/service-override/extensions'));
|
|
100
|
-
}
|
|
101
92
|
if (lc.enableModelService === true) {
|
|
102
93
|
addService('model', import('vscode/service-override/model'));
|
|
103
94
|
}
|
|
@@ -141,7 +132,7 @@ const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
|
141
132
|
if (lc.enableSnippetsService === true) {
|
|
142
133
|
addService('snippets', import('vscode/service-override/snippets'));
|
|
143
134
|
}
|
|
144
|
-
if (lc.
|
|
135
|
+
if (lc.enableQuickaccessService === true) {
|
|
145
136
|
addService('quickaccess', import('vscode/service-override/quickaccess'));
|
|
146
137
|
}
|
|
147
138
|
if (lc.enableOutputService === true) {
|
|
@@ -159,11 +150,8 @@ const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
|
159
150
|
if (lc.enableAccessibilityService === true) {
|
|
160
151
|
addService('accessibility', import('vscode/service-override/accessibility'));
|
|
161
152
|
}
|
|
162
|
-
if (lc.
|
|
163
|
-
addService('
|
|
164
|
-
}
|
|
165
|
-
if (lc.enableLayoutService === true) {
|
|
166
|
-
addService('layout', import('vscode/service-override/layout'));
|
|
153
|
+
if (lc.enableLanguageDetectionWorkerService === true) {
|
|
154
|
+
addService('languageDetectionWorker', import('vscode/service-override/languageDetectionWorker'));
|
|
167
155
|
}
|
|
168
156
|
|
|
169
157
|
const reportServiceLoading = (services: editor.IEditorOverrideServices, debugLogging: boolean, origin?: string) => {
|
|
@@ -192,8 +180,6 @@ const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
|
192
180
|
reportServiceLoading(userServices, lc.debugLogging === true, 'user');
|
|
193
181
|
}
|
|
194
182
|
|
|
195
|
-
// files service and extension service are loaded automatically by monaco-vscode-api
|
|
196
|
-
|
|
197
183
|
// theme requires textmate
|
|
198
184
|
if ((serviceNames.includes('theme') || Object.keys(overrideServices).includes('themeService')) &&
|
|
199
185
|
!(serviceNames.includes('textmate') || Object.keys(overrideServices).includes('textMateTokenizationFeature'))) {
|
|
@@ -239,10 +225,18 @@ const importAllServices = async (config?: InitializeServiceConfig) => {
|
|
|
239
225
|
services = loadedImport.default(lc.configureTerminalServiceConfig.backendImpl);
|
|
240
226
|
}
|
|
241
227
|
} else if (serviceName === 'quickaccess') {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
228
|
+
if (lc.configureEditorOrViewsServiceConfig?.enableViewsService === true) {
|
|
229
|
+
const {
|
|
230
|
+
isEditorPartVisible
|
|
231
|
+
} = await import('vscode/service-override/views');
|
|
232
|
+
services = loadedImport.default({
|
|
233
|
+
isKeybindingConfigurationVisible: isEditorPartVisible,
|
|
234
|
+
shouldUseGlobalPicker: isEditorPartVisible
|
|
235
|
+
});
|
|
236
|
+
services = loadedImport.default();
|
|
237
|
+
} else {
|
|
238
|
+
services = loadedImport.default();
|
|
239
|
+
}
|
|
246
240
|
} else {
|
|
247
241
|
services = loadedImport.default();
|
|
248
242
|
}
|