user3025289
user3025289

Reputation:

How to show references coming from HTML-Files (Angular-Templates) in TypeScript files within VSCode?

As you know you can enable the following settings in VSCode to see the references in the editor:

"typescript.implementationsCodeLens.enabled": true,
"javascript.referencesCodeLens.enabled": true

As you see in the image below there are no references (See the code below and the grey reference-info-text above method-name 'myOperations') 0 references)

enter image description here

But in reality, it exists! It exists within an angular template:

<div class="some-cool-class">
  <my-super-thing
    *ngIf="ifItIsCool"
    (operations)="myOperations($event)"
  >
  </my-super-thing>

Can I handle that somehow? How can I see the references (method calls) from templates too?

Upvotes: 11

Views: 1944

Answers (1)

msanford
msanford

Reputation: 12237

EDIT 26 Jan 2021 (from Johan Aspeling):

Seems to have finally been fixed with the new Ivy language service (used in Angular 11) Angular Language Service v11+

===

That feature is not supported in Angular's official language service.

There is an open issue to add it which is going completely ignored for over two years, and a second issue opened a year ago which is also being ignored.

Upvotes: 7

Related Questions