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
18.85k stars 4.01k forks source link

Inline Rename with Multiple Carets #34903

Open KirillOsenkov opened 5 years ago

KirillOsenkov commented 5 years ago

Version Used: Dev16 RTM

Steps to Reproduce:

  1. New C# console app
  2. F2 on Program to enter Rename mode
  3. Cltr+Alt+Click twice inside the green identifier to have two carets
  4. Delete or type a character

Expected Behavior: Works

Actual Behavior: Exception

http://source.roslyn.io/#Microsoft.CodeAnalysis.EditorFeatures.Wpf/InlineRename/AbstractInlineRenameUndoManager.cs,51

Assumes a single caret

Bug found courtesy of @DavidKarlas

KirillOsenkov commented 5 years ago

@jasonmalinowski fun one!

jasonmalinowski commented 5 years ago

Dunno, the behavior you're seeing is what I'd expect would happen. 😛

KirillOsenkov commented 5 years ago

I've just discovered that this is a duplicate of https://github.com/dotnet/roslyn/issues/34866

sharwell commented 5 years ago

They are related, but not exactly a duplicate.