dotnet/roslyn

Renaming a nested type should offer to update filename using Outer.Inner.cs convention

Open

#60,054 opened on Mar 9, 2022

View on GitHub
 (3 comments) (1 reaction) (2 assignees)C# (4,257 forks)batch import
Area-IDEBugFeature - Renamehelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

Version Used: 17.2.0 Preview 3.0 [32308.589.main]

Steps to Reproduce:

Create a file Outer.Inner.cs containing:

partial class Outer
{
    class Inner {}
}

Invoke rename on the Inner symbol.

Notice that the rename dialog does not offer to rename the file.

image

Expected Behavior:

Renaming Inner to Foo also renames the source file to Outer.Foo.cs.

Equally, renaming Outer to Bar further renames the file to Bar.Foo.cs (and renames any other files with the same prefix that have corresponding nested types).

Equally files nested three or more levels deep should support this A.B.C.cs convention.

Actual Behavior:

Rename for the file is disabled.

Contributor guide