@jupyterlab/lsp 4.0.0-alpha.11 → 4.0.0-alpha.12
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/lib/adapters/adapter.d.ts +184 -54
- package/lib/adapters/adapter.js +177 -132
- package/lib/adapters/adapter.js.map +1 -1
- package/lib/adapters/statusmessage.d.ts +47 -0
- package/lib/adapters/statusmessage.js +74 -0
- package/lib/adapters/statusmessage.js.map +1 -0
- package/lib/connection.d.ts +113 -26
- package/lib/connection.js +166 -105
- package/lib/connection.js.map +1 -1
- package/lib/connection_manager.d.ts +143 -18
- package/lib/connection_manager.js +163 -49
- package/lib/connection_manager.js.map +1 -1
- package/lib/extractors/index.d.ts +3 -0
- package/lib/extractors/index.js +6 -0
- package/lib/extractors/index.js.map +1 -0
- package/lib/extractors/manager.d.ts +21 -4
- package/lib/extractors/manager.js +22 -5
- package/lib/extractors/manager.js.map +1 -1
- package/lib/extractors/text_extractor.d.ts +34 -7
- package/lib/extractors/text_extractor.js +11 -0
- package/lib/extractors/text_extractor.js.map +1 -1
- package/lib/extractors/types.d.ts +8 -6
- package/lib/extractors/types.js +2 -0
- package/lib/extractors/types.js.map +1 -1
- package/lib/feature.d.ts +18 -3
- package/lib/feature.js +20 -3
- package/lib/feature.js.map +1 -1
- package/lib/index.d.ts +6 -9
- package/lib/index.js +8 -13
- package/lib/index.js.map +1 -1
- package/lib/lsp.d.ts +10 -4
- package/lib/lsp.js +2 -0
- package/lib/lsp.js.map +1 -1
- package/lib/manager.d.ts +103 -16
- package/lib/manager.js +118 -31
- package/lib/manager.js.map +1 -1
- package/lib/plugin.d.ts +18 -13
- package/lib/plugin.js +2 -1
- package/lib/plugin.js.map +1 -1
- package/lib/positioning.d.ts +43 -6
- package/lib/positioning.js +28 -2
- package/lib/positioning.js.map +1 -1
- package/lib/schema.js +2 -1
- package/lib/schema.js.map +1 -1
- package/lib/tokens.d.ts +275 -45
- package/lib/tokens.js +28 -0
- package/lib/tokens.js.map +1 -1
- package/lib/utils.d.ts +15 -1
- package/lib/utils.js +18 -2
- package/lib/utils.js.map +1 -1
- package/lib/virtual/document.d.ts +374 -78
- package/lib/virtual/document.js +375 -148
- package/lib/virtual/document.js.map +1 -1
- package/lib/ws-connection/server-capability-registration.d.ts +18 -0
- package/lib/ws-connection/server-capability-registration.js +46 -0
- package/lib/ws-connection/server-capability-registration.js.map +1 -0
- package/lib/ws-connection/types.d.ts +75 -0
- package/lib/ws-connection/types.js +7 -0
- package/lib/ws-connection/types.js.map +1 -0
- package/lib/ws-connection/ws-connection.d.ts +82 -0
- package/lib/ws-connection/ws-connection.js +201 -0
- package/lib/ws-connection/ws-connection.js.map +1 -0
- package/package.json +15 -16
- package/style/index.css +0 -2
- package/style/index.js +0 -2
package/lib/connection.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ClientNotifications, ClientRequests, ILSPConnection, ILSPOptions, Method, ServerNotifications, ServerRequests } from './tokens';
|
|
1
|
+
import { ISignal } from '@lumino/signaling';
|
|
2
|
+
import { ClientNotifications, ClientRequests, IDocumentInfo, ILSPConnection, ILSPOptions, Method, ServerNotifications, ServerRequests } from './tokens';
|
|
3
|
+
import { LspWsConnection } from './ws-connection/ws-connection';
|
|
3
4
|
import type * as lsp from 'vscode-languageserver-protocol';
|
|
4
5
|
export declare const Provider: {
|
|
5
6
|
[key: string]: keyof lsp.ServerCapabilities;
|
|
@@ -18,48 +19,134 @@ interface IMessageLog<T extends AnyMethod = AnyMethod> {
|
|
|
18
19
|
message: any;
|
|
19
20
|
}
|
|
20
21
|
export declare class LSPConnection extends LspWsConnection implements ILSPConnection {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
constructor(options: ILSPOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Identifier of the language server
|
|
25
|
+
*/
|
|
26
|
+
readonly serverIdentifier?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Language of the language server
|
|
29
|
+
*/
|
|
30
|
+
readonly serverLanguage?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Notifications comes from the client.
|
|
33
|
+
*/
|
|
34
|
+
readonly clientNotifications: ClientNotifications;
|
|
35
|
+
/**
|
|
36
|
+
* Notifications comes from the server.
|
|
37
|
+
*/
|
|
38
|
+
readonly serverNotifications: ServerNotifications;
|
|
39
|
+
/**
|
|
40
|
+
* Requests comes from the client.
|
|
41
|
+
*/
|
|
25
42
|
clientRequests: ClientRequests;
|
|
43
|
+
/**
|
|
44
|
+
* Responses comes from the server.
|
|
45
|
+
*/
|
|
26
46
|
serverRequests: ServerRequests;
|
|
47
|
+
/**
|
|
48
|
+
* Should log all communication?
|
|
49
|
+
*/
|
|
27
50
|
logAllCommunication: boolean;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Check if the connection is disposed
|
|
53
|
+
*/
|
|
54
|
+
get isDisposed(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Signal emitted when the connection is closed.
|
|
57
|
+
*/
|
|
58
|
+
get closeSignal(): ISignal<ILSPConnection, boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Signal emitted when the connection receives an error
|
|
61
|
+
* message..
|
|
62
|
+
*/
|
|
63
|
+
get errorSignal(): ISignal<ILSPConnection, any>;
|
|
64
|
+
/**
|
|
65
|
+
* Signal emitted when the connection is initialized.
|
|
66
|
+
*/
|
|
67
|
+
get serverInitialized(): ISignal<ILSPConnection, lsp.ServerCapabilities<any>>;
|
|
68
|
+
/**
|
|
69
|
+
* Dispose the connection.
|
|
70
|
+
*/
|
|
71
|
+
dispose(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Helper to print the logs to logger, for now we are using
|
|
74
|
+
* directly the browser's console.
|
|
75
|
+
*/
|
|
31
76
|
log(kind: MessageKind, message: IMessageLog): void;
|
|
77
|
+
/**
|
|
78
|
+
* Send the open request to the backend when the server is
|
|
79
|
+
* ready.
|
|
80
|
+
*/
|
|
81
|
+
sendOpenWhenReady(documentInfo: IDocumentInfo): void;
|
|
82
|
+
/**
|
|
83
|
+
* Send the document changes to the server.
|
|
84
|
+
*/
|
|
85
|
+
sendSelectiveChange(changeEvent: lsp.TextDocumentContentChangeEvent, documentInfo: IDocumentInfo): void;
|
|
86
|
+
/**
|
|
87
|
+
* Send all changes to the server.
|
|
88
|
+
*/
|
|
89
|
+
sendFullTextChange(text: string, documentInfo: IDocumentInfo): void;
|
|
90
|
+
/**
|
|
91
|
+
* Check if a provider is available in the registered capabilities.
|
|
92
|
+
*/
|
|
93
|
+
provides(provider: keyof lsp.ServerCapabilities): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Close the connection to the server.
|
|
96
|
+
*/
|
|
97
|
+
close(): void;
|
|
98
|
+
/**
|
|
99
|
+
* initialize a connection over a web socket that speaks the LSP
|
|
100
|
+
*/
|
|
101
|
+
connect(socket: WebSocket): void;
|
|
102
|
+
/**
|
|
103
|
+
* Get send request to the server to get completion results
|
|
104
|
+
* from a completion item
|
|
105
|
+
*/
|
|
106
|
+
getCompletionResolve(completionItem: lsp.CompletionItem): Promise<lsp.CompletionItem | undefined>;
|
|
107
|
+
/**
|
|
108
|
+
* List of documents waiting to be opened once the connection
|
|
109
|
+
* is ready.
|
|
110
|
+
*/
|
|
111
|
+
protected documentsToOpen: IDocumentInfo[];
|
|
112
|
+
/**
|
|
113
|
+
* Generate the notification handlers
|
|
114
|
+
*/
|
|
32
115
|
protected constructNotificationHandlers<T extends ServerNotifications | ClientNotifications>(methods: typeof Method.ServerNotification | typeof Method.ClientNotification): T;
|
|
116
|
+
/**
|
|
117
|
+
* Generate the client request handler
|
|
118
|
+
*/
|
|
33
119
|
protected constructClientRequestHandler<T extends ClientRequests, U extends keyof T = keyof T>(methods: typeof Method.ClientRequest): T;
|
|
120
|
+
/**
|
|
121
|
+
* Generate the server response handler
|
|
122
|
+
*/
|
|
34
123
|
protected constructServerRequestHandler<T extends ServerRequests, U extends keyof T = keyof T>(methods: typeof Method.ServerRequest): T;
|
|
35
124
|
/**
|
|
36
125
|
* Initialization parameters to be sent to the language server.
|
|
37
126
|
* Subclasses can overload this when adding more features.
|
|
38
127
|
*/
|
|
39
128
|
protected initializeParams(): lsp.InitializeParams;
|
|
40
|
-
|
|
129
|
+
/**
|
|
130
|
+
* Callback called when the server is initialized.
|
|
131
|
+
*/
|
|
41
132
|
protected onServerInitialized(params: lsp.InitializeResult): void;
|
|
42
|
-
protected afterInitialized(): void;
|
|
43
|
-
sendSelectiveChange(changeEvent: lsp.TextDocumentContentChangeEvent, documentInfo: IDocumentInfo): void;
|
|
44
|
-
sendFullTextChange(text: string, documentInfo: IDocumentInfo): void;
|
|
45
133
|
/**
|
|
46
|
-
*
|
|
134
|
+
* Once the server is initialized, this method generates the
|
|
135
|
+
* client and server handlers
|
|
47
136
|
*/
|
|
48
|
-
|
|
49
|
-
provides(provider: keyof lsp.ServerCapabilities): boolean;
|
|
137
|
+
protected afterInitialized(): void;
|
|
50
138
|
/**
|
|
51
|
-
*
|
|
139
|
+
* Is the connection is closed manually?
|
|
52
140
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
private
|
|
56
|
-
|
|
57
|
-
private
|
|
58
|
-
|
|
141
|
+
private _closingManually;
|
|
142
|
+
private _options;
|
|
143
|
+
private _closeSignal;
|
|
144
|
+
private _errorSignal;
|
|
145
|
+
private _serverInitialized;
|
|
146
|
+
private _isDisposed;
|
|
59
147
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @deprecated The method should not be used in new code
|
|
148
|
+
* Send the document changed data to the server.
|
|
62
149
|
*/
|
|
63
|
-
|
|
150
|
+
private _sendChange;
|
|
64
151
|
}
|
|
65
152
|
export {};
|
package/lib/connection.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// but without language deemed unnecessary following the Berne Convention." (Wikipedia).
|
|
4
|
-
// Introduced modifications are BSD licenced, copyright JupyterLab development team.
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
5
3
|
import { Signal } from '@lumino/signaling';
|
|
6
|
-
import { LspWsConnection } from 'lsp-ws-connection';
|
|
7
|
-
import { registerServerCapability, unregisterServerCapability } from 'lsp-ws-connection/lib/server-capability-registration';
|
|
8
4
|
import { Method } from './tokens';
|
|
9
5
|
import { untilReady } from './utils';
|
|
6
|
+
import { registerServerCapability, unregisterServerCapability } from './ws-connection/server-capability-registration';
|
|
7
|
+
import { LspWsConnection } from './ws-connection/ws-connection';
|
|
8
|
+
/**
|
|
9
|
+
* Helper class to handle client request
|
|
10
|
+
*/
|
|
10
11
|
class ClientRequestHandler {
|
|
11
12
|
constructor(connection, method, emitter) {
|
|
12
13
|
this.connection = connection;
|
|
@@ -30,16 +31,25 @@ class ClientRequestHandler {
|
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Helper class to handle server responses
|
|
36
|
+
*/
|
|
33
37
|
class ServerRequestHandler {
|
|
34
38
|
constructor(connection, method, emitter) {
|
|
35
39
|
this.connection = connection;
|
|
36
40
|
this.method = method;
|
|
37
41
|
this.emitter = emitter;
|
|
38
42
|
// on request accepts "thenable"
|
|
39
|
-
this.connection.onRequest(method, this.
|
|
43
|
+
this.connection.onRequest(method, this._handle.bind(this));
|
|
40
44
|
this._handler = null;
|
|
41
45
|
}
|
|
42
|
-
|
|
46
|
+
setHandler(handler) {
|
|
47
|
+
this._handler = handler;
|
|
48
|
+
}
|
|
49
|
+
clearHandler() {
|
|
50
|
+
this._handler = null;
|
|
51
|
+
}
|
|
52
|
+
_handle(request) {
|
|
43
53
|
this.emitter.log(MessageKind.serverRequested, {
|
|
44
54
|
method: this.method,
|
|
45
55
|
message: request
|
|
@@ -55,12 +65,6 @@ class ServerRequestHandler {
|
|
|
55
65
|
return result;
|
|
56
66
|
});
|
|
57
67
|
}
|
|
58
|
-
setHandler(handler) {
|
|
59
|
-
this._handler = handler;
|
|
60
|
-
}
|
|
61
|
-
clearHandler() {
|
|
62
|
-
this._handler = null;
|
|
63
|
-
}
|
|
64
68
|
}
|
|
65
69
|
export const Provider = {
|
|
66
70
|
TEXT_DOCUMENT_SYNC: 'textDocumentSync',
|
|
@@ -88,6 +92,9 @@ export const Provider = {
|
|
|
88
92
|
WORKSPACE_SYMBOL: 'workspaceSymbolProvider',
|
|
89
93
|
WORKSPACE: 'workspace'
|
|
90
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Create a map between the request method and its handler
|
|
97
|
+
*/
|
|
91
98
|
function createMethodMap(methods, handlerFactory) {
|
|
92
99
|
const result = {};
|
|
93
100
|
for (let method of Object.values(methods)) {
|
|
@@ -107,7 +114,14 @@ var MessageKind;
|
|
|
107
114
|
export class LSPConnection extends LspWsConnection {
|
|
108
115
|
constructor(options) {
|
|
109
116
|
super(options);
|
|
110
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Is the connection is closed manually?
|
|
119
|
+
*/
|
|
120
|
+
this._closingManually = false;
|
|
121
|
+
this._closeSignal = new Signal(this);
|
|
122
|
+
this._errorSignal = new Signal(this);
|
|
123
|
+
this._serverInitialized = new Signal(this);
|
|
124
|
+
this._isDisposed = false;
|
|
111
125
|
this._options = options;
|
|
112
126
|
this.logAllCommunication = false;
|
|
113
127
|
this.serverIdentifier = options.serverIdentifier;
|
|
@@ -118,17 +132,136 @@ export class LSPConnection extends LspWsConnection {
|
|
|
118
132
|
this.serverNotifications =
|
|
119
133
|
this.constructNotificationHandlers(Method.ServerNotification);
|
|
120
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Check if the connection is disposed
|
|
137
|
+
*/
|
|
138
|
+
get isDisposed() {
|
|
139
|
+
return this._isDisposed;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Signal emitted when the connection is closed.
|
|
143
|
+
*/
|
|
144
|
+
get closeSignal() {
|
|
145
|
+
return this._closeSignal;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Signal emitted when the connection receives an error
|
|
149
|
+
* message..
|
|
150
|
+
*/
|
|
151
|
+
get errorSignal() {
|
|
152
|
+
return this._errorSignal;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Signal emitted when the connection is initialized.
|
|
156
|
+
*/
|
|
157
|
+
get serverInitialized() {
|
|
158
|
+
return this._serverInitialized;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Dispose the connection.
|
|
162
|
+
*/
|
|
163
|
+
dispose() {
|
|
164
|
+
if (this._isDisposed) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this._isDisposed = true;
|
|
168
|
+
this.close();
|
|
169
|
+
Signal.clearData(this);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Helper to print the logs to logger, for now we are using
|
|
173
|
+
* directly the browser's console.
|
|
174
|
+
*/
|
|
121
175
|
log(kind, message) {
|
|
122
176
|
if (this.logAllCommunication) {
|
|
123
177
|
console.log(kind, message);
|
|
124
178
|
}
|
|
125
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Send the open request to the backend when the server is
|
|
182
|
+
* ready.
|
|
183
|
+
*/
|
|
184
|
+
sendOpenWhenReady(documentInfo) {
|
|
185
|
+
if (this.isReady) {
|
|
186
|
+
this.sendOpen(documentInfo);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
this.documentsToOpen.push(documentInfo);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Send the document changes to the server.
|
|
194
|
+
*/
|
|
195
|
+
sendSelectiveChange(changeEvent, documentInfo) {
|
|
196
|
+
this._sendChange([changeEvent], documentInfo);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Send all changes to the server.
|
|
200
|
+
*/
|
|
201
|
+
sendFullTextChange(text, documentInfo) {
|
|
202
|
+
this._sendChange([{ text }], documentInfo);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Check if a provider is available in the registered capabilities.
|
|
206
|
+
*/
|
|
207
|
+
provides(provider) {
|
|
208
|
+
return !!(this.serverCapabilities && this.serverCapabilities[provider]);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Close the connection to the server.
|
|
212
|
+
*/
|
|
213
|
+
close() {
|
|
214
|
+
try {
|
|
215
|
+
this._closingManually = true;
|
|
216
|
+
super.close();
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
this._closingManually = false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* initialize a connection over a web socket that speaks the LSP
|
|
224
|
+
*/
|
|
225
|
+
connect(socket) {
|
|
226
|
+
super.connect(socket);
|
|
227
|
+
untilReady(() => {
|
|
228
|
+
return this.isConnected;
|
|
229
|
+
}, -1)
|
|
230
|
+
.then(() => {
|
|
231
|
+
this.connection.onClose(() => {
|
|
232
|
+
this._isConnected = false;
|
|
233
|
+
this._closeSignal.emit(this._closingManually);
|
|
234
|
+
});
|
|
235
|
+
})
|
|
236
|
+
.catch(() => {
|
|
237
|
+
console.error('Could not connect onClose signal');
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Get send request to the server to get completion results
|
|
242
|
+
* from a completion item
|
|
243
|
+
*/
|
|
244
|
+
async getCompletionResolve(completionItem) {
|
|
245
|
+
if (!this.isReady) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
return this.connection.sendRequest('completionItem/resolve', completionItem);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Generate the notification handlers
|
|
252
|
+
*/
|
|
126
253
|
constructNotificationHandlers(methods) {
|
|
127
254
|
return createMethodMap(methods, () => new Signal(this));
|
|
128
255
|
}
|
|
256
|
+
/**
|
|
257
|
+
* Generate the client request handler
|
|
258
|
+
*/
|
|
129
259
|
constructClientRequestHandler(methods) {
|
|
130
260
|
return createMethodMap(methods, method => new ClientRequestHandler(this.connection, method, this));
|
|
131
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Generate the server response handler
|
|
264
|
+
*/
|
|
132
265
|
constructServerRequestHandler(methods) {
|
|
133
266
|
return createMethodMap(methods, method => new ServerRequestHandler(this.connection, method, this));
|
|
134
267
|
}
|
|
@@ -137,28 +270,25 @@ export class LSPConnection extends LspWsConnection {
|
|
|
137
270
|
* Subclasses can overload this when adding more features.
|
|
138
271
|
*/
|
|
139
272
|
initializeParams() {
|
|
140
|
-
return Object.assign(Object.assign({}, super.initializeParams()), {
|
|
141
|
-
// TODO: remove as `lsp.ClientCapabilities` after upgrading to 3.17
|
|
142
|
-
// which should finally include a fix for moniker issue:
|
|
143
|
-
// https://github.com/microsoft/vscode-languageserver-node/pull/720
|
|
144
|
-
capabilities: this._options.capabilities, initializationOptions: null, processId: null, workspaceFolders: null });
|
|
145
|
-
}
|
|
146
|
-
sendOpenWhenReady(documentInfo) {
|
|
147
|
-
if (this.isReady) {
|
|
148
|
-
this.sendOpen(documentInfo);
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
this.documentsToOpen.push(documentInfo);
|
|
152
|
-
}
|
|
273
|
+
return Object.assign(Object.assign({}, super.initializeParams()), { capabilities: this._options.capabilities, initializationOptions: null, processId: null, workspaceFolders: null });
|
|
153
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Callback called when the server is initialized.
|
|
277
|
+
*/
|
|
154
278
|
onServerInitialized(params) {
|
|
155
279
|
this.afterInitialized();
|
|
156
280
|
super.onServerInitialized(params);
|
|
157
281
|
while (this.documentsToOpen.length) {
|
|
158
282
|
this.sendOpen(this.documentsToOpen.pop());
|
|
159
283
|
}
|
|
284
|
+
this._serverInitialized.emit(this.serverCapabilities);
|
|
160
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Once the server is initialized, this method generates the
|
|
288
|
+
* client and server handlers
|
|
289
|
+
*/
|
|
161
290
|
afterInitialized() {
|
|
291
|
+
this.connection.onError(e => this._errorSignal.emit(e));
|
|
162
292
|
for (const method of Object.values(Method.ServerNotification)) {
|
|
163
293
|
const signal = this.serverNotifications[method];
|
|
164
294
|
this.connection.onNotification(method, params => {
|
|
@@ -176,7 +306,7 @@ export class LSPConnection extends LspWsConnection {
|
|
|
176
306
|
method,
|
|
177
307
|
message: params
|
|
178
308
|
});
|
|
179
|
-
this.connection.sendNotification(method, params);
|
|
309
|
+
this.connection.sendNotification(method, params).catch(console.error);
|
|
180
310
|
});
|
|
181
311
|
}
|
|
182
312
|
this.clientRequests = this.constructClientRequestHandler(Method.ClientRequest);
|
|
@@ -211,73 +341,16 @@ export class LSPConnection extends LspWsConnection {
|
|
|
211
341
|
});
|
|
212
342
|
});
|
|
213
343
|
}
|
|
214
|
-
sendSelectiveChange(changeEvent, documentInfo) {
|
|
215
|
-
this._sendChange([changeEvent], documentInfo);
|
|
216
|
-
}
|
|
217
|
-
sendFullTextChange(text, documentInfo) {
|
|
218
|
-
this._sendChange([{ text }], documentInfo);
|
|
219
|
-
}
|
|
220
344
|
/**
|
|
221
|
-
*
|
|
345
|
+
* Send the document changed data to the server.
|
|
222
346
|
*/
|
|
223
|
-
isRenameSupported() {
|
|
224
|
-
return !!(this.serverCapabilities && this.serverCapabilities.renameProvider);
|
|
225
|
-
}
|
|
226
|
-
provides(provider) {
|
|
227
|
-
return !!(this.serverCapabilities && this.serverCapabilities[provider]);
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* @deprecated The method should not be used in new code
|
|
231
|
-
*/
|
|
232
|
-
async rename(location, documentInfo, newName, emit = true) {
|
|
233
|
-
if (!this.isReady || !this.isRenameSupported()) {
|
|
234
|
-
return null;
|
|
235
|
-
}
|
|
236
|
-
const params = {
|
|
237
|
-
textDocument: {
|
|
238
|
-
uri: documentInfo.uri
|
|
239
|
-
},
|
|
240
|
-
position: {
|
|
241
|
-
line: location.line,
|
|
242
|
-
character: location.ch
|
|
243
|
-
},
|
|
244
|
-
newName
|
|
245
|
-
};
|
|
246
|
-
const edit = await this.connection.sendRequest('textDocument/rename', params);
|
|
247
|
-
if (emit) {
|
|
248
|
-
this.emit('renamed', edit);
|
|
249
|
-
}
|
|
250
|
-
return edit;
|
|
251
|
-
}
|
|
252
|
-
connect(socket) {
|
|
253
|
-
super.connect(socket);
|
|
254
|
-
untilReady(() => {
|
|
255
|
-
return this.isConnected;
|
|
256
|
-
}, -1)
|
|
257
|
-
.then(() => {
|
|
258
|
-
this.connection.onClose(() => {
|
|
259
|
-
this.isConnected = false;
|
|
260
|
-
this.emit('close', this.closingManually);
|
|
261
|
-
});
|
|
262
|
-
})
|
|
263
|
-
.catch(() => {
|
|
264
|
-
console.error('Could not connect onClose signal');
|
|
265
|
-
});
|
|
266
|
-
return this;
|
|
267
|
-
}
|
|
268
|
-
close() {
|
|
269
|
-
try {
|
|
270
|
-
this.closingManually = true;
|
|
271
|
-
super.close();
|
|
272
|
-
}
|
|
273
|
-
catch (e) {
|
|
274
|
-
this.closingManually = false;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
347
|
_sendChange(changeEvents, documentInfo) {
|
|
278
348
|
if (!this.isReady) {
|
|
279
349
|
return;
|
|
280
350
|
}
|
|
351
|
+
if (documentInfo.uri.length === 0) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
281
354
|
if (!this.openedUris.get(documentInfo.uri)) {
|
|
282
355
|
this.sendOpen(documentInfo);
|
|
283
356
|
}
|
|
@@ -288,22 +361,10 @@ export class LSPConnection extends LspWsConnection {
|
|
|
288
361
|
},
|
|
289
362
|
contentChanges: changeEvents
|
|
290
363
|
};
|
|
291
|
-
this.connection
|
|
364
|
+
this.connection
|
|
365
|
+
.sendNotification('textDocument/didChange', textDocumentChange)
|
|
366
|
+
.catch(console.error);
|
|
292
367
|
documentInfo.version++;
|
|
293
368
|
}
|
|
294
|
-
async getCompletionResolve(completionItem) {
|
|
295
|
-
if (!this.isReady || !this.isCompletionResolveProvider()) {
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
return this.connection.sendRequest('completionItem/resolve', completionItem);
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Does support completionItem/resolve?
|
|
302
|
-
* @deprecated The method should not be used in new code
|
|
303
|
-
*/
|
|
304
|
-
isCompletionResolveProvider() {
|
|
305
|
-
var _a, _b;
|
|
306
|
-
return (((_b = (_a = this.serverCapabilities) === null || _a === void 0 ? void 0 : _a.completionProvider) === null || _b === void 0 ? void 0 : _b.resolveProvider) || false);
|
|
307
|
-
}
|
|
308
369
|
}
|
|
309
370
|
//# sourceMappingURL=connection.js.map
|
package/lib/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAYL,MAAM,EAGP,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE;;GAEG;AACH,MAAM,oBAAoB;IAIxB,YACY,UAA6B,EAC7B,MAAS,EACT,OAAsB;QAFtB,eAAU,GAAV,UAAU,CAAmB;QAC7B,WAAM,GAAN,MAAM,CAAG;QACT,YAAO,GAAP,OAAO,CAAe;IAC/B,CAAC;IACJ,OAAO,CAAC,MAA+B;QACrC,0BAA0B;QAC1B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,eAAe,EAAE;YAC5C,MAAM,EAAE,IAAI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