dotnet/roslyn

Renaming a global using alias does not update usages

Open

#74.474 aperta il 22 lug 2024

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)C# (4257 fork)batch import
Area-IDEBughelp wanted

Metriche repository

Star
 (20.414 star)
Metriche merge PR
 (Merge medio 6g 17h) (256 PR mergiate in 30 g)

Descrizione

Version Used: 17.11.0 Preview 3.0

Steps to Reproduce: Test1.cs

global using MyInteger = int; // Rename here…

Test2.cs

public class C {
  public MyInteger M() => 42; // …or here
}

Rename the MyInteger using alias in any of the two places.

Expected Behavior: The using alias should be updated in both places.

Actual Behavior: Only the using alias declaration is updated. This looks especially weird when you start the rename from the usage.

Guida contributor