Fix whitespace around inserted static property

Fixes #18743
This commit is contained in:
Andrew Casey 2017-10-04 11:23:58 -07:00
parent d03d237b3b
commit 686fd1e62d
3 changed files with 7 additions and 5 deletions

View file

@ -92,7 +92,7 @@ namespace ts.codefix {
classDeclarationSourceFile,
classDeclaration,
staticInitialization,
{ suffix: context.newLineCharacter });
{ prefix: context.newLineCharacter, suffix: context.newLineCharacter });
const initializeStaticAction = {
description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Initialize_static_property_0), [tokenName]),
changes: staticInitializationChangeTracker.getChanges()

View file

@ -13,11 +13,12 @@
verify.codeFix({
description: "Initialize static property 'foo'.",
index: 0,
// TODO: GH#18743 and GH#18445
// TODO: GH#18445
newFileContent: `class C {
static method() {
()=>{ this.foo === 10 };
}
}C.foo = undefined;\r
}\r
C.foo = undefined;\r
`
});

View file

@ -11,9 +11,10 @@
verify.codeFix({
description: "Initialize static property 'foo'.",
index: 2,
// TODO: GH#18743 and GH#18445
// TODO: GH#18445
newFileContent: `class C {
static p = ()=>{ this.foo === 10 };
}C.foo = undefined;\r
}\r
C.foo = undefined;\r
`
});