Skip to content

Incremental parsing producing an invalid tree #47610

@sharwell

Description

@sharwell

Version Used: 8adbb93

Steps to Reproduce:

Run the test CSharpCompletionCommandHandlerTests.LocalFunctionAttributeNamedPropertyCompletionCommitWithTab and wait for an assertion failure in SyntaxTreeExtensions.VerifySource.

The test attempts to apply this change and incrementally parse the result:

 
 class MyAttribute : System.Attribute
 {
     public string Name { get; set; }
 }
 
 public class Goo
 {
     void M()
     {
-        [MyAttribute(Nam
+        [MyAttribute(Name =
         void local1() { }
     }
 }
                             

Expected Behavior:

The full text of the CompilationUnitSyntax should match this original SyntaxTree text:


class MyAttribute : System.Attribute
{
    public string Name { get; set; }
}

public class Goo
{
    void M()
    {
        [MyAttribute(Name =
        void local1() { }
    }
}
                            

Actual Behavior:

The full text of the CompilationUnitSyntax is this:


class MyAttribute : System.Attribute
{
    public string Name { get; set; }
}

public class Goo
{
    void M()
    {
{ }
    }
}
                            

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions