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