monaco-languageclient 10.7.0 → 11.0.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 +13 -4
- package/LICENSE +0 -0
- package/README.md +63 -63
- package/lib/common/commonTypes.d.ts +1 -1
- package/lib/common/commonTypes.d.ts.map +1 -1
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +2 -2
- package/lib/common/utils.js.map +1 -1
- package/lib/debugger/index.d.ts +1 -1
- package/lib/debugger/index.d.ts.map +1 -1
- package/lib/debugger/index.js +2 -4
- package/lib/debugger/index.js.map +1 -1
- package/lib/editorApp/config.d.ts +11 -11
- package/lib/editorApp/config.d.ts.map +1 -1
- package/lib/editorApp/config.js +0 -1
- package/lib/editorApp/config.js.map +1 -1
- package/lib/editorApp/editorApp.d.ts +5 -5
- package/lib/editorApp/editorApp.d.ts.map +1 -1
- package/lib/editorApp/editorApp.js +21 -23
- package/lib/editorApp/editorApp.js.map +1 -1
- package/lib/fs/definitions.d.ts.map +1 -1
- package/lib/fs/endpoints/defaultEndpoint.d.ts.map +1 -1
- package/lib/fs/endpoints/defaultEndpoint.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/vscode/apiWrapper.d.ts +2 -2
- package/lib/vscode/apiWrapper.d.ts.map +1 -1
- package/lib/vscode/apiWrapper.js +18 -20
- package/lib/vscode/apiWrapper.js.map +1 -1
- package/lib/vscode/config.d.ts +4 -4
- package/lib/vscode/config.d.ts.map +1 -1
- package/lib/vscode/config.js +0 -1
- package/lib/vscode/config.js.map +1 -1
- package/lib/vscode/locales.d.ts +1 -1
- package/lib/vscode/locales.d.ts.map +1 -1
- package/lib/vscode/locales.js +35 -18
- package/lib/vscode/locales.js.map +1 -1
- package/lib/vscode/utils.d.ts +3 -3
- package/lib/vscode/utils.d.ts.map +1 -1
- package/lib/vscode/utils.js +3 -10
- package/lib/vscode/utils.js.map +1 -1
- package/lib/vscode/viewsService.d.ts.map +1 -1
- package/lib/vscode/viewsService.js +13 -7
- package/lib/vscode/viewsService.js.map +1 -1
- package/lib/worker/index.d.ts +1 -1
- package/lib/worker/index.d.ts.map +1 -1
- package/lib/worker/index.js.map +1 -1
- package/lib/wrapper/lcconfig.d.ts +2 -2
- package/lib/wrapper/lcconfig.d.ts.map +1 -1
- package/lib/wrapper/lcmanager.d.ts.map +1 -1
- package/lib/wrapper/lcmanager.js.map +1 -1
- package/lib/wrapper/lcwrapper.d.ts +1 -1
- package/lib/wrapper/lcwrapper.d.ts.map +1 -1
- package/lib/wrapper/lcwrapper.js +17 -16
- package/lib/wrapper/lcwrapper.js.map +1 -1
- package/package.json +70 -96
- package/src/common/commonTypes.ts +35 -30
- package/src/common/index.ts +0 -1
- package/src/common/utils.ts +45 -45
- package/src/debugger/index.ts +130 -133
- package/src/editorApp/config.ts +33 -33
- package/src/editorApp/editorApp.ts +382 -370
- package/src/fs/definitions.ts +72 -75
- package/src/fs/endpoints/defaultEndpoint.ts +50 -41
- package/src/index.ts +18 -18
- package/src/vscode/apiWrapper.ts +302 -295
- package/src/vscode/config.ts +30 -30
- package/src/vscode/locales.ts +127 -110
- package/src/vscode/utils.ts +20 -26
- package/src/vscode/viewsService.ts +44 -37
- package/src/worker/index.ts +38 -45
- package/src/wrapper/lcconfig.ts +16 -16
- package/src/wrapper/lcmanager.ts +68 -69
- package/src/wrapper/lcwrapper.ts +256 -249
package/src/fs/definitions.ts
CHANGED
|
@@ -6,117 +6,114 @@
|
|
|
6
6
|
import type { ILogger } from '@codingame/monaco-vscode-log-service-override';
|
|
7
7
|
|
|
8
8
|
export interface FileReadRequest {
|
|
9
|
-
|
|
9
|
+
resourceUri: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export type FileReadResultStatus = 'success' | 'denied';
|
|
13
13
|
|
|
14
14
|
export interface FileReadRequestResult {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
status: FileReadResultStatus;
|
|
16
|
+
content: string | ArrayBuffer | ArrayBufferLike | BlobPart;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface FileUpdate {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
resourceUri: string;
|
|
21
|
+
content: string | ArrayBuffer | ArrayBufferLike | BlobPart;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type FileUpdateResultStatus = 'equal' | 'updated' | 'created' | 'denied';
|
|
25
25
|
|
|
26
26
|
export interface FileUpdateResult {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
status: FileUpdateResultStatus;
|
|
28
|
+
message?: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export interface DirectoryListingRequest {
|
|
32
|
-
|
|
32
|
+
directoryUri: string;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface DirectoryListingRequestResult {
|
|
36
|
-
|
|
36
|
+
files: string[];
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export type StatsRequestType = 'directory' | 'file';
|
|
40
40
|
|
|
41
41
|
export interface StatsRequest {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
type: StatsRequestType;
|
|
43
|
+
resourceUri: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export interface StatsRequestResult {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
type: StatsRequestType;
|
|
48
|
+
size: number;
|
|
49
|
+
name: string;
|
|
50
|
+
mtime: number;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export type EndpointType = 'DRIVER' | 'FOLLOWER' | 'LOCAL' | 'EMPTY';
|
|
54
54
|
|
|
55
55
|
export interface FileSystemCapabilities {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult>
|
|
89
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Get a text file content
|
|
58
|
+
* @param params the resourceUri of the file
|
|
59
|
+
* @returns The ReadFileResult containing the content of the file
|
|
60
|
+
*/
|
|
61
|
+
readFile(params: FileReadRequest): Promise<FileReadRequestResult>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Save a file on the filesystem
|
|
65
|
+
* @param params the resourceUri and the content of the file
|
|
66
|
+
* @returns The FileUpdateResult containing the result of the operation and an optional message
|
|
67
|
+
*/
|
|
68
|
+
writeFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The implementation has to decide if the file at given uri at need to be updated
|
|
72
|
+
* @param params the resourceUri and the content of the file
|
|
73
|
+
* @returns The FileUpdateResult containing the result of the operation and an optional message
|
|
74
|
+
*/
|
|
75
|
+
syncFile(params: FileUpdate): Promise<FileUpdateResult>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Get file stats on a given file
|
|
79
|
+
* @param params the resourceUri and if a file or a directory is requested
|
|
80
|
+
*/
|
|
81
|
+
getFileStats(params: StatsRequest): Promise<StatsRequestResult>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* List the files of a directory
|
|
85
|
+
* @param resourceUri the Uri of the directory
|
|
86
|
+
*/
|
|
87
|
+
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult>;
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
/**
|
|
93
91
|
* Defines the APT for a file system endpoint
|
|
94
92
|
*/
|
|
95
93
|
export interface FileSystemEndpoint extends FileSystemCapabilities {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ready?(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Whatever can't be handled in the constructor should be done here
|
|
96
|
+
*/
|
|
97
|
+
init?(): void;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Set an optional logger
|
|
101
|
+
* @param logger the logger implemenation
|
|
102
|
+
*/
|
|
103
|
+
setLogger?(logger: ILogger): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Get the type of the client
|
|
107
|
+
*/
|
|
108
|
+
getEndpointType(): EndpointType;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Provide info about the file system
|
|
112
|
+
*/
|
|
113
|
+
getFileSystemInfo(): string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Signal readiness
|
|
117
|
+
*/
|
|
118
|
+
ready?(): void;
|
|
122
119
|
}
|
|
@@ -4,57 +4,66 @@
|
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
5
|
|
|
6
6
|
import { type ILogger } from '@codingame/monaco-vscode-log-service-override';
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
DirectoryListingRequest,
|
|
9
|
+
DirectoryListingRequestResult,
|
|
10
|
+
EndpointType,
|
|
11
|
+
FileReadRequest,
|
|
12
|
+
FileReadRequestResult,
|
|
13
|
+
FileSystemEndpoint,
|
|
14
|
+
FileUpdate,
|
|
15
|
+
FileUpdateResult,
|
|
16
|
+
StatsRequest,
|
|
17
|
+
StatsRequestResult
|
|
18
|
+
} from '../definitions.js';
|
|
8
19
|
|
|
9
20
|
export class EmptyFileSystemEndpoint implements FileSystemEndpoint {
|
|
21
|
+
private endpointType: EndpointType;
|
|
22
|
+
private logger?: ILogger;
|
|
10
23
|
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
constructor(endpointType: EndpointType) {
|
|
25
|
+
this.endpointType = endpointType;
|
|
26
|
+
}
|
|
13
27
|
|
|
14
|
-
|
|
15
|
-
this.endpointType = endpointType;
|
|
16
|
-
}
|
|
28
|
+
init(): void {}
|
|
17
29
|
|
|
18
|
-
|
|
30
|
+
getFileSystemInfo(): string {
|
|
31
|
+
return 'This file system performs no operations.';
|
|
32
|
+
}
|
|
19
33
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
34
|
+
setLogger(logger: ILogger): void {
|
|
35
|
+
this.logger = logger;
|
|
36
|
+
}
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
getEndpointType(): EndpointType {
|
|
39
|
+
return this.endpointType;
|
|
40
|
+
}
|
|
27
41
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
readFile(params: FileReadRequest): Promise<FileReadRequestResult> {
|
|
43
|
+
this.logger?.info(`Reading file: ${params.resourceUri}`);
|
|
44
|
+
return Promise.resolve({
|
|
45
|
+
status: 'denied',
|
|
46
|
+
content: ''
|
|
47
|
+
});
|
|
48
|
+
}
|
|
31
49
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
content: ''
|
|
37
|
-
});
|
|
38
|
-
}
|
|
50
|
+
writeFile(params: FileUpdate): Promise<FileUpdateResult> {
|
|
51
|
+
this.logger?.info(`Writing file: ${params.resourceUri}`);
|
|
52
|
+
return Promise.resolve({ status: 'denied' });
|
|
53
|
+
}
|
|
39
54
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
syncFile(params: FileUpdate): Promise<FileUpdateResult> {
|
|
56
|
+
this.logger?.info(`Syncing file: ${params.resourceUri}`);
|
|
57
|
+
return Promise.resolve({ status: 'denied' });
|
|
58
|
+
}
|
|
44
59
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
getFileStats(params: StatsRequest): Promise<StatsRequestResult> {
|
|
51
|
-
this.logger?.info(`Getting file stats for: "${params.resourceUri}" (${params.type})`);
|
|
52
|
-
return Promise.reject('No stats available.');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult> {
|
|
56
|
-
this.logger?.info(`Listing files for directory: "${params.directoryUri}"`);
|
|
57
|
-
return Promise.reject('No file listing possible.');
|
|
58
|
-
}
|
|
60
|
+
getFileStats(params: StatsRequest): Promise<StatsRequestResult> {
|
|
61
|
+
this.logger?.info(`Getting file stats for: "${params.resourceUri}" (${params.type})`);
|
|
62
|
+
return Promise.reject('No stats available.');
|
|
63
|
+
}
|
|
59
64
|
|
|
65
|
+
listFiles(params: DirectoryListingRequest): Promise<DirectoryListingRequestResult> {
|
|
66
|
+
this.logger?.info(`Listing files for directory: "${params.directoryUri}"`);
|
|
67
|
+
return Promise.reject('No file listing possible.');
|
|
68
|
+
}
|
|
60
69
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
* Licensed under the MIT License. See LICENSE in the package root for license information.
|
|
4
4
|
* ------------------------------------------------------------------------------------------ */
|
|
5
5
|
|
|
6
|
-
import { BaseLanguageClient, MessageTransports, ProposedFeatures, type LanguageClientOptions } from 'vscode-languageclient/browser
|
|
6
|
+
import { BaseLanguageClient, MessageTransports, ProposedFeatures, type LanguageClientOptions } from 'vscode-languageclient/browser';
|
|
7
7
|
|
|
8
8
|
export type MonacoLanguageClientOptions = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
9
|
+
name: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
clientOptions: LanguageClientOptions;
|
|
12
|
+
messageTransports: MessageTransports;
|
|
13
|
+
};
|
|
14
14
|
|
|
15
15
|
export class MonacoLanguageClient extends BaseLanguageClient {
|
|
16
|
-
|
|
16
|
+
protected readonly messageTransports: MessageTransports;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
constructor({ id, name, clientOptions, messageTransports }: MonacoLanguageClientOptions) {
|
|
19
|
+
super(id ?? name.toLowerCase(), name, clientOptions);
|
|
20
|
+
this.messageTransports = messageTransports;
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
protected override createMessageTransports(_encoding: string): Promise<MessageTransports> {
|
|
24
|
+
return Promise.resolve(this.messageTransports);
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export class MonacoLanguageClientWithProposedFeatures extends MonacoLanguageClient {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
constructor({ id, name, clientOptions, messageTransports }: MonacoLanguageClientOptions) {
|
|
30
|
+
super({ id, name, clientOptions, messageTransports });
|
|
31
|
+
ProposedFeatures.createAll(this);
|
|
32
|
+
}
|
|
33
33
|
}
|