Please sign in to comment.
fix(language-service): Use ts.CompletionEntry for completions (#32375)
This is a prerequisite to fix a bug in template completions whereby completion of the string `ti` for the variable `title` results in `tititle`. This is because the position where the completion is requested is used to insert the completion text. This is incorrect. Instead, a `replacementSpan` should be used to indicate the span of text that needs to be replaced. Angular's own `Completion` interface is insufficient to hold this information. Instead, we should just use ts.CompletionEntry. Also added string enum for `CompletionKind`, which is similar to ts.ScriptElementKind but contains more info about HTML entities. PR Close #32375
- Loading branch information...
Showing with 138 additions and 134 deletions.
- +1 −43 integration/language_service_plugin/goldens/completionInfo.json
- +116 −68 packages/language-service/src/completions.ts
- +2 −2 packages/language-service/src/language_service.ts
- +18 −0 packages/language-service/src/types.ts
- +0 −17 packages/language-service/src/utils.ts
- +1 −4 packages/language-service/test/completions_spec.ts
Oops, something went wrong.