Fix deprecation warnings
This commit is contained in:
parent
e898bd91f4
commit
b738e9aab4
|
|
@ -5855,6 +5855,31 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encoding": {
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
|
||||
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"iconv-lite": "^0.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/encoding/node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/end-of-stream": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
|
||||
|
|
|
|||
|
|
@ -76,17 +76,17 @@ function ensureLspForKey(
|
|||
while (true) {
|
||||
const headerEnd = entry.buffer.indexOf("\r\n\r\n");
|
||||
if (headerEnd === -1) break;
|
||||
const header = entry.buffer.slice(0, headerEnd).toString();
|
||||
const header = entry.buffer.subarray(0, headerEnd).toString();
|
||||
const m = header.match(/Content-Length:\s*(\d+)/i);
|
||||
if (!m) {
|
||||
// Malformed, drop
|
||||
entry.buffer = entry.buffer.slice(headerEnd + 4);
|
||||
entry.buffer = entry.buffer.subarray(headerEnd + 4);
|
||||
continue;
|
||||
}
|
||||
const len = parseInt(m[1], 10);
|
||||
const totalLen = headerEnd + 4 + len;
|
||||
if (entry.buffer.length < totalLen) break; // wait for more
|
||||
const body = entry.buffer.slice(headerEnd + 4, totalLen).toString();
|
||||
const body = entry.buffer.subarray(headerEnd + 4, totalLen).toString();
|
||||
// Forward body to all attached ports
|
||||
try {
|
||||
entry.ports.forEach((p) => {
|
||||
|
|
@ -103,7 +103,7 @@ function ensureLspForKey(
|
|||
} catch (err) {
|
||||
console.warn("Failed to forward LSP message to renderer", err);
|
||||
}
|
||||
entry.buffer = entry.buffer.slice(totalLen);
|
||||
entry.buffer = entry.buffer.subarray(totalLen);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue