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

Only attribute parameter in un-ended function crashes refactorings #37837

Closed
petrroll opened this issue Aug 8, 2019 · 1 comment
Closed

Only attribute parameter in un-ended function crashes refactorings #37837

petrroll opened this issue Aug 8, 2019 · 1 comment
Assignees

Comments

@petrroll
Copy link
Contributor

petrroll commented Aug 8, 2019

using System;
public class Class1
{
    static void foo(result:[Test]$$
    {

    }
}

Moving caret to $$ position crashes bunch of refactorings.

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.LanguageServices.AbstractSyntaxFactsService.IsOnHeader[THoleSyntax](Int32 position,SyntaxNode ownerOfHeader,SyntaxNodeOrToken lastTokenOrNodeOfHeader,ImmutableArray`1 holes)
   at Microsoft.CodeAnalysis.LanguageServices.AbstractSyntaxFactsService.IsOnHeader(Int32 position,SyntaxNode ownerOfHeader,SyntaxNodeOrToken lastTokenOrNodeOfHeader)
   at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxFactsService.IsOnParameterHeader(SyntaxNode root,Int32 position,SyntaxNode& parameter)
   at Microsoft.CodeAnalysis.CodeRefactorings.AbstractRefactoringHelpersService`2.<ExtractNodesInHeader>d__7.MoveNext()
   at System.Linq.Enumerable.<OfTypeIterator>d__95`1.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
@petrroll petrroll self-assigned this Aug 8, 2019
petrroll added a commit to petrroll/roslyn that referenced this issue Aug 8, 2019
petrroll added a commit to petrroll/roslyn that referenced this issue Aug 8, 2019
petrroll added a commit that referenced this issue Aug 9, 2019
@petrroll
Copy link
Contributor Author

petrroll commented Aug 9, 2019

Fixed in #37838

@petrroll petrroll closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant