Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

parent does not update after using InsertChildAfter #497

Open
joodies opened this issue Jun 23, 2015 · 0 comments
Open

parent does not update after using InsertChildAfter #497

joodies opened this issue Jun 23, 2015 · 0 comments

Comments

@joodies
Copy link

joodies commented Jun 23, 2015

Hello,

I tried some code in the NRefractor demo project,
I modify the syntax tree, add 2 nodes

vc.InsertChildBefore(vc.Children.Last(), AstType.Create("int b = 78;"), new Role<AstType>("Variable", AstType.Null));

vc.InsertChildBefore(vc.Children.Last(), AstType.Create(Environment.NewLine), new Role<AstType>("NewLine", AstType.Null));             

And can see the new nodes in watch window as follow,
As you can see , the new node is not there when i try syntaxtree.ToString()
nr

source code

using System;
using System.Linq;
class Test
{
    public void Main(string[] args)
    {
         int a = 80;
    }
}

what i want as result

using System;
using System.Linq;
class Test
{
    public void Main(string[] args)
    {
         int a = 80;
         int b = 78;
    }
}
@joodies joodies closed this as completed Jun 23, 2015
@joodies joodies reopened this Jun 23, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant