refactor(language-service): Cleanup TypescriptHost (#32017)

Cleanup the logic in TypeScriptHost as to when langauge service state
should be synchronized with the editor state.

The model employed follows that of tsserver, in which case it is the
caller's responsiblity to synchronize host data before any LS methods
are called.

PR Close #32017
This commit is contained in:
Keen Yee Liau
2019-08-05 19:37:30 -07:00
committed by Andrew Kushnir
parent 7a75f7805c
commit 9808d91c62
6 changed files with 202 additions and 233 deletions

View File

@ -18,6 +18,7 @@ const projectHostMap = new WeakMap<tss.server.Project, TypeScriptServiceHost>();
export function getExternalFiles(project: tss.server.Project): string[]|undefined {
const host = projectHostMap.get(project);
if (host) {
host.getAnalyzedModules();
const externalFiles = host.getTemplateReferences();
return externalFiles;
}