Skip to content
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

CSharpIntroduceParameterCodeRefactoringProvider encountered an error and has been disabled #73304

Closed
vsfeedback opened this issue May 2, 2024 · 2 comments
Assignees
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] [regression] [worked-in:17.9.6]
Randomly pops up when editing .cs files

System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
at Microsoft.CodeAnalysis.SeparatedSyntaxList1.InsertRange(Int32 index,IEnumerable1 nodes)
at Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider5.IntroduceParameterDocumentRewriter.AddArgumentToArgumentList(SeparatedSyntaxList1 invocationArguments,SyntaxNode newArgumentExpression,String parameterName,Int32 insertionIndex,Boolean named)
at Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider5.IntroduceParameterDocumentRewriter.<>c__DisplayClass17_0. <ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync>g__GenerateNewArgumentListSyntaxForTrampoline|0(Compilation compilation,SemanticModel invocationSemanticModel,Dictionary2 parameterToArgumentMap,SyntaxNode currentArgumentListSyntax,SyntaxNode argumentListSyntax,SyntaxNode invocation,ImmutableArray1 validParameters,String parameterName,String newMethodIdentifier,Int32 insertionIndex,CancellationToken cancellationToken) at Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider5.IntroduceParameterDocumentRewriter.<>c__DisplayClass17_2. b__1(SyntaxNode currentArgumentListSyntax,SyntaxGenerator _)
at Microsoft.CodeAnalysis.Editing.SyntaxEditor.ReplaceChange.Apply(SyntaxNode root,SyntaxNode currentNode,SyntaxGenerator generator)
at Microsoft.CodeAnalysis.Editing.SyntaxEditor.GetChangedRoot()
at async Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider5.IntroduceParameterDocumentRewriter.ModifyDocumentInvocationsTrampolineOverloadAndIntroduceParameterAsync[TExpressionSyntax,TInvocationExpressionSyntax,TObjectCreationExpressionSyntax,TIdentifierNameSyntax,TArgumentSyntax](<Unknown Parameters>) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider5.IntroduceParameterDocumentRewriter.RewriteDocumentAsyncTExpressionSyntax,TInvocationExpressionSyntax,TObjectCreationExpressionSyntax,TIdentifierNameSyntax,TArgumentSyntax
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.IntroduceParameter.AbstractIntroduceParameterCodeRefactoringProvider`5.IntroduceParameterAsyncTExpressionSyntax,TInvocationExpressionSyntax,TObjectCreationExpressionSyntax,TIdentifierNameSyntax,TArgumentSyntax
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputePreviewOperationsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.PreviewChangesSuggestedAction.CreateAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.GetPreviewChangesFlavorAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.CreateAllFlavorsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsyncT


Original Comments

Feedback Bot on 4/26/2024, 01:05 AM:

(private comment, text removed)

Wenwen Fan [MSFT] on 4/28/2024, 04:26 AM:

(private comment, text removed)

Tim Sirmovics on 4/29/2024, 06:12 PM:

(private comment, text removed)

Feedback Bot on 4/30/2024, 00:27 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 2, 2024
@genlu genlu added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels May 2, 2024
@genlu genlu added this to the 17.11 milestone May 2, 2024
@TimSirmovics
Copy link

A small error in the report, it says worked-in:17.9.6 but that is actually the version I am reporting it from.
It does not work in 17.9.6.

@akhera99
Copy link
Member

akhera99 commented May 8, 2024

I believe this was fixed in #72191, which should be in 17.10 Preview 2

@akhera99 akhera99 closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants