diff --git a/src/services/services.ts b/src/services/services.ts index fad7632843aaa..fcb5c696a38cf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -10,7 +10,7 @@ module ts { - export var servicesVersion = "0.5" + export var servicesVersion = "0.4" export interface Node { getSourceFile(): SourceFile; diff --git a/src/services/shims.ts b/src/services/shims.ts index 5b5216813fe40..759c1078d90fa 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -204,6 +204,8 @@ module ts { } export class LanguageServiceShimHostAdapter implements LanguageServiceHost { + private files: string[]; + constructor(private shimHost: LanguageServiceShimHost) { } @@ -230,10 +232,15 @@ module ts { public getScriptFileNames(): string[] { var encoded = this.shimHost.getScriptFileNames(); - return JSON.parse(encoded); + return this.files = JSON.parse(encoded); } public getScriptSnapshot(fileName: string): IScriptSnapshot { + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. + if (this.files && this.files.indexOf(fileName) < 0) { + return undefined; + } var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); } @@ -266,7 +273,10 @@ module ts { } public getDefaultLibFileName(options: CompilerOptions): string { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. + return ""; + //return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); } } @@ -662,6 +672,9 @@ module ts { "getEmitOutput('" + fileName + "')", () => { var output = this.languageService.getEmitOutput(fileName); + // Shim the API changes for 1.5 release. This should be removed once + // TypeScript 1.5 has shipped. + (output).emitOutputStatus = output.emitSkipped ? 1 : 0; return output; }); }