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

SA1626 Fix All in Solution appears to throw an exception #1997

Closed
sharwell opened this issue Dec 23, 2015 · 2 comments
Closed

SA1626 Fix All in Solution appears to throw an exception #1997

sharwell opened this issue Dec 23, 2015 · 2 comments
Assignees
Labels

Comments

@sharwell
Copy link
Member

I'm working with DanTup.DartVS.sln from the recently added churn tests, and ran StyleCopTester with /id:SA1626 /fixall. I haven't yet tracked down the cause.

The fix 'SA1626CodeFixProvider' threw an exception after 15ms:
System.ArgumentException: The changes must be ordered and not overlapping.
Parameter name: changes
   at Microsoft.CodeAnalysis.Text.SourceText.WithChanges(IEnumerable`1 changes)
   at StyleCop.Analyzers.DocumentationRules.SA1626CodeFixProvider.FixAll.<FixAllInDocumentAsync>d__5.MoveNext() in J:\dev\github\sharwell\StyleCopAnalyzers\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\DocumentationRules\SA1626CodeFixProvider.cs:line 89
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at StyleCop.Analyzers.Helpers.DocumentBasedFixAllProvider.<GetSolutionFixesAsync>d__5.MoveNext() in J:\dev\github\sharwell\StyleCopAnalyzers\StyleCop.Analyzers\StyleCop.Analyzers.CodeFixes\Helpers\DocumentBasedFixAllProvider.cs:line 107
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.<ComputeOperationsAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.<GetOperationsCoreAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.<GetOperationsAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at StyleCopTester.CodeFixEquivalenceGroup.<GetOperationsAsync>d__23.MoveNext() in J:\dev\github\sharwell\StyleCopAnalyzers\StyleCop.Analyzers\StyleCopTester\CodeFixEquivalenceGroup.cs:line 141
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at StyleCopTester.Program.<TestFixAllAsync>d__3.MoveNext() in J:\dev\github\sharwell\StyleCopAnalyzers\StyleCop.Analyzers\StyleCopTester\Program.cs:line 198
@sharwell
Copy link
Member Author

⚠️ I only see this occurring with #1983 merged, and even then only when using Roslyn 1.0.

@sharwell
Copy link
Member Author

This was caused by a bug in #1983, and was corrected in 5fa8d69.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant