@codingame/monaco-languageclient-wrapper 2.1.4 → 2.3.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/dist/index.d.ts +75 -60
- package/dist/index.js +272 -203
- package/package.json +45 -8
- package/stats.html +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toSocket, createWebSocketConnection, ConsoleLogger } from '@codingame/monaco-jsonrpc';
|
|
2
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/edcore.main';
|
|
3
|
+
import { Uri } from 'monaco-editor/esm/vs/editor/edcore.main';
|
|
2
4
|
import * as vscodeLanguageserverProtocol from 'vscode-languageserver-protocol';
|
|
3
|
-
import { ProtocolNotificationType, ProtocolRequestType, RenameFile, CreateFile } from 'vscode-languageserver-protocol';
|
|
5
|
+
import { ProtocolNotificationType, ProtocolRequestType, Disposable, RenameFile, CreateFile } from 'vscode-languageserver-protocol';
|
|
6
|
+
import { loadConfigurationForExtension } from '@codingame/monaco-editor-wrapper/dist/features/extensionConfigurations';
|
|
4
7
|
import * as api$1 from 'vscode-languageserver-protocol/lib/common/api';
|
|
5
8
|
import * as is$2 from 'vscode-languageserver-protocol/lib/common/utils/is';
|
|
6
|
-
import * as monaco from 'monaco-editor/esm/vs/editor/edcore.main';
|
|
7
|
-
import { Uri } from 'monaco-editor/esm/vs/editor/edcore.main';
|
|
8
|
-
import { toSocket, createWebSocketConnection, ConsoleLogger } from '@codingame/monaco-jsonrpc';
|
|
9
9
|
import { registerTextModelContentProvider } from '@codingame/monaco-editor-wrapper';
|
|
10
10
|
import swal from 'sweetalert';
|
|
11
11
|
import once$1 from 'once';
|
|
@@ -294,13 +294,158 @@ var proxy = function proxyPolyfill() {
|
|
|
294
294
|
: self
|
|
295
295
|
);
|
|
296
296
|
|
|
297
|
+
function ownKeys(object, enumerableOnly) {
|
|
298
|
+
var keys = Object.keys(object);
|
|
299
|
+
|
|
300
|
+
if (Object.getOwnPropertySymbols) {
|
|
301
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
302
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
303
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
304
|
+
})), keys.push.apply(keys, symbols);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return keys;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function _objectSpread2(target) {
|
|
311
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
312
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
313
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
314
|
+
_defineProperty(target, key, source[key]);
|
|
315
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
316
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return target;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function _defineProperty(obj, key, value) {
|
|
324
|
+
if (key in obj) {
|
|
325
|
+
Object.defineProperty(obj, key, {
|
|
326
|
+
value: value,
|
|
327
|
+
enumerable: true,
|
|
328
|
+
configurable: true,
|
|
329
|
+
writable: true
|
|
330
|
+
});
|
|
331
|
+
} else {
|
|
332
|
+
obj[key] = value;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return obj;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const willShutdownNotificationType = new ProtocolNotificationType('willShutdown');
|
|
339
|
+
const saveTextDocumentRequestType = new ProtocolRequestType('textDocument/save');
|
|
340
|
+
const getTextDocumentRequestType = new ProtocolRequestType('textDocument/get');
|
|
341
|
+
function updateFile(uri, text, languageClient) {
|
|
342
|
+
return languageClient.sendRequest(saveTextDocumentRequestType, {
|
|
343
|
+
textDocument: {
|
|
344
|
+
uri,
|
|
345
|
+
text
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function getFile(uri, languageClient) {
|
|
350
|
+
return languageClient.sendRequest(getTextDocumentRequestType, {
|
|
351
|
+
textDocument: {
|
|
352
|
+
uri
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function openWebsocketConnection(url) {
|
|
358
|
+
return new Promise((resolve, reject) => {
|
|
359
|
+
const webSocket = new WebSocket(url);
|
|
360
|
+
|
|
361
|
+
webSocket.onopen = () => {
|
|
362
|
+
const socket = toSocket(webSocket);
|
|
363
|
+
const webSocketConnection = createWebSocketConnection(socket, new ConsoleLogger());
|
|
364
|
+
webSocketConnection.onDispose(() => {
|
|
365
|
+
webSocket.close();
|
|
366
|
+
});
|
|
367
|
+
resolve(webSocketConnection);
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
webSocket.onerror = () => {
|
|
371
|
+
reject(new Error('Unable to connect to server'));
|
|
372
|
+
};
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
class CodinGameInfrastructure {
|
|
377
|
+
constructor(
|
|
378
|
+
/**
|
|
379
|
+
* The domain of the server
|
|
380
|
+
*/
|
|
381
|
+
serverAddress, _useMutualizedProxy,
|
|
382
|
+
/**
|
|
383
|
+
* An optional sessionId when connecting to the session-mutualized server
|
|
384
|
+
*/
|
|
385
|
+
sessionId,
|
|
386
|
+
/**
|
|
387
|
+
* A list of urls which link to zip files containing libraries/resources
|
|
388
|
+
*/
|
|
389
|
+
libraryUrls) {
|
|
390
|
+
this.serverAddress = serverAddress;
|
|
391
|
+
this._useMutualizedProxy = _useMutualizedProxy;
|
|
392
|
+
this.sessionId = sessionId;
|
|
393
|
+
this.libraryUrls = libraryUrls;
|
|
394
|
+
|
|
395
|
+
_defineProperty(this, "automaticTextDocumentUpdate", false);
|
|
396
|
+
|
|
397
|
+
_defineProperty(this, "rootUri", 'file:///tmp/project');
|
|
398
|
+
|
|
399
|
+
_defineProperty(this, "workspaceFolders", [{
|
|
400
|
+
uri: monaco.Uri.file('/tmp/project'),
|
|
401
|
+
index: 0,
|
|
402
|
+
name: 'main'
|
|
403
|
+
}]);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
useMutualizedProxy(languageClientId, options) {
|
|
407
|
+
return this._useMutualizedProxy && options.mutualizable;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
async saveFileContent(document, reason, languageClient) {
|
|
411
|
+
if (languageClient.isConnected()) {
|
|
412
|
+
await updateFile(document.uri.toString(), document.getText(), languageClient);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
async getFileContent(resource, languageClient) {
|
|
417
|
+
try {
|
|
418
|
+
const content = (await getFile(resource.toString(true), languageClient)).text;
|
|
419
|
+
return monaco.editor.createModel(content, undefined, resource);
|
|
420
|
+
} catch (error) {
|
|
421
|
+
console.error('File not found', resource.toString());
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* A function which returns a valid JWT token to use to connect to the server
|
|
427
|
+
*/
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
async openConnection(id) {
|
|
431
|
+
var _this$libraryUrls;
|
|
432
|
+
|
|
433
|
+
const url = new URL(this.sessionId != null ? "run/".concat(this.sessionId, "/").concat(id) : "run/".concat(id), this.serverAddress);
|
|
434
|
+
(_this$libraryUrls = this.libraryUrls) === null || _this$libraryUrls === void 0 ? void 0 : _this$libraryUrls.forEach(libraryUrl => url.searchParams.append('libraryUrl', libraryUrl));
|
|
435
|
+
url.searchParams.append('token', await this.getSecurityToken());
|
|
436
|
+
const connection = await openWebsocketConnection(url);
|
|
437
|
+
return connection;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
}
|
|
441
|
+
|
|
297
442
|
var lib = {};
|
|
298
443
|
|
|
299
444
|
var disposable$1 = {};
|
|
300
445
|
|
|
301
446
|
var services$1 = {};
|
|
302
447
|
|
|
303
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(vscodeLanguageserverProtocol);
|
|
448
|
+
var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(vscodeLanguageserverProtocol);
|
|
304
449
|
|
|
305
450
|
/* --------------------------------------------------------------------------------------------
|
|
306
451
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -557,7 +702,7 @@ var main$1 = /*#__PURE__*/Object.freeze({
|
|
|
557
702
|
get TextDocument () { return TextDocument; }
|
|
558
703
|
});
|
|
559
704
|
|
|
560
|
-
var require$$1$
|
|
705
|
+
var require$$1$2 = /*@__PURE__*/getAugmentedNamespace(main$1);
|
|
561
706
|
|
|
562
707
|
var main = {};
|
|
563
708
|
|
|
@@ -1418,7 +1563,7 @@ var util$1 = /*#__PURE__*/Object.freeze({
|
|
|
1418
1563
|
'default': util
|
|
1419
1564
|
});
|
|
1420
1565
|
|
|
1421
|
-
var require$$1$
|
|
1566
|
+
var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(util$1);
|
|
1422
1567
|
|
|
1423
1568
|
var disposable = {};
|
|
1424
1569
|
|
|
@@ -1600,7 +1745,7 @@ messageBuffer.AbstractMessageBuffer = AbstractMessageBuffer;
|
|
|
1600
1745
|
* ------------------------------------------------------------------------------------------ */
|
|
1601
1746
|
Object.defineProperty(ril, "__esModule", { value: true });
|
|
1602
1747
|
const ral_1$1 = ral;
|
|
1603
|
-
const util_1 = require$$1$
|
|
1748
|
+
const util_1 = require$$1$1;
|
|
1604
1749
|
const disposable_1$2 = disposable;
|
|
1605
1750
|
const messageBuffer_1 = messageBuffer;
|
|
1606
1751
|
class MessageBuffer extends messageBuffer_1.AbstractMessageBuffer {
|
|
@@ -4915,8 +5060,8 @@ var require$$3 = /*@__PURE__*/getAugmentedNamespace(api$1);
|
|
|
4915
5060
|
value: true
|
|
4916
5061
|
});
|
|
4917
5062
|
exports.ConfigurationTarget = exports.DocumentIdentifier = exports.ProgressLocation = exports.VsCodeDiagnosticSeverity = exports.SignatureHelpTriggerKind = exports.isDocumentSelector = exports.Services = exports.TextDocument = exports.Emitter = exports.Event = exports.CancellationToken = exports.Disposable = void 0;
|
|
4918
|
-
const vscode_languageserver_protocol_1 = require$$0;
|
|
4919
|
-
const vscode_languageserver_textdocument_1 = require$$1$
|
|
5063
|
+
const vscode_languageserver_protocol_1 = require$$0$1;
|
|
5064
|
+
const vscode_languageserver_textdocument_1 = require$$1$2;
|
|
4920
5065
|
Object.defineProperty(exports, "TextDocument", {
|
|
4921
5066
|
enumerable: true,
|
|
4922
5067
|
get: function () {
|
|
@@ -5073,7 +5218,7 @@ var require$$3 = /*@__PURE__*/getAugmentedNamespace(api$1);
|
|
|
5073
5218
|
|
|
5074
5219
|
var connection = {};
|
|
5075
5220
|
|
|
5076
|
-
var require$$1
|
|
5221
|
+
var require$$1 = /*@__PURE__*/getAugmentedNamespace(is$2);
|
|
5077
5222
|
|
|
5078
5223
|
/* --------------------------------------------------------------------------------------------
|
|
5079
5224
|
* Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved.
|
|
@@ -5116,8 +5261,8 @@ Object.defineProperty(connection, "__esModule", {
|
|
|
5116
5261
|
value: true
|
|
5117
5262
|
});
|
|
5118
5263
|
connection.createConnection = void 0;
|
|
5119
|
-
const vscode_languageserver_protocol_1$f = require$$0;
|
|
5120
|
-
const Is$4 = require$$1
|
|
5264
|
+
const vscode_languageserver_protocol_1$f = require$$0$1;
|
|
5265
|
+
const Is$4 = require$$1;
|
|
5121
5266
|
|
|
5122
5267
|
function createConnection(connection, errorHandler, closeHandler) {
|
|
5123
5268
|
connection.onError(data => {
|
|
@@ -5194,7 +5339,7 @@ var esm = /*#__PURE__*/Object.freeze({
|
|
|
5194
5339
|
Utils: Utils
|
|
5195
5340
|
});
|
|
5196
5341
|
|
|
5197
|
-
var require$$
|
|
5342
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(esm);
|
|
5198
5343
|
|
|
5199
5344
|
/* --------------------------------------------------------------------------------------------
|
|
5200
5345
|
* Copyright (c) 2018 TypeFox GmbH (http://www.typefox.io). All rights reserved.
|
|
@@ -5238,12 +5383,11 @@ Object.defineProperty(vscodeApi, "__esModule", {
|
|
|
5238
5383
|
value: true
|
|
5239
5384
|
});
|
|
5240
5385
|
vscodeApi.createVSCodeApi = void 0;
|
|
5241
|
-
const
|
|
5242
|
-
const vscode_uri_1 = require$$1;
|
|
5386
|
+
const vscode_uri_1 = require$$0;
|
|
5243
5387
|
const disposable_1$1 = disposable$1;
|
|
5244
5388
|
const services_1$3 = services$1;
|
|
5245
5389
|
const ServicesModule = services$1;
|
|
5246
|
-
const vscode_languageserver_protocol_1$e = require$$0;
|
|
5390
|
+
const vscode_languageserver_protocol_1$e = require$$0$1;
|
|
5247
5391
|
|
|
5248
5392
|
function createVSCodeApi(servicesProvider) {
|
|
5249
5393
|
const unsupported = () => {
|
|
@@ -5386,6 +5530,16 @@ function createVSCodeApi(servicesProvider) {
|
|
|
5386
5530
|
|
|
5387
5531
|
}
|
|
5388
5532
|
|
|
5533
|
+
let TextDocumentChangeReason;
|
|
5534
|
+
|
|
5535
|
+
(function (TextDocumentChangeReason) {
|
|
5536
|
+
/** The text change is caused by an undo operation. */
|
|
5537
|
+
TextDocumentChangeReason[TextDocumentChangeReason["Undo"] = 1] = "Undo";
|
|
5538
|
+
/** The text change is caused by an redo operation. */
|
|
5539
|
+
|
|
5540
|
+
TextDocumentChangeReason[TextDocumentChangeReason["Redo"] = 2] = "Redo";
|
|
5541
|
+
})(TextDocumentChangeReason || (TextDocumentChangeReason = {}));
|
|
5542
|
+
|
|
5389
5543
|
const workspace = {
|
|
5390
5544
|
fs: new EmptyFileSystem(),
|
|
5391
5545
|
workspaceFile: undefined,
|
|
@@ -5512,7 +5666,7 @@ function createVSCodeApi(servicesProvider) {
|
|
|
5512
5666
|
l({
|
|
5513
5667
|
document: textDocument,
|
|
5514
5668
|
contentChanges: contentChanges,
|
|
5515
|
-
reason: isUndoing ?
|
|
5669
|
+
reason: isUndoing ? TextDocumentChangeReason.Undo : isRedoing ? TextDocumentChangeReason.Redo : undefined
|
|
5516
5670
|
});
|
|
5517
5671
|
}, undefined, disposables);
|
|
5518
5672
|
};
|
|
@@ -6606,7 +6760,8 @@ function createVSCodeApi(servicesProvider) {
|
|
|
6606
6760
|
DiagnosticSeverity: ServicesModule.DiagnosticSeverity,
|
|
6607
6761
|
EventEmitter: ServicesModule.Emitter,
|
|
6608
6762
|
CancellationTokenSource: vscode_languageserver_protocol_1$e.CancellationTokenSource,
|
|
6609
|
-
ProgressLocation: ServicesModule.ProgressLocation
|
|
6763
|
+
ProgressLocation: ServicesModule.ProgressLocation,
|
|
6764
|
+
TextDocumentChangeReason
|
|
6610
6765
|
};
|
|
6611
6766
|
return partialApi;
|
|
6612
6767
|
}
|
|
@@ -6636,7 +6791,7 @@ Object.defineProperty(configuration, "__esModule", {
|
|
|
6636
6791
|
});
|
|
6637
6792
|
configuration.toJSONObject = configuration.ConfigurationFeature = void 0;
|
|
6638
6793
|
const vscode_1$8 = vscodeCompatibility;
|
|
6639
|
-
const vscode_languageserver_protocol_1$d = require$$0;
|
|
6794
|
+
const vscode_languageserver_protocol_1$d = require$$0$1;
|
|
6640
6795
|
|
|
6641
6796
|
class ConfigurationFeature {
|
|
6642
6797
|
constructor(_client) {
|
|
@@ -6973,7 +7128,7 @@ Object.defineProperty(codeConverter, "__esModule", {
|
|
|
6973
7128
|
});
|
|
6974
7129
|
codeConverter.createConverter = void 0;
|
|
6975
7130
|
const code$1 = vscodeCompatibility;
|
|
6976
|
-
const proto = require$$0;
|
|
7131
|
+
const proto = require$$0$1;
|
|
6977
7132
|
const Is$3 = is;
|
|
6978
7133
|
const protocolCompletionItem_1$1 = protocolCompletionItem;
|
|
6979
7134
|
const protocolCodeLens_1$1 = protocolCodeLens;
|
|
@@ -6981,7 +7136,7 @@ const protocolDocumentLink_1$1 = protocolDocumentLink;
|
|
|
6981
7136
|
const protocolCodeAction_1$1 = protocolCodeAction;
|
|
6982
7137
|
const protocolDiagnostic_1$1 = protocolDiagnostic;
|
|
6983
7138
|
const protocolCallHierarchyItem_1$1 = protocolCallHierarchyItem;
|
|
6984
|
-
const vscode_languageserver_protocol_1$c = require$$0;
|
|
7139
|
+
const vscode_languageserver_protocol_1$c = require$$0$1;
|
|
6985
7140
|
var InsertReplaceRange;
|
|
6986
7141
|
|
|
6987
7142
|
(function (InsertReplaceRange) {
|
|
@@ -7886,7 +8041,7 @@ Object.defineProperty(protocolConverter, "__esModule", {
|
|
|
7886
8041
|
});
|
|
7887
8042
|
protocolConverter.createConverter = void 0;
|
|
7888
8043
|
const code = vscodeCompatibility;
|
|
7889
|
-
const ls = require$$0;
|
|
8044
|
+
const ls = require$$0$1;
|
|
7890
8045
|
const Is$2 = is;
|
|
7891
8046
|
const protocolCompletionItem_1 = protocolCompletionItem;
|
|
7892
8047
|
const protocolCodeLens_1 = protocolCodeLens;
|
|
@@ -7894,7 +8049,7 @@ const protocolDocumentLink_1 = protocolDocumentLink;
|
|
|
7894
8049
|
const protocolCodeAction_1 = protocolCodeAction;
|
|
7895
8050
|
const protocolDiagnostic_1 = protocolDiagnostic;
|
|
7896
8051
|
const protocolCallHierarchyItem_1 = protocolCallHierarchyItem;
|
|
7897
|
-
const vscode_languageserver_protocol_1$b = require$$0;
|
|
8052
|
+
const vscode_languageserver_protocol_1$b = require$$0$1;
|
|
7898
8053
|
var CodeBlock;
|
|
7899
8054
|
|
|
7900
8055
|
(function (CodeBlock) {
|
|
@@ -9033,7 +9188,7 @@ Object.defineProperty(async, "__esModule", {
|
|
|
9033
9188
|
value: true
|
|
9034
9189
|
});
|
|
9035
9190
|
async.Delayer = void 0;
|
|
9036
|
-
const vscode_languageserver_protocol_1$a = require$$0;
|
|
9191
|
+
const vscode_languageserver_protocol_1$a = require$$0$1;
|
|
9037
9192
|
|
|
9038
9193
|
class Delayer {
|
|
9039
9194
|
constructor(defaultDelay) {
|
|
@@ -9204,7 +9359,7 @@ Object.defineProperty(progressPart, "__esModule", {
|
|
|
9204
9359
|
});
|
|
9205
9360
|
progressPart.ProgressPart = void 0;
|
|
9206
9361
|
const vscode_1$7 = vscodeCompatibility;
|
|
9207
|
-
const vscode_languageserver_protocol_1$9 = require$$0;
|
|
9362
|
+
const vscode_languageserver_protocol_1$9 = require$$0$1;
|
|
9208
9363
|
const Is$1 = is;
|
|
9209
9364
|
|
|
9210
9365
|
class ProgressPart {
|
|
@@ -9318,7 +9473,7 @@ progressPart.ProgressPart = ProgressPart;
|
|
|
9318
9473
|
});
|
|
9319
9474
|
exports.BaseLanguageClient = exports.MessageTransports = exports.TextDocumentFeature = exports.State = exports.RevealOutputChannelOn = exports.CloseAction = exports.ErrorAction = void 0;
|
|
9320
9475
|
const vscode_1 = vscodeCompatibility;
|
|
9321
|
-
const vscode_languageserver_protocol_1 = require$$0;
|
|
9476
|
+
const vscode_languageserver_protocol_1 = require$$0$1;
|
|
9322
9477
|
const configuration_1 = configuration;
|
|
9323
9478
|
const c2p = codeConverter;
|
|
9324
9479
|
const p2c = protocolConverter;
|
|
@@ -12570,7 +12725,7 @@ Object.defineProperty(typeDefinition, "__esModule", {
|
|
|
12570
12725
|
});
|
|
12571
12726
|
typeDefinition.TypeDefinitionFeature = void 0;
|
|
12572
12727
|
const vscode_1$6 = vscodeCompatibility;
|
|
12573
|
-
const vscode_languageserver_protocol_1$8 = require$$0;
|
|
12728
|
+
const vscode_languageserver_protocol_1$8 = require$$0$1;
|
|
12574
12729
|
const client_1$6 = client;
|
|
12575
12730
|
|
|
12576
12731
|
function ensure$7(target, key) {
|
|
@@ -12641,7 +12796,7 @@ Object.defineProperty(implementation, "__esModule", {
|
|
|
12641
12796
|
});
|
|
12642
12797
|
implementation.ImplementationFeature = void 0;
|
|
12643
12798
|
const vscode_1$5 = vscodeCompatibility;
|
|
12644
|
-
const vscode_languageserver_protocol_1$7 = require$$0;
|
|
12799
|
+
const vscode_languageserver_protocol_1$7 = require$$0$1;
|
|
12645
12800
|
const client_1$5 = client;
|
|
12646
12801
|
|
|
12647
12802
|
function ensure$6(target, key) {
|
|
@@ -12711,7 +12866,7 @@ Object.defineProperty(colorProvider, "__esModule", {
|
|
|
12711
12866
|
});
|
|
12712
12867
|
colorProvider.ColorProviderFeature = void 0;
|
|
12713
12868
|
const vscode_1$4 = vscodeCompatibility;
|
|
12714
|
-
const vscode_languageserver_protocol_1$6 = require$$0;
|
|
12869
|
+
const vscode_languageserver_protocol_1$6 = require$$0$1;
|
|
12715
12870
|
const client_1$4 = client;
|
|
12716
12871
|
|
|
12717
12872
|
function ensure$5(target, key) {
|
|
@@ -12827,7 +12982,7 @@ Object.defineProperty(workspaceFolders, "__esModule", {
|
|
|
12827
12982
|
workspaceFolders.WorkspaceFoldersFeature = workspaceFolders.arrayDiff = void 0;
|
|
12828
12983
|
const UUID = uuid;
|
|
12829
12984
|
const vscode_1$3 = vscodeCompatibility;
|
|
12830
|
-
const vscode_languageserver_protocol_1$5 = require$$0;
|
|
12985
|
+
const vscode_languageserver_protocol_1$5 = require$$0$1;
|
|
12831
12986
|
|
|
12832
12987
|
function access(target, key) {
|
|
12833
12988
|
if (target === void 0) {
|
|
@@ -13000,7 +13155,7 @@ Object.defineProperty(foldingRange, "__esModule", {
|
|
|
13000
13155
|
});
|
|
13001
13156
|
foldingRange.FoldingRangeFeature = void 0;
|
|
13002
13157
|
const vscode_1$2 = vscodeCompatibility;
|
|
13003
|
-
const vscode_languageserver_protocol_1$4 = require$$0;
|
|
13158
|
+
const vscode_languageserver_protocol_1$4 = require$$0$1;
|
|
13004
13159
|
const client_1$3 = client;
|
|
13005
13160
|
|
|
13006
13161
|
function ensure$4(target, key) {
|
|
@@ -13101,7 +13256,7 @@ Object.defineProperty(callHierarchy, "__esModule", {
|
|
|
13101
13256
|
});
|
|
13102
13257
|
callHierarchy.CallHierarchyFeature = void 0;
|
|
13103
13258
|
const vscode_1$1 = vscodeCompatibility;
|
|
13104
|
-
const vscode_languageserver_protocol_1$3 = require$$0;
|
|
13259
|
+
const vscode_languageserver_protocol_1$3 = require$$0$1;
|
|
13105
13260
|
const client_1$2 = client;
|
|
13106
13261
|
|
|
13107
13262
|
function ensure$3(target, key) {
|
|
@@ -13218,7 +13373,7 @@ Object.defineProperty(progress, "__esModule", {
|
|
|
13218
13373
|
value: true
|
|
13219
13374
|
});
|
|
13220
13375
|
progress.ProgressFeature = void 0;
|
|
13221
|
-
const vscode_languageserver_protocol_1$2 = require$$0;
|
|
13376
|
+
const vscode_languageserver_protocol_1$2 = require$$0$1;
|
|
13222
13377
|
const progressPart_1 = progressPart;
|
|
13223
13378
|
|
|
13224
13379
|
function ensure$2(target, key) {
|
|
@@ -13279,7 +13434,7 @@ Object.defineProperty(semanticTokens, "__esModule", {
|
|
|
13279
13434
|
semanticTokens.SemanticTokensFeature = void 0;
|
|
13280
13435
|
const vscode = vscodeCompatibility;
|
|
13281
13436
|
const client_1$1 = client;
|
|
13282
|
-
const vscode_languageserver_protocol_1$1 = require$$0;
|
|
13437
|
+
const vscode_languageserver_protocol_1$1 = require$$0$1;
|
|
13283
13438
|
const Is = is;
|
|
13284
13439
|
|
|
13285
13440
|
function ensure$1(target, key) {
|
|
@@ -13434,7 +13589,7 @@ Object.defineProperty(declaration, "__esModule", {
|
|
|
13434
13589
|
});
|
|
13435
13590
|
declaration.DeclarationFeature = void 0;
|
|
13436
13591
|
const vscode_1 = vscodeCompatibility;
|
|
13437
|
-
const vscode_languageserver_protocol_1 = require$$0;
|
|
13592
|
+
const vscode_languageserver_protocol_1 = require$$0$1;
|
|
13438
13593
|
const client_1 = client;
|
|
13439
13594
|
|
|
13440
13595
|
function ensure(target, key) {
|
|
@@ -14497,7 +14652,7 @@ Object.defineProperty(monacoWorkspace, "__esModule", {
|
|
|
14497
14652
|
});
|
|
14498
14653
|
monacoWorkspace.MonacoWorkspace = void 0;
|
|
14499
14654
|
const services_1 = services$1;
|
|
14500
|
-
const vscode_languageserver_textdocument_1 = require$$1$
|
|
14655
|
+
const vscode_languageserver_textdocument_1 = require$$1$2;
|
|
14501
14656
|
|
|
14502
14657
|
class MonacoWorkspace {
|
|
14503
14658
|
constructor(_monaco, p2m, m2p) {
|
|
@@ -14652,8 +14807,8 @@ var monacoConverter = {};
|
|
|
14652
14807
|
value: true
|
|
14653
14808
|
});
|
|
14654
14809
|
exports.ProtocolToMonacoConverter = exports.MonacoToProtocolConverter = exports.ProtocolCodeAction = exports.ProtocolIMarkerData = exports.ProtocolCompletionItem = exports.ProtocolCodeLens = exports.ProtocolDocumentLink = void 0;
|
|
14655
|
-
const ls = require$$0;
|
|
14656
|
-
const Is = require$$1
|
|
14810
|
+
const ls = require$$0$1;
|
|
14811
|
+
const Is = require$$1;
|
|
14657
14812
|
const services_1 = services$1;
|
|
14658
14813
|
var ProtocolDocumentLink;
|
|
14659
14814
|
|
|
@@ -16417,7 +16572,8 @@ const staticOptions = asLanguageClientOptionsById({
|
|
|
16417
16572
|
synchronize: {
|
|
16418
16573
|
configurationSection: 'kotlin'
|
|
16419
16574
|
},
|
|
16420
|
-
mutualizable: false
|
|
16575
|
+
mutualizable: false,
|
|
16576
|
+
maxInitializeDuration: 60000
|
|
16421
16577
|
},
|
|
16422
16578
|
lua: {
|
|
16423
16579
|
documentSelector: [{
|
|
@@ -16552,7 +16708,9 @@ const staticOptions = asLanguageClientOptionsById({
|
|
|
16552
16708
|
configurationSection: 'metals'
|
|
16553
16709
|
},
|
|
16554
16710
|
mutualizable: false,
|
|
16555
|
-
vscodeExtensionIds: ['scalameta']
|
|
16711
|
+
vscodeExtensionIds: ['scalameta'],
|
|
16712
|
+
maxInitializeDuration: 60000,
|
|
16713
|
+
readinessMessageMatcher: /compiled scala-project in/
|
|
16556
16714
|
},
|
|
16557
16715
|
sql: {
|
|
16558
16716
|
documentSelector: [{
|
|
@@ -16646,146 +16804,6 @@ monaco.editor.onWillDisposeModel(model => {
|
|
|
16646
16804
|
});
|
|
16647
16805
|
});
|
|
16648
16806
|
|
|
16649
|
-
function ownKeys(object, enumerableOnly) {
|
|
16650
|
-
var keys = Object.keys(object);
|
|
16651
|
-
|
|
16652
|
-
if (Object.getOwnPropertySymbols) {
|
|
16653
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
16654
|
-
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
16655
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
16656
|
-
})), keys.push.apply(keys, symbols);
|
|
16657
|
-
}
|
|
16658
|
-
|
|
16659
|
-
return keys;
|
|
16660
|
-
}
|
|
16661
|
-
|
|
16662
|
-
function _objectSpread2(target) {
|
|
16663
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
16664
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
16665
|
-
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
16666
|
-
_defineProperty(target, key, source[key]);
|
|
16667
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
16668
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
16669
|
-
});
|
|
16670
|
-
}
|
|
16671
|
-
|
|
16672
|
-
return target;
|
|
16673
|
-
}
|
|
16674
|
-
|
|
16675
|
-
function _defineProperty(obj, key, value) {
|
|
16676
|
-
if (key in obj) {
|
|
16677
|
-
Object.defineProperty(obj, key, {
|
|
16678
|
-
value: value,
|
|
16679
|
-
enumerable: true,
|
|
16680
|
-
configurable: true,
|
|
16681
|
-
writable: true
|
|
16682
|
-
});
|
|
16683
|
-
} else {
|
|
16684
|
-
obj[key] = value;
|
|
16685
|
-
}
|
|
16686
|
-
|
|
16687
|
-
return obj;
|
|
16688
|
-
}
|
|
16689
|
-
|
|
16690
|
-
const willShutdownNotificationType = new ProtocolNotificationType('willShutdown');
|
|
16691
|
-
const saveTextDocumentRequestType = new ProtocolRequestType('textDocument/save');
|
|
16692
|
-
const getTextDocumentRequestType = new ProtocolRequestType('textDocument/get');
|
|
16693
|
-
function updateFile(uri, text, languageClient) {
|
|
16694
|
-
return languageClient.sendRequest(saveTextDocumentRequestType, {
|
|
16695
|
-
textDocument: {
|
|
16696
|
-
uri,
|
|
16697
|
-
text
|
|
16698
|
-
}
|
|
16699
|
-
});
|
|
16700
|
-
}
|
|
16701
|
-
function getFile(uri, languageClient) {
|
|
16702
|
-
return languageClient.sendRequest(getTextDocumentRequestType, {
|
|
16703
|
-
textDocument: {
|
|
16704
|
-
uri
|
|
16705
|
-
}
|
|
16706
|
-
});
|
|
16707
|
-
}
|
|
16708
|
-
|
|
16709
|
-
function openWebsocketConnection(url) {
|
|
16710
|
-
return new Promise((resolve, reject) => {
|
|
16711
|
-
const webSocket = new WebSocket(url);
|
|
16712
|
-
|
|
16713
|
-
webSocket.onopen = () => {
|
|
16714
|
-
const socket = toSocket(webSocket);
|
|
16715
|
-
const webSocketConnection = createWebSocketConnection(socket, new ConsoleLogger());
|
|
16716
|
-
webSocketConnection.onDispose(() => {
|
|
16717
|
-
webSocket.close();
|
|
16718
|
-
});
|
|
16719
|
-
resolve(webSocketConnection);
|
|
16720
|
-
};
|
|
16721
|
-
|
|
16722
|
-
webSocket.onerror = () => {
|
|
16723
|
-
reject(new Error('Unable to connect to server'));
|
|
16724
|
-
};
|
|
16725
|
-
});
|
|
16726
|
-
}
|
|
16727
|
-
|
|
16728
|
-
class CodinGameInfrastructure {
|
|
16729
|
-
constructor(
|
|
16730
|
-
/**
|
|
16731
|
-
* The domain of the server
|
|
16732
|
-
*/
|
|
16733
|
-
serverAddress, useMutualizedProxy,
|
|
16734
|
-
/**
|
|
16735
|
-
* An optional sessionId when connecting to the session-mutualized server
|
|
16736
|
-
*/
|
|
16737
|
-
sessionId,
|
|
16738
|
-
/**
|
|
16739
|
-
* A list of urls which link to zip files containing libraries/resources
|
|
16740
|
-
*/
|
|
16741
|
-
libraryUrls) {
|
|
16742
|
-
this.serverAddress = serverAddress;
|
|
16743
|
-
this.useMutualizedProxy = useMutualizedProxy;
|
|
16744
|
-
this.sessionId = sessionId;
|
|
16745
|
-
this.libraryUrls = libraryUrls;
|
|
16746
|
-
|
|
16747
|
-
_defineProperty(this, "automaticTextDocumentUpdate", false);
|
|
16748
|
-
|
|
16749
|
-
_defineProperty(this, "rootUri", 'file:///tmp/project');
|
|
16750
|
-
|
|
16751
|
-
_defineProperty(this, "workspaceFolders", [{
|
|
16752
|
-
uri: monaco.Uri.file('/tmp/project'),
|
|
16753
|
-
index: 0,
|
|
16754
|
-
name: 'main'
|
|
16755
|
-
}]);
|
|
16756
|
-
}
|
|
16757
|
-
|
|
16758
|
-
async saveFileContent(document, reason, languageClient) {
|
|
16759
|
-
if (languageClient.isReady()) {
|
|
16760
|
-
await updateFile(document.uri.toString(), document.getText(), languageClient);
|
|
16761
|
-
}
|
|
16762
|
-
}
|
|
16763
|
-
|
|
16764
|
-
async getFileContent(resource, languageClient) {
|
|
16765
|
-
try {
|
|
16766
|
-
return (await getFile(resource.toString(true), languageClient)).text;
|
|
16767
|
-
} catch (error) {
|
|
16768
|
-
console.error('File not found', resource.toString());
|
|
16769
|
-
return null;
|
|
16770
|
-
}
|
|
16771
|
-
}
|
|
16772
|
-
/**
|
|
16773
|
-
* A function which returns a valid JWT token to use to connect to the server
|
|
16774
|
-
*/
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
async openConnection(id) {
|
|
16778
|
-
var _this$libraryUrls;
|
|
16779
|
-
|
|
16780
|
-
const url = new URL(this.sessionId != null ? "run/".concat(this.sessionId, "/").concat(id) : "run/".concat(id), this.serverAddress);
|
|
16781
|
-
(_this$libraryUrls = this.libraryUrls) === null || _this$libraryUrls === void 0 ? void 0 : _this$libraryUrls.forEach(libraryUrl => url.searchParams.append('libraryUrl', libraryUrl));
|
|
16782
|
-
url.searchParams.append('token', await this.getSecurityToken());
|
|
16783
|
-
const connection = await openWebsocketConnection(url);
|
|
16784
|
-
return connection;
|
|
16785
|
-
}
|
|
16786
|
-
|
|
16787
|
-
}
|
|
16788
|
-
|
|
16789
16807
|
var delay$2 = {exports: {}};
|
|
16790
16808
|
|
|
16791
16809
|
// From https://github.com/sindresorhus/random-int/blob/c37741b56f76b9160b0b63dae4e9c64875128146/index.js#L13-L15
|
|
@@ -17120,7 +17138,7 @@ function installCommands(services) {
|
|
|
17120
17138
|
// Comes from https://github.com/redhat-developer/vscode-java/blob/9b0f0aca80cbefabad4c034fb5dd365d029f6170/src/extension.ts#L155-L160
|
|
17121
17139
|
// Other commands needs to be implemented as well?
|
|
17122
17140
|
// (https://github.com/eclipse/eclipse.jdt.ls/issues/376#issuecomment-333923685)
|
|
17123
|
-
services.commands.registerCommand('java.apply.workspaceEdit', edit => {
|
|
17141
|
+
return services.commands.registerCommand('java.apply.workspaceEdit', edit => {
|
|
17124
17142
|
if (edit.documentChanges != null && edit.documentChanges.some(change => RenameFile.is(change) || CreateFile.is(change))) {
|
|
17125
17143
|
alert('Unimplemented command');
|
|
17126
17144
|
return;
|
|
@@ -17131,8 +17149,9 @@ function installCommands(services) {
|
|
|
17131
17149
|
}
|
|
17132
17150
|
|
|
17133
17151
|
function autoSaveModels(services) {
|
|
17152
|
+
const disposableCollection = new lib.DisposableCollection();
|
|
17134
17153
|
const timeoutMap = new Map();
|
|
17135
|
-
services.workspace.onDidChangeTextDocument(e => {
|
|
17154
|
+
disposableCollection.push(services.workspace.onDidChangeTextDocument(e => {
|
|
17136
17155
|
const timeout = timeoutMap.get(e.textDocument.uri);
|
|
17137
17156
|
|
|
17138
17157
|
if (timeout != null) {
|
|
@@ -17146,31 +17165,60 @@ function autoSaveModels(services) {
|
|
|
17146
17165
|
console.error('[LSP]', "Unable to save the document ".concat(e.textDocument.uri.toString()), err);
|
|
17147
17166
|
});
|
|
17148
17167
|
}, 500));
|
|
17149
|
-
});
|
|
17168
|
+
}));
|
|
17169
|
+
disposableCollection.push(Disposable.create(() => {
|
|
17170
|
+
for (const timeout of Array.from(timeoutMap.values())) {
|
|
17171
|
+
window.clearTimeout(timeout);
|
|
17172
|
+
}
|
|
17173
|
+
}));
|
|
17174
|
+
return disposableCollection;
|
|
17150
17175
|
}
|
|
17151
17176
|
|
|
17152
17177
|
let services = null;
|
|
17178
|
+
let serviceDisposable = null;
|
|
17179
|
+
let serviceReferenceCount = 0;
|
|
17153
17180
|
|
|
17154
17181
|
function installServices(infrastructure) {
|
|
17155
|
-
const m2p = new lib.MonacoToProtocolConverter(monaco);
|
|
17156
|
-
const p2m = new lib.ProtocolToMonacoConverter(monaco);
|
|
17157
|
-
|
|
17158
17182
|
if (services == null) {
|
|
17183
|
+
// FIXME: we can't recreate services because MonacoWorkspace can't be disposed without memory leaks
|
|
17184
|
+
// fix me as soon as https://github.com/TypeFox/monaco-languageclient/pull/330/files is released
|
|
17185
|
+
const m2p = new lib.MonacoToProtocolConverter(monaco);
|
|
17186
|
+
const p2m = new lib.ProtocolToMonacoConverter(monaco);
|
|
17159
17187
|
services = {
|
|
17160
17188
|
commands: new lib.MonacoCommands(monaco),
|
|
17161
17189
|
languages: new lib.MonacoLanguages(monaco, p2m, m2p),
|
|
17162
17190
|
workspace: new CodinGameMonacoWorkspace(p2m, m2p, infrastructure.rootUri, infrastructure.workspaceFolders),
|
|
17163
17191
|
window: new WatchableConsoleWindow()
|
|
17164
17192
|
};
|
|
17165
|
-
|
|
17166
|
-
|
|
17193
|
+
}
|
|
17194
|
+
|
|
17195
|
+
if (serviceReferenceCount === 0) {
|
|
17196
|
+
const disposableCollection = new lib.DisposableCollection();
|
|
17197
|
+
disposableCollection.push(installCommands(services));
|
|
17198
|
+
disposableCollection.push(lib.Services.install(services));
|
|
17167
17199
|
|
|
17168
17200
|
if (!infrastructure.automaticTextDocumentUpdate) {
|
|
17169
|
-
autoSaveModels(services);
|
|
17201
|
+
disposableCollection.push(autoSaveModels(services));
|
|
17170
17202
|
}
|
|
17203
|
+
|
|
17204
|
+
serviceDisposable = disposableCollection;
|
|
17171
17205
|
}
|
|
17172
17206
|
|
|
17173
|
-
|
|
17207
|
+
serviceReferenceCount++;
|
|
17208
|
+
return Disposable.create(() => {
|
|
17209
|
+
serviceReferenceCount--;
|
|
17210
|
+
|
|
17211
|
+
if (serviceReferenceCount <= 0) {
|
|
17212
|
+
var _serviceDisposable;
|
|
17213
|
+
|
|
17214
|
+
(_serviceDisposable = serviceDisposable) === null || _serviceDisposable === void 0 ? void 0 : _serviceDisposable.dispose();
|
|
17215
|
+
serviceDisposable = null;
|
|
17216
|
+
}
|
|
17217
|
+
});
|
|
17218
|
+
}
|
|
17219
|
+
|
|
17220
|
+
function getServices() {
|
|
17221
|
+
return lib.Services.get();
|
|
17174
17222
|
}
|
|
17175
17223
|
|
|
17176
17224
|
// Initialize the file content into the lsp server for implementations that don't support open/close notifications
|
|
@@ -17438,6 +17486,8 @@ class LanguageClientManager {
|
|
|
17438
17486
|
|
|
17439
17487
|
_defineProperty(this, "currentStatus", 'connecting');
|
|
17440
17488
|
|
|
17489
|
+
_defineProperty(this, "useMutualizedProxy", void 0);
|
|
17490
|
+
|
|
17441
17491
|
_defineProperty(this, "handleClose", () => {
|
|
17442
17492
|
if (this.isDisposed()) {
|
|
17443
17493
|
return lib.CloseAction.DoNotRestart;
|
|
@@ -17451,6 +17501,8 @@ class LanguageClientManager {
|
|
|
17451
17501
|
this.updateStatus('error');
|
|
17452
17502
|
return lib.ErrorAction.Continue;
|
|
17453
17503
|
});
|
|
17504
|
+
|
|
17505
|
+
this.useMutualizedProxy = this.infrastructure.useMutualizedProxy(this.id, this.languageServerOptions);
|
|
17454
17506
|
}
|
|
17455
17507
|
|
|
17456
17508
|
updateStatus(status) {
|
|
@@ -17464,8 +17516,8 @@ class LanguageClientManager {
|
|
|
17464
17516
|
});
|
|
17465
17517
|
}
|
|
17466
17518
|
|
|
17467
|
-
|
|
17468
|
-
return
|
|
17519
|
+
isConnected() {
|
|
17520
|
+
return ['connected', 'ready'].includes(this.currentStatus);
|
|
17469
17521
|
}
|
|
17470
17522
|
|
|
17471
17523
|
async dispose() {
|
|
@@ -17509,7 +17561,7 @@ class LanguageClientManager {
|
|
|
17509
17561
|
|
|
17510
17562
|
async start() {
|
|
17511
17563
|
try {
|
|
17512
|
-
await loadExtensionConfigurations([this.id], this.
|
|
17564
|
+
await loadExtensionConfigurations([this.id], this.useMutualizedProxy);
|
|
17513
17565
|
} catch (error) {
|
|
17514
17566
|
console.error('Unable to load extension configuration', error);
|
|
17515
17567
|
}
|
|
@@ -17613,9 +17665,27 @@ class LanguageClientManager {
|
|
|
17613
17665
|
this.updateStatus('connecting');
|
|
17614
17666
|
readyPromise = languageClient.onReady().then(async () => {
|
|
17615
17667
|
const disposableCollection = new lib.DisposableCollection();
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17668
|
+
let readyPromise;
|
|
17669
|
+
const {
|
|
17670
|
+
maxInitializeDuration,
|
|
17671
|
+
readinessMessageMatcher
|
|
17672
|
+
} = this.languageServerOptions;
|
|
17673
|
+
|
|
17674
|
+
if (readinessMessageMatcher != null && !this.useMutualizedProxy) {
|
|
17675
|
+
readyPromise = new Promise(resolve => {
|
|
17676
|
+
disposableCollection.push(languageClient.onNotification(lib.LogMessageNotification.type, logMessage => {
|
|
17677
|
+
if (readinessMessageMatcher.exec(logMessage.message) != null) {
|
|
17678
|
+
resolve();
|
|
17679
|
+
}
|
|
17680
|
+
}));
|
|
17681
|
+
});
|
|
17682
|
+
} else {
|
|
17683
|
+
readyPromise = new Promise(resolve => {
|
|
17684
|
+
disposableCollection.push(onServerResponse.event(resolve));
|
|
17685
|
+
});
|
|
17686
|
+
}
|
|
17687
|
+
|
|
17688
|
+
await Promise.race([readyPromise, delay$1(maxInitializeDuration !== null && maxInitializeDuration !== void 0 ? maxInitializeDuration : 15000)]);
|
|
17619
17689
|
disposableCollection.dispose();
|
|
17620
17690
|
}, error => {
|
|
17621
17691
|
console.error('[LSP]', 'Error while waiting for the language client to be ready', error);
|
|
@@ -17676,7 +17746,7 @@ function createLanguageClientManager(id, infrastructure) {
|
|
|
17676
17746
|
throw new Error("Unknown ".concat(id, " language server"));
|
|
17677
17747
|
}
|
|
17678
17748
|
|
|
17679
|
-
if (infrastructure.useMutualizedProxy && languageServerOptions.mutualizable) {
|
|
17749
|
+
if (infrastructure.useMutualizedProxy(id, languageServerOptions) && languageServerOptions.mutualizable) {
|
|
17680
17750
|
// When using the mutualized proxy, we don't need to synchronize the configuration nor send the initialization options
|
|
17681
17751
|
languageServerOptions = _objectSpread2(_objectSpread2({}, languageServerOptions), {}, {
|
|
17682
17752
|
synchronize: undefined,
|
|
@@ -17684,8 +17754,8 @@ function createLanguageClientManager(id, infrastructure) {
|
|
|
17684
17754
|
});
|
|
17685
17755
|
}
|
|
17686
17756
|
|
|
17687
|
-
const services = installServices(infrastructure);
|
|
17688
17757
|
const disposableCollection = new lib.DisposableCollection();
|
|
17758
|
+
disposableCollection.push(installServices(infrastructure));
|
|
17689
17759
|
const languageClientManager = new LanguageClientManager(id, languageServerOptions, infrastructure);
|
|
17690
17760
|
languageClientManagerByLanguageId[id] = languageClientManager;
|
|
17691
17761
|
disposableCollection.push(lib.Disposable.create(() => {
|
|
@@ -17693,12 +17763,11 @@ function createLanguageClientManager(id, infrastructure) {
|
|
|
17693
17763
|
}));
|
|
17694
17764
|
disposableCollection.push(registerTextModelContentProvider('file', {
|
|
17695
17765
|
async provideTextContent(resource) {
|
|
17696
|
-
|
|
17697
|
-
return content != null ? monaco.editor.createModel(content, undefined, resource) : null;
|
|
17766
|
+
return await infrastructure.getFileContent(resource, languageClientManager);
|
|
17698
17767
|
}
|
|
17699
17768
|
|
|
17700
17769
|
}));
|
|
17701
|
-
disposableCollection.push(
|
|
17770
|
+
disposableCollection.push(getServices().workspace.registerSaveDocumentHandler({
|
|
17702
17771
|
async saveTextContent(textDocument, reason) {
|
|
17703
17772
|
var _infrastructure$saveF;
|
|
17704
17773
|
|