Example #1
0
        public override Task InsertWithCursor(string operation, InsertPosition defaultPosition, IEnumerable <AstNode> nodes)
        {
            var entity = _context.GetNode <EntityDeclaration>();

            foreach (var node in nodes)
            {
                InsertBefore(entity, node);
            }
            var tcs = new TaskCompletionSource <object>();

            tcs.SetResult(null);
            return(tcs.Task);
        }
Example #2
0
        public override Task <Script> InsertWithCursor(string operation, InsertPosition defaultPosition, IList <AstNode> nodes)
        {
            EntityDeclaration entity = _context.GetNode <EntityDeclaration>();

            if (entity is Accessor)
            {
                entity = (EntityDeclaration)entity.Parent;
            }

            foreach (var node in nodes)
            {
                InsertBefore(entity, node);
            }
            var tcs = new TaskCompletionSource <Script> ();

            tcs.SetResult(this);
            return(tcs.Task);
        }