refactor(language-service): Create ng.CompletionEntry to replace ts.CompletionEntry (#33379)
It is messy to keep casting `CompletionEntry.kind` from `ng.CompletionKind` to `ts.ScriptElementKind`. Instead, create a new type `ng.CompletionEntry` that is exactly the same as `ts.CompletionEntry`, but with the `kind` type overridden to `ng.CompletionKind`. This way, we only have to cast it once, and can do so in a safe manner. PR Close #33379
This commit is contained in:

committed by
Andrew Kushnir

parent
b00189bb9a
commit
73530a9e25
@ -70,7 +70,8 @@ class LanguageServiceImpl implements LanguageService {
|
||||
isGlobalCompletion: false,
|
||||
isMemberCompletion: false,
|
||||
isNewIdentifierLocation: false,
|
||||
entries: results,
|
||||
// Cast CompletionEntry.kind from ng.CompletionKind to ts.ScriptElementKind
|
||||
entries: results as unknown as ts.CompletionEntry[],
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user