Commit Graph

2 Commits

Author SHA1 Message Date
Keen Yee Liau f6e88cd659 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
2019-09-04 11:53:14 -07:00
Keen Yee Liau f8ad4d1e99 test(language-service): Improve integration test (#28168)
The current integration test for language service involves piping the
results of one process to another using Unix pipes.
This makes the test hard to debug, and hard to configure.

This commit refactors the integration test to use regular Jasmine
scaffolding.

More importantly, it tests the way the language service will actually
be installed by end users. Users would not have to add
`@angular/language-service` to the plugins section in tsconfig.json
Instead, all they need to do is install the *extension* from
the VS Code Marketplace and Angular Language Service will be loaded
as a global plugin.

PR Close #28168
2019-01-17 14:11:28 -08:00