RefactoringEssentials
RefactoringEssentials copied to clipboard
Encountered exception when editing code
Following exception was thrown by an analyzer while editing code.
System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values.
Parameter name: index
at Microsoft.CodeAnalysis.SeparatedSyntaxList1.get_Item(Int32 index) at Microsoft.CodeAnalysis.SeparatedSyntaxList
1.First()
at async RefactoringEssentials.CSharp.CodeRefactorings.CheckDictionaryKeyValueCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
I also get this exception and was able to reproduce it. You can see it happening repeatedly in this video (sorry for the bad quality). It is triggered by typing the opening bracket.
The exception has the same stack trace, but for better readability here it comes formatted:
System.ArgumentOutOfRangeException : Specified argument was out of the range of valid values. Parameter name: index at Microsoft.CodeAnalysis.SeparatedSyntaxList`1.get_Item(Int32 index) at async RefactoringEssentials.CSharp.CodeRefactorings.CheckArrayIndexValueCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
Interesingly, it doesn't make a difference if I click “Enable” or “Enable and ignore future errors”. The yellow bar always comes back the next time I try it.