refactor(language-service): Return ts.CompletionInfo for getCompletionsAt() (#32116)

Part 3/3 of language-service refactoring:
Change all language service APIs to return TS value since Angular LS
will be a proper tsserver plugin. This reduces the need to transform
results among Angular <--> TS <--> LSP.

PR Close #32116
This commit is contained in:
Keen Yee Liau
2019-08-12 16:54:36 -07:00
committed by Andrew Kushnir
parent d6bbc4d76d
commit 5a562d8a0a
7 changed files with 124 additions and 143 deletions

View File

@ -498,3 +498,12 @@ function expandedAttr(attr: AttrInfo): AttrInfo[] {
function lowerName(name: string): string {
return name && (name[0].toLowerCase() + name.substr(1));
}
export function ngCompletionToTsCompletionEntry(completion: Completion): ts.CompletionEntry {
return {
name: completion.name,
kind: completion.kind as ts.ScriptElementKind,
kindModifiers: '',
sortText: completion.sort,
};
}