@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/adapters/adapter.js
CHANGED
|
@@ -1,40 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
1
3
|
import { Dialog, showDialog } from '@jupyterlab/apputils';
|
|
2
4
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
3
5
|
import { Signal } from '@lumino/signaling';
|
|
4
6
|
import mergeWith from 'lodash.mergewith';
|
|
5
7
|
const createButton = Dialog.createButton;
|
|
6
|
-
export class StatusMessage {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.message = '';
|
|
9
|
-
this.changed = new Signal(this);
|
|
10
|
-
this.timer = null;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Set the text message and (optionally) the timeout to remove it.
|
|
14
|
-
* @param message
|
|
15
|
-
* @param timeout - number of ms to until the message is cleaned;
|
|
16
|
-
* -1 if the message should stay up indefinitely;
|
|
17
|
-
* defaults to 3000ms (3 seconds)
|
|
18
|
-
*/
|
|
19
|
-
set(message, timeout = 1000 * 3) {
|
|
20
|
-
this.expireTimer();
|
|
21
|
-
this.message = message;
|
|
22
|
-
this.changed.emit();
|
|
23
|
-
if (timeout !== -1) {
|
|
24
|
-
this.timer = window.setTimeout(this.clear.bind(this), timeout);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
clear() {
|
|
28
|
-
this.message = '';
|
|
29
|
-
this.changed.emit();
|
|
30
|
-
}
|
|
31
|
-
expireTimer() {
|
|
32
|
-
if (this.timer !== null) {
|
|
33
|
-
window.clearTimeout(this.timer);
|
|
34
|
-
this.timer = 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
8
|
/**
|
|
39
9
|
* The values should follow the https://microsoft.github.io/language-server-protocol/specification guidelines
|
|
40
10
|
*/
|
|
@@ -50,50 +20,63 @@ const MIME_TYPE_LANGUAGE_MAP = {
|
|
|
50
20
|
* as this would make the logic of inspections caching impossible to maintain, thus the WidgetAdapter
|
|
51
21
|
* has to handle that, keeping multiple connections and multiple virtual documents.
|
|
52
22
|
*/
|
|
53
|
-
export class
|
|
23
|
+
export class WidgetLSPAdapter {
|
|
54
24
|
// note: it could be using namespace/IOptions pattern,
|
|
55
25
|
// but I do not know how to make it work with the generic type T
|
|
56
26
|
// (other than using 'any' in the IOptions interface)
|
|
57
|
-
constructor(
|
|
58
|
-
this.options = options;
|
|
27
|
+
constructor(widget, options) {
|
|
59
28
|
this.widget = widget;
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
29
|
+
this.options = options;
|
|
30
|
+
this._isDisposed = false;
|
|
31
|
+
/**
|
|
32
|
+
* Signal emitted when the adapter is connected.
|
|
33
|
+
*/
|
|
34
|
+
this._adapterConnected = new Signal(this);
|
|
35
|
+
/**
|
|
36
|
+
* Signal emitted when the active editor have changed.
|
|
37
|
+
*/
|
|
38
|
+
this._activeEditorChanged = new Signal(this);
|
|
39
|
+
/**
|
|
40
|
+
* Signal emitted when an editor is changed.
|
|
41
|
+
*/
|
|
42
|
+
this._editorAdded = new Signal(this);
|
|
43
|
+
/**
|
|
44
|
+
* Signal emitted when an editor is removed.
|
|
45
|
+
*/
|
|
46
|
+
this._editorRemoved = new Signal(this);
|
|
47
|
+
/**
|
|
48
|
+
* Signal emitted when the adapter is disposed.
|
|
49
|
+
*/
|
|
50
|
+
this._disposed = new Signal(this);
|
|
62
51
|
this.connectionManager = options.connectionManager;
|
|
63
|
-
this.adapterConnected = new Signal(this);
|
|
64
|
-
this.activeEditorChanged = new Signal(this);
|
|
65
|
-
this.editorRemoved = new Signal(this);
|
|
66
|
-
this.editorAdded = new Signal(this);
|
|
67
52
|
this.isConnected = false;
|
|
68
|
-
this.trans = (options.translator || nullTranslator).load('jupyterlab
|
|
53
|
+
this.trans = (options.translator || nullTranslator).load('jupyterlab');
|
|
69
54
|
// set up signal connections
|
|
70
55
|
this.widget.context.saveState.connect(this.onSaveState, this);
|
|
71
56
|
this.connectionManager.closed.connect(this.onConnectionClosed, this);
|
|
72
57
|
this.widget.disposed.connect(this.dispose, this);
|
|
73
58
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Check if the adapter is disposed
|
|
61
|
+
*/
|
|
62
|
+
get isDisposed() {
|
|
63
|
+
return this._isDisposed;
|
|
78
64
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
this.connectionManager.closed.disconnect(this.onConnectionClosed, this);
|
|
85
|
-
this.widget.disposed.disconnect(this.dispose, this);
|
|
86
|
-
this.disconnect();
|
|
87
|
-
// just to be sure
|
|
88
|
-
this.app = null;
|
|
89
|
-
this.widget = null;
|
|
90
|
-
this.connectionManager = null;
|
|
91
|
-
this.widget = null;
|
|
92
|
-
this.isDisposed = true;
|
|
65
|
+
/**
|
|
66
|
+
* Check if the document contains multiple editors
|
|
67
|
+
*/
|
|
68
|
+
get hasMultipleEditors() {
|
|
69
|
+
return this.editors.length > 1;
|
|
93
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Get the ID of the internal widget.
|
|
73
|
+
*/
|
|
94
74
|
get widgetId() {
|
|
95
75
|
return this.widget.id;
|
|
96
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Get the language identifier of the document
|
|
79
|
+
*/
|
|
97
80
|
get language() {
|
|
98
81
|
// the values should follow https://microsoft.github.io/language-server-protocol/specification guidelines,
|
|
99
82
|
// see the table in https://microsoft.github.io/language-server-protocol/specification#textDocumentItem
|
|
@@ -116,18 +99,110 @@ export class WidgetAdapter {
|
|
|
116
99
|
}
|
|
117
100
|
}
|
|
118
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Signal emitted when the adapter is connected.
|
|
104
|
+
*/
|
|
105
|
+
get adapterConnected() {
|
|
106
|
+
return this._adapterConnected;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Signal emitted when the active editor have changed.
|
|
110
|
+
*/
|
|
111
|
+
get activeEditorChanged() {
|
|
112
|
+
return this._activeEditorChanged;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Signal emitted when the adapter is disposed.
|
|
116
|
+
*/
|
|
117
|
+
get disposed() {
|
|
118
|
+
return this._disposed;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Signal emitted when the an editor is changed.
|
|
122
|
+
*/
|
|
123
|
+
get editorAdded() {
|
|
124
|
+
return this._editorAdded;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Signal emitted when the an editor is removed.
|
|
128
|
+
*/
|
|
129
|
+
get editorRemoved() {
|
|
130
|
+
return this._editorRemoved;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Callback on connection closed event.
|
|
134
|
+
*/
|
|
135
|
+
onConnectionClosed(_, { virtualDocument }) {
|
|
136
|
+
if (virtualDocument === this.virtualDocument) {
|
|
137
|
+
this.dispose();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Dispose the adapter.
|
|
142
|
+
*/
|
|
143
|
+
dispose() {
|
|
144
|
+
if (this._isDisposed) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
this._isDisposed = true;
|
|
148
|
+
this.widget.context.saveState.disconnect(this.onSaveState, this);
|
|
149
|
+
this.connectionManager.closed.disconnect(this.onConnectionClosed, this);
|
|
150
|
+
this.widget.disposed.disconnect(this.dispose, this);
|
|
151
|
+
this.disconnect();
|
|
152
|
+
this._disposed.emit();
|
|
153
|
+
Signal.clearData(this);
|
|
154
|
+
// just to be sure
|
|
155
|
+
this.widget = null;
|
|
156
|
+
this.connectionManager = null;
|
|
157
|
+
this.widget = null;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Disconnect virtual document from the language server.
|
|
161
|
+
*/
|
|
119
162
|
disconnect() {
|
|
120
163
|
this.connectionManager.unregisterDocument(this.virtualDocument);
|
|
121
|
-
this.widget.context.model.contentChanged.disconnect(this.
|
|
164
|
+
this.widget.context.model.contentChanged.disconnect(this._onContentChanged, this);
|
|
122
165
|
// pretend that all editors were removed to trigger the disconnection of even handlers
|
|
123
166
|
// they will be connected again on new connection
|
|
124
167
|
for (let { ceEditor: editor } of this.editors) {
|
|
125
|
-
this.
|
|
168
|
+
this._editorRemoved.emit({
|
|
126
169
|
editor: editor
|
|
127
170
|
});
|
|
128
171
|
}
|
|
129
172
|
this.virtualDocument.dispose();
|
|
130
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Update the virtual document.
|
|
176
|
+
*/
|
|
177
|
+
updateDocuments() {
|
|
178
|
+
if (this._isDisposed) {
|
|
179
|
+
console.warn('Cannot update documents: adapter disposed');
|
|
180
|
+
return Promise.reject('Cannot update documents: adapter disposed');
|
|
181
|
+
}
|
|
182
|
+
return this.virtualDocument.updateManager.updateDocuments(this.editors.map(({ ceEditor, type }) => {
|
|
183
|
+
return {
|
|
184
|
+
ceEditor: ceEditor,
|
|
185
|
+
value: ceEditor.model.value.text,
|
|
186
|
+
type
|
|
187
|
+
};
|
|
188
|
+
}));
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Callback called on the document changed event.
|
|
192
|
+
*/
|
|
193
|
+
documentChanged(virtualDocument, document, isInit = false) {
|
|
194
|
+
if (this._isDisposed) {
|
|
195
|
+
console.warn('Cannot swap document: adapter disposed');
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// TODO only send the difference, using connection.sendSelectiveChange()
|
|
199
|
+
let connection = this.connectionManager.connections.get(virtualDocument.uri);
|
|
200
|
+
if (!(connection === null || connection === void 0 ? void 0 : connection.isReady)) {
|
|
201
|
+
console.log('Skipping document update signal: connection not ready');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
connection.sendFullTextChange(virtualDocument.value, virtualDocument.documentInfo);
|
|
205
|
+
}
|
|
131
206
|
// equivalent to triggering didClose and didOpen, as per syncing specification,
|
|
132
207
|
// but also reloads the connection; used during file rename (or when it was moved)
|
|
133
208
|
reloadConnection() {
|
|
@@ -145,20 +220,15 @@ export class WidgetAdapter {
|
|
|
145
220
|
// reconnect
|
|
146
221
|
this.connectDocument(this.virtualDocument, true).catch(console.warn);
|
|
147
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Callback on document saved event.
|
|
225
|
+
*/
|
|
148
226
|
onSaveState(context, state) {
|
|
149
227
|
// ignore premature calls (before the editor was initialized)
|
|
150
228
|
if (this.virtualDocument == null) {
|
|
151
229
|
return;
|
|
152
230
|
}
|
|
153
|
-
|
|
154
|
-
// workaround for https://github.com/jupyterlab/jupyterlab/issues/10721
|
|
155
|
-
// while already reverted in https://github.com/jupyterlab/jupyterlab/pull/10741,
|
|
156
|
-
// it was not released yet and many users will continue to run 3.1.0 and 3.1.1
|
|
157
|
-
// so lets workaround it for now
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
159
|
-
// @ts-ignore
|
|
160
|
-
const completedManually = state === 'completed manually';
|
|
161
|
-
if (state === 'completed' || completedManually) {
|
|
231
|
+
if (state === 'completed') {
|
|
162
232
|
// note: must only be send to the appropriate connections as
|
|
163
233
|
// some servers (Julia) break if they receive save notification
|
|
164
234
|
// for a document that was not opened before, see:
|
|
@@ -177,37 +247,21 @@ export class WidgetAdapter {
|
|
|
177
247
|
}
|
|
178
248
|
}
|
|
179
249
|
/**
|
|
180
|
-
*
|
|
250
|
+
* Connect the virtual document with the language server.
|
|
181
251
|
*/
|
|
182
|
-
updateDocuments() {
|
|
183
|
-
if (this.isDisposed) {
|
|
184
|
-
console.warn('Cannot update documents: adapter disposed');
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
return this.virtualDocument.updateManager.updateDocuments(this.editors.map(({ ceEditor, type }) => {
|
|
188
|
-
return {
|
|
189
|
-
ceEditor: ceEditor,
|
|
190
|
-
value: ceEditor.model.value.text,
|
|
191
|
-
type
|
|
192
|
-
};
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
get hasMultipleEditors() {
|
|
196
|
-
return this.editors.length > 1;
|
|
197
|
-
}
|
|
198
252
|
async onConnected(data) {
|
|
199
253
|
let { virtualDocument } = data;
|
|
200
|
-
this.
|
|
254
|
+
this._adapterConnected.emit(data);
|
|
201
255
|
this.isConnected = true;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
256
|
+
try {
|
|
257
|
+
await this.updateDocuments();
|
|
258
|
+
}
|
|
259
|
+
catch (reason) {
|
|
260
|
+
console.warn('Could not update documents', reason);
|
|
205
261
|
return;
|
|
206
262
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.documentChanged(virtualDocument, virtualDocument, true);
|
|
210
|
-
});
|
|
263
|
+
// refresh the document on the LSP server
|
|
264
|
+
this.documentChanged(virtualDocument, virtualDocument, true);
|
|
211
265
|
// Note: the logger extension behaves badly with non-default names
|
|
212
266
|
// as it changes the source to the active file afterwards anyways
|
|
213
267
|
// const loggerSourceName = virtualDocument.uri;
|
|
@@ -259,7 +313,7 @@ export class WidgetAdapter {
|
|
|
259
313
|
*/
|
|
260
314
|
async connectDocument(virtualDocument, sendOpen = false) {
|
|
261
315
|
virtualDocument.foreignDocumentOpened.connect(this.onForeignDocumentOpened, this);
|
|
262
|
-
const connectionContext = await this.
|
|
316
|
+
const connectionContext = await this._connect(virtualDocument).catch(console.error);
|
|
263
317
|
if (connectionContext && connectionContext.connection) {
|
|
264
318
|
virtualDocument.changed.connect(this.documentChanged, this);
|
|
265
319
|
if (sendOpen) {
|
|
@@ -267,6 +321,9 @@ export class WidgetAdapter {
|
|
|
267
321
|
}
|
|
268
322
|
}
|
|
269
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Create the virtual document using current path and language.
|
|
326
|
+
*/
|
|
270
327
|
initVirtual() {
|
|
271
328
|
let virtualDocument = this.createVirtualDocument();
|
|
272
329
|
if (virtualDocument == null) {
|
|
@@ -274,13 +331,7 @@ export class WidgetAdapter {
|
|
|
274
331
|
return;
|
|
275
332
|
}
|
|
276
333
|
this.virtualDocument = virtualDocument;
|
|
277
|
-
this.
|
|
278
|
-
}
|
|
279
|
-
onForeignDocumentClosed(_, context) {
|
|
280
|
-
const { foreignDocument } = context;
|
|
281
|
-
foreignDocument.foreignDocumentClosed.disconnect(this.onForeignDocumentClosed, this);
|
|
282
|
-
foreignDocument.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened, this);
|
|
283
|
-
foreignDocument.changed.disconnect(this.documentChanged, this);
|
|
334
|
+
this._connectContentChangedSignal();
|
|
284
335
|
}
|
|
285
336
|
/**
|
|
286
337
|
* Handler for opening a document contained in a parent document. The assumption
|
|
@@ -293,33 +344,24 @@ export class WidgetAdapter {
|
|
|
293
344
|
async onForeignDocumentOpened(_, context) {
|
|
294
345
|
const { foreignDocument } = context;
|
|
295
346
|
await this.connectDocument(foreignDocument, true);
|
|
296
|
-
foreignDocument.foreignDocumentClosed.connect(this.
|
|
347
|
+
foreignDocument.foreignDocumentClosed.connect(this._onForeignDocumentClosed, this);
|
|
297
348
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
connection.sendFullTextChange(virtualDocument.value, virtualDocument.documentInfo);
|
|
310
|
-
// the first change (initial) is not propagated to features,
|
|
311
|
-
// as it has no associated CodeMirrorChange object
|
|
312
|
-
if (!isInit) {
|
|
313
|
-
// TODO??
|
|
314
|
-
// guarantee that the virtual editor won't perform an update of the virtual documents while
|
|
315
|
-
// the changes are recorded...
|
|
316
|
-
// TODO this is not ideal - why it solves the problem of some errors,
|
|
317
|
-
// it introduces an unnecessary delay. A better way could be to invalidate some of the updates when a new one comes in.
|
|
318
|
-
// but maybe not every one (then the outdated state could be kept for too long fo a user who writes very quickly)
|
|
319
|
-
// also we would not want to invalidate the updates for the purpose of autocompletion (the trigger characters)
|
|
320
|
-
}
|
|
349
|
+
/**
|
|
350
|
+
* Callback called when a foreign document is closed,
|
|
351
|
+
* the associated signals with this virtual document
|
|
352
|
+
* are disconnected.
|
|
353
|
+
*/
|
|
354
|
+
_onForeignDocumentClosed(_, context) {
|
|
355
|
+
const { foreignDocument } = context;
|
|
356
|
+
foreignDocument.foreignDocumentClosed.disconnect(this._onForeignDocumentClosed, this);
|
|
357
|
+
foreignDocument.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened, this);
|
|
358
|
+
foreignDocument.changed.disconnect(this.documentChanged, this);
|
|
321
359
|
}
|
|
322
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Detect the capabilities for the document type then
|
|
362
|
+
* open the websocket connection with the language server.
|
|
363
|
+
*/
|
|
364
|
+
async _connect(virtualDocument) {
|
|
323
365
|
let language = virtualDocument.language;
|
|
324
366
|
let capabilities = {
|
|
325
367
|
textDocument: {
|
|
@@ -365,10 +407,13 @@ export class WidgetAdapter {
|
|
|
365
407
|
* (range) updates this can be still implemented by comparison of before/after states of the
|
|
366
408
|
* virtual documents, which is even more resilient and -obviously - editor-independent.
|
|
367
409
|
*/
|
|
368
|
-
|
|
369
|
-
this.widget.context.model.contentChanged.connect(this.
|
|
410
|
+
_connectContentChangedSignal() {
|
|
411
|
+
this.widget.context.model.contentChanged.connect(this._onContentChanged, this);
|
|
370
412
|
}
|
|
371
|
-
|
|
413
|
+
/**
|
|
414
|
+
* Callback called when the content of the document have changed.
|
|
415
|
+
*/
|
|
416
|
+
async _onContentChanged(_slot) {
|
|
372
417
|
// update the virtual documents (sending the updates to LSP is out of scope here)
|
|
373
418
|
const promise = this.updateDocuments();
|
|
374
419
|
if (!promise) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/adapters/adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,EAEL,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAczC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACzC,MAAM,OAAO,aAAa;IAQxB;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACH,GAAG,CAAC,OAAe,EAAE,UAAkB,IAAI,GAAG,CAAC;QAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACpB,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE;YAClB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO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GAA6B;YACtC,YAAY;YACZ,eAAe;YACf,QAAQ;YACR,mBAAmB,EAAE,eAAe,CAAC,mBAAmB;SACzD,CAAC;QAEF,IAAI,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAE/D,IAAI,UAAU,EAAE;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC,CAAC;YAExD,OAAO;gBACL,UAAU;gBACV,eAAe;aAChB,CAAC;SACH;aAAM;YACL,OAAO,SAAS,CAAC;SAClB;IACH,CAAC;IAED;;;;;;;;;OASG;IACK,4BAA4B;QAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAC9C,IAAI,CAAC,iBAAiB,EACtB,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,iBAAiB,CAAC,KAAU;QACxC,iFAAiF;QAEjF,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;YAC3C,OAAO;SACR;QACD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { IDisposable } from '@lumino/disposable';
|
|
2
|
+
import { ISignal } from '@lumino/signaling';
|
|
3
|
+
export declare class StatusMessage implements IDisposable {
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
* Signal emitted on status changed event.
|
|
7
|
+
*/
|
|
8
|
+
get changed(): ISignal<StatusMessage, void>;
|
|
9
|
+
/**
|
|
10
|
+
* Test whether the object is disposed.
|
|
11
|
+
*/
|
|
12
|
+
get isDisposed(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Dispose the object.
|
|
15
|
+
*/
|
|
16
|
+
dispose(): void;
|
|
17
|
+
/**
|
|
18
|
+
* The text message to be shown on the statusbar.
|
|
19
|
+
*/
|
|
20
|
+
get message(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Set the text message and (optionally) the timeout to remove it.
|
|
23
|
+
* @param message
|
|
24
|
+
* @param timeout - number of ms to until the message is cleaned;
|
|
25
|
+
* -1 if the message should stay up indefinitely;
|
|
26
|
+
* defaults to 3000ms (3 seconds)
|
|
27
|
+
*/
|
|
28
|
+
set(message: string, timeout?: number): void;
|
|
29
|
+
/**
|
|
30
|
+
* Clear the status message.
|
|
31
|
+
*/
|
|
32
|
+
clear(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Timeout reference used to clear the previous `setTimeout` call.
|
|
35
|
+
*/
|
|
36
|
+
private _timer;
|
|
37
|
+
/**
|
|
38
|
+
* Clear the previous `setTimeout` call.
|
|
39
|
+
*/
|
|
40
|
+
private _expireTimer;
|
|
41
|
+
/**
|
|
42
|
+
* The text message to be shown on the statusbar
|
|
43
|
+
*/
|
|
44
|
+
private _message;
|
|
45
|
+
private _changed;
|
|
46
|
+
private _isDisposed;
|
|
47
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright (c) Jupyter Development Team.
|
|
2
|
+
// Distributed under the terms of the Modified BSD License.
|
|
3
|
+
import { Signal } from '@lumino/signaling';
|
|
4
|
+
export class StatusMessage {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._changed = new Signal(this);
|
|
7
|
+
this._isDisposed = false;
|
|
8
|
+
this._message = '';
|
|
9
|
+
this._timer = null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Signal emitted on status changed event.
|
|
13
|
+
*/
|
|
14
|
+
get changed() {
|
|
15
|
+
return this._changed;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Test whether the object is disposed.
|
|
19
|
+
*/
|
|
20
|
+
get isDisposed() {
|
|
21
|
+
return this._isDisposed;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Dispose the object.
|
|
25
|
+
*/
|
|
26
|
+
dispose() {
|
|
27
|
+
if (this.isDisposed) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this._isDisposed = true;
|
|
31
|
+
if (this._timer) {
|
|
32
|
+
window.clearTimeout(this._timer);
|
|
33
|
+
}
|
|
34
|
+
Signal.clearData(this);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The text message to be shown on the statusbar.
|
|
38
|
+
*/
|
|
39
|
+
get message() {
|
|
40
|
+
return this._message;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Set the text message and (optionally) the timeout to remove it.
|
|
44
|
+
* @param message
|
|
45
|
+
* @param timeout - number of ms to until the message is cleaned;
|
|
46
|
+
* -1 if the message should stay up indefinitely;
|
|
47
|
+
* defaults to 3000ms (3 seconds)
|
|
48
|
+
*/
|
|
49
|
+
set(message, timeout = 1000 * 3) {
|
|
50
|
+
this._expireTimer();
|
|
51
|
+
this._message = message;
|
|
52
|
+
this._changed.emit();
|
|
53
|
+
if (timeout !== -1) {
|
|
54
|
+
this._timer = window.setTimeout(this.clear.bind(this), timeout);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Clear the status message.
|
|
59
|
+
*/
|
|
60
|
+
clear() {
|
|
61
|
+
this._message = '';
|
|
62
|
+
this._changed.emit();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Clear the previous `setTimeout` call.
|
|
66
|
+
*/
|
|
67
|
+
_expireTimer() {
|
|
68
|
+
if (this._timer !== null) {
|
|
69
|
+
window.clearTimeout(this._timer);
|
|
70
|
+
this._timer = null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=statusmessage.js.map
|
|
@@ -0,0 +1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