monaco-languageclient 8.8.3 → 9.0.0-next.10
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 +17 -0
- package/lib/client.d.ts +13 -0
- package/lib/client.d.ts.map +1 -0
- package/lib/client.js +16 -0
- package/lib/client.js.map +1 -0
- package/lib/commonTypes.d.ts +47 -0
- package/lib/commonTypes.d.ts.map +1 -0
- package/lib/commonTypes.js +6 -0
- package/lib/commonTypes.js.map +1 -0
- package/lib/fs/definitions.d.ts +98 -0
- package/lib/fs/definitions.d.ts.map +1 -0
- package/lib/fs/definitions.js +12 -0
- package/lib/fs/definitions.js.map +1 -0
- package/lib/fs/endpoints/defaultEndpoint.d.ts +17 -0
- package/lib/fs/endpoints/defaultEndpoint.d.ts.map +1 -0
- package/lib/fs/endpoints/defaultEndpoint.js +45 -0
- package/lib/fs/endpoints/defaultEndpoint.js.map +1 -0
- package/lib/fs/index.d.ts +3 -0
- package/lib/fs/index.d.ts.map +1 -0
- package/lib/fs/index.js +7 -0
- package/lib/fs/index.js.map +1 -0
- package/lib/index.d.ts +2 -15
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -11
- package/lib/index.js.map +1 -1
- package/lib/tools/index.d.ts +2 -14
- package/lib/tools/index.d.ts.map +1 -1
- package/lib/tools/index.js +2 -27
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/logging.d.ts +10 -0
- package/lib/tools/logging.d.ts.map +1 -0
- package/lib/tools/logging.js +18 -0
- package/lib/tools/logging.js.map +1 -0
- package/lib/tools/utils.d.ts +3 -0
- package/lib/tools/utils.d.ts.map +1 -0
- package/lib/tools/utils.js +36 -0
- package/lib/tools/utils.js.map +1 -0
- package/lib/vscode/index.d.ts +3 -0
- package/lib/vscode/index.d.ts.map +1 -0
- package/lib/vscode/index.js +7 -0
- package/lib/vscode/index.js.map +1 -0
- package/lib/vscode/services.d.ts +29 -14
- package/lib/vscode/services.d.ts.map +1 -1
- package/lib/vscode/services.js +39 -31
- package/lib/vscode/services.js.map +1 -1
- package/package.json +23 -14
- package/src/client.ts +26 -0
- package/src/commonTypes.ts +60 -0
- package/src/fs/definitions.ts +127 -0
- package/src/fs/endpoints/defaultEndpoint.ts +60 -0
- package/src/fs/index.ts +7 -0
- package/src/index.ts +2 -25
- package/src/tools/index.ts +2 -39
- package/src/tools/logging.ts +26 -0
- package/src/tools/utils.ts +39 -0
- package/src/vscode/index.ts +7 -0
- package/src/vscode/services.ts +68 -44
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this npm module are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [9.0.0-next.10] - 2024-11-2
|
|
6
|
+
|
|
7
|
+
- Workaround for `@codingame/monaco-vscode-chat-extensions-notebook-task-terminal-testing-common` dependency problem
|
|
8
|
+
- Run language clients independent of wrapper lifecycle [#784](https://github.com/TypeFox/monaco-languageclient/pull/784)
|
|
9
|
+
- API and internal functions clean-up
|
|
10
|
+
- Function naming adjustments
|
|
11
|
+
- Prototype: File system endpoint.
|
|
12
|
+
- Added `createUrl` to `monaco-languageclient/tools`. Moved it here from `monaco-editor-wrapper`.
|
|
13
|
+
- Updated to eslint 9
|
|
14
|
+
- Support all arguments for monaco-vscode-api `initialize` [#756](https://github.com/TypeFox/monaco-languageclient/pull/756)
|
|
15
|
+
- Update to monaco-vscode-api 9.0.x [#749](https://github.com/TypeFox/monaco-languageclient/pull/749)
|
|
16
|
+
- Updated all `@codingame/monaco-vscode` packages to `11.1.2`.
|
|
17
|
+
- Enhancements to logging
|
|
18
|
+
- monaco-languageclient config improvement, wrapper+languageclientwrapper improvements [#741](https://github.com/TypeFox/monaco-languageclient/pull/741)
|
|
19
|
+
- Pass MessageTransports directly
|
|
20
|
+
- Allows to configure more than one language client
|
|
21
|
+
|
|
5
22
|
## [8.8.3] - 2024-08-26
|
|
6
23
|
|
|
7
24
|
- Update to monaco-vscode-api 8.0.4 (monaco-editor 0.51.0)
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseLanguageClient, MessageTransports, LanguageClientOptions } from 'vscode-languageclient/browser.js';
|
|
2
|
+
export type MonacoLanguageClientOptions = {
|
|
3
|
+
name: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
clientOptions: LanguageClientOptions;
|
|
6
|
+
messageTransports: MessageTransports;
|
|
7
|
+
};
|
|
8
|
+
export declare class MonacoLanguageClient extends BaseLanguageClient {
|
|
9
|
+
protected readonly messageTransports: MessageTransports;
|
|
10
|
+
constructor({ id, name, clientOptions, messageTransports }: MonacoLanguageClientOptions);
|
|
11
|
+
protected createMessageTransports(_encoding: string): Promise<MessageTransports>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEhH,MAAM,MAAM,2BAA2B,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,qBAAqB,CAAC;IACrC,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,CAAA;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IACxD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;gBAE5C,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,2BAA2B;cAKpE,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAG5F"}
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
import { BaseLanguageClient } from 'vscode-languageclient/browser.js';
|
|
6
|
+
export class MonacoLanguageClient extends BaseLanguageClient {
|
|
7
|
+
messageTransports;
|
|
8
|
+
constructor({ id, name, clientOptions, messageTransports }) {
|
|
9
|
+
super(id ?? name.toLowerCase(), name, clientOptions);
|
|
10
|
+
this.messageTransports = messageTransports;
|
|
11
|
+
}
|
|
12
|
+
createMessageTransports(_encoding) {
|
|
13
|
+
return Promise.resolve(this.messageTransports);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAA4C,MAAM,kCAAkC,CAAC;AAShH,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IACrC,iBAAiB,CAAoB;IAExD,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAA+B;QACnF,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,CAAC;IAEkB,uBAAuB,CAAC,SAAiB;QACxD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MonacoLanguageClient } from './client.js';
|
|
2
|
+
export type ConnectionConfigOptions = WebSocketConfigOptionsDirect | WebSocketConfigOptionsParams | WebSocketConfigOptionsUrl | WorkerConfigOptionsParams | WorkerConfigOptionsDirect;
|
|
3
|
+
export interface WebSocketCallOptions {
|
|
4
|
+
/** Adds handle on languageClient */
|
|
5
|
+
onCall: (languageClient?: MonacoLanguageClient) => void;
|
|
6
|
+
/** Reports Status Of Language Client */
|
|
7
|
+
reportStatus?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface WebSocketConfigOptionsDirect {
|
|
10
|
+
$type: 'WebSocketDirect';
|
|
11
|
+
webSocket: WebSocket;
|
|
12
|
+
startOptions?: WebSocketCallOptions;
|
|
13
|
+
stopOptions?: WebSocketCallOptions;
|
|
14
|
+
}
|
|
15
|
+
export interface WebSocketUrlParams {
|
|
16
|
+
secured: boolean;
|
|
17
|
+
host: string;
|
|
18
|
+
port?: number;
|
|
19
|
+
path?: string;
|
|
20
|
+
extraParams?: Record<string, string | number | Array<string | number>>;
|
|
21
|
+
}
|
|
22
|
+
export interface WebSocketConfigOptionsParams extends WebSocketUrlParams {
|
|
23
|
+
$type: 'WebSocketParams';
|
|
24
|
+
startOptions?: WebSocketCallOptions;
|
|
25
|
+
stopOptions?: WebSocketCallOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface WebSocketUrlString {
|
|
28
|
+
url: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WebSocketConfigOptionsUrl extends WebSocketUrlString {
|
|
31
|
+
$type: 'WebSocketUrl';
|
|
32
|
+
startOptions?: WebSocketCallOptions;
|
|
33
|
+
stopOptions?: WebSocketCallOptions;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkerConfigOptionsParams {
|
|
36
|
+
$type: 'WorkerConfig';
|
|
37
|
+
url: URL;
|
|
38
|
+
type: 'classic' | 'module';
|
|
39
|
+
messagePort?: MessagePort;
|
|
40
|
+
workerName?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WorkerConfigOptionsDirect {
|
|
43
|
+
$type: 'WorkerDirect';
|
|
44
|
+
worker: Worker;
|
|
45
|
+
messagePort?: MessagePort;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=commonTypes.d.ts.map
|
|
@@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oB,CAAC;CACtC;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,EAAE,cAAc,CAAA;IACrB,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACtC,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=commonTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonTypes.js","sourceRoot":"","sources":["../src/commonTypes.ts"],"names":[],"mappings":"AAAA;;;gGAGgG"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Logger } from 'monaco-languageclient/tools';
|
|
2
|
+
export interface FileReadRequest {
|
|
3
|
+
resourceUri: string;
|
|
4
|
+
}
|
|
5
|
+
export type FileReadResultStatus = 'success' | 'denied';
|
|
6
|
+
export interface FileReadRequestResult {
|
|
7
|
+
status: FileReadResultStatus;
|
|
8
|
+
content: string | ArrayBuffer;
|
|
9
|
+
}
|
|
10
|
+
export interface FileUpdate {
|
|
11
|
+
resourceUri: string;
|
|
12
|
+
content: string | ArrayBuffer;
|
|
13
|
+
}
|
|
14
|
+
export type FileUpdateResultStatus = 'equal' | 'updated' | 'created' | 'denied';
|
|
15
|
+
export interface FileUpdateResult {
|
|
16
|
+
status: FileUpdateResultStatus;
|
|
17
|
+
message?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DirectoryListingRequest {
|
|
20
|
+
directoryUri: string;
|
|
21
|
+
}
|
|
22
|
+
export interface DirectoryListingRequestResult {
|
|
23
|
+
files: string[];
|
|
24
|
+
}
|
|
25
|
+
export type StatsRequestType = 'directory' | 'file';
|
|
26
|
+
export interface StatsRequest {
|
|
27
|
+
type: StatsRequestType;
|
|
28
|
+
resourceUri: string;
|
|
29
|
+
}
|
|
30
|
+
export interface StatsRequestResult {
|
|
31
|
+
type: StatsRequestType;
|
|
32
|
+
size: number;
|
|
33
|
+
name: string;
|
|
34
|
+
mtime: number;
|
|
35
|
+
}
|
|
36
|
+
export declare enum EndpointType {
|
|
37
|
+
DRIVER = 0,
|
|
38
|
+
FOLLOWER = 1,
|
|
39
|
+
LOCAL = 2,
|
|
40
|
+
EMPTY = 3
|
|
41
|
+
}
|
|
42
|
+
export interface FileSystemCapabilities {
|
|
43
|
+
/**
|
|
44
|
+
* Get a text file content
|
|
45
|
+
* @param params the resourceUri of the file
|
|
46
|
+
* @returns The ReadFileResult containing the content of the file
|
|
47
|
+
*/
|
|
48
|
+
readFile(params: FileReadRequest): Promise<FileReadRequestResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Save a file on the filesystem
|
|
51
|
+
* @param params the resourceUri and the content of the file
|
|
52
|
+
* @returns The FileUpdateResult containing the result of the operation and an optional message
|
|
53
|
+
*/
|
|
54
|
+
writeFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
55
|
+
/**
|
|
56
|
+
* The implementation has to decide if the file at given uri at need to be updated
|
|
57
|
+
* @param params the resourceUri and the content of the file
|
|
58
|
+
* @returns The FileUpdateResult containing the result of the operation and an optional message
|
|
59
|
+
*/
|
|
60
|
+
syncFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
61
|
+
/**
|
|
62
|
+
* Get file stats on a given file
|
|
63
|
+
* @param params the resourceUri and if a file or a directory is requested
|
|
64
|
+
*/
|
|
65
|
+
getFileStats(params: StatsRequest): Promise<StatsRequestResult>;
|
|
66
|
+
/**
|
|
67
|
+
* List the files of a directory
|
|
68
|
+
* @param resourceUri the Uri of the directory
|
|
69
|
+
*/
|
|
70
|
+
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Defines the APT for a file system endpoint
|
|
74
|
+
*/
|
|
75
|
+
export interface FileSystemEndpoint extends FileSystemCapabilities {
|
|
76
|
+
/**
|
|
77
|
+
* Whatever can't be handled in the constructor should be done here
|
|
78
|
+
*/
|
|
79
|
+
init?(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Set an optional logger
|
|
82
|
+
* @param logger the logger implemenation
|
|
83
|
+
*/
|
|
84
|
+
setLogger?(logger: Logger): void;
|
|
85
|
+
/**
|
|
86
|
+
* Get the type of the client
|
|
87
|
+
*/
|
|
88
|
+
getEndpointType(): EndpointType;
|
|
89
|
+
/**
|
|
90
|
+
* Provide info about the file system
|
|
91
|
+
*/
|
|
92
|
+
getFileSystemInfo(): string;
|
|
93
|
+
/**
|
|
94
|
+
* Signal readiness
|
|
95
|
+
*/
|
|
96
|
+
ready?(): void;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/fs/definitions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,OAAO,EAAE,MAAM,GAAG,WAAW,CAAA;CAChC;AAED,MAAM,WAAW,UAAU;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,GAAG,WAAW,CAAA;CACh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mB,SAAQ,sBAAsB;IAE9D;;OAEG;IACH,IAAI,CAAC,IAAI,IAAI,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,eAAe,IAAI,YAAY,CAAC;IAEhC;;OAEG;IACH,iBAAiB,IAAI,MAAM,CAAC;IAE5B;;OAEG;IACH,KAAK,CAAC,IAAI,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export var EndpointType;
|
|
6
|
+
(function (EndpointType) {
|
|
7
|
+
EndpointType[EndpointType["DRIVER"] = 0] = "DRIVER";
|
|
8
|
+
EndpointType[EndpointType["FOLLOWER"] = 1] = "FOLLOWER";
|
|
9
|
+
EndpointType[EndpointType["LOCAL"] = 2] = "LOCAL";
|
|
10
|
+
EndpointType[EndpointType["EMPTY"] = 3] = "EMPTY";
|
|
11
|
+
})(EndpointType || (EndpointType = {}));
|
|
12
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/fs/definitions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAiDhG,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,mDAAM,CAAA;IACN,uDAAQ,CAAA;IACR,iDAAK,CAAA;IACL,iDAAK,CAAA;AACT,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Logger } from 'monaco-languageclient/tools';
|
|
2
|
+
import { DirectoryListingRequest, DirectoryListingRequestResult, EndpointType, FileReadRequest, FileReadRequestResult, FileSystemEndpoint, FileUpdate, FileUpdateResult, StatsRequest, StatsRequestResult } from '../definitions.js';
|
|
3
|
+
export declare class EmptyFileSystemEndpoint implements FileSystemEndpoint {
|
|
4
|
+
private endpointType;
|
|
5
|
+
private logger?;
|
|
6
|
+
constructor(endpointType: EndpointType);
|
|
7
|
+
init(): void;
|
|
8
|
+
getFileSystemInfo(): string;
|
|
9
|
+
setLogger(logger: Logger): void;
|
|
10
|
+
getEndpointType(): EndpointType;
|
|
11
|
+
readFile(params: FileReadRequest): Promise<FileReadRequestResult>;
|
|
12
|
+
writeFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
13
|
+
syncFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
14
|
+
getFileStats(params: StatsRequest): Promise<StatsRequestResult>;
|
|
15
|
+
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=defaultEndpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultEndpoint.d.ts","sourceRoot":"","sources":["../../../src/fs/endpoints/defaultEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAErO,qBAAa,uBAAwB,YAAW,kBAAkB;IAE9D,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,MAAM,CAAC,CAAS;gBAEZ,YAAY,EAAE,YAAY;IAItC,IAAI,IAAI,IAAI;IAEZ,iBAAiB,IAAI,MAAM;IAI3B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B,eAAe,IAAI,YAAY;IAI/B,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQjE,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKxD,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKvD,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAK/D,SAAS,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,6BAA6B,CAAC;CAKrF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export class EmptyFileSystemEndpoint {
|
|
6
|
+
endpointType;
|
|
7
|
+
logger;
|
|
8
|
+
constructor(endpointType) {
|
|
9
|
+
this.endpointType = endpointType;
|
|
10
|
+
}
|
|
11
|
+
init() { }
|
|
12
|
+
getFileSystemInfo() {
|
|
13
|
+
return 'This file system performs no operations.';
|
|
14
|
+
}
|
|
15
|
+
setLogger(logger) {
|
|
16
|
+
this.logger = logger;
|
|
17
|
+
}
|
|
18
|
+
getEndpointType() {
|
|
19
|
+
return this.endpointType;
|
|
20
|
+
}
|
|
21
|
+
readFile(params) {
|
|
22
|
+
this.logger?.info(`Reading file: ${params.resourceUri}`);
|
|
23
|
+
return Promise.resolve({
|
|
24
|
+
status: 'denied',
|
|
25
|
+
content: ''
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
writeFile(params) {
|
|
29
|
+
this.logger?.info(`Writing file: ${params.resourceUri}`);
|
|
30
|
+
return Promise.resolve({ status: 'denied' });
|
|
31
|
+
}
|
|
32
|
+
syncFile(params) {
|
|
33
|
+
this.logger?.info(`Syncing file: ${params.resourceUri}`);
|
|
34
|
+
return Promise.resolve({ status: 'denied' });
|
|
35
|
+
}
|
|
36
|
+
getFileStats(params) {
|
|
37
|
+
this.logger?.info(`Getting file stats for: "${params.resourceUri}" (${params.type})`);
|
|
38
|
+
return Promise.reject('No stats available.');
|
|
39
|
+
}
|
|
40
|
+
listFiles(params) {
|
|
41
|
+
this.logger?.info(`Listing files for directory: "${params.directoryUri}"`);
|
|
42
|
+
return Promise.reject('No file listing possible.');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=defaultEndpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultEndpoint.js","sourceRoot":"","sources":["../../../src/fs/endpoints/defaultEndpoint.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAKhG,MAAM,OAAO,uBAAuB;IAExB,YAAY,CAAe;IAC3B,MAAM,CAAU;IAExB,YAAY,YAA0B;QAClC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,IAAI,KAAW,CAAC;IAEhB,iBAAiB;QACb,OAAO,0CAA0C,CAAC;IACtD,CAAC;IAED,SAAS,CAAC,MAAc;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,MAAuB;QAC5B,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,OAAO,OAAO,CAAC,OAAO,CAAC;YACnB,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,EAAE;SACd,CAAC,CAAC;IACP,CAAC;IAED,SAAS,CAAC,MAAkB;QACxB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,QAAQ,CAAC,MAAkB;QACvB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,YAAY,CAAC,MAAoB;QAC7B,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,4BAA4B,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;QACtF,OAAO,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IACjD,CAAC;IAED,SAAS,CAAC,MAA+B;QACrC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iCAAiC,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC;QAC3E,OAAO,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC;IACvD,CAAC;CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fs/index.ts"],"names":[],"mappings":"AAKA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC"}
|
package/lib/fs/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export * from './definitions.js';
|
|
6
|
+
export * from './endpoints/defaultEndpoint.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fs/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
get(encoding: string): Promise<MessageTransports>;
|
|
4
|
-
}
|
|
5
|
-
export type MonacoLanguageClientOptions = {
|
|
6
|
-
name: string;
|
|
7
|
-
id?: string;
|
|
8
|
-
clientOptions: LanguageClientOptions;
|
|
9
|
-
connectionProvider: IConnectionProvider;
|
|
10
|
-
};
|
|
11
|
-
export declare class MonacoLanguageClient extends BaseLanguageClient {
|
|
12
|
-
protected readonly connectionProvider: IConnectionProvider;
|
|
13
|
-
constructor({ id, name, clientOptions, connectionProvider }: MonacoLanguageClientOptions);
|
|
14
|
-
protected createMessageTransports(encoding: string): Promise<MessageTransports>;
|
|
15
|
-
}
|
|
1
|
+
export * from './client.js';
|
|
2
|
+
export * from './commonTypes.js';
|
|
16
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2024 TypeFox and others.
|
|
3
3
|
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
connectionProvider;
|
|
8
|
-
constructor({ id, name, clientOptions, connectionProvider }) {
|
|
9
|
-
super(id ?? name.toLowerCase(), name, clientOptions);
|
|
10
|
-
this.connectionProvider = connectionProvider;
|
|
11
|
-
}
|
|
12
|
-
createMessageTransports(encoding) {
|
|
13
|
-
return this.connectionProvider.get(encoding);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
5
|
+
export * from './client.js';
|
|
6
|
+
export * from './commonTypes.js';
|
|
16
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
|
package/lib/tools/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
debugEnabled?: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare class Logger {
|
|
6
|
-
private enabled;
|
|
7
|
-
private debugEnabled;
|
|
8
|
-
constructor(config?: LoggerConfig);
|
|
9
|
-
updateConfig(config?: LoggerConfig): void;
|
|
10
|
-
isEnabled(): boolean;
|
|
11
|
-
isDebugEnabled(): boolean;
|
|
12
|
-
info(message: string): void;
|
|
13
|
-
debug(message: string, force?: boolean): void;
|
|
14
|
-
}
|
|
1
|
+
export * from './logging.js';
|
|
2
|
+
export * from './utils.js';
|
|
15
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/tools/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
package/lib/tools/index.js
CHANGED
|
@@ -2,31 +2,6 @@
|
|
|
2
2
|
* Copyright (c) 2024 TypeFox and others.
|
|
3
3
|
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
debugEnabled;
|
|
8
|
-
constructor(config) {
|
|
9
|
-
this.updateConfig(config);
|
|
10
|
-
}
|
|
11
|
-
updateConfig(config) {
|
|
12
|
-
this.enabled = !config ? true : config.enabled === true;
|
|
13
|
-
this.debugEnabled = this.enabled && config?.debugEnabled === true;
|
|
14
|
-
}
|
|
15
|
-
isEnabled() {
|
|
16
|
-
return this.enabled;
|
|
17
|
-
}
|
|
18
|
-
isDebugEnabled() {
|
|
19
|
-
return this.debugEnabled;
|
|
20
|
-
}
|
|
21
|
-
info(message) {
|
|
22
|
-
if (this.enabled) {
|
|
23
|
-
console.log(message);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
debug(message, force) {
|
|
27
|
-
if (this.enabled && (this.debugEnabled || force === true)) {
|
|
28
|
-
console.debug(message);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
5
|
+
export * from './logging.js';
|
|
6
|
+
export * from './utils.js';
|
|
32
7
|
//# sourceMappingURL=index.js.map
|
package/lib/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConsoleLogger as VSCodeConsoleLogger, ILogger } from '@codingame/monaco-vscode-log-service-override';
|
|
2
|
+
import { LogLevel } from 'vscode/services';
|
|
3
|
+
export interface Logger extends ILogger {
|
|
4
|
+
createErrorAndLog(message: string, ...params: unknown[]): Error;
|
|
5
|
+
}
|
|
6
|
+
export declare class ConsoleLogger extends VSCodeConsoleLogger {
|
|
7
|
+
constructor(logLevel?: LogLevel, useColors?: boolean);
|
|
8
|
+
createErrorAndLog(message: string, ...params: unknown[]): Error;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/tools/logging.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,WAAW,MAAO,SAAQ,OAAO;IACnC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;CACnE;AAED,qBAAa,aAAc,SAAQ,mBAAmB;gBAEtC,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,OAAO;IAIpD,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE;CAO1D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
import { ConsoleLogger as VSCodeConsoleLogger } from '@codingame/monaco-vscode-log-service-override';
|
|
6
|
+
import { LogLevel } from 'vscode/services';
|
|
7
|
+
export class ConsoleLogger extends VSCodeConsoleLogger {
|
|
8
|
+
constructor(logLevel, useColors) {
|
|
9
|
+
super(logLevel ?? LogLevel.Off, useColors);
|
|
10
|
+
}
|
|
11
|
+
createErrorAndLog(message, ...params) {
|
|
12
|
+
if (this.getLevel() >= LogLevel.Error) {
|
|
13
|
+
this.error(message, ...params);
|
|
14
|
+
}
|
|
15
|
+
return new Error(message);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/tools/logging.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAW,MAAM,+CAA+C,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAM3C,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAElD,YAAY,QAAmB,EAAE,SAAmB;QAChD,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED,iBAAiB,CAAC,OAAe,EAAE,GAAG,MAAiB;QACnD,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YACpC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,eAAO,MAAM,SAAS,WAAY,kBAAkB,GAAG,kBAAkB,WA+BxE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export const createUrl = (config) => {
|
|
6
|
+
let buildUrl = '';
|
|
7
|
+
if (config.url) {
|
|
8
|
+
const options = config;
|
|
9
|
+
if (!options.url.startsWith('ws://') && !options.url.startsWith('wss://')) {
|
|
10
|
+
throw new Error(`This is not a proper websocket url: ${options.url}`);
|
|
11
|
+
}
|
|
12
|
+
buildUrl = options.url;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const options = config;
|
|
16
|
+
const protocol = options.secured ? 'wss' : 'ws';
|
|
17
|
+
buildUrl = `${protocol}://${options.host}`;
|
|
18
|
+
if (options.port !== undefined) {
|
|
19
|
+
if (options.port !== 80) {
|
|
20
|
+
buildUrl += `:${options.port}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (options.path !== undefined) {
|
|
24
|
+
buildUrl += `/${options.path}`;
|
|
25
|
+
}
|
|
26
|
+
if (options.extraParams) {
|
|
27
|
+
const url = new URL(buildUrl);
|
|
28
|
+
for (const [key, value] of Object.entries(options.extraParams)) {
|
|
29
|
+
url.searchParams.set(key, value instanceof Array ? value.join(',') : value.toString());
|
|
30
|
+
}
|
|
31
|
+
buildUrl = url.toString();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return buildUrl;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/tools/utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAIhG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAA+C,EAAE,EAAE;IACzE,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAK,MAA6B,CAAC,GAAG,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,MAA4B,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,KAAK,CAAC,uCAAuC,OAAO,CAAC,GAAG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.ts"],"names":[],"mappings":"AAKA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* --------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2024 TypeFox and others.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
|
+
* ------------------------------------------------------------------------------------------ */
|
|
5
|
+
export * from './fakeWorker.js';
|
|
6
|
+
export * from './services.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/vscode/index.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|