_This issue has been moved from a ticket on Developer Community._
The following refactoring providers crashes when I try to type a [ before a function argument with almost the same stacktrace:
Stacktrace (I just put one as an example since all are the same down to at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringContextExtensions.TryGetRelevantNodeAsync[TSyntaxNode](<Unknown Parameters>):
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.Shared.Extensions.SyntaxNodeExtensions.GetInitialToken(SyntaxNode root,Int32 position,Boolean includeSkipped,Boolean includeDirectives,Boolean includeDocumentationComments)
at Microsoft.CodeAnalysis.Shared.Extensions.SyntaxNodeExtensions.FindTokenOnRightOfPosition(SyntaxNode root,Int32 position,Boolean includeSkipped,Boolean includeDirectives,Boolean includeDocumentationComments)
at Microsoft.CodeAnalysis.LanguageServices.AbstractSyntaxFactsService.GetStartOfNodeExcludingAttributes(SyntaxNode node)
at Microsoft.CodeAnalysis.LanguageServices.AbstractSyntaxFactsService.IsOnHeader[THoleSyntax](Int32 position,SyntaxNode ownerOfHeader,SyntaxNodeOrToken lastTokenOrNodeOfHeader,ImmutableArray`1 holes)
at Microsoft.CodeAnalysis.LanguageServices.AbstractSyntaxFactsService.IsOnHeader(Int32 position,SyntaxNode ownerOfHeader,SyntaxNodeOrToken lastTokenOrNodeOfHeader)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxFactsService.IsOnParameterHeader(SyntaxNode root,Int32 position,SyntaxNode& parameter)
at Microsoft.CodeAnalysis.CodeRefactorings.AbstractRefactoringHelpersService`2. <ExtractNodesInHeader>d__7.MoveNext()
at System.Linq.Enumerable. <OfTypeIterator>d__95`1.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Microsoft.CodeAnalysis.CodeRefactorings.AbstractRefactoringHelpersService`2.AddNonHiddenCorrectTypeNodes[TSyntaxNode](IEnumerable`1 nodes,ArrayBuilder`1 resultBuilder,CancellationToken cancellationToken)
at async Microsoft.CodeAnalysis.CodeRefactorings.AbstractRefactoringHelpersService`2.GetRelevantNodesAsync[TExpressionSyntax,TArgumentSyntax,TSyntaxNode](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringContextExtensions.GetRelevantNodesAsync[TSyntaxNode](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringContextExtensions.TryGetRelevantNodeAsync[TSyntaxNode](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.ReplacePropertyWithMethods.AbstractReplacePropertyWithMethodsService`5.GetPropertyDeclarationAsync[TIdentifierNameSyntax,TExpressionSyntax,TCrefSyntax,TStatementSyntax,TPropertySyntax]( <Unknown Parameters>)
at async Microsoft.CodeAnalysis.ReplacePropertyWithMethods.ReplacePropertyWithMethodsCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.
(no solutions)
馃摑 This is very similar to #38502, but this issue was reported with version 16.3.5, which is newer than the version where this was supposed to be fixed.
It was me that added this issue to Visual Studio Feedback, so if there is anything just notfiy me!
Thanks for reporting @dozer75 . I verified this reproduces on 16.3 but is fixed in 16.4 preview 2. If this is causing issue you can upgrade to the preview channel, or just wait for 16.4 to release out of preview.
Also, thanks for the comments on repro steps and clear report. It makes my life much easier :)
@ryzngard Can you set the specific milestone for this issue and update #39775 to match?
Most helpful comment
It was me that added this issue to Visual Studio Feedback, so if there is anything just notfiy me!