diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 4f23e9a7c14..7a055b77eac 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -72,34 +72,12 @@ module ts.server { } } - export class CancellationToken { - public static None = new CancellationToken(); - - requestPending = false; - - constructor() { - } - - cancel() { - this.requestPending = true; - } - - reset() { - this.requestPending = false; - } - - public isCancellationRequested() { - var temp = this.requestPending; - return temp; - } - } - export class LSHost implements ts.LanguageServiceHost { ls: ts.LanguageService = null; compilationSettings: ts.CompilerOptions; filenameToScript: ts.Map = {}; - constructor(public host: ServerHost, public project: Project, private cancellationToken: CancellationToken = CancellationToken.None) { + constructor(public host: ServerHost, public project: Project) { } getDefaultLibFileName() { @@ -107,14 +85,6 @@ module ts.server { return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilationSettings)); } - cancel() { - this.cancellationToken.cancel(); - } - - reset() { - this.cancellationToken.reset(); - } - getScriptSnapshot(filename: string): ts.IScriptSnapshot { var scriptInfo = this.getScriptInfo(filename); if (scriptInfo) { @@ -154,10 +124,6 @@ module ts.server { return this.getScriptInfo(filename).svc.latestVersion().toString(); } - getCancellationToken(): ts.CancellationToken { - return this.cancellationToken; - } - getCurrentDirectory(): string { return ""; } @@ -736,7 +702,6 @@ module ts.server { } export class CompilerService { - cancellationToken = new CancellationToken(); host: LSHost; languageService: ts.LanguageService; classifier: ts.Classifier; @@ -745,7 +710,7 @@ module ts.server { formatCodeOptions: ts.FormatCodeOptions = CompilerService.defaultFormatCodeOptions; constructor(public project: Project) { - this.host = new LSHost(project.projectService.host, project, this.cancellationToken); + this.host = new LSHost(project.projectService.host, project); // override default ES6 (remove when compiler default back at ES5) this.settings.target = ts.ScriptTarget.ES5; this.host.setCompilationSettings(this.settings);