@codingame/monaco-languageclient-wrapper 5.0.0-update-monaco.4 → 5.0.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/createLanguageClient.js +130 -0
- package/dist/{src/customRequests.js → customRequests.js} +11 -11
- package/dist/{src/extensionConfiguration.js → extensionConfiguration.js} +1 -1
- package/dist/extensions/cobol.js +27 -0
- package/dist/extensions/csharp.js +27 -0
- package/dist/extensions/java/commands.js +70 -70
- package/dist/extensions/java/extension.js +9 -8
- package/dist/extensions/java/inlayHintsProvider.js +43 -42
- package/dist/extensions/java/protocol.js +19 -19
- package/dist/extensions/java/sourceAction.js +328 -328
- package/dist/extensions/java.js +34 -0
- package/dist/extensions/tools.js +66 -0
- package/dist/extensions.js +171 -0
- package/dist/index.js +5 -5
- package/dist/infrastructure.js +89 -0
- package/dist/languageClient.js +314 -0
- package/dist/languageClientOptions.js +16 -0
- package/dist/node_modules/tslib/tslib.es6.js +9 -9
- package/dist/services.js +8 -0
- package/dist/staticOptions.js +421 -0
- package/package.json +12 -13
- package/stats.html +1 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -5
- package/dist/_virtual/_rollupPluginBabelHelpers.js +0 -50
- package/dist/_virtual/api.js +0 -2
- package/dist/_virtual/cancellation.js +0 -2
- package/dist/_virtual/connection.js +0 -2
- package/dist/_virtual/disposable.js +0 -2
- package/dist/_virtual/events.js +0 -2
- package/dist/_virtual/is.js +0 -2
- package/dist/_virtual/linkedMap.js +0 -2
- package/dist/_virtual/main.js +0 -2
- package/dist/_virtual/messageBuffer.js +0 -2
- package/dist/_virtual/messageReader.js +0 -2
- package/dist/_virtual/messageWriter.js +0 -2
- package/dist/_virtual/messages.js +0 -2
- package/dist/_virtual/once.js +0 -2
- package/dist/_virtual/ral.js +0 -2
- package/dist/_virtual/ril.js +0 -2
- package/dist/_virtual/semaphore.js +0 -2
- package/dist/_virtual/sharedArrayCancellation.js +0 -2
- package/dist/node_modules/delay/index.js +0 -45
- package/dist/node_modules/once/once.js +0 -44
- package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -77
- package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -153
- package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +0 -96
- package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -95
- package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -1182
- package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -19
- package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +0 -121
- package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +0 -38
- package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -386
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -149
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -198
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -122
- package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -240
- package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -26
- package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -72
- package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -80
- package/dist/node_modules/wrappy/wrappy.js +0 -25
- package/dist/src/createLanguageClient.js +0 -131
- package/dist/src/extensions/cobol.js +0 -24
- package/dist/src/extensions/csharp.js +0 -29
- package/dist/src/extensions/java.js +0 -36
- package/dist/src/extensions/tools.js +0 -91
- package/dist/src/extensions.js +0 -172
- package/dist/src/infrastructure.js +0 -87
- package/dist/src/languageClient.js +0 -305
- package/dist/src/languageClientOptions.js +0 -16
- package/dist/src/services.js +0 -8
- package/dist/src/staticOptions.js +0 -441
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { __exports as messageReader } from '../../../../_virtual/messageReader.js';
|
|
2
|
-
import { __require as requireRal } from './ral.js';
|
|
3
|
-
import { __require as requireIs } from './is.js';
|
|
4
|
-
import { __require as requireEvents } from './events.js';
|
|
5
|
-
import { __require as requireSemaphore } from './semaphore.js';
|
|
6
|
-
var hasRequiredMessageReader;
|
|
7
|
-
function requireMessageReader () {
|
|
8
|
-
if (hasRequiredMessageReader) return messageReader;
|
|
9
|
-
hasRequiredMessageReader = 1;
|
|
10
|
-
Object.defineProperty(messageReader, "__esModule", { value: true });
|
|
11
|
-
messageReader.ReadableStreamMessageReader = messageReader.AbstractMessageReader = messageReader.MessageReader = void 0;
|
|
12
|
-
const ral_1 = requireRal();
|
|
13
|
-
const Is = requireIs();
|
|
14
|
-
const events_1 = requireEvents();
|
|
15
|
-
const semaphore_1 = requireSemaphore();
|
|
16
|
-
var MessageReader;
|
|
17
|
-
(function (MessageReader) {
|
|
18
|
-
function is(value) {
|
|
19
|
-
let candidate = value;
|
|
20
|
-
return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) &&
|
|
21
|
-
Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
|
|
22
|
-
}
|
|
23
|
-
MessageReader.is = is;
|
|
24
|
-
})(MessageReader || (messageReader.MessageReader = MessageReader = {}));
|
|
25
|
-
class AbstractMessageReader {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.errorEmitter = new events_1.Emitter();
|
|
28
|
-
this.closeEmitter = new events_1.Emitter();
|
|
29
|
-
this.partialMessageEmitter = new events_1.Emitter();
|
|
30
|
-
}
|
|
31
|
-
dispose() {
|
|
32
|
-
this.errorEmitter.dispose();
|
|
33
|
-
this.closeEmitter.dispose();
|
|
34
|
-
}
|
|
35
|
-
get onError() {
|
|
36
|
-
return this.errorEmitter.event;
|
|
37
|
-
}
|
|
38
|
-
fireError(error) {
|
|
39
|
-
this.errorEmitter.fire(this.asError(error));
|
|
40
|
-
}
|
|
41
|
-
get onClose() {
|
|
42
|
-
return this.closeEmitter.event;
|
|
43
|
-
}
|
|
44
|
-
fireClose() {
|
|
45
|
-
this.closeEmitter.fire(undefined);
|
|
46
|
-
}
|
|
47
|
-
get onPartialMessage() {
|
|
48
|
-
return this.partialMessageEmitter.event;
|
|
49
|
-
}
|
|
50
|
-
firePartialMessage(info) {
|
|
51
|
-
this.partialMessageEmitter.fire(info);
|
|
52
|
-
}
|
|
53
|
-
asError(error) {
|
|
54
|
-
if (error instanceof Error) {
|
|
55
|
-
return error;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
messageReader.AbstractMessageReader = AbstractMessageReader;
|
|
63
|
-
var ResolvedMessageReaderOptions;
|
|
64
|
-
(function (ResolvedMessageReaderOptions) {
|
|
65
|
-
function fromOptions(options) {
|
|
66
|
-
let charset;
|
|
67
|
-
let contentDecoder;
|
|
68
|
-
const contentDecoders = new Map();
|
|
69
|
-
let contentTypeDecoder;
|
|
70
|
-
const contentTypeDecoders = new Map();
|
|
71
|
-
if (options === undefined || typeof options === 'string') {
|
|
72
|
-
charset = options ?? 'utf-8';
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
charset = options.charset ?? 'utf-8';
|
|
76
|
-
if (options.contentDecoder !== undefined) {
|
|
77
|
-
contentDecoder = options.contentDecoder;
|
|
78
|
-
contentDecoders.set(contentDecoder.name, contentDecoder);
|
|
79
|
-
}
|
|
80
|
-
if (options.contentDecoders !== undefined) {
|
|
81
|
-
for (const decoder of options.contentDecoders) {
|
|
82
|
-
contentDecoders.set(decoder.name, decoder);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (options.contentTypeDecoder !== undefined) {
|
|
86
|
-
contentTypeDecoder = options.contentTypeDecoder;
|
|
87
|
-
contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
|
|
88
|
-
}
|
|
89
|
-
if (options.contentTypeDecoders !== undefined) {
|
|
90
|
-
for (const decoder of options.contentTypeDecoders) {
|
|
91
|
-
contentTypeDecoders.set(decoder.name, decoder);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (contentTypeDecoder === undefined) {
|
|
96
|
-
contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder;
|
|
97
|
-
contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
|
|
98
|
-
}
|
|
99
|
-
return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };
|
|
100
|
-
}
|
|
101
|
-
ResolvedMessageReaderOptions.fromOptions = fromOptions;
|
|
102
|
-
})(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
|
|
103
|
-
class ReadableStreamMessageReader extends AbstractMessageReader {
|
|
104
|
-
constructor(readable, options) {
|
|
105
|
-
super();
|
|
106
|
-
this.readable = readable;
|
|
107
|
-
this.options = ResolvedMessageReaderOptions.fromOptions(options);
|
|
108
|
-
this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset);
|
|
109
|
-
this._partialMessageTimeout = 10000;
|
|
110
|
-
this.nextMessageLength = -1;
|
|
111
|
-
this.messageToken = 0;
|
|
112
|
-
this.readSemaphore = new semaphore_1.Semaphore(1);
|
|
113
|
-
}
|
|
114
|
-
set partialMessageTimeout(timeout) {
|
|
115
|
-
this._partialMessageTimeout = timeout;
|
|
116
|
-
}
|
|
117
|
-
get partialMessageTimeout() {
|
|
118
|
-
return this._partialMessageTimeout;
|
|
119
|
-
}
|
|
120
|
-
listen(callback) {
|
|
121
|
-
this.nextMessageLength = -1;
|
|
122
|
-
this.messageToken = 0;
|
|
123
|
-
this.partialMessageTimer = undefined;
|
|
124
|
-
this.callback = callback;
|
|
125
|
-
const result = this.readable.onData((data) => {
|
|
126
|
-
this.onData(data);
|
|
127
|
-
});
|
|
128
|
-
this.readable.onError((error) => this.fireError(error));
|
|
129
|
-
this.readable.onClose(() => this.fireClose());
|
|
130
|
-
return result;
|
|
131
|
-
}
|
|
132
|
-
onData(data) {
|
|
133
|
-
try {
|
|
134
|
-
this.buffer.append(data);
|
|
135
|
-
while (true) {
|
|
136
|
-
if (this.nextMessageLength === -1) {
|
|
137
|
-
const headers = this.buffer.tryReadHeaders(true);
|
|
138
|
-
if (!headers) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const contentLength = headers.get('content-length');
|
|
142
|
-
if (!contentLength) {
|
|
143
|
-
this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(headers))}`));
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const length = parseInt(contentLength);
|
|
147
|
-
if (isNaN(length)) {
|
|
148
|
-
this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
this.nextMessageLength = length;
|
|
152
|
-
}
|
|
153
|
-
const body = this.buffer.tryReadBody(this.nextMessageLength);
|
|
154
|
-
if (body === undefined) {
|
|
155
|
-
this.setPartialMessageTimer();
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
this.clearPartialMessageTimer();
|
|
159
|
-
this.nextMessageLength = -1;
|
|
160
|
-
this.readSemaphore.lock(async () => {
|
|
161
|
-
const bytes = this.options.contentDecoder !== undefined
|
|
162
|
-
? await this.options.contentDecoder.decode(body)
|
|
163
|
-
: body;
|
|
164
|
-
const message = await this.options.contentTypeDecoder.decode(bytes, this.options);
|
|
165
|
-
this.callback(message);
|
|
166
|
-
}).catch((error) => {
|
|
167
|
-
this.fireError(error);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
this.fireError(error);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
clearPartialMessageTimer() {
|
|
176
|
-
if (this.partialMessageTimer) {
|
|
177
|
-
this.partialMessageTimer.dispose();
|
|
178
|
-
this.partialMessageTimer = undefined;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
setPartialMessageTimer() {
|
|
182
|
-
this.clearPartialMessageTimer();
|
|
183
|
-
if (this._partialMessageTimeout <= 0) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout((token, timeout) => {
|
|
187
|
-
this.partialMessageTimer = undefined;
|
|
188
|
-
if (token === this.messageToken) {
|
|
189
|
-
this.firePartialMessage({ messageToken: token, waitingTime: timeout });
|
|
190
|
-
this.setPartialMessageTimer();
|
|
191
|
-
}
|
|
192
|
-
}, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
messageReader.ReadableStreamMessageReader = ReadableStreamMessageReader;
|
|
196
|
-
return messageReader;
|
|
197
|
-
}
|
|
198
|
-
export { requireMessageReader as __require };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { __exports as messageWriter } from '../../../../_virtual/messageWriter.js';
|
|
2
|
-
import { __require as requireRal } from './ral.js';
|
|
3
|
-
import { __require as requireIs } from './is.js';
|
|
4
|
-
import { __require as requireSemaphore } from './semaphore.js';
|
|
5
|
-
import { __require as requireEvents } from './events.js';
|
|
6
|
-
var hasRequiredMessageWriter;
|
|
7
|
-
function requireMessageWriter () {
|
|
8
|
-
if (hasRequiredMessageWriter) return messageWriter;
|
|
9
|
-
hasRequiredMessageWriter = 1;
|
|
10
|
-
Object.defineProperty(messageWriter, "__esModule", { value: true });
|
|
11
|
-
messageWriter.WriteableStreamMessageWriter = messageWriter.AbstractMessageWriter = messageWriter.MessageWriter = void 0;
|
|
12
|
-
const ral_1 = requireRal();
|
|
13
|
-
const Is = requireIs();
|
|
14
|
-
const semaphore_1 = requireSemaphore();
|
|
15
|
-
const events_1 = requireEvents();
|
|
16
|
-
const ContentLength = 'Content-Length: ';
|
|
17
|
-
const CRLF = '\r\n';
|
|
18
|
-
var MessageWriter;
|
|
19
|
-
(function (MessageWriter) {
|
|
20
|
-
function is(value) {
|
|
21
|
-
let candidate = value;
|
|
22
|
-
return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) &&
|
|
23
|
-
Is.func(candidate.onError) && Is.func(candidate.write);
|
|
24
|
-
}
|
|
25
|
-
MessageWriter.is = is;
|
|
26
|
-
})(MessageWriter || (messageWriter.MessageWriter = MessageWriter = {}));
|
|
27
|
-
class AbstractMessageWriter {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.errorEmitter = new events_1.Emitter();
|
|
30
|
-
this.closeEmitter = new events_1.Emitter();
|
|
31
|
-
}
|
|
32
|
-
dispose() {
|
|
33
|
-
this.errorEmitter.dispose();
|
|
34
|
-
this.closeEmitter.dispose();
|
|
35
|
-
}
|
|
36
|
-
get onError() {
|
|
37
|
-
return this.errorEmitter.event;
|
|
38
|
-
}
|
|
39
|
-
fireError(error, message, count) {
|
|
40
|
-
this.errorEmitter.fire([this.asError(error), message, count]);
|
|
41
|
-
}
|
|
42
|
-
get onClose() {
|
|
43
|
-
return this.closeEmitter.event;
|
|
44
|
-
}
|
|
45
|
-
fireClose() {
|
|
46
|
-
this.closeEmitter.fire(undefined);
|
|
47
|
-
}
|
|
48
|
-
asError(error) {
|
|
49
|
-
if (error instanceof Error) {
|
|
50
|
-
return error;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
messageWriter.AbstractMessageWriter = AbstractMessageWriter;
|
|
58
|
-
var ResolvedMessageWriterOptions;
|
|
59
|
-
(function (ResolvedMessageWriterOptions) {
|
|
60
|
-
function fromOptions(options) {
|
|
61
|
-
if (options === undefined || typeof options === 'string') {
|
|
62
|
-
return { charset: options ?? 'utf-8', contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder };
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return { charset: options.charset ?? 'utf-8', contentEncoder: options.contentEncoder, contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
ResolvedMessageWriterOptions.fromOptions = fromOptions;
|
|
69
|
-
})(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
|
|
70
|
-
class WriteableStreamMessageWriter extends AbstractMessageWriter {
|
|
71
|
-
constructor(writable, options) {
|
|
72
|
-
super();
|
|
73
|
-
this.writable = writable;
|
|
74
|
-
this.options = ResolvedMessageWriterOptions.fromOptions(options);
|
|
75
|
-
this.errorCount = 0;
|
|
76
|
-
this.writeSemaphore = new semaphore_1.Semaphore(1);
|
|
77
|
-
this.writable.onError((error) => this.fireError(error));
|
|
78
|
-
this.writable.onClose(() => this.fireClose());
|
|
79
|
-
}
|
|
80
|
-
async write(msg) {
|
|
81
|
-
return this.writeSemaphore.lock(async () => {
|
|
82
|
-
const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {
|
|
83
|
-
if (this.options.contentEncoder !== undefined) {
|
|
84
|
-
return this.options.contentEncoder.encode(buffer);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return buffer;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
return payload.then((buffer) => {
|
|
91
|
-
const headers = [];
|
|
92
|
-
headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
|
|
93
|
-
headers.push(CRLF);
|
|
94
|
-
return this.doWrite(msg, headers, buffer);
|
|
95
|
-
}, (error) => {
|
|
96
|
-
this.fireError(error);
|
|
97
|
-
throw error;
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
async doWrite(msg, headers, data) {
|
|
102
|
-
try {
|
|
103
|
-
await this.writable.write(headers.join(''), 'ascii');
|
|
104
|
-
return this.writable.write(data);
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
this.handleError(error, msg);
|
|
108
|
-
return Promise.reject(error);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
handleError(error, msg) {
|
|
112
|
-
this.errorCount++;
|
|
113
|
-
this.fireError(error, msg, this.errorCount);
|
|
114
|
-
}
|
|
115
|
-
end() {
|
|
116
|
-
this.writable.end();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
messageWriter.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
|
|
120
|
-
return messageWriter;
|
|
121
|
-
}
|
|
122
|
-
export { requireMessageWriter as __require };
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { __exports as messages } from '../../../../_virtual/messages.js';
|
|
2
|
-
import { __require as requireIs } from './is.js';
|
|
3
|
-
var hasRequiredMessages;
|
|
4
|
-
function requireMessages () {
|
|
5
|
-
if (hasRequiredMessages) return messages;
|
|
6
|
-
hasRequiredMessages = 1;
|
|
7
|
-
Object.defineProperty(messages, "__esModule", { value: true });
|
|
8
|
-
messages.Message = messages.NotificationType9 = messages.NotificationType8 = messages.NotificationType7 = messages.NotificationType6 = messages.NotificationType5 = messages.NotificationType4 = messages.NotificationType3 = messages.NotificationType2 = messages.NotificationType1 = messages.NotificationType0 = messages.NotificationType = messages.RequestType9 = messages.RequestType8 = messages.RequestType7 = messages.RequestType6 = messages.RequestType5 = messages.RequestType4 = messages.RequestType3 = messages.RequestType2 = messages.RequestType1 = messages.RequestType = messages.RequestType0 = messages.AbstractMessageSignature = messages.ParameterStructures = messages.ResponseError = messages.ErrorCodes = void 0;
|
|
9
|
-
const is = requireIs();
|
|
10
|
-
var ErrorCodes;
|
|
11
|
-
(function (ErrorCodes) {
|
|
12
|
-
ErrorCodes.ParseError = -32700;
|
|
13
|
-
ErrorCodes.InvalidRequest = -32600;
|
|
14
|
-
ErrorCodes.MethodNotFound = -32601;
|
|
15
|
-
ErrorCodes.InvalidParams = -32602;
|
|
16
|
-
ErrorCodes.InternalError = -32603;
|
|
17
|
-
ErrorCodes.jsonrpcReservedErrorRangeStart = -32099;
|
|
18
|
-
ErrorCodes.serverErrorStart = -32099;
|
|
19
|
-
ErrorCodes.MessageWriteError = -32099;
|
|
20
|
-
ErrorCodes.MessageReadError = -32098;
|
|
21
|
-
ErrorCodes.PendingResponseRejected = -32097;
|
|
22
|
-
ErrorCodes.ConnectionInactive = -32096;
|
|
23
|
-
ErrorCodes.ServerNotInitialized = -32002;
|
|
24
|
-
ErrorCodes.UnknownErrorCode = -32001;
|
|
25
|
-
ErrorCodes.jsonrpcReservedErrorRangeEnd = -32000;
|
|
26
|
-
ErrorCodes.serverErrorEnd = -32000;
|
|
27
|
-
})(ErrorCodes || (messages.ErrorCodes = ErrorCodes = {}));
|
|
28
|
-
class ResponseError extends Error {
|
|
29
|
-
constructor(code, message, data) {
|
|
30
|
-
super(message);
|
|
31
|
-
this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
|
|
32
|
-
this.data = data;
|
|
33
|
-
Object.setPrototypeOf(this, ResponseError.prototype);
|
|
34
|
-
}
|
|
35
|
-
toJson() {
|
|
36
|
-
const result = {
|
|
37
|
-
code: this.code,
|
|
38
|
-
message: this.message
|
|
39
|
-
};
|
|
40
|
-
if (this.data !== undefined) {
|
|
41
|
-
result.data = this.data;
|
|
42
|
-
}
|
|
43
|
-
return result;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
messages.ResponseError = ResponseError;
|
|
47
|
-
class ParameterStructures {
|
|
48
|
-
constructor(kind) {
|
|
49
|
-
this.kind = kind;
|
|
50
|
-
}
|
|
51
|
-
static is(value) {
|
|
52
|
-
return value === ParameterStructures.auto || value === ParameterStructures.byName || value === ParameterStructures.byPosition;
|
|
53
|
-
}
|
|
54
|
-
toString() {
|
|
55
|
-
return this.kind;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
messages.ParameterStructures = ParameterStructures;
|
|
59
|
-
ParameterStructures.auto = new ParameterStructures('auto');
|
|
60
|
-
ParameterStructures.byPosition = new ParameterStructures('byPosition');
|
|
61
|
-
ParameterStructures.byName = new ParameterStructures('byName');
|
|
62
|
-
class AbstractMessageSignature {
|
|
63
|
-
constructor(method, numberOfParams) {
|
|
64
|
-
this.method = method;
|
|
65
|
-
this.numberOfParams = numberOfParams;
|
|
66
|
-
}
|
|
67
|
-
get parameterStructures() {
|
|
68
|
-
return ParameterStructures.auto;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
messages.AbstractMessageSignature = AbstractMessageSignature;
|
|
72
|
-
class RequestType0 extends AbstractMessageSignature {
|
|
73
|
-
constructor(method) {
|
|
74
|
-
super(method, 0);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
messages.RequestType0 = RequestType0;
|
|
78
|
-
class RequestType extends AbstractMessageSignature {
|
|
79
|
-
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
80
|
-
super(method, 1);
|
|
81
|
-
this._parameterStructures = _parameterStructures;
|
|
82
|
-
}
|
|
83
|
-
get parameterStructures() {
|
|
84
|
-
return this._parameterStructures;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
messages.RequestType = RequestType;
|
|
88
|
-
class RequestType1 extends AbstractMessageSignature {
|
|
89
|
-
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
90
|
-
super(method, 1);
|
|
91
|
-
this._parameterStructures = _parameterStructures;
|
|
92
|
-
}
|
|
93
|
-
get parameterStructures() {
|
|
94
|
-
return this._parameterStructures;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
messages.RequestType1 = RequestType1;
|
|
98
|
-
class RequestType2 extends AbstractMessageSignature {
|
|
99
|
-
constructor(method) {
|
|
100
|
-
super(method, 2);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
messages.RequestType2 = RequestType2;
|
|
104
|
-
class RequestType3 extends AbstractMessageSignature {
|
|
105
|
-
constructor(method) {
|
|
106
|
-
super(method, 3);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
messages.RequestType3 = RequestType3;
|
|
110
|
-
class RequestType4 extends AbstractMessageSignature {
|
|
111
|
-
constructor(method) {
|
|
112
|
-
super(method, 4);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
messages.RequestType4 = RequestType4;
|
|
116
|
-
class RequestType5 extends AbstractMessageSignature {
|
|
117
|
-
constructor(method) {
|
|
118
|
-
super(method, 5);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
messages.RequestType5 = RequestType5;
|
|
122
|
-
class RequestType6 extends AbstractMessageSignature {
|
|
123
|
-
constructor(method) {
|
|
124
|
-
super(method, 6);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
messages.RequestType6 = RequestType6;
|
|
128
|
-
class RequestType7 extends AbstractMessageSignature {
|
|
129
|
-
constructor(method) {
|
|
130
|
-
super(method, 7);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
messages.RequestType7 = RequestType7;
|
|
134
|
-
class RequestType8 extends AbstractMessageSignature {
|
|
135
|
-
constructor(method) {
|
|
136
|
-
super(method, 8);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
messages.RequestType8 = RequestType8;
|
|
140
|
-
class RequestType9 extends AbstractMessageSignature {
|
|
141
|
-
constructor(method) {
|
|
142
|
-
super(method, 9);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
messages.RequestType9 = RequestType9;
|
|
146
|
-
class NotificationType extends AbstractMessageSignature {
|
|
147
|
-
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
148
|
-
super(method, 1);
|
|
149
|
-
this._parameterStructures = _parameterStructures;
|
|
150
|
-
}
|
|
151
|
-
get parameterStructures() {
|
|
152
|
-
return this._parameterStructures;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
messages.NotificationType = NotificationType;
|
|
156
|
-
class NotificationType0 extends AbstractMessageSignature {
|
|
157
|
-
constructor(method) {
|
|
158
|
-
super(method, 0);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
messages.NotificationType0 = NotificationType0;
|
|
162
|
-
class NotificationType1 extends AbstractMessageSignature {
|
|
163
|
-
constructor(method, _parameterStructures = ParameterStructures.auto) {
|
|
164
|
-
super(method, 1);
|
|
165
|
-
this._parameterStructures = _parameterStructures;
|
|
166
|
-
}
|
|
167
|
-
get parameterStructures() {
|
|
168
|
-
return this._parameterStructures;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
messages.NotificationType1 = NotificationType1;
|
|
172
|
-
class NotificationType2 extends AbstractMessageSignature {
|
|
173
|
-
constructor(method) {
|
|
174
|
-
super(method, 2);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
messages.NotificationType2 = NotificationType2;
|
|
178
|
-
class NotificationType3 extends AbstractMessageSignature {
|
|
179
|
-
constructor(method) {
|
|
180
|
-
super(method, 3);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
messages.NotificationType3 = NotificationType3;
|
|
184
|
-
class NotificationType4 extends AbstractMessageSignature {
|
|
185
|
-
constructor(method) {
|
|
186
|
-
super(method, 4);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
messages.NotificationType4 = NotificationType4;
|
|
190
|
-
class NotificationType5 extends AbstractMessageSignature {
|
|
191
|
-
constructor(method) {
|
|
192
|
-
super(method, 5);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
messages.NotificationType5 = NotificationType5;
|
|
196
|
-
class NotificationType6 extends AbstractMessageSignature {
|
|
197
|
-
constructor(method) {
|
|
198
|
-
super(method, 6);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
messages.NotificationType6 = NotificationType6;
|
|
202
|
-
class NotificationType7 extends AbstractMessageSignature {
|
|
203
|
-
constructor(method) {
|
|
204
|
-
super(method, 7);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
messages.NotificationType7 = NotificationType7;
|
|
208
|
-
class NotificationType8 extends AbstractMessageSignature {
|
|
209
|
-
constructor(method) {
|
|
210
|
-
super(method, 8);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
messages.NotificationType8 = NotificationType8;
|
|
214
|
-
class NotificationType9 extends AbstractMessageSignature {
|
|
215
|
-
constructor(method) {
|
|
216
|
-
super(method, 9);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
messages.NotificationType9 = NotificationType9;
|
|
220
|
-
var Message;
|
|
221
|
-
(function (Message) {
|
|
222
|
-
function isRequest(message) {
|
|
223
|
-
const candidate = message;
|
|
224
|
-
return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
|
|
225
|
-
}
|
|
226
|
-
Message.isRequest = isRequest;
|
|
227
|
-
function isNotification(message) {
|
|
228
|
-
const candidate = message;
|
|
229
|
-
return candidate && is.string(candidate.method) && message.id === void 0;
|
|
230
|
-
}
|
|
231
|
-
Message.isNotification = isNotification;
|
|
232
|
-
function isResponse(message) {
|
|
233
|
-
const candidate = message;
|
|
234
|
-
return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
|
|
235
|
-
}
|
|
236
|
-
Message.isResponse = isResponse;
|
|
237
|
-
})(Message || (messages.Message = Message = {}));
|
|
238
|
-
return messages;
|
|
239
|
-
}
|
|
240
|
-
export { requireMessages as __require };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __exports as ral } from '../../../../_virtual/ral.js';
|
|
2
|
-
var hasRequiredRal;
|
|
3
|
-
function requireRal () {
|
|
4
|
-
if (hasRequiredRal) return ral;
|
|
5
|
-
hasRequiredRal = 1;
|
|
6
|
-
Object.defineProperty(ral, "__esModule", { value: true });
|
|
7
|
-
let _ral;
|
|
8
|
-
function RAL() {
|
|
9
|
-
if (_ral === undefined) {
|
|
10
|
-
throw new Error(`No runtime abstraction layer installed`);
|
|
11
|
-
}
|
|
12
|
-
return _ral;
|
|
13
|
-
}
|
|
14
|
-
(function (RAL) {
|
|
15
|
-
function install(ral) {
|
|
16
|
-
if (ral === undefined) {
|
|
17
|
-
throw new Error(`No runtime abstraction layer provided`);
|
|
18
|
-
}
|
|
19
|
-
_ral = ral;
|
|
20
|
-
}
|
|
21
|
-
RAL.install = install;
|
|
22
|
-
})(RAL || (RAL = {}));
|
|
23
|
-
ral.default = RAL;
|
|
24
|
-
return ral;
|
|
25
|
-
}
|
|
26
|
-
export { requireRal as __require };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { __exports as semaphore } from '../../../../_virtual/semaphore.js';
|
|
2
|
-
import { __require as requireRal } from './ral.js';
|
|
3
|
-
var hasRequiredSemaphore;
|
|
4
|
-
function requireSemaphore () {
|
|
5
|
-
if (hasRequiredSemaphore) return semaphore;
|
|
6
|
-
hasRequiredSemaphore = 1;
|
|
7
|
-
Object.defineProperty(semaphore, "__esModule", { value: true });
|
|
8
|
-
semaphore.Semaphore = void 0;
|
|
9
|
-
const ral_1 = requireRal();
|
|
10
|
-
class Semaphore {
|
|
11
|
-
constructor(capacity = 1) {
|
|
12
|
-
if (capacity <= 0) {
|
|
13
|
-
throw new Error('Capacity must be greater than 0');
|
|
14
|
-
}
|
|
15
|
-
this._capacity = capacity;
|
|
16
|
-
this._active = 0;
|
|
17
|
-
this._waiting = [];
|
|
18
|
-
}
|
|
19
|
-
lock(thunk) {
|
|
20
|
-
return new Promise((resolve, reject) => {
|
|
21
|
-
this._waiting.push({ thunk, resolve, reject });
|
|
22
|
-
this.runNext();
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
get active() {
|
|
26
|
-
return this._active;
|
|
27
|
-
}
|
|
28
|
-
runNext() {
|
|
29
|
-
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
(0, ral_1.default)().timer.setImmediate(() => this.doRunNext());
|
|
33
|
-
}
|
|
34
|
-
doRunNext() {
|
|
35
|
-
if (this._waiting.length === 0 || this._active === this._capacity) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const next = this._waiting.shift();
|
|
39
|
-
this._active++;
|
|
40
|
-
if (this._active > this._capacity) {
|
|
41
|
-
throw new Error(`To many thunks active`);
|
|
42
|
-
}
|
|
43
|
-
try {
|
|
44
|
-
const result = next.thunk();
|
|
45
|
-
if (result instanceof Promise) {
|
|
46
|
-
result.then((value) => {
|
|
47
|
-
this._active--;
|
|
48
|
-
next.resolve(value);
|
|
49
|
-
this.runNext();
|
|
50
|
-
}, (err) => {
|
|
51
|
-
this._active--;
|
|
52
|
-
next.reject(err);
|
|
53
|
-
this.runNext();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this._active--;
|
|
58
|
-
next.resolve(result);
|
|
59
|
-
this.runNext();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (err) {
|
|
63
|
-
this._active--;
|
|
64
|
-
next.reject(err);
|
|
65
|
-
this.runNext();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
semaphore.Semaphore = Semaphore;
|
|
70
|
-
return semaphore;
|
|
71
|
-
}
|
|
72
|
-
export { requireSemaphore as __require };
|