monaco-languageclient 5.0.0 → 5.1.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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this npm module are documented in this file.
4
4
 
5
+ ## [5.1.0] - 2023-04-xx
6
+
7
+ - Update to monaco-vscode-api 1.78
8
+
9
+ ## [5.0.1] - 2023-04-04
10
+
11
+ - Bugfix: textDocument/didChange message is doubled #[479](https://github.com/TypeFox/monaco-languageclient/issues/479)
12
+
5
13
  ## [5.0.0] - 2023-04-04
6
14
 
7
15
  - **BREAKING CHANGE**: Update to monaco-vscode-api 1.76 #[470](https://github.com/TypeFox/monaco-languageclient/pull/470)
package/README.md CHANGED
@@ -12,7 +12,8 @@ See [here](https://github.com/TypeFox/monaco-languageclient/blob/main/README.md)
12
12
 
13
13
  ## History
14
14
 
15
- For the history please see the [main repository](https://github.com/TypeFox/monaco-languageclient/blob/main/CHANGELOG.md).
15
+
16
+ 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).
16
17
 
17
18
  ## License
18
19
 
package/lib/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- export * from './monaco-language-client.js';
2
- export * from './console-window.js';
3
- export * from './monaco-workspace.js';
4
- export * from './monaco-services.js';
1
+ export * from './monaco-language-client.js';
2
+ export * from './monaco-vscode-api-services.js';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
package/lib/index.js CHANGED
@@ -1,9 +1,7 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- export * from './monaco-language-client.js';
6
- export * from './console-window.js';
7
- export * from './monaco-workspace.js';
8
- export * from './monaco-services.js';
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ------------------------------------------------------------------------------------------ */
5
+ export * from './monaco-language-client.js';
6
+ export * from './monaco-vscode-api-services.js';
9
7
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC"}
@@ -1,25 +1,25 @@
1
- import { BaseLanguageClient, MessageTransports, LanguageClientOptions } from 'vscode-languageclient/lib/common/client.js';
2
- export interface IConnectionProvider {
3
- get(encoding: string): Promise<MessageTransports>;
4
- }
5
- export declare class MonacoLanguageClient extends BaseLanguageClient {
6
- protected readonly connectionProvider: IConnectionProvider;
7
- constructor({ id, name, clientOptions, connectionProvider }: MonacoLanguageClient.Options);
8
- protected createMessageTransports(encoding: string): Promise<MessageTransports>;
9
- 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
- }
1
+ import { BaseLanguageClient, MessageTransports, LanguageClientOptions } from 'vscode-languageclient/lib/common/client.js';
2
+ export interface IConnectionProvider {
3
+ get(encoding: string): Promise<MessageTransports>;
4
+ }
5
+ export declare class MonacoLanguageClient extends BaseLanguageClient {
6
+ protected readonly connectionProvider: IConnectionProvider;
7
+ constructor({ id, name, clientOptions, connectionProvider }: MonacoLanguageClient.Options);
8
+ protected createMessageTransports(encoding: string): Promise<MessageTransports>;
9
+ 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
+ }
25
25
  //# 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":"AAOA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAqC1H,MAAM,WAAW,mBAAmB;IAChC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACrD;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IACxD,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,CA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AAkB,EAAE,mBAAmB,CAAC;KAC3C;CACJ"}
@@ -1,133 +1,132 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- /* eslint-disable @typescript-eslint/dot-notation */
6
- 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
- export class MonacoLanguageClient extends BaseLanguageClient {
41
- connectionProvider;
42
- constructor({ id, name, clientOptions, connectionProvider }) {
43
- super(id || name.toLowerCase(), name, clientOptions);
44
- 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
- }
62
- createMessageTransports(encoding) {
63
- return this.connectionProvider.get(encoding);
64
- }
65
- getLocale() {
66
- return navigator.language || 'en-US';
67
- }
68
- registerBuiltinFeatures() {
69
- const pendingFullTextDocumentChanges = new Map();
70
- this.registerFeature(new ConfigurationFeature(this));
71
- this.registerFeature(new DidOpenTextDocumentFeature(this, this['_syncedDocuments']));
72
- this.registerFeature(new DidChangeTextDocumentFeature(this, this['_syncedDocuments']));
73
- this['_didChangeTextDocumentFeature'] = new DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);
74
- this['_didChangeTextDocumentFeature'].onPendingChangeAdded(() => {
75
- this['triggerPendingChangeDelivery']();
76
- });
77
- this.registerFeature(this['_didChangeTextDocumentFeature']);
78
- this.registerFeature(new DidCloseTextDocumentFeature(this, this['_syncedDocuments'], pendingFullTextDocumentChanges));
79
- this.registerFeature(new CompletionItemFeature(this));
80
- this.registerFeature(new HoverFeature(this));
81
- this.registerFeature(new SignatureHelpFeature(this));
82
- this.registerFeature(new DefinitionFeature(this));
83
- this.registerFeature(new ReferencesFeature(this));
84
- this.registerFeature(new DocumentHighlightFeature(this));
85
- this.registerFeature(new DocumentSymbolFeature(this));
86
- this.registerFeature(new CodeActionFeature(this));
87
- this.registerFeature(new CodeLensFeature(this));
88
- this.registerFeature(new DocumentFormattingFeature(this));
89
- this.registerFeature(new DocumentRangeFormattingFeature(this));
90
- this.registerFeature(new DocumentOnTypeFormattingFeature(this));
91
- this.registerFeature(new RenameFeature(this));
92
- this.registerFeature(new DocumentLinkFeature(this));
93
- this.registerFeature(new ExecuteCommandFeature(this));
94
- this.registerFeature(new SyncConfigurationFeature(this));
95
- this.registerFeature(new TypeDefinitionFeature(this));
96
- this.registerFeature(new ImplementationFeature(this));
97
- this.registerFeature(new ColorProviderFeature(this));
98
- // We only register the workspace folder feature if the client is not locked
99
- // to a specific workspace folder.
100
- if (this.clientOptions.workspaceFolder === undefined) {
101
- this.registerFeature(new WorkspaceFoldersFeature(this));
102
- }
103
- this.registerFeature(new FoldingRangeFeature(this));
104
- this.registerFeature(new DeclarationFeature(this));
105
- this.registerFeature(new SelectionRangeFeature(this));
106
- this.registerFeature(new SemanticTokensFeature(this));
107
- this.registerFeature(new LinkedEditingFeature(this));
108
- this.registerFeature(new InlayHintsFeature(this));
109
- this.registerFeature(new DiagnosticFeature(this));
110
- }
111
- /**
112
- * These are all contained in BaseLanguageClient#registerBuiltinFeatures but not registered
113
- * in MonacoLanguageClient. This method is not called!
114
- */
115
- registerNotUsedFeatures() {
116
- this.registerFeature(new WillSaveFeature(this));
117
- this.registerFeature(new WillSaveWaitUntilFeature(this));
118
- this.registerFeature(new DidSaveTextDocumentFeature(this));
119
- this.registerFeature(new WorkspaceSymbolFeature(this));
120
- this.registerFeature(new ProgressFeature(this));
121
- this.registerFeature(new DidCreateFilesFeature(this));
122
- this.registerFeature(new DidRenameFilesFeature(this));
123
- this.registerFeature(new DidDeleteFilesFeature(this));
124
- this.registerFeature(new WillCreateFilesFeature(this));
125
- this.registerFeature(new WillRenameFilesFeature(this));
126
- this.registerFeature(new WillDeleteFilesFeature(this));
127
- this.registerFeature(new CallHierarchyFeature(this));
128
- this.registerFeature(new TypeHierarchyFeature(this));
129
- this.registerFeature(new InlineValueFeature(this));
130
- this.registerFeature(new NotebookDocumentSyncFeature(this));
131
- }
132
- }
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ------------------------------------------------------------------------------------------ */
5
+ /* eslint-disable @typescript-eslint/dot-notation */
6
+ 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
+ export class MonacoLanguageClient extends BaseLanguageClient {
41
+ connectionProvider;
42
+ constructor({ id, name, clientOptions, connectionProvider }) {
43
+ super(id || name.toLowerCase(), name, clientOptions);
44
+ 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
+ }
62
+ createMessageTransports(encoding) {
63
+ return this.connectionProvider.get(encoding);
64
+ }
65
+ getLocale() {
66
+ return navigator.language || 'en-US';
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
+ }
110
+ /**
111
+ * These are all contained in BaseLanguageClient#registerBuiltinFeatures but not registered
112
+ * in MonacoLanguageClient. This method is not called!
113
+ */
114
+ registerNotUsedFeatures() {
115
+ this.registerFeature(new WillSaveFeature(this));
116
+ this.registerFeature(new WillSaveWaitUntilFeature(this));
117
+ this.registerFeature(new DidSaveTextDocumentFeature(this));
118
+ this.registerFeature(new WorkspaceSymbolFeature(this));
119
+ this.registerFeature(new ProgressFeature(this));
120
+ this.registerFeature(new DidCreateFilesFeature(this));
121
+ this.registerFeature(new DidRenameFilesFeature(this));
122
+ this.registerFeature(new DidDeleteFilesFeature(this));
123
+ this.registerFeature(new WillCreateFilesFeature(this));
124
+ this.registerFeature(new WillRenameFilesFeature(this));
125
+ this.registerFeature(new WillDeleteFilesFeature(this));
126
+ this.registerFeature(new CallHierarchyFeature(this));
127
+ this.registerFeature(new TypeHierarchyFeature(this));
128
+ this.registerFeature(new InlineValueFeature(this));
129
+ this.registerFeature(new NotebookDocumentSyncFeature(this));
130
+ }
131
+ }
133
132
  //# 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,oDAAoD;AAEpD,OAAO,EAAE,kBAAkB,EAA4C,MAAM,4CAA4C,CAAC;AAC1H,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AACnH,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,0BA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Ae,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;QAChD,IAAI,CAAC,eAAe,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,eAAe,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,eAAe,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,eAAe,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,eAAe,CAAC,IAAI,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;CACJ"}
@@ -0,0 +1,25 @@
1
+ import { editor, Uri } from 'monaco-editor/esm/vs/editor/editor.api.js';
2
+ import type { OpenEditor } from 'vscode/service-override/modelEditor';
3
+ export type InitializeServiceConfig = {
4
+ enableDialogService?: boolean;
5
+ enableNotificationService?: boolean;
6
+ enableModelEditorService?: boolean;
7
+ modelEditorServiceConfig?: {
8
+ useDefaultFunction: boolean;
9
+ openEditorFunc?: OpenEditor;
10
+ };
11
+ enableConfigurationService?: boolean;
12
+ configurationServiceConfig?: {
13
+ defaultWorkspaceUri: Uri;
14
+ };
15
+ enableThemeService?: boolean;
16
+ enableKeybindingsService?: boolean;
17
+ enableTextmateService?: boolean;
18
+ enableLanguagesService?: boolean;
19
+ enableAudioCueService?: boolean;
20
+ enableDebugService?: boolean;
21
+ enablePreferencesService?: boolean;
22
+ userServices?: editor.IEditorOverrideServices;
23
+ };
24
+ export declare const initServices: (config?: InitializeServiceConfig) => Promise<void>;
25
+ //# sourceMappingURL=monaco-vscode-api-services.d.ts.map
@@ -0,0 +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,EAAE,GAAG,EAAE,MAAM,2CAA2C,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG;IAClC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,wBAAwB,CAAC,EAAE;QACvB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,CAAC,EAAE,UAAU,CAAA;KAC9B,CAAC;IACF,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,0BAA0B,CAAC,EAAE;QACzB,mBAAmB,EAAE,GAAG,CAAC;KAC5B,CAAC;IACF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC,uBAAuB,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,YAAY,YAAmB,uBAAuB,kBAMlE,CAAC"}
@@ -0,0 +1,111 @@
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ------------------------------------------------------------------------------------------ */
5
+ import { initialize as initializeMonacoService } from 'vscode/services';
6
+ import { initialize as initializeVscodeExtensions } from 'vscode/extensions';
7
+ export const initServices = async (config) => {
8
+ await importAllServices(config)
9
+ .then(() => console.log('initializeMonacoService completed successfully'))
10
+ .then(async () => await initializeVscodeExtensions())
11
+ .then(() => console.log('initializeVscodeExtensions completed successfully'))
12
+ .catch((e) => { throw e; });
13
+ };
14
+ const importAllServices = async (config) => {
15
+ const promises = [];
16
+ const serviceNames = [];
17
+ if (!config) {
18
+ config = {};
19
+ }
20
+ const addService = (name, promise) => {
21
+ promises.push(promise);
22
+ serviceNames.push(name);
23
+ };
24
+ // files service is required
25
+ addService('files', import('vscode/service-override/files'));
26
+ if (config.enableDialogService === true) {
27
+ addService('dialogs', import('vscode/service-override/dialogs'));
28
+ }
29
+ if (config.enableNotificationService === true) {
30
+ addService('notifications', import('vscode/service-override/notifications'));
31
+ }
32
+ if (config.enableModelEditorService === true && config.modelEditorServiceConfig !== undefined) {
33
+ addService('modelEditor', import('vscode/service-override/modelEditor'));
34
+ }
35
+ if (config.enableConfigurationService === true && config.configurationServiceConfig !== undefined) {
36
+ addService('configuration', import('vscode/service-override/configuration'));
37
+ }
38
+ if (config.enableThemeService === true) {
39
+ addService('theme', import('vscode/service-override/theme'));
40
+ // theme requires textmate
41
+ config.enableTextmateService = true;
42
+ }
43
+ if (config.enableTextmateService === true) {
44
+ addService('textmate', import('vscode/service-override/textmate'));
45
+ }
46
+ if (config.enableKeybindingsService === true) {
47
+ addService('keybindings', import('vscode/service-override/keybindings'));
48
+ }
49
+ if (config.enableLanguagesService === true) {
50
+ addService('languages', import('vscode/service-override/languages'));
51
+ }
52
+ if (config.enableAudioCueService === true) {
53
+ addService('audioCue', import('vscode/service-override/audioCue'));
54
+ }
55
+ if (config.enableDebugService === true) {
56
+ addService('debug', import('vscode/service-override/debug'));
57
+ }
58
+ if (config.enablePreferencesService === true) {
59
+ addService('preferences', import('vscode/service-override/preferences'));
60
+ }
61
+ const reportServiceLoading = (origin, services) => {
62
+ for (const serviceName of Object.keys(services)) {
63
+ console.log(`Loading ${origin} service: ${serviceName}`);
64
+ }
65
+ };
66
+ let count = 0;
67
+ return Promise.all(Object.values(promises))
68
+ .then((loadedImports) => {
69
+ let overrideServices = {};
70
+ if (config?.userServices) {
71
+ overrideServices = { overrideServices, ...config?.userServices };
72
+ reportServiceLoading('user', overrideServices);
73
+ }
74
+ for (const loadedImport of loadedImports) {
75
+ const serviceName = serviceNames[count];
76
+ console.log(`Initialising provided service: ${serviceName}`);
77
+ if (serviceNames[count] === 'modelEditor') {
78
+ const { default: getModelEditorServiceOverride } = loadedImport;
79
+ const defaultOpenEditorFunc = async (model, options, sideBySide) => {
80
+ console.log('Trying to open a model', model, options, sideBySide);
81
+ return undefined;
82
+ };
83
+ let services = {};
84
+ if (config?.modelEditorServiceConfig?.useDefaultFunction) {
85
+ services = { ...getModelEditorServiceOverride(defaultOpenEditorFunc) };
86
+ }
87
+ else if (config?.modelEditorServiceConfig?.openEditorFunc) {
88
+ services = { ...getModelEditorServiceOverride(config.modelEditorServiceConfig.openEditorFunc) };
89
+ }
90
+ reportServiceLoading('provided', services);
91
+ overrideServices = { ...overrideServices, ...services };
92
+ }
93
+ else if (serviceNames[count] === 'configuration') {
94
+ const { default: getConfigurationServiceOverride } = loadedImport;
95
+ const services = { ...getConfigurationServiceOverride(config.configurationServiceConfig.defaultWorkspaceUri) };
96
+ reportServiceLoading('provided', services);
97
+ overrideServices = { ...overrideServices, ...services };
98
+ }
99
+ else {
100
+ // using the same import type here is a hack
101
+ const { default: getServiceOverride } = loadedImport;
102
+ const services = { ...getServiceOverride() };
103
+ reportServiceLoading('provided', services);
104
+ overrideServices = { ...overrideServices, ...services };
105
+ }
106
+ count++;
107
+ }
108
+ return initializeMonacoService(overrideServices);
109
+ });
110
+ };
111
+ //# sourceMappingURL=monaco-vscode-api-services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monaco-vscode-api-services.js","sourceRoot":"","sources":["../src/monaco-vscode-api-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,UAAU,IAAI,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,UAAU,IAAI,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAyB7E,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAgC,EAAE,EAAE;IACnE,MAAM,iBAAiB,CAAC,MAAM,CAAC;SAC1B,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;SACzE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,0BAA0B,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;SAC5E,KAAK,CAAC,CAAC,CAAQ,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,KAAK,EAAE,MAAgC,EAAE,EAAE;IACjE,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,EAAE;QACT,MAAM,GAAG,EAAE,CAAC;KACf;IAED,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,OAAyB,EAAE,EAAE;QAC3D,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,4BAA4B;IAC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AAC,CAAC;gBAC3C,gBAAgB,GAAG,EAAE,GAAG,gBAAgB,EAAE,GAAG,QAAQ,EAAE,CAAC;aAC3D;YACD,KAAK,EAAE,CAAC;SACX;QACD,OAAO,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACX,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monaco-languageclient",
3
- "version": "5.0.0",
3
+ "version": "5.1.0-next.0",
4
4
  "description": "Monaco Language client implementation",
5
5
  "author": {
6
6
  "name": "TypeFox GmbH ",
@@ -37,8 +37,8 @@
37
37
  "npm": ">=9.0.0"
38
38
  },
39
39
  "volta": {
40
- "node": "18.15.0",
41
- "npm": "9.6.2"
40
+ "node": "18.16.0",
41
+ "npm": "9.6.3"
42
42
  },
43
43
  "files": [
44
44
  "lib",
@@ -52,7 +52,7 @@
52
52
  "vscode-languageclient": "~8.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "vscode": "npm:@codingame/monaco-vscode-api@~1.76.6"
55
+ "vscode": "npm:@codingame/monaco-vscode-api@~1.78.0"
56
56
  },
57
57
  "scripts": {
58
58
  "clean": "npx shx rm -fr lib *.tsbuildinfo",
package/src/index.ts CHANGED
@@ -4,6 +4,4 @@
4
4
  * ------------------------------------------------------------------------------------------ */
5
5
 
6
6
  export * from './monaco-language-client.js';
7
- export * from './console-window.js';
8
- export * from './monaco-workspace.js';
9
- export * from './monaco-services.js';
7
+ export * from './monaco-vscode-api-services.js';
@@ -83,7 +83,6 @@ export class MonacoLanguageClient extends BaseLanguageClient {
83
83
  const pendingFullTextDocumentChanges: Map<string, TextDocument> = new Map();
84
84
  this.registerFeature(new ConfigurationFeature(this));
85
85
  this.registerFeature(new DidOpenTextDocumentFeature(this, this['_syncedDocuments']));
86
- this.registerFeature(new DidChangeTextDocumentFeature(this, this['_syncedDocuments']));
87
86
  this['_didChangeTextDocumentFeature'] = new DidChangeTextDocumentFeature(this, pendingFullTextDocumentChanges);
88
87
  this['_didChangeTextDocumentFeature'].onPendingChangeAdded(() => {
89
88
  this['triggerPendingChangeDelivery']();
@@ -0,0 +1,145 @@
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ------------------------------------------------------------------------------------------ */
5
+
6
+ import { editor, Uri } from 'monaco-editor/esm/vs/editor/editor.api.js';
7
+ import { initialize as initializeMonacoService } from 'vscode/services';
8
+ import { initialize as initializeVscodeExtensions } from 'vscode/extensions';
9
+ import type { OpenEditor } from 'vscode/service-override/modelEditor';
10
+
11
+ export type InitializeServiceConfig = {
12
+ enableDialogService?: boolean;
13
+ enableNotificationService?: boolean;
14
+ enableModelEditorService?: boolean;
15
+ modelEditorServiceConfig?: {
16
+ useDefaultFunction: boolean;
17
+ openEditorFunc?: OpenEditor
18
+ };
19
+ enableConfigurationService?: boolean
20
+ configurationServiceConfig?: {
21
+ defaultWorkspaceUri: Uri;
22
+ };
23
+ enableThemeService?: boolean;
24
+ enableKeybindingsService?: boolean;
25
+ enableTextmateService?: boolean;
26
+ enableLanguagesService?: boolean;
27
+ enableAudioCueService?: boolean;
28
+ enableDebugService?: boolean;
29
+ enablePreferencesService?: boolean;
30
+ userServices?: editor.IEditorOverrideServices;
31
+ };
32
+
33
+ export const initServices = async (config?: InitializeServiceConfig) => {
34
+ await importAllServices(config)
35
+ .then(() => console.log('initializeMonacoService completed successfully'))
36
+ .then(async () => await initializeVscodeExtensions())
37
+ .then(() => console.log('initializeVscodeExtensions completed successfully'))
38
+ .catch((e: Error) => { throw e; });
39
+ };
40
+
41
+ const importAllServices = async (config?: InitializeServiceConfig) => {
42
+ const promises: Promise<unknown>[] = [];
43
+ const serviceNames: string[] = [];
44
+ if (!config) {
45
+ config = {};
46
+ }
47
+
48
+ const addService = (name: string, promise: Promise<unknown>) => {
49
+ promises.push(promise);
50
+ serviceNames.push(name);
51
+ };
52
+
53
+ // files service is required
54
+ addService('files', import('vscode/service-override/files'));
55
+
56
+ if (config.enableDialogService === true) {
57
+ addService('dialogs', import('vscode/service-override/dialogs'));
58
+ }
59
+ if (config.enableNotificationService === true) {
60
+ addService('notifications', import('vscode/service-override/notifications'));
61
+ }
62
+ if (config.enableModelEditorService === true && config.modelEditorServiceConfig !== undefined) {
63
+ addService('modelEditor', import('vscode/service-override/modelEditor'));
64
+ }
65
+ if (config.enableConfigurationService === true && config.configurationServiceConfig !== undefined) {
66
+ addService('configuration', import('vscode/service-override/configuration'));
67
+ }
68
+ if (config.enableThemeService === true) {
69
+ addService('theme', import('vscode/service-override/theme'));
70
+ // theme requires textmate
71
+ config.enableTextmateService = true;
72
+ }
73
+ if (config.enableTextmateService === true) {
74
+ addService('textmate', import('vscode/service-override/textmate'));
75
+ }
76
+ if (config.enableKeybindingsService === true) {
77
+ addService('keybindings', import('vscode/service-override/keybindings'));
78
+ }
79
+ if (config.enableLanguagesService === true) {
80
+ addService('languages', import('vscode/service-override/languages'));
81
+ }
82
+ if (config.enableAudioCueService === true) {
83
+ addService('audioCue', import('vscode/service-override/audioCue'));
84
+ }
85
+ if (config.enableDebugService === true) {
86
+ addService('debug', import('vscode/service-override/debug'));
87
+ }
88
+ if (config.enablePreferencesService === true) {
89
+ addService('preferences', import('vscode/service-override/preferences'));
90
+ }
91
+
92
+ const reportServiceLoading = (origin: string, services: editor.IEditorOverrideServices) => {
93
+ for (const serviceName of Object.keys(services)) {
94
+ console.log(`Loading ${origin} service: ${serviceName}`);
95
+ }
96
+ };
97
+
98
+ let count = 0;
99
+ return Promise.all(Object.values(promises))
100
+ .then((loadedImports) => {
101
+ let overrideServices: editor.IEditorOverrideServices = {};
102
+ if (config?.userServices) {
103
+ overrideServices = { overrideServices, ...config?.userServices };
104
+ reportServiceLoading('user', overrideServices);
105
+ }
106
+
107
+ for (const loadedImport of loadedImports) {
108
+ const serviceName = serviceNames[count];
109
+ console.log(`Initialising provided service: ${serviceName}`);
110
+ if (serviceNames[count] === 'modelEditor') {
111
+ const {
112
+ default: getModelEditorServiceOverride
113
+ } = loadedImport as unknown as typeof import('vscode/service-override/modelEditor');
114
+ const defaultOpenEditorFunc: OpenEditor = async (model, options, sideBySide) => {
115
+ console.log('Trying to open a model', model, options, sideBySide);
116
+ return undefined;
117
+ };
118
+
119
+ let services = {};
120
+ if (config?.modelEditorServiceConfig?.useDefaultFunction) {
121
+ services = { ...getModelEditorServiceOverride(defaultOpenEditorFunc) };
122
+ } else if (config?.modelEditorServiceConfig?.openEditorFunc) {
123
+ services = { ...getModelEditorServiceOverride(config.modelEditorServiceConfig.openEditorFunc) };
124
+ }
125
+ reportServiceLoading('provided', services);
126
+ overrideServices = { ...overrideServices, ...services };
127
+ } else if (serviceNames[count] === 'configuration') {
128
+ const {
129
+ default: getConfigurationServiceOverride
130
+ } = loadedImport as unknown as typeof import('vscode/service-override/configuration');
131
+ const services = { ...getConfigurationServiceOverride(config!.configurationServiceConfig!.defaultWorkspaceUri) };
132
+ reportServiceLoading('provided', services);
133
+ overrideServices = { ...overrideServices, ...services };
134
+ } else {
135
+ // using the same import type here is a hack
136
+ const { default: getServiceOverride } = loadedImport as unknown as typeof import('vscode/service-override/files');
137
+ const services = { ...getServiceOverride() };
138
+ reportServiceLoading('provided', services);
139
+ overrideServices = { ...overrideServices, ...services };
140
+ }
141
+ count++;
142
+ }
143
+ return initializeMonacoService(overrideServices);
144
+ });
145
+ };
@@ -1,10 +0,0 @@
1
- import { Window, Severity } from 'vscode/services';
2
- import * as vscode from 'vscode';
3
- export declare class ConsoleWindow implements Window {
4
- protected readonly channels: Map<string, vscode.LogOutputChannel>;
5
- showMessage<T extends vscode.MessageOptions | string | vscode.MessageItem>(severity: Severity, message: string, ..._actions: T[]): Thenable<T | undefined>;
6
- createOutputChannel(name: string, _options: string | {
7
- log: true;
8
- } | undefined): vscode.LogOutputChannel;
9
- }
10
- //# sourceMappingURL=console-window.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-window.d.ts","sourceRoot":"","sources":["../src/console-window.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,qBAAa,aAAc,YAAW,MAAM;IACxC,SAAS,CAAC,QAAQ,CAAC,QAAQ,uCAA8C;IACzE,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC;IAgB1J,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;QACjD,GAAG,EAAE,IAAI,CAAC;KACb,GAAG,SAAS,GAAG,MAAM,CAAC,gBAAgB;CAkD1C"}
@@ -1,74 +0,0 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- import { Severity } from 'vscode/services';
6
- import * as vscode from 'vscode';
7
- export class ConsoleWindow {
8
- channels = new Map();
9
- showMessage(severity, message, ..._actions) {
10
- if (severity === Severity.Error) {
11
- console.error(message);
12
- }
13
- if (severity === Severity.Warning) {
14
- console.warn(message);
15
- }
16
- if (severity === Severity.Info) {
17
- console.info(message);
18
- }
19
- if (severity === Severity.Ignore) {
20
- console.debug(message);
21
- }
22
- return Promise.resolve(undefined);
23
- }
24
- createOutputChannel(name, _options) {
25
- const existing = this.channels.get(name);
26
- if (existing) {
27
- return existing;
28
- }
29
- const channel = {
30
- name: 'default',
31
- logLevel: vscode.LogLevel.Info,
32
- onDidChangeLogLevel: new vscode.EventEmitter().event,
33
- trace(_message, ..._args) {
34
- // no-op
35
- },
36
- debug(_message, ..._args) {
37
- // no-op
38
- },
39
- info(_message, ..._args) {
40
- // no-op
41
- },
42
- warn(_message, ..._args) {
43
- // no-op
44
- },
45
- error(_message, ..._args) {
46
- // no-op
47
- },
48
- append(value) {
49
- console.log(name + ': ' + value);
50
- },
51
- appendLine(line) {
52
- console.log(name + ': ' + line);
53
- },
54
- show() {
55
- // no-op
56
- },
57
- dispose() {
58
- // no-op
59
- },
60
- replace: function (_value) {
61
- // no-op
62
- },
63
- clear: function () {
64
- // no-op
65
- },
66
- hide: function () {
67
- // no-op
68
- }
69
- };
70
- this.channels.set(name, channel);
71
- return channel;
72
- }
73
- }
74
- //# sourceMappingURL=console-window.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-window.js","sourceRoot":"","sources":["../src/console-window.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAU,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,OAAO,aAAa;IACH,QAAQ,GAAG,IAAI,GAAG,EAAmC,CAAC;IACzE,WAAW,CAAgE,QAAkB,EAAE,OAAe,EAAE,GAAG,QAAa;QAC5H,IAAI,QAAQ,KAAK,QAAQ,CAAC,KAAK,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC1B;QACD,IAAI,QAAQ,KAAK,QAAQ,CAAC,OAAO,EAAE;YAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACzB;QACD,IAAI,QAAQ,KAAK,QAAQ,CAAC,IAAI,EAAE;YAC5B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACzB;QACD,IAAI,QAAQ,KAAK,QAAQ,CAAC,MAAM,EAAE;YAC9B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC1B;QACD,OAAO,OAA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,CAAC,CAAC;QACjC,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
@@ -1,19 +0,0 @@
1
- import { MonacoWorkspace } from './monaco-workspace.js';
2
- import { ConsoleWindow } from './console-window.js';
3
- import { Services } from 'vscode/services';
4
- import * as vscode from 'vscode';
5
- export interface MonacoServices extends Services {
6
- workspace: MonacoWorkspace;
7
- window: ConsoleWindow;
8
- }
9
- export declare namespace MonacoServices {
10
- interface Options {
11
- workspaceFolders?: vscode.WorkspaceFolder[];
12
- rootPath?: string;
13
- }
14
- type Provider = () => MonacoServices;
15
- function create(options?: Options): MonacoServices;
16
- function install(options?: Options): vscode.Disposable;
17
- function get(): MonacoServices;
18
- }
19
- //# sourceMappingURL=monaco-services.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monaco-services.d.ts","sourceRoot":"","sources":["../src/monaco-services.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC5C,SAAS,EAAE,eAAe,CAAA;IAC1B,MAAM,EAAE,aAAa,CAAA;CACxB;AAED,yBAAiB,cAAc,CAAC;IAC5B,UAAiB,OAAO;QACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC,eAAe,EAAE,CAAA;QAC3C,QAAQ,CAAC,EAAE,MAAM,CAAA;KACpB;IACD,KAAY,QAAQ,GAAG,MAAM,cAAc,CAAC;IAC5C,SAAgB,MAAM,CAAC,OAAO,GAAE,OAAY,GAAG,cAAc,CAK5D;IACD,SAAgB,OAAO,CAAC,OAAO,GAAE,OAAY,GAAG,MAAM,CAAC,UAAU,CAGhE;IACD,SAAgB,GAAG,IAAI,cAAc,CAEpC;CACJ"}
@@ -1,27 +0,0 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- import { MonacoWorkspace } from './monaco-workspace.js';
6
- import { ConsoleWindow } from './console-window.js';
7
- import { Services } from 'vscode/services';
8
- export var MonacoServices;
9
- (function (MonacoServices) {
10
- function create(options = {}) {
11
- return {
12
- workspace: new MonacoWorkspace(options.workspaceFolders, options.rootPath),
13
- window: new ConsoleWindow()
14
- };
15
- }
16
- MonacoServices.create = create;
17
- function install(options = {}) {
18
- const services = create(options);
19
- return Services.install(services);
20
- }
21
- MonacoServices.install = install;
22
- function get() {
23
- return Services.get();
24
- }
25
- MonacoServices.get = get;
26
- })(MonacoServices || (MonacoServices = {}));
27
- //# sourceMappingURL=monaco-services.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monaco-services.js","sourceRoot":"","sources":["../src/monaco-services.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQ3C,MAAM,KAAW,cAAc,CAmB9B;AAnBD,WAAiB,cAAc;IAM3B,SAAgB,MAAM,CAAC,UAAmB,EAAE;QACxC,OAAO;YACH,SAAS,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC;YAC1E,MAAM,EAAE,IAAI,aAAa,EAAE;SAC9B,CAAC;IACN,CAAC;IALe,qBAAM,SAKrB,CAAA;IACD,SAAgB,OAAO,CAAC,UAAmB,EAAE;QACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IAHe,sBAAO,UAGtB,CAAA;IACD,SAAgB,GAAG;QACf,OAAO,QAAQ,CAAC,GAAG,EAAoB,CAAC;IAC5C,CAAC;IAFe,kBAAG,MAElB,CAAA;AACL,CAAC,EAnBgB,cAAc,KAAd,cAAc,QAmB9B"}
@@ -1,8 +0,0 @@
1
- import * as vscode from 'vscode';
2
- import { Workspace } from 'vscode/services';
3
- export declare class MonacoWorkspace implements Workspace {
4
- readonly workspaceFolders?: vscode.WorkspaceFolder[] | undefined;
5
- readonly rootPath?: string | undefined;
6
- constructor(workspaceFolders?: vscode.WorkspaceFolder[] | undefined, rootPath?: string | undefined);
7
- }
8
- //# sourceMappingURL=monaco-workspace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monaco-workspace.d.ts","sourceRoot":"","sources":["../src/monaco-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,eAAgB,YAAW,SAAS;aAGzB,gBAAgB,CAAC;aACjB,QAAQ,CAAC;gBADT,gBAAgB,CAAC,sCAA0B,EAC3C,QAAQ,CAAC,oBAAoB;CAGpD"}
@@ -1,10 +0,0 @@
1
- export class MonacoWorkspace {
2
- workspaceFolders;
3
- rootPath;
4
- // eslint-disable-next-line no-useless-constructor
5
- constructor(workspaceFolders, rootPath) {
6
- this.workspaceFolders = workspaceFolders;
7
- this.rootPath = rootPath;
8
- }
9
- }
10
- //# sourceMappingURL=monaco-workspace.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monaco-workspace.js","sourceRoot":"","sources":["../src/monaco-workspace.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,eAAe;IAGJ;IACA;IAHpB,kDAAkD;IAClD,YACoB,gBAA2C,EAC3C,QAA6B;QAD7B,qBAAgB,GAAhB,gBAAgB,CAA2B;QAC3C,aAAQ,GAAR,QAAQ,CAAqB;IAEjD,CAAC;CACJ"}
@@ -1,78 +0,0 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- import { Window, Severity } from 'vscode/services';
6
- import * as vscode from 'vscode';
7
-
8
- export class ConsoleWindow implements Window {
9
- protected readonly channels = new Map<string, vscode.LogOutputChannel>();
10
- showMessage<T extends vscode.MessageOptions | string | vscode.MessageItem>(severity: Severity, message: string, ..._actions: T[]): Thenable<T | undefined> {
11
- if (severity === Severity.Error) {
12
- console.error(message);
13
- }
14
- if (severity === Severity.Warning) {
15
- console.warn(message);
16
- }
17
- if (severity === Severity.Info) {
18
- console.info(message);
19
- }
20
- if (severity === Severity.Ignore) {
21
- console.debug(message);
22
- }
23
- return Promise.resolve(undefined);
24
- }
25
-
26
- createOutputChannel(name: string, _options: string | {
27
- log: true;
28
- } | undefined): vscode.LogOutputChannel {
29
- const existing = this.channels.get(name);
30
- if (existing) {
31
- return existing;
32
- }
33
-
34
- const channel: vscode.LogOutputChannel = {
35
- name: 'default',
36
- logLevel: vscode.LogLevel.Info,
37
- onDidChangeLogLevel: new vscode.EventEmitter<vscode.LogLevel.Info>().event,
38
- trace(_message: string, ..._args: any[]): void {
39
- // no-op
40
- },
41
- debug(_message: string, ..._args: any[]): void {
42
- // no-op
43
- },
44
- info(_message: string, ..._args: any[]): void {
45
- // no-op
46
- },
47
- warn(_message: string, ..._args: any[]): void {
48
- // no-op
49
- },
50
- error(_message: string | Error, ..._args: any[]): void {
51
- // no-op
52
- },
53
- append(value: string): void {
54
- console.log(name + ': ' + value);
55
- },
56
- appendLine(line: string): void {
57
- console.log(name + ': ' + line);
58
- },
59
- show(): void {
60
- // no-op
61
- },
62
- dispose(): void {
63
- // no-op
64
- },
65
- replace: function(_value: string): void {
66
- // no-op
67
- },
68
- clear: function(): void {
69
- // no-op
70
- },
71
- hide: function(): void {
72
- // no-op
73
- }
74
- };
75
- this.channels.set(name, channel);
76
- return channel;
77
- }
78
- }
@@ -1,34 +0,0 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- import { MonacoWorkspace } from './monaco-workspace.js';
6
- import { ConsoleWindow } from './console-window.js';
7
- import { Services } from 'vscode/services';
8
- import * as vscode from 'vscode';
9
-
10
- export interface MonacoServices extends Services {
11
- workspace: MonacoWorkspace
12
- window: ConsoleWindow
13
- }
14
-
15
- export namespace MonacoServices {
16
- export interface Options {
17
- workspaceFolders?: vscode.WorkspaceFolder[]
18
- rootPath?: string
19
- }
20
- export type Provider = () => MonacoServices;
21
- export function create(options: Options = {}): MonacoServices {
22
- return {
23
- workspace: new MonacoWorkspace(options.workspaceFolders, options.rootPath),
24
- window: new ConsoleWindow()
25
- };
26
- }
27
- export function install(options: Options = {}): vscode.Disposable {
28
- const services = create(options);
29
- return Services.install(services);
30
- }
31
- export function get(): MonacoServices {
32
- return Services.get() as MonacoServices;
33
- }
34
- }
@@ -1,15 +0,0 @@
1
- /* --------------------------------------------------------------------------------------------
2
- * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- * ------------------------------------------------------------------------------------------ */
5
- import * as vscode from 'vscode';
6
- import { Workspace } from 'vscode/services';
7
-
8
- export class MonacoWorkspace implements Workspace {
9
- // eslint-disable-next-line no-useless-constructor
10
- constructor(
11
- public readonly workspaceFolders?: vscode.WorkspaceFolder[],
12
- public readonly rootPath?: string | undefined
13
- ) {
14
- }
15
- }