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(language-service): TS references from template items #37437
Conversation
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.
Did you mean to not expose this for now?
We'll need to make getReferencesAtPosition
part of the plugin for it to be externally available.
angular/packages/language-service/src/ts_plugin.ts
Lines 90 to 101 in c8f7fc2
const proxy: tss.LanguageService = Object.assign( | |
// First clone the original TS language service | |
{}, tsLS, | |
// Then override the methods supported by Angular language service | |
{ | |
getCompletionsAtPosition, | |
getQuickInfoAtPosition, | |
getSemanticDiagnostics, | |
getDefinitionAtPosition, | |
getDefinitionAndBoundSpan, | |
}); | |
return proxy; |
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 for bazel build change! (as always 😄 )
I think it's okay to expose it in this package, it doesn't need to be known by the VSCode extension until it's in a more useful state IMO. |
Keen and I were talking about what it would take to support getting references at a position in the current language service, since it's unclear when more investment in the Ivy LS will be available. Getting TS references from a template is trivial -- we simply need to get the definition of a symbol, which is already handled by the language service, and ask the TS language service to give us the references for that definition. This doesn't handle references in templates, but that could be done in a subsequent pass. Part of angular/vscode-ng-language-service#29
c2e7c3e
to
335ea03
Compare
}); | ||
}); | ||
|
||
// TODO: override parsing-cases#TemplateReference for inline templates. |
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.
This'd be nice, TemplateReference
already has an external template 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.
yeah but we can just overwrite and replace templateUrl
Keen and I were talking about what it would take to support getting references at a position in the current language service, since it's unclear when more investment in the Ivy LS will be available. Getting TS references from a template is trivial -- we simply need to get the definition of a symbol, which is already handled by the language service, and ask the TS language service to give us the references for that definition. This doesn't handle references in templates, but that could be done in a subsequent pass. Part of angular/vscode-ng-language-service#29 PR Close #37437
) Keen and I were talking about what it would take to support getting references at a position in the current language service, since it's unclear when more investment in the Ivy LS will be available. Getting TS references from a template is trivial -- we simply need to get the definition of a symbol, which is already handled by the language service, and ask the TS language service to give us the references for that definition. This doesn't handle references in templates, but that could be done in a subsequent pass. Part of angular/vscode-ng-language-service#29 PR Close angular#37437
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. |
) Keen and I were talking about what it would take to support getting references at a position in the current language service, since it's unclear when more investment in the Ivy LS will be available. Getting TS references from a template is trivial -- we simply need to get the definition of a symbol, which is already handled by the language service, and ask the TS language service to give us the references for that definition. This doesn't handle references in templates, but that could be done in a subsequent pass. Part of angular/vscode-ng-language-service#29 PR Close angular#37437
Keen and I were talking about what it would take to support getting
references at a position in the current language service, since it's
unclear when more investment in the Ivy LS will be available. Getting TS
references from a template is trivial -- we simply need to get the
definition of a symbol, which is already handled by the language
service, and ask the TS language service to give us the references for
that definition.
This doesn't handle references in templates, but that could be done in a
subsequent pass.
Part of angular/vscode-ng-language-service#29
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?