File tree 3 files changed +69
-0
lines changed
.yarn/sdks/typescript/lib
packages/yarnpkg-sdks/sources/sdks
3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,22 @@ const moduleWrapper = tsserver => {
61
61
//
62
62
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
63
63
//
64
+ // Update 2021-10-08: VSCode changed their format in 1.61.
65
+ // Before | ^zip:/c:/foo/bar.zip/package.json
66
+ // After | ^/zip//c:/foo/bar.zip/package.json
67
+ //
68
+ // Update 2022-04-06: VSCode changed the format in 1.66.
69
+ // Before | ^/zip//c:/foo/bar.zip/package.json
70
+ // After | ^/zip/c:/foo/bar.zip/package.json
71
+ //
72
+ case `vscode <1.61` : {
73
+ str = `^zip:${ str } ` ;
74
+ } break ;
75
+
76
+ case `vscode <1.66` : {
77
+ str = `^/zip/${ str } ` ;
78
+ } break ;
79
+
64
80
case `vscode` : {
65
81
str = `^/zip${ str } ` ;
66
82
} break ;
@@ -152,6 +168,13 @@ const moduleWrapper = tsserver => {
152
168
typeof parsedMessage . arguments . hostInfo === `string`
153
169
) {
154
170
hostInfo = parsedMessage . arguments . hostInfo ;
171
+ if ( hostInfo === `vscode` && process . env . VSCODE_IPC_HOOK ) {
172
+ if ( / .* ( \/ | - ) 1 \. ( [ 1 - 5 ] [ 0 - 9 ] | 6 0 ) \. / . 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` ;
176
+ }
177
+ }
155
178
}
156
179
157
180
const processedMessageJSON = JSON . stringify ( parsedMessage , ( key , value ) => {
Original file line number Diff line number Diff line change @@ -61,6 +61,22 @@ const moduleWrapper = tsserver => {
61
61
//
62
62
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
63
63
//
64
+ // Update 2021-10-08: VSCode changed their format in 1.61.
65
+ // Before | ^zip:/c:/foo/bar.zip/package.json
66
+ // After | ^/zip//c:/foo/bar.zip/package.json
67
+ //
68
+ // Update 2022-04-06: VSCode changed the format in 1.66.
69
+ // Before | ^/zip//c:/foo/bar.zip/package.json
70
+ // After | ^/zip/c:/foo/bar.zip/package.json
71
+ //
72
+ case `vscode <1.61` : {
73
+ str = `^zip:${ str } ` ;
74
+ } break ;
75
+
76
+ case `vscode <1.66` : {
77
+ str = `^/zip/${ str } ` ;
78
+ } break ;
79
+
64
80
case `vscode` : {
65
81
str = `^/zip${ str } ` ;
66
82
} break ;
@@ -152,6 +168,13 @@ const moduleWrapper = tsserver => {
152
168
typeof parsedMessage . arguments . hostInfo === `string`
153
169
) {
154
170
hostInfo = parsedMessage . arguments . hostInfo ;
171
+ if ( hostInfo === `vscode` && process . env . VSCODE_IPC_HOOK ) {
172
+ if ( / .* ( \/ | - ) 1 \. ( [ 1 - 5 ] [ 0 - 9 ] | 6 0 ) \. / . 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` ;
176
+ }
177
+ }
155
178
}
156
179
157
180
const processedMessageJSON = JSON . stringify ( parsedMessage , ( key , value ) => {
Original file line number Diff line number Diff line change @@ -88,6 +88,22 @@ export const generateTypescriptBaseWrapper: GenerateBaseWrapper = async (pnpApi:
88
88
//
89
89
// Ref: https://github.com/microsoft/vscode/issues/105014#issuecomment-686760910
90
90
//
91
+ // Update 2021-10-08: VSCode changed their format in 1.61.
92
+ // Before | ^zip:/c:/foo/bar.zip/package.json
93
+ // After | ^/zip//c:/foo/bar.zip/package.json
94
+ //
95
+ // Update 2022-04-06: VSCode changed the format in 1.66.
96
+ // Before | ^/zip//c:/foo/bar.zip/package.json
97
+ // After | ^/zip/c:/foo/bar.zip/package.json
98
+ //
99
+ case \`vscode <1.61\`: {
100
+ str = \`^zip:\${str}\`;
101
+ } break;
102
+
103
+ case \`vscode <1.66\`: {
104
+ str = \`^/zip/\${str}\`;
105
+ } break;
106
+
91
107
case \`vscode\`: {
92
108
str = \`^/zip\${str}\`;
93
109
} break;
@@ -179,6 +195,13 @@ export const generateTypescriptBaseWrapper: GenerateBaseWrapper = async (pnpApi:
179
195
typeof parsedMessage.arguments.hostInfo === \`string\`
180
196
) {
181
197
hostInfo = parsedMessage.arguments.hostInfo;
198
+ if (hostInfo === \`vscode\` && process.env.VSCODE_IPC_HOOK) {
199
+ if (/.*(\\/|-)1\\.([1-5][0-9]|60)\\./.test(process.env.VSCODE_IPC_HOOK)) {
200
+ hostInfo += \` <1.61\`;
201
+ } else if (/.*(\\/|-)1\\.(6[1-5])\\./.test(process.env.VSCODE_IPC_HOOK)) {
202
+ hostInfo += \` <1.66\`;
203
+ }
204
+ }
182
205
}
183
206
184
207
const processedMessageJSON = JSON.stringify(parsedMessage, (key, value) => {
You can’t perform that action at this time.
0 commit comments