mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge branch 'vladima/textChanges' into createTypeNode
This commit is contained in:
@@ -667,5 +667,47 @@ class A {
|
||||
}
|
||||
});
|
||||
}
|
||||
{
|
||||
const text = `
|
||||
class A {
|
||||
x
|
||||
}
|
||||
`;
|
||||
runSingleFileTest("insertNodeAfterInClass1", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
|
||||
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined), { suffix: newLineCharacter });
|
||||
});
|
||||
}
|
||||
{
|
||||
const text = `
|
||||
class A {
|
||||
x;
|
||||
}
|
||||
`;
|
||||
runSingleFileTest("insertNodeAfterInClass2", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
|
||||
changeTracker.insertNodeAfter(sourceFile, findChild("x", sourceFile), createProperty(undefined, undefined, "a", undefined, createKeywordTypeNode(SyntaxKind.BooleanKeyword), undefined), { suffix: newLineCharacter });
|
||||
});
|
||||
}
|
||||
{
|
||||
const text = `
|
||||
class A {
|
||||
x;
|
||||
y = 1;
|
||||
}
|
||||
`;
|
||||
runSingleFileTest("deleteNodeAfterInClass1", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
|
||||
changeTracker.deleteNode(sourceFile, findChild("x", sourceFile));
|
||||
});
|
||||
}
|
||||
{
|
||||
const text = `
|
||||
class A {
|
||||
x
|
||||
y = 1;
|
||||
}
|
||||
`;
|
||||
runSingleFileTest("deleteNodeAfterInClass2", noop, text, /*validateNodes*/ false, (sourceFile, changeTracker) => {
|
||||
changeTracker.deleteNode(sourceFile, findChild("x", sourceFile));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
===ORIGINAL===
|
||||
|
||||
class A {
|
||||
x;
|
||||
y = 1;
|
||||
}
|
||||
|
||||
===MODIFIED===
|
||||
|
||||
class A {
|
||||
y = 1;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
===ORIGINAL===
|
||||
|
||||
class A {
|
||||
x
|
||||
y = 1;
|
||||
}
|
||||
|
||||
===MODIFIED===
|
||||
|
||||
class A {
|
||||
y = 1;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
===ORIGINAL===
|
||||
|
||||
class A {
|
||||
x
|
||||
}
|
||||
|
||||
===MODIFIED===
|
||||
|
||||
class A {
|
||||
x
|
||||
a: boolean;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
===ORIGINAL===
|
||||
|
||||
class A {
|
||||
x;
|
||||
}
|
||||
|
||||
===MODIFIED===
|
||||
|
||||
class A {
|
||||
x;
|
||||
a: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user