@mrclrchtr/supi-lsp 11.0.0 → 11.1.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/README.md +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +41 -1
- package/node_modules/ignore/README.md +95 -14
- package/node_modules/ignore/index.d.ts +56 -20
- package/node_modules/ignore/index.js +150 -120
- package/node_modules/ignore/legacy.js +159 -131
- package/node_modules/ignore/package.json +1 -1
- package/node_modules/vscode-jsonrpc/README.md +5 -0
- package/node_modules/vscode-jsonrpc/lib/browser/ril.js +8 -0
- package/node_modules/vscode-jsonrpc/lib/common/connection.js +7 -2
- package/node_modules/vscode-jsonrpc/lib/common/ral.d.ts +8 -0
- package/node_modules/vscode-jsonrpc/lib/node/main.d.ts +14 -0
- package/node_modules/vscode-jsonrpc/lib/node/main.js +6 -4
- package/node_modules/vscode-jsonrpc/lib/node/ril.js +5 -1
- package/node_modules/vscode-jsonrpc/package.json +4 -2
- package/node_modules/vscode-languageserver-protocol/package.json +4 -3
- package/node_modules/vscode-languageserver-types/lib/esm/main.js +2 -2
- package/node_modules/vscode-languageserver-types/lib/umd/main.js +2 -2
- package/node_modules/vscode-languageserver-types/package.json +2 -1
- package/package.json +6 -6
- package/src/client/client.ts +21 -0
- package/src/manager/manager.ts +1 -1
|
@@ -84,7 +84,7 @@ class IPCMessageWriter extends api_1.AbstractMessageWriter {
|
|
|
84
84
|
this.errorCount = 0;
|
|
85
85
|
const eventEmitter = this.process;
|
|
86
86
|
eventEmitter.on('error', (error) => this.fireError(error));
|
|
87
|
-
eventEmitter.on('close', () => this.fireClose);
|
|
87
|
+
eventEmitter.on('close', () => this.fireClose());
|
|
88
88
|
}
|
|
89
89
|
write(msg) {
|
|
90
90
|
try {
|
|
@@ -119,7 +119,7 @@ class PortMessageReader extends api_1.AbstractMessageReader {
|
|
|
119
119
|
constructor(port) {
|
|
120
120
|
super();
|
|
121
121
|
this.onData = new api_1.Emitter;
|
|
122
|
-
port.on('close', () => this.fireClose);
|
|
122
|
+
port.on('close', () => this.fireClose());
|
|
123
123
|
port.on('error', (error) => this.fireError(error));
|
|
124
124
|
port.on('message', (message) => {
|
|
125
125
|
this.onData.fire(message);
|
|
@@ -227,7 +227,8 @@ function createClientPipeTransport(pipeName, encoding = 'utf-8') {
|
|
|
227
227
|
server.listen(pipeName, () => {
|
|
228
228
|
server.removeListener('error', reject);
|
|
229
229
|
resolve({
|
|
230
|
-
onConnected: () => { return connected; }
|
|
230
|
+
onConnected: () => { return connected; },
|
|
231
|
+
close: () => { server.close(); }
|
|
231
232
|
});
|
|
232
233
|
});
|
|
233
234
|
});
|
|
@@ -263,7 +264,8 @@ function createClientSocketTransport(port, encoding = 'utf-8') {
|
|
|
263
264
|
const boundPort = address.port;
|
|
264
265
|
resolve({
|
|
265
266
|
port: () => boundPort,
|
|
266
|
-
onConnected: () => { return connected; }
|
|
267
|
+
onConnected: () => { return connected; },
|
|
268
|
+
close: () => { server.close(); }
|
|
267
269
|
});
|
|
268
270
|
});
|
|
269
271
|
});
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const util_1 = require("util");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
8
9
|
const api_1 = require("../common/api");
|
|
9
10
|
class MessageBuffer extends api_1.AbstractMessageBuffer {
|
|
10
11
|
static emptyBuffer = Buffer.allocUnsafe(0);
|
|
@@ -30,7 +31,7 @@ class MessageBuffer extends api_1.AbstractMessageBuffer {
|
|
|
30
31
|
return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
|
-
return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer
|
|
34
|
+
return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer.subarray(0, length));
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
allocNative(length) {
|
|
@@ -99,6 +100,9 @@ class WritableStreamWrapper {
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
const _ril = Object.freeze({
|
|
103
|
+
crypto: Object.freeze({
|
|
104
|
+
randomUUID: () => (0, crypto_1.randomUUID)()
|
|
105
|
+
}),
|
|
102
106
|
messageBuffer: Object.freeze({
|
|
103
107
|
create: (encoding) => new MessageBuffer(encoding)
|
|
104
108
|
}),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vscode-jsonrpc",
|
|
3
3
|
"description": "A json rpc implementation over streams",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/jsonrpc",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/Microsoft/vscode-languageserver-node.git",
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"url": "https://github.com/Microsoft/vscode-languageserver-node/issues"
|
|
14
15
|
},
|
|
15
16
|
"engines": {
|
|
16
|
-
"node": ">=14.
|
|
17
|
+
"node": ">=14.17.0"
|
|
17
18
|
},
|
|
18
19
|
"exports": {
|
|
19
20
|
".": {
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/msgpack-lite": "^0.1.12",
|
|
35
|
+
"@types/node": "22.13.14",
|
|
34
36
|
"msgpack-lite": "^0.1.26"
|
|
35
37
|
},
|
|
36
38
|
"scripts": {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vscode-languageserver-protocol",
|
|
3
3
|
"description": "VSCode Language Server Protocol implementation",
|
|
4
|
-
"version": "3.18.
|
|
4
|
+
"version": "3.18.5",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/protocol",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/Microsoft/vscode-languageserver-node.git",
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"vscode-jsonrpc": "
|
|
31
|
-
"vscode-languageserver-types": "3.18.
|
|
31
|
+
"vscode-jsonrpc": "10.0.0",
|
|
32
|
+
"vscode-languageserver-types": "3.18.5"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"prepublishOnly": "npm run all:publish",
|
|
@@ -222,7 +222,7 @@ export var ColorPresentation;
|
|
|
222
222
|
function is(value) {
|
|
223
223
|
const candidate = value;
|
|
224
224
|
return Is.objectLiteral(candidate) && Is.string(candidate.label)
|
|
225
|
-
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
|
225
|
+
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate.textEdit))
|
|
226
226
|
&& (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
227
227
|
}
|
|
228
228
|
ColorPresentation.is = is;
|
|
@@ -279,7 +279,7 @@ export var FoldingRange;
|
|
|
279
279
|
*/
|
|
280
280
|
function is(value) {
|
|
281
281
|
const candidate = value;
|
|
282
|
-
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.
|
|
282
|
+
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.endLine)
|
|
283
283
|
&& (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
|
|
284
284
|
&& (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
|
|
285
285
|
&& (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
function is(value) {
|
|
234
234
|
var candidate = value;
|
|
235
235
|
return Is.objectLiteral(candidate) && Is.string(candidate.label)
|
|
236
|
-
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
|
236
|
+
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate.textEdit))
|
|
237
237
|
&& (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
238
238
|
}
|
|
239
239
|
ColorPresentation.is = is;
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
*/
|
|
291
291
|
function is(value) {
|
|
292
292
|
var candidate = value;
|
|
293
|
-
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.
|
|
293
|
+
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.endLine)
|
|
294
294
|
&& (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
|
|
295
295
|
&& (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
|
|
296
296
|
&& (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vscode-languageserver-types",
|
|
3
3
|
"description": "Types used by the Language server for node",
|
|
4
|
-
"version": "3.18.
|
|
4
|
+
"version": "3.18.5",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/types",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/Microsoft/vscode-languageserver-node.git",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-lsp",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Language Server Protocol runtime for SuPi code intelligence",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ignore": "^7.0.5",
|
|
36
36
|
"typescript": "6.0.3",
|
|
37
|
-
"vscode-jsonrpc": "^
|
|
38
|
-
"vscode-languageserver-protocol": "^3.18.
|
|
39
|
-
"vscode-languageserver-types": "^3.18.
|
|
40
|
-
"@mrclrchtr/supi-code-runtime": "11.
|
|
41
|
-
"@mrclrchtr/supi-core": "11.
|
|
37
|
+
"vscode-jsonrpc": "^10.0.0",
|
|
38
|
+
"vscode-languageserver-protocol": "^3.18.5",
|
|
39
|
+
"vscode-languageserver-types": "^3.18.5",
|
|
40
|
+
"@mrclrchtr/supi-code-runtime": "11.1.0",
|
|
41
|
+
"@mrclrchtr/supi-core": "11.1.0"
|
|
42
42
|
},
|
|
43
43
|
"bundledDependencies": [
|
|
44
44
|
"@mrclrchtr/supi-code-runtime",
|
package/src/client/client.ts
CHANGED
|
@@ -82,6 +82,9 @@ import { SemanticInputSynchronizationError } from "./client-semantic-input-error
|
|
|
82
82
|
import { JsonRpcClient, JsonRpcRequestError } from "./transport.ts";
|
|
83
83
|
|
|
84
84
|
const SHUTDOWN_TIMEOUT_MS = 5_000;
|
|
85
|
+
// ContentModified can outlive the server's progress notifications. Yield before
|
|
86
|
+
// spending the single retry instead of immediately racing the same analysis.
|
|
87
|
+
const CONTENT_MODIFIED_RETRY_DELAY_MS = 100;
|
|
85
88
|
|
|
86
89
|
/** Bounded stderr tail kept for startup-failure error messages. */
|
|
87
90
|
const STDERR_TAIL_MAX_CHARS = 4_000;
|
|
@@ -1498,6 +1501,9 @@ export class LspClient {
|
|
|
1498
1501
|
for (;;) {
|
|
1499
1502
|
const attempt: SemanticRequestAttemptState = { inputRevision: undefined };
|
|
1500
1503
|
try {
|
|
1504
|
+
if (retryGuard.retryReason === "content-modified") {
|
|
1505
|
+
await this.waitForContentModifiedRetry(control);
|
|
1506
|
+
}
|
|
1501
1507
|
const data = await this.runSemanticRequestAttempt<T>({
|
|
1502
1508
|
method,
|
|
1503
1509
|
params,
|
|
@@ -1515,6 +1521,21 @@ export class LspClient {
|
|
|
1515
1521
|
}
|
|
1516
1522
|
}
|
|
1517
1523
|
|
|
1524
|
+
/** Pause only the protocol retry, without extending the caller's deadline. */
|
|
1525
|
+
private async waitForContentModifiedRetry(control?: CodeRequestControl): Promise<void> {
|
|
1526
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
1527
|
+
try {
|
|
1528
|
+
await raceRequestControl(
|
|
1529
|
+
new Promise<void>((resolve) => {
|
|
1530
|
+
timer = setTimeout(resolve, CONTENT_MODIFIED_RETRY_DELAY_MS);
|
|
1531
|
+
}),
|
|
1532
|
+
control,
|
|
1533
|
+
);
|
|
1534
|
+
} finally {
|
|
1535
|
+
if (timer) clearTimeout(timer);
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1518
1539
|
/** Return only when another attempt is permitted; retain the cause when retry stops. */
|
|
1519
1540
|
private prepareSemanticRetry(options: {
|
|
1520
1541
|
method: string;
|
package/src/manager/manager.ts
CHANGED
|
@@ -2975,7 +2975,7 @@ export class LspManager {
|
|
|
2975
2975
|
control?: CodeRequestControl,
|
|
2976
2976
|
): Promise<{ kind: "enrolled" } | { kind: "unavailable"; reason: string }> {
|
|
2977
2977
|
throwIfCodeRequestInterrupted(control);
|
|
2978
|
-
const files = [...new Set(filePaths)].sort();
|
|
2978
|
+
const files = [...new Set(filePaths)].sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
2979
2979
|
const routeKey = clientKey(client.name, client.root);
|
|
2980
2980
|
if (this.clients.get(routeKey) !== client) {
|
|
2981
2981
|
return { kind: "unavailable", reason: "The semantic route changed during rename planning." };
|