RefactoringEssentials icon indicating copy to clipboard operation
RefactoringEssentials copied to clipboard

Encountered exception when editing code

Open tanveerbadar opened this issue 7 years ago • 1 comments

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.SeparatedSyntaxList1.First() at async RefactoringEssentials.CSharp.CodeRefactorings.CheckDictionaryKeyValueCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>) at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)

tanveerbadar avatar Sep 25 '17 06:09 tanveerbadar

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.

CmdQ avatar Jan 09 '18 09:01 CmdQ