mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Properly adjust nodes while walking down the tree.
This commit is contained in:
parent
2f833d5f97
commit
9c0e4211bc
@ -801,7 +801,7 @@ module ts {
|
||||
// Adjust the pos or end (or both) of the intersecting array accordingly.
|
||||
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
||||
for (var i = 0, n = array.length; i < n; i++) {
|
||||
forEachChild(array[i], visitNode, visitArray);
|
||||
visitNode(array[i]);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
@ -908,7 +908,7 @@ module ts {
|
||||
array.end += delta;
|
||||
|
||||
for (var i = 0, n = array.length; i < n; i++) {
|
||||
forEachChild(array[i], visitNode, visitArray);
|
||||
visitNode(array[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ module ts {
|
||||
Utils.assertInvariants(newTree, /*parent:*/ undefined);
|
||||
|
||||
// Create a tree for the new text, in an incremental fashion.
|
||||
var incrementalNewTree = updateLanguageServiceSourceFile(oldTree, newText, oldTree.version + ".", /*isOpen:*/ true, textChangeRange, /*useIncremental:*/ false);
|
||||
var incrementalNewTree = updateLanguageServiceSourceFile(oldTree, newText, oldTree.version + ".", /*isOpen:*/ true, textChangeRange, /*useIncremental:*/ true);
|
||||
Utils.assertInvariants(incrementalNewTree, /*parent:*/ undefined);
|
||||
|
||||
// We should get the same tree when doign a full or incremental parse.
|
||||
@ -177,7 +177,9 @@ module ts {
|
||||
}
|
||||
|
||||
describe('Incremental',() => {
|
||||
debugger;
|
||||
it('Inserting into method',() => {
|
||||
debugger;
|
||||
var source = "class C {\r\n" +
|
||||
" public foo1() { }\r\n" +
|
||||
" public foo2() {\r\n" +
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user