refactor(language-service): Remove NgLSHost -> NgLS dependency (#31122)

```
NgLSHost: AngularLanguageServiceHost
NgLS: AngularLanguageService
```

NgLSHost should not depend on NgLS, because it introduces circular
dependency.
Instead, the `getTemplateAst` and `getTemplatAstAtPosition` methods should
be moved to NgLSHost and exposed as public methods.
This removes the circular dependency, and also removes the need for the
awkward 'setSite' method in NgLSHost.

PR Close #31122
This commit is contained in:
Keen Yee Liau
2019-06-18 16:55:53 -07:00
committed by Kara Erickson
parent c34abf2cbc
commit 4ec50811d4
10 changed files with 140 additions and 139 deletions

View File

@ -81,7 +81,6 @@ export function create(info: tss.server.PluginCreateInfo): ts.LanguageService {
const serviceHost = new TypeScriptServiceHost(info.languageServiceHost, oldLS);
const ls = createLanguageService(serviceHost);
serviceHost.setSite(ls);
projectHostMap.set(info.project, serviceHost);
proxy.getCompletionsAtPosition = function(