Skip to content

Commit 68fd9f8

Browse files
committed
Shim API changes to enable existing installations of VS to use the latest master builds
1 parent 369f784 commit 68fd9f8

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
module ts {
1212

13-
export var servicesVersion = "0.5"
13+
export var servicesVersion = "0.4"
1414

1515
export interface Node {
1616
getSourceFile(): SourceFile;

src/services/shims.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ module ts {
204204
}
205205

206206
export class LanguageServiceShimHostAdapter implements LanguageServiceHost {
207+
private files: string[];
208+
207209
constructor(private shimHost: LanguageServiceShimHost) {
208210
}
209211

@@ -230,10 +232,15 @@ module ts {
230232

231233
public getScriptFileNames(): string[] {
232234
var encoded = this.shimHost.getScriptFileNames();
233-
return JSON.parse(encoded);
235+
return this.files = JSON.parse(encoded);
234236
}
235237

236238
public getScriptSnapshot(fileName: string): IScriptSnapshot {
239+
// Shim the API changes for 1.5 release. This should be removed once
240+
// TypeScript 1.5 has shipped.
241+
if (this.files && this.files.indexOf(fileName) < 0) {
242+
return undefined;
243+
}
237244
var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName);
238245
return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot);
239246
}
@@ -266,7 +273,10 @@ module ts {
266273
}
267274

268275
public getDefaultLibFileName(options: CompilerOptions): string {
269-
return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
276+
// Shim the API changes for 1.5 release. This should be removed once
277+
// TypeScript 1.5 has shipped.
278+
return "";
279+
//return this.shimHost.getDefaultLibFileName(JSON.stringify(options));
270280
}
271281
}
272282

@@ -662,6 +672,7 @@ module ts {
662672
"getEmitOutput('" + fileName + "')",
663673
() => {
664674
var output = this.languageService.getEmitOutput(fileName);
675+
(<any>output).emitOutputStatus = output.emitSkipped ? 1 : 0;
665676
return output;
666677
});
667678
}

0 commit comments

Comments
 (0)