Skip to content

Commit 86067f8

Browse files
committed
fix featureset.CoderExtension to be sematically correct
1 parent b273261 commit 86067f8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/featureSet.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ export type FeatureSet = {
1010
*/
1111
export function featureSetForVersion(version: semver.SemVer | null): FeatureSet {
1212
return {
13-
coderExtension:
14-
version?.major === 0 && version?.minor <= 14 && version?.patch < 1 && version?.prerelease.length === 0,
13+
coderExtension: !(
14+
version?.major === 0 &&
15+
version?.minor <= 14 &&
16+
version?.patch < 1 &&
17+
version?.prerelease.length === 0
18+
),
1519

1620
// CLI versions before 2.3.3 don't support the --log-dir flag!
1721
// If this check didn't exist, VS Code connections would fail on

src/remote.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,15 @@ export class Remote {
213213

214214
let version: semver.SemVer | null = null
215215
try {
216-
let v = await cli.version(binaryPath)
217-
if (!v) {
218-
v = buildInfo.version
219-
}
220-
version = semver.parse(v)
216+
version = semver.parse(await cli.version(binaryPath))
221217
} catch (e) {
222218
version = semver.parse(buildInfo.version)
223219
}
224220

225221
const featureSet = featureSetForVersion(version)
226222

227223
// Server versions before v0.14.1 don't support the vscodessh command!
228-
if (featureSet.coderExtension) {
224+
if (!featureSet.coderExtension) {
229225
await this.vscodeProposed.window.showErrorMessage(
230226
"Incompatible Server",
231227
{

0 commit comments

Comments
 (0)