-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): provide folding ranges for inline templates #1779
Conversation
6c311b8
to
b2ec117
Compare
To support legacy view engine, we install an old version of the language server into the vsix.
The esbuild configuration is now managed in the BUILD.bazel rules.
b2ec117
to
67f4fe7
Compare
Following the embedded language support documentation, this commit provides folding ranges for inline templates in typescript files. This feature is provided in the language server so other editors that use the @angular/language-server package can make use of the feature as well. https://code.visualstudio.com/api/language-extensions/embedded-languages fixes angular#852
67f4fe7
to
9783009
Compare
@ivanwonder Would you mind reviewing this change? |
Ok, I will review this soon. |
return classDeclNode; | ||
} | ||
|
||
export function findAllMatchingNodes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this can be moved into NgLanguageService
(for example, getAllComponentLocationsInFile
), and reused for styles
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, we maybe need this.🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some tests. Good thought.
As for moving it to the NgLanguageService
, I do like the idea in general. Let's do it as a follow-up refactor? We do pretty much have these exact functions: https://github.com/angular/angular/blob/54e32dad3e130a64e0c312746b67229d8aeb785c/packages/language-service/src/language_service.ts#L594-L598
I don't know what exactly we'd want to expose as public API though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Let's do it in the follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, this should be a really useful feature!
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Following the embedded language support documentation, this commit provides folding ranges for inline templates in typescript files. This feature is provided in the language server so other editors that use the @angular/language-server package can make use of the feature as well.
https://code.visualstudio.com/api/language-extensions/embedded-languages
fixes #852