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

Exception when trying to run the fix to "Dispose before re-assigning." #482

Open
JeremyMorton opened this issue Apr 14, 2023 · 0 comments
Open

Comments

@JeremyMorton
Copy link

JeremyMorton commented Apr 14, 2023

The code line with the issue:

          _goToAction = await GenerateActionAsync();
"Dispose before re-assigning." System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'Dispose before code gen failed for ExpressionStatement, write an issue so we can add support.')
  at IDisposableAnalyzers.DisposeBeforeAssignFix.DisposeBefore(DocumentEditor editor, ExpressionSyntax disposable, SyntaxNode location, CancellationToken cancellationToken)
  at IDisposableAnalyzers.DisposeBeforeAssignFix.DisposeBefore(DocumentEditor editor, ExpressionSyntax disposable, SyntaxNode location, CancellationToken cancellationToken)
  at Gu.Roslyn.CodeFixExtensions.DocumentEditorAction.GetChangedDocumentAsync(CancellationToken cancellationToken)
  at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(CancellationToken cancellationToken) in Z:\BuildAgent\work\3b7ce003563d6f8f\src\Workspaces\Core\Portable\CodeActions\CodeAction.cs:line 212
  at Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(CancellationToken cancellationToken) in Z:\BuildAgent\work\3b7ce003563d6f8f\src\Workspaces\Core\Portable\CodeActions\CodeAction.cs:line 183
  at Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(IProgressTracker progressTracker, CancellationToken cancellationToken) in Z:\BuildAgent\work\3b7ce003563d6f8f\src\Workspaces\Core\Portable\CodeActions\CodeAction.cs:line 195
  at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetOperationsCoreAsync(IProgressTracker progressTracker, CancellationToken cancellationToken) in Z:\BuildAgent\work\3b7ce003563d6f8f\src\Workspaces\Core\Portable\CodeActions\CodeAction.cs:line 153
  at JetBrains.Roslyn.Worker.Workspaces.Analyzers.CodeActionHelper.GetOperationsSafeAsync(CodeAction codeAction, CancellationToken cancellationToken)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant