dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.08k stars 4.04k forks source link

Rename Not Working in projected C# scenarios (Blazor Code) #44891

Closed vsfeedback closed 3 weeks ago

vsfeedback commented 4 years ago

This issue has been moved from a ticket on Developer Community.


Hi Team,

Using VS Community 2019 V16.6.0 on Windows 10, when creating and using Blazor WebAssembly App project template, in a Blazor component, I am not seeing the Rename refactoring option when I right click a variable or method name. But rename does work in JavaScript code in the same project.

Reproduce steps:

dotnet/aspnetcore#1. Create a new Blazor WebAssembly App project.

dotnet/aspnetcore#2. Add some codes in .razor file for example Index.razor and includes methods and variables.

dotnet/aspnetcore#3. move cursor to focus on the method's name or variable, then right-click it, you will not find the "Rename" option in the list.

If this is a potential issue, please fix it.

Thanks.


Original Comments

Visual Studio Feedback System on 6/3/2020, 00:22 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

NTaylorMullen commented 4 years ago

I verified that the rename option disapeared for Razor scenarios /cc @jasonmalinowski

To workaround this issue you can use hotkeys such as ctrl + r, ctrl + r to rename your items.

NTaylorMullen commented 4 years ago

Repro:

  1. Create a default Blazor app
  2. Open Counter.razor
  3. right click on currentCount
  4. See no rename option: image
iikuzmychov commented 1 year ago

Why after 2 years it still doesn't work correctly??

CyrusNajmabadi commented 1 year ago

@iiKuzmychov this is currently on the backlog. So this does not take priority over all the other work we have on our plates. If you'd like to contribute a fix here though, we'd help get that in!

CyrusNajmabadi commented 3 weeks ago

Closing out as this would be handled by razor.