Vscode-ng-language-service: [Feature Request] Rename variables in template

Created on 18 May 2018  路  7Comments  路  Source: angular/vscode-ng-language-service

I don't know if this is even something that VS Code could allow, but it would nice if you could refactor variables names in template, either right in the template, or in the component code. Both ways should update each other.

some.component.html

Hello {{ world }}

some.component.ts

...
@Component(
...
)
class SomeComponent {
  world; // <-- rename to `people` should update also in the html template
}

Renaming can be triggered with F2, and it currently updates any references to that symbol, but references in Angular template.

feature lib

Most helpful comment

In the same way, using Shift + F12 to find references from the component code should also show those of the template.

All 7 comments

In the same way, using Shift + F12 to find references from the component code should also show those of the template.

IntelliJ has this feature too.

Yeah IntelliJ works, every time all the time. Great product.

@ikilinc @kresdjan How do your comments refer to the Visual Code extension feature request?

@tomaszs

I dont know exactly which part of angular have to implement it so that it works. I thought its the language service.

Perhaps VS Code do not support such kind of editing, it would be cool to see this, also because IntelliJ can this, and best editor in this world dont.

It is the language service鈥檚 issue. We are happy to track it here, since many people see issues with the language service by using the extension.

@ikilinc @kresdjan

Intellij is an IDE. This is a text editor. That's like comparing a Chevy and a Mustang because you can take a ride in both.

Was this page helpful?
0 / 5 - 0 ratings