Skip to content

Commit db40434

Browse files
authored
Add more specific checks for being on TS 4.0.1 (#104457)
Fixes #104456
1 parent 4c23fc2 commit db40434

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

extensions/typescript-language-features/src/tsServer/spawner.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { ILogDirectoryProvider } from './logDirectoryProvider';
1818
import { GetErrRoutingTsServer, ITypeScriptServer, ProcessBasedTsServer, SyntaxRoutingTsServer, TsServerDelegate, TsServerProcessFactory, TsServerProcessKind } from './server';
1919
import { TypeScriptVersionManager } from './versionManager';
2020
import { ITypeScriptVersionProvider, TypeScriptVersion } from './versionProvider';
21-
import * as semver from 'semver';
2221

2322
const enum CompositeServerType {
2423
/** Run a single server that handles all commands */
@@ -164,11 +163,9 @@ export class TypeScriptServerSpawner {
164163
let tsServerLogFile: string | undefined;
165164

166165
if (kind === TsServerProcessKind.Syntax) {
167-
if (semver.gte(API.v400rc.fullVersionString, apiVersion.fullVersionString)) {
168-
args.push('--serverMode');
169-
args.push('partialSemantic');
170-
}
171-
else {
166+
if (apiVersion.gte(API.v401)) {
167+
args.push('--serverMode', 'partialSemantic');
168+
} else {
172169
args.push('--syntaxOnly');
173170
}
174171
}

extensions/typescript-language-features/src/utils/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export default class API {
3434
public static readonly v380 = API.fromSimpleString('3.8.0');
3535
public static readonly v381 = API.fromSimpleString('3.8.1');
3636
public static readonly v390 = API.fromSimpleString('3.9.0');
37-
public static readonly v400rc = API.fromSimpleString('4.0.0-rc');
3837
public static readonly v400 = API.fromSimpleString('4.0.0');
38+
public static readonly v401 = API.fromSimpleString('4.0.1');
3939

4040
public static fromVersionString(versionString: string): API {
4141
let version = semver.valid(versionString);

0 commit comments

Comments
 (0)