@codingame/monaco-languageclient-wrapper 4.4.0 → 4.4.1
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/dist/index2.js +22 -3
- package/package.json +1 -1
- package/stats.html +1 -1
package/dist/index2.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toSocket,
|
|
1
|
+
import { toSocket, WebSocketMessageWriter, WebSocketMessageReader } from 'vscode-ws-jsonrpc';
|
|
2
2
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
3
3
|
import { loadConfigurationForExtension } from '@codingame/monaco-editor-wrapper/features/extensionConfigurations';
|
|
4
4
|
import { registerDefaultConfigurations, registerTextModelContentProvider } from '@codingame/monaco-editor-wrapper';
|
|
@@ -5718,10 +5718,16 @@ function getFile(uri, languageClient) {
|
|
|
5718
5718
|
}
|
|
5719
5719
|
});
|
|
5720
5720
|
}
|
|
5721
|
+
class CloseOnDisposeWebSocketMessageReader extends WebSocketMessageReader {
|
|
5722
|
+
dispose() {
|
|
5723
|
+
super.dispose();
|
|
5724
|
+
this.socket.dispose();
|
|
5725
|
+
}
|
|
5726
|
+
}
|
|
5721
5727
|
async function openWebsocketConnection(url) {
|
|
5722
5728
|
const webSocket = new WebSocket(url);
|
|
5723
5729
|
const socket = toSocket(webSocket);
|
|
5724
|
-
const reader = new
|
|
5730
|
+
const reader = new CloseOnDisposeWebSocketMessageReader(socket);
|
|
5725
5731
|
const writer = new WebSocketMessageWriter(socket);
|
|
5726
5732
|
await new Promise((resolve, reject) => {
|
|
5727
5733
|
webSocket.addEventListener('open', resolve);
|
|
@@ -16470,7 +16476,20 @@ async function createLanguageClient(id, infrastructure, _ref, errorHandler, midd
|
|
|
16470
16476
|
}
|
|
16471
16477
|
return undefined;
|
|
16472
16478
|
};
|
|
16473
|
-
|
|
16479
|
+
class _MonacoLanguageClient extends MonacoLanguageClient {
|
|
16480
|
+
async stop(timeout) {
|
|
16481
|
+
const connection = this['_connection'];
|
|
16482
|
+
try {
|
|
16483
|
+
await super.stop(timeout);
|
|
16484
|
+
} finally {
|
|
16485
|
+
try {
|
|
16486
|
+
connection.dispose();
|
|
16487
|
+
} catch (err) {
|
|
16488
|
+
}
|
|
16489
|
+
}
|
|
16490
|
+
}
|
|
16491
|
+
}
|
|
16492
|
+
const client = new _MonacoLanguageClient({
|
|
16474
16493
|
id: "".concat(id, "-languageclient"),
|
|
16475
16494
|
name: "CodinGame ".concat(id, " Language Client"),
|
|
16476
16495
|
clientOptions: {
|