Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 1033070

Browse files
committed
chore: update yarn sdks
1 parent fd12bc2 commit 1033070

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

.yarn/sdks/typescript/lib/tsserver.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ const moduleWrapper = tsserver => {
6161
//
6262
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
6363
//
64-
// Update 2021-10-08: VSCode changed their format in 1.61.
64+
// 2021-10-08: VSCode changed the format in 1.61.
6565
// Before | ^zip:/c:/foo/bar.zip/package.json
6666
// After | ^/zip//c:/foo/bar.zip/package.json
6767
//
68-
// Update 2022-04-06: VSCode changed the format in 1.66.
68+
// 2022-04-06: VSCode changed the format in 1.66.
6969
// Before | ^/zip//c:/foo/bar.zip/package.json
7070
// After | ^/zip/c:/foo/bar.zip/package.json
7171
//
72+
// 2022-05-06: VSCode changed the format in 1.68
73+
// Before | ^/zip/c:/foo/bar.zip/package.json
74+
// After | ^/zip//c:/foo/bar.zip/package.json
75+
//
7276
case `vscode <1.61`: {
7377
str = `^zip:${str}`;
7478
} break;
@@ -77,10 +81,14 @@ const moduleWrapper = tsserver => {
7781
str = `^/zip/${str}`;
7882
} break;
7983

80-
case `vscode`: {
84+
case `vscode <1.68`: {
8185
str = `^/zip${str}`;
8286
} break;
8387

88+
case `vscode`: {
89+
str = `^/zip/${str}`;
90+
} break;
91+
8492
// To make "go to definition" work,
8593
// We have to resolve the actual file system path from virtual path
8694
// and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip)
@@ -127,9 +135,7 @@ const moduleWrapper = tsserver => {
127135

128136
case `vscode`:
129137
default: {
130-
return process.platform === `win32`
131-
? str.replace(/^\^?(zip:|\/zip)\/+/, ``)
132-
: str.replace(/^\^?(zip:|\/zip)\/+/, `/`);
138+
return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`)
133139
} break;
134140
}
135141
}
@@ -169,10 +175,19 @@ const moduleWrapper = tsserver => {
169175
) {
170176
hostInfo = parsedMessage.arguments.hostInfo;
171177
if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) {
172-
if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) {
173-
hostInfo += ` <1.61`;
174-
} else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) {
175-
hostInfo += ` <1.66`;
178+
const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match(
179+
// The RegExp from https://semver.org/ but without the caret at the start
180+
/(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-]+)*))?$/
181+
) ?? []).map(Number)
182+
183+
if (major === 1) {
184+
if (minor < 61) {
185+
hostInfo += ` <1.61`;
186+
} else if (minor < 66) {
187+
hostInfo += ` <1.66`;
188+
} else if (minor < 68) {
189+
hostInfo += ` <1.68`;
190+
}
176191
}
177192
}
178193
}

.yarn/sdks/typescript/lib/tsserverlibrary.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ const moduleWrapper = tsserver => {
6161
//
6262
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
6363
//
64-
// Update 2021-10-08: VSCode changed their format in 1.61.
64+
// 2021-10-08: VSCode changed the format in 1.61.
6565
// Before | ^zip:/c:/foo/bar.zip/package.json
6666
// After | ^/zip//c:/foo/bar.zip/package.json
6767
//
68-
// Update 2022-04-06: VSCode changed the format in 1.66.
68+
// 2022-04-06: VSCode changed the format in 1.66.
6969
// Before | ^/zip//c:/foo/bar.zip/package.json
7070
// After | ^/zip/c:/foo/bar.zip/package.json
7171
//
72+
// 2022-05-06: VSCode changed the format in 1.68
73+
// Before | ^/zip/c:/foo/bar.zip/package.json
74+
// After | ^/zip//c:/foo/bar.zip/package.json
75+
//
7276
case `vscode <1.61`: {
7377
str = `^zip:${str}`;
7478
} break;
@@ -77,10 +81,14 @@ const moduleWrapper = tsserver => {
7781
str = `^/zip/${str}`;
7882
} break;
7983

80-
case `vscode`: {
84+
case `vscode <1.68`: {
8185
str = `^/zip${str}`;
8286
} break;
8387

88+
case `vscode`: {
89+
str = `^/zip/${str}`;
90+
} break;
91+
8492
// To make "go to definition" work,
8593
// We have to resolve the actual file system path from virtual path
8694
// and convert scheme to supported by [vim-rzip](https://github.com/lbrayner/vim-rzip)
@@ -127,9 +135,7 @@ const moduleWrapper = tsserver => {
127135

128136
case `vscode`:
129137
default: {
130-
return process.platform === `win32`
131-
? str.replace(/^\^?(zip:|\/zip)\/+/, ``)
132-
: str.replace(/^\^?(zip:|\/zip)\/+/, `/`);
138+
return str.replace(/^\^?(zip:|\/zip(\/ts-nul-authority)?)\/+/, process.platform === `win32` ? `` : `/`)
133139
} break;
134140
}
135141
}
@@ -169,10 +175,19 @@ const moduleWrapper = tsserver => {
169175
) {
170176
hostInfo = parsedMessage.arguments.hostInfo;
171177
if (hostInfo === `vscode` && process.env.VSCODE_IPC_HOOK) {
172-
if (/(\/|-)1\.([1-5][0-9]|60)\./.test(process.env.VSCODE_IPC_HOOK)) {
173-
hostInfo += ` <1.61`;
174-
} else if (/(\/|-)1\.(6[1-5])\./.test(process.env.VSCODE_IPC_HOOK)) {
175-
hostInfo += ` <1.66`;
178+
const [, major, minor] = (process.env.VSCODE_IPC_HOOK.match(
179+
// The RegExp from https://semver.org/ but without the caret at the start
180+
/(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-]+)*))?$/
181+
) ?? []).map(Number)
182+
183+
if (major === 1) {
184+
if (minor < 61) {
185+
hostInfo += ` <1.61`;
186+
} else if (minor < 66) {
187+
hostInfo += ` <1.66`;
188+
} else if (minor < 68) {
189+
hostInfo += ` <1.68`;
190+
}
176191
}
177192
}
178193
}

0 commit comments

Comments
 (0)