From 6543cd6660dd759542ed2f68fe554cd2450a69ef Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 13 Jun 2022 14:01:35 +0200 Subject: [PATCH] Update yarn SDKs --- .yarn/sdks/typescript/lib/tsserver.js | 35 ++++++++++++++------ .yarn/sdks/typescript/lib/tsserverlibrary.js | 35 ++++++++++++++------ 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/.yarn/sdks/typescript/lib/tsserver.js b/.yarn/sdks/typescript/lib/tsserver.js index 830ad9f2..9f9f4d6f 100644 --- a/.yarn/sdks/typescript/lib/tsserver.js +++ b/.yarn/sdks/typescript/lib/tsserver.js @@ -61,14 +61,18 @@ const moduleWrapper = tsserver => { // // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 // - // Update 2021-10-08: VSCode changed their format in 1.61. + // 2021-10-08: VSCode changed the format in 1.61. // Before | ^zip:/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // - // Update 2022-04-06: VSCode changed the format in 1.66. + // 2022-04-06: VSCode changed the format in 1.66. // Before | ^/zip//c:/foo/bar.zip/package.json // After | ^/zip/c:/foo/bar.zip/package.json // + // 2022-05-06: VSCode changed the format in 1.68 + // Before | ^/zip/c:/foo/bar.zip/package.json + // After | ^/zip//c:/foo/bar.zip/package.json + // case `vscode <1.61`: { str = `^zip:${str}`; } break; @@ -77,10 +81,14 @@ const moduleWrapper = tsserver => { str = `^/zip/${str}`; } break; - case `vscode`: { + case `vscode <1.68`: { str = `^/zip${str}`; } break; + case `vscode`: { + str = `^/zip/${str}`; + } break; + // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) @@ -127,9 +135,7 @@ const moduleWrapper = tsserver => { case `vscode`: default: { - return process.platform === `win32` - ? str.replace(/^\^?(zip:|\/zip)\/+/, ``) - : str.replace(/^\^?(zip:|\/zip)\/+/, `/`); + return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`) } break; } } @@ -169,10 +175,19 @@ const moduleWrapper = tsserver => { ) { hostInfo = parsedMessage.arguments.hostInfo; if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { - if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) { - hostInfo += ` <1.61`; - } else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) { - hostInfo += ` <1.66`; + const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match( + // The RegExp from https://semver.org/ but without the caret at the start + /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/ + ) ?? []).map(Number) + + if (major === 1) { + if (minor < 61) { + hostInfo += ` <1.61`; + } else if (minor < 66) { + hostInfo += ` <1.66`; + } else if (minor < 68) { + hostInfo += ` <1.68`; + } } } } diff --git a/.yarn/sdks/typescript/lib/tsserverlibrary.js b/.yarn/sdks/typescript/lib/tsserverlibrary.js index 0f7084cd..878b1194 100644 --- a/.yarn/sdks/typescript/lib/tsserverlibrary.js +++ b/.yarn/sdks/typescript/lib/tsserverlibrary.js @@ -61,14 +61,18 @@ const moduleWrapper = tsserver => { // // Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910 // - // Update 2021-10-08: VSCode changed their format in 1.61. + // 2021-10-08: VSCode changed the format in 1.61. // Before | ^zip:/c:/foo/bar.zip/package.json // After | ^/zip//c:/foo/bar.zip/package.json // - // Update 2022-04-06: VSCode changed the format in 1.66. + // 2022-04-06: VSCode changed the format in 1.66. // Before | ^/zip//c:/foo/bar.zip/package.json // After | ^/zip/c:/foo/bar.zip/package.json // + // 2022-05-06: VSCode changed the format in 1.68 + // Before | ^/zip/c:/foo/bar.zip/package.json + // After | ^/zip//c:/foo/bar.zip/package.json + // case `vscode <1.61`: { str = `^zip:${str}`; } break; @@ -77,10 +81,14 @@ const moduleWrapper = tsserver => { str = `^/zip/${str}`; } break; - case `vscode`: { + case `vscode <1.68`: { str = `^/zip${str}`; } break; + case `vscode`: { + str = `^/zip/${str}`; + } break; + // To make "go to definition" work, // We have to resolve the actual file system path from virtual path // and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip) @@ -127,9 +135,7 @@ const moduleWrapper = tsserver => { case `vscode`: default: { - return process.platform === `win32` - ? str.replace(/^\^?(zip:|\/zip)\/+/, ``) - : str.replace(/^\^?(zip:|\/zip)\/+/, `/`); + return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`) } break; } } @@ -169,10 +175,19 @@ const moduleWrapper = tsserver => { ) { hostInfo = parsedMessage.arguments.hostInfo; if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) { - if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) { - hostInfo += ` <1.61`; - } else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) { - hostInfo += ` <1.66`; + const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match( + // The RegExp from https://semver.org/ but without the caret at the start + /(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/ + ) ?? []).map(Number) + + if (major === 1) { + if (minor < 61) { + hostInfo += ` <1.61`; + } else if (minor < 66) { + hostInfo += ` <1.66`; + } else if (minor < 68) { + hostInfo += ` <1.68`; + } } } }