Is this a R# issue?
I'm currentl yworking with Visual Studio 2019 16.4 Preview 2 (Enterprie Edition) and R# 2019.2.3. While working on the source code i get the following message some times:

The stack trace is the following:
System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: position
at Microsoft.CodeAnalysis.SyntaxNode.FindTokenCore(Int32 position,Boolean findInsideTrivia)
at Microsoft.CodeAnalysis.CodeRefactoringHelpers.IsNodeUnderselected(SyntaxNode node,TextSpan selection)
at async Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceVariableService`6.State.TryInitializeAsync[TService,TExpressionSyntax,TTypeSyntax,TTypeDeclarationSyntax,TQueryExpressionSyntax,TNameSyntax](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceVariableService`6.State.GenerateAsync[TService,TExpressionSyntax,TTypeSyntax,TTypeDeclarationSyntax,TQueryExpressionSyntax,TNameSyntax](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.IntroduceVariable.AbstractIntroduceVariableService`6.IntroduceVariableAsync[TService,TExpressionSyntax,TTypeSyntax,TTypeDeclarationSyntax,TQueryExpressionSyntax,TNameSyntax](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.IntroduceVariable.IntroduceVariableCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
Is this an issue of R# or Visual Studio?
Regards
Andreas
Please sign in to leave a comment.
Hello Andreas,
This happens to be Roslyn issue - http://source.roslyn.io/#Microsoft.CodeAnalysis.Features/IntroduceVariable/IntroduceVariableCodeRefactoringProvider.cs
Please refer to the reported issue - https://github.com/dotnet/roslyn/issues/39293.
Thank you.
Hello Angelina,
thank you for clarifiaction.
Regards
Andreas