remove unused cancellationToken class

This commit is contained in:
Mohamed Hegazy 2015-02-15 19:55:10 -08:00
parent bdd0bf341b
commit bbcdb61254

View File

@ -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<ScriptInfo> = {};
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);