Exemplo n.º 1
0
        /// <summary>
        /// Updates the physical file with the provided ChangeEvents.
        /// Afterwards, the updated content gets verified.
        /// </summary>
        /// <param name="changes">The change events to be handled.</param>
        public void UpdateFile(Container <TextDocumentContentChangeEvent> changes)
        {
            foreach (var change in changes)
            {
                PhysicalFile.Apply(change);
            }

            GenerateTranslationResult();
            AddSymbolTable();
        }
Exemplo n.º 2
0
        public void HitReturn_2_8()
        {
            TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent
            {
                Text  = "",
                Range = new Range
                {
                    Start = new Position {
                        Line = 2, Character = 7
                    },
                    End = new Position {
                        Line = 2, Character = 8
                    }
                },
                RangeLength = 1
            };

            f.Apply(change);

            const string expected = "class A {\r\n    var a:int;\r\n    contructor(){}\r\n}";

            Assert.AreEqual(expected, f.Sourcecode);
        }
Exemplo n.º 3
0
        public void Empty_at_0_0()
        {
            TextDocumentContentChangeEvent change = new TextDocumentContentChangeEvent
            {
                Text  = "",
                Range = new Range
                {
                    Start = new Position {
                        Line = 0, Character = 0
                    },
                    End = new Position {
                        Line = 0, Character = 0
                    }
                },
                RangeLength = 0
            };

            f.Apply(change);

            Assert.AreEqual(cleanSource, cleanSource);
        }