Commit Graph

8 Commits

Author SHA1 Message Date
ayazhafiz a391aebbcf feat(language-service): add definitions for styleUrls (#32464)
Adds support for `styleUrls` definitions in the same way `templateUrl`
definitions are provided; clicking on styleUrl will take a user to the
respective file.

Unifies some code in determining a URL definition. We first check if a
url is a `templateUrl`; if it's not, we check that it's a `styleUrl` or
return no definitions.

PR Close #32464
2019-09-09 16:04:14 -04:00
ayazhafiz 46caf88b2c feat(language-service): add definitions for templateUrl (#32238)
Adds support for `getDefinitionAt` when called on a templateUrl
property assignment.

The currrent architecture for getting definitions is designed to be
called on templates, so we have to introduce a new
`getTsDefinitionAndBoundSpan` method to get Angular-specific definitions
in TypeScript files and pass a `readTemplate` closure that will read the
contents of a template using `TypeScriptServiceHost#getTemplates`. We
can probably go in and make this nicer in a future PR, though I'm not
sure what the best architecture should be yet.

Part of angular/vscode-ng-language-service#111

PR Close #32238
2019-08-28 17:09:46 -07:00
Keen Yee Liau 9e6c677135 test(language-service): Remove test for external template (#32017)
The tsserver is not meant to handle HTML files, so there is no point
sending an "open" request. The existing test is wrong because the
quickinfo returns "const name: never", which should be
"(property) WidgetComponent.name"

PR Close #32017
2019-08-14 11:57:48 -07:00
Keen Yee Liau 6dc884f2ab test(language-service): Load language service from tsconfig (#30153)
This PR changes the integration test to load language service the way it would be loaded in the editor.
If the language service is specified in tsconfig, it'd only be loaded for Angular projects.
Specifying it as `globalPlugins` loads it unconditionally whenever tsserver is brought up.

PR Close #30153
2019-04-29 13:28:18 -07:00
Keen Yee Liau 05eabb19d6 test(language-service): Add external template (#30128)
This is in preparation for more rigorous testing of external templates, since it'll work differently under the new tsserver plugin model.

PR Close #30128
2019-04-29 13:27:38 -07:00
Keen Yee Liau f4916730b5 feat(language-service): Implement `definitionAndBoundSpan` (#30125)
This PR adds the implementation for `definitionAndBoundSpan` because
it's now preferred over `definition`. vscode would send this new request
for `Go to definition`. As part of this PR the implementation for
`definition` is refactored and simplified. Goldens for both methods are
checked in.

PR Close #30125
2019-04-29 13:27:01 -07:00
Keen Yee Liau 017bf0b794 test(language-service): Add tests for quickinfo and definition (#29990)
`quickinfo` is used for hover tooltip.
`definition` is used for "Go to definition".

PR Close #29990
2019-04-19 19:28:46 -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