-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntroduceVariableCodeRefactoring Crash #38708
Comments
tagging @petrroll . Note: this may have been fixed already. |
Hit the same issue in VS16.4 Preview1.0 Select all text between public static void Method()
{
//>
var str = "<aaa";
} |
Hit the same issue on latest dogfood build. I will investigate. |
I can take a look at it on Friday if it proves to be more problematic to solve. |
Hmm, that doesn't seem to be the issue: http://source.roslyn.io/#Microsoft.CodeAnalysis.Features/CodeRefactoringHelpers.cs,34b38eefcd6d9c43 Can't immediately see how that can fail. The node's span isn't empty so That said, IIRC there should be an easier way (and faster) to get the first and last token of the Node (and then their respective parents). And switching to that solution might fix the issue as byproduct. |
Just hit this one with VisualStudio.16.Preview/16.4.0-pre.1.0+29319.158 |
And here is a repro: class Program
{
static void Main()
{
Main();
}
} Select the semicolon only, either by double-clicking it or using keyboard. |
I have found the issue and have a fix ready, PR in an hour or so. |
The selection here appears to be a little finicky, it need to be in the middle of some kind of nested expression, I think? Here's a screenshot of my selection:
As far as I can tell, the offer to rename the method is unrelated, it's just showing that as I was simplifying my repro.
Raw code as well:
VS Version 29312.127 Int Preview
The text was updated successfully, but these errors were encountered: