Skip to content

F2 Rename Apply is inconsistent #54918

@kzrnm

Description

@kzrnm

Version Used:

  • Microsoft Visual Studio Community 2019 Version 16.10.3
  • Microsoft Visual Studio Community 2022 Preview Version 17.0.0 Preview 2.0

Steps to Reproduce:

  1. Create a project like below.
  2. Open Project/RenameFile.csproj.
  3. Focus Program in Source/Program.cs
  4. Press F2 Rename
  5. Check Rename symbol's file
  6. Rename class name
  7. Do
    • Press Enter key
    • Click Apply button

Expected Behavior:

After pressing Enter key or clicking Apply button, an error will be thrown.

Actual Behavior:

After clicking Apply button, an error will be thrown.
After pressing Enter key, a line break will be added.

RenameFile.-.Microsoft.Visual.Studio.Preview.2021-07-20.00-29-59.mp4

file tree

.
├── Project
│   └── RenameFile.csproj
└── Source
    └── Program.cs

Project/RenameFile.csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Library</OutputType>
    <TargetFramework>net5.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="../Source/Program.cs" />
  </ItemGroup>
</Project>

Source/Program.cs

class Program { }

Metadata

Metadata

Assignees

Labels

Area-IDEBugFeature - Renamehelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

Status

Completed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions