Skip to content

Commit

Permalink
Renames
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Jun 21, 2019
1 parent fd245fc commit 5fc7a8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions extensions/typescript-language-features/src/tsServer/spanwer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ export class TypeScriptServerSpawner {
pluginManager: PluginManager
): ITypeScriptServer {
if (this.shouldUseSeparateSyntaxServer(version)) {
const syntaxServer = this.spawnProcessBasedTsServer('syntax', version, configuration, pluginManager, ['--syntaxOnly', '--disableAutomaticTypingAcquisition']);
const semanticServer = this.spawnProcessBasedTsServer('semantic', version, configuration, pluginManager, []);
const syntaxServer = this.spawnTsServer('syntax', version, configuration, pluginManager, ['--syntaxOnly', '--disableAutomaticTypingAcquisition']);
const semanticServer = this.spawnTsServer('semantic', version, configuration, pluginManager, []);
return new SyntaxRoutingTsServer(syntaxServer, semanticServer);
}

return this.spawnProcessBasedTsServer('main', version, configuration, pluginManager, []);
return this.spawnTsServer('main', version, configuration, pluginManager, []);
}

private shouldUseSeparateSyntaxServer(version: TypeScriptVersion): boolean {
if (!version.version || version.version.lt(API.v340)) {
if (!version.apiVersion || version.apiVersion.lt(API.v340)) {
return false;
}
return vscode.workspace.getConfiguration('typescript')
.get<boolean>('experimental.useSeparateSyntaxServer', false);
}

private spawnProcessBasedTsServer(
private spawnTsServer(
serverId: string,
version: TypeScriptVersion,
configuration: TypeScriptServiceConfiguration,
pluginManager: PluginManager,
extraForkArgs: readonly string[],
): ITypeScriptServer {
const apiVersion = version.version || API.defaultVersion;
const apiVersion = version.apiVersion || API.defaultVersion;

const { args, cancellationPipeName, tsServerLogFile } = this.getTsServerArgs(configuration, version, apiVersion, pluginManager);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
currentVersion = this.versionPicker.currentVersion;
}

const apiVersion = this.versionPicker.currentVersion.version || API.defaultVersion;
const apiVersion = this.versionPicker.currentVersion.apiVersion || API.defaultVersion;
this.onDidChangeTypeScriptVersion(currentVersion);

let mytoken = ++this.token;
Expand Down Expand Up @@ -353,7 +353,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
handle.onEvent(event => this.dispatchEvent(event));

this._onReady!.resolve();
this._onTsServerStarted.fire(currentVersion.version);
this._onTsServerStarted.fire(currentVersion.apiVersion);

if (apiVersion.gte(API.v300)) {
this.loadingIndicator.startedLoadingProject(undefined /* projectName */);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export class TypeScriptVersion {
}

public get isValid(): boolean {
return this.version !== undefined;
return this.apiVersion !== undefined;
}

public get version(): API | undefined {
public get apiVersion(): API | undefined {
const version = this.getTypeScriptVersion(this.tsServerPath);
if (version) {
return version;
Expand All @@ -46,7 +46,7 @@ export class TypeScriptVersion {
}

public get versionString(): string {
const version = this.version;
const version = this.apiVersion;
return version ? version.versionString : localize(
'couldNotLoadTsVersion', 'Could not load the TypeScript version at this path');
}
Expand Down

0 comments on commit 5fc7a8c

Please sign in to comment.