roslyn: CSharpWrappingCodeRefactorProvider encountered an error and has been disabled
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] [regression] [worked-in:17.2 Preview 5.0]
System.ArgumentOutOfRangeException : 'end' must not be less than 'start'
Parameter name: end
at Microsoft.CodeAnalysis.Text.TextSpan.FromBounds(Int32 start,Int32 end)
at Microsoft.CodeAnalysis.CSharp.Wrapping.SeparatedSyntaxList.CSharpParameterWrapper.PositionIsApplicable(SyntaxNode root,Int32 position,SyntaxNode declaration,Boolean containsSyntaxError,BaseParameterListSyntax listSyntax)
at async Microsoft.CodeAnalysis.Wrapping.SeparatedSyntaxList.AbstractSeparatedSyntaxListWrapper`2.TryCreateComputerAsync[TListSyntax,TListItemSyntax]()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.Wrapping.AbstractWrappingCodeRefactoringProvider.ComputeRefactoringsAsync()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync()
Original Comments
Feedback Bot on 5/9/2022, 05:53 PM:
(private comment, text removed)
Original Solutions
(no solutions)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (10 by maintainers)
I recently hit this too while I think I was editing a bunch of a generic arguments. I don’t have a precise repro though.
@vatsalyaagrawal can we get somebody to investigate? We’ve already had a few hits of feedback and multiple bugs filed here too.
@Bosch-Eli-Black: so submitting stuff via the VS Feedback tool does collect additional logs; whether those logs are actually useful really depends on what the issue is. Performance issues with the feedback tool can attach ETW traces we can look at which can absolutely help. For outright crashes (i.e. not something like the yellow bar but VS outright crashing hard) it’ll also help with dumps or give us some pointers to crash reports that your machine recently submitted. We also made some recent improvements where we may be able to better capture memory dumps for things that trigger these yellow bars, so this might be somewhere we want to try using that as well. That said, for issues like this it often comes down to a repro being needed, or us staring at the code and trying to think where it might have gone wrong.
Otherwise, “hey, I think this happened when I was typing something like X” never hurts. And even just a “I’m hitting this a lot, anybody know why?” at least sometimes gets the right attention too. Sometimes bugs just get lost in triage or telemetry systems misprocess data and we don’t always notice until somebody goes and asks about a bug the old fashioned way.
same problem VS 2022 17.3.3
Error occours after typing <
@swerve-city Awesome. I repro the issue with that. Working on a fix now.
I am on version 17.2.5 and received the same error when following some general training.
Closed and tried again and the error appears when I highlight a method I was in the process of typing out. Doesn’t happen once I have the brackets in.
public void UpsertRecord<T>