Skip to content

Commit 54a38a2

Browse files
Add check to ensure RC and forward use '--serverMode'. (microsoft#104123)
1 parent ddc794a commit 54a38a2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ 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';
2122

2223
const enum CompositeServerType {
2324
/** Run a single server that handles all commands */
@@ -163,7 +164,13 @@ export class TypeScriptServerSpawner {
163164
let tsServerLogFile: string | undefined;
164165

165166
if (kind === TsServerProcessKind.Syntax) {
166-
args.push('--syntaxOnly');
167+
if (semver.gte(API.v400rc.fullVersionString, apiVersion.fullVersionString)) {
168+
args.push('--serverMode');
169+
args.push('partialSemantic');
170+
}
171+
else {
172+
args.push('--syntaxOnly');
173+
}
167174
}
168175

169176
if (apiVersion.gte(API.v250)) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ 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');
3738
public static readonly v400 = API.fromSimpleString('4.0.0');
3839

3940
public static fromVersionString(versionString: string): API {

0 commit comments

Comments
 (0)