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
Feature request: Get references in template (getReferencesAtPosition) #29
Comments
This would also enabling symbols in templates (i.e. using F2) |
Someone is doing something with this?! |
anything new? |
We should be able to implement this by adding (note: perhaps we can use the Angular indexing API or similar for this) |
It had different name Feature request: Find usages shows also occurencies in templates as you can see but it was changed by @kyliau So you have to make agreement with him :). |
4 years?) I wonder how WebStorm got this faster than VScode O_o |
This would be a great feature. Is there any timeline or priority on this? I think this issue also relates to #252 |
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
We hear you! @ayazhafiz and I are thinking about ways to support this in Angular language service. @ayazhafiz already has a PR ready that partially* supports this feature. Re partial support: |
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
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 #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
I would be very thankful for every process. |
Any news on this? Seems the PR wasn't merged |
) 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
Really excited about this feature, is there any news about it ? |
We are going to launch Ivy version of the language service in version 11 (November 2020). Once it's achieve feature parity with the existing View Engine language service, we'll prioritize this feature! Switching to the Ivy backend enables us to implement features like this one, which was almost impossible previously. |
This has been fixed by the new Ivy-native language service, released in v11.1.0. |
Should we be seeing the correct # of references via CodeLens too? Because Ctrl-Click / Find all References does work, but codelens references and a click on it does not show template refs. I'm assuming that CodeLens pulls these refs from somewhere else, or am I missing a config flag somewhere? |
Great question! It looks like there's additional configuration needed on our end for integrating with CodeLens. Could you open a new issue for this? Edit: Re-opening #162 |
@atscott @ic3guy Guys am I missing something, or is there something weird with configuration of project :)? Because i tried it in my own project and it does not work, I even tried latest version of Angular cli, generated new project, there is Thx |
@atscott hmmm i have looked at it and i found out, that it needs to be turned on, but if i turn it on, it keeps crashing and restarting, should i open new issue or paste it here :) ? |
Hey guys, I couldn't get it to work. What do I need to do? Do I need to enable any option? |
@erosostolato if you have installed language server and vscode extensions for angular then in user preferences you can find Angular: Experimental-ivy, if you enable it it should start working, in my case it is crashing, i need to create new issue for it |
If i saw it correctly, what should be working so far is only getting correct number of references in templates :), renaming is feature that i saw in Angular 12 beta.0 so it is not working, because it is still not there :), but it should be soon :). |
Codelens also needs some work, so only find all references should be working, but still there is some problem in my project because if i turn it on, it crashes :). |
FYI - renaming for Angular is only available in external templates. There is now way to ensure that the Angular extension is used in TypeScript files so we opted to disable it there. See microsoft/vscode#115354. If you would like this feature, it could be worth upvoting the vscode issue so it gets prioritized sooner. |
In reference to Codelens, there is no way to augment those results with ours. We can consider providing our own, separate lens in addition to the typescript one that could say something like “# references in templates” but we can’t include our results in the same one that’s already there. |
@atscott I liked the idea of having “# references in templates”. That could work as a notice for the developer that wants to rename a variable, so he can go to the template and rename it from there. |
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. |
Hi,
as for now you can navigate to source by ctrl+click, or peek definition, but if you use find all usages template occurencies on methods or properties are not in result window.
This would be awesome, but i`m not sure that this is possible to do in VsCode, but it would be nice :). Especially while refactoring code, since right now this occurencies can be forgotten or must be string searched.
Thank you
The text was updated successfully, but these errors were encountered: