Removing languageServiceEnabled check

After further discussion with the TS team, we determined that we do not need to stop sending  semantic commands when the language service disables itself
This commit is contained in:
Matt Bierner
2019-01-25 17:10:10 -08:00
parent ef25b181ea
commit a70b1317a1
2 changed files with 1 additions and 21 deletions

View File

@@ -22,9 +22,8 @@ export namespace ServerResponse {
}
export const NoContent = new class { readonly type = 'noContent'; };
export const LanguageServiceDisabled = new class { readonly type = 'languageServiceDisabled'; };
export type Response<T extends Proto.Response> = T | Cancelled | typeof NoContent | typeof LanguageServiceDisabled;
export type Response<T extends Proto.Response> = T | Cancelled | typeof NoContent;
}
export interface TypeScriptRequestTypes {

View File

@@ -619,25 +619,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType
private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise<ServerResponse.Response<Proto.Response>>;
private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise<ServerResponse.Response<Proto.Response>> | undefined {
const runningServerState = this.service();
if (!runningServerState.langaugeServiceEnabled) {
const nonSemanticCommands: string[] = [
'change',
'close',
'compilerOptionsForInferredProjects',
'configure',
'format',
'formatonkey',
'getOutliningSpans',
'open',
'projectInfo',
'reloadProjects',
];
if (nonSemanticCommands.indexOf(command) === -1) {
return Promise.resolve(ServerResponse.LanguageServiceDisabled);
}
}
return runningServerState.server.executeImpl(command, args, executeInfo);
}