From d6decf82e1fde4a688b27f87e4c9a6b61e7c04d1 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 28 Jan 2015 00:13:28 -0800 Subject: [PATCH] Expose underlying program from the LS --- src/services/services.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/services/services.ts b/src/services/services.ts index 129d6d6289b..14f7afd52ca 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -914,6 +914,8 @@ module ts { getEmitOutput(fileName: string): EmitOutput; + getProgram(): Program; + getSourceFile(filename: string): SourceFile; dispose(): void; @@ -2075,6 +2077,12 @@ module ts { } } + function getProgram(): Program { + synchronizeHostData(); + + return program; + } + /** * Clean up any semantic caches that are not needed. * The host can call this method if it wants to jettison unused memory. @@ -5444,6 +5452,7 @@ module ts { getFormattingEditsAfterKeystroke, getEmitOutput, getSourceFile: getCurrentSourceFile, + getProgram }; }