fix(29908): Declare static method/property quickfix can add st… (#36854)

This commit is contained in:
Alexander T
2020-02-18 21:27:35 +02:00
committed by GitHub
parent 7cc4a8df94
commit bc12123115
4 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
/// <reference path='fourslash.ts' />
////interface Foo {}
////class Foo {}
////Foo.test();
verify.codeFix({
description: ignoreInterpolations(ts.Diagnostics.Declare_static_method_0),
index: 0,
newFileContent:
`interface Foo {}
class Foo {
static test() {
throw new Error("Method not implemented.");
}
}
Foo.test();`
});

View File

@@ -0,0 +1,16 @@
/// <reference path='fourslash.ts' />
////interface Foo {}
////class Foo {}
////Foo.test;
verify.codeFix({
description: ignoreInterpolations(ts.Diagnostics.Declare_static_property_0),
index: 0,
newFileContent:
`interface Foo {}
class Foo {
static test: any;
}
Foo.test;`
});

View File

@@ -0,0 +1,9 @@
/// <reference path='fourslash.ts' />
////interface Foo {}
////namespace Foo {
//// export function bar() { }
////}
////Foo.test();
verify.not.codeFixAvailable();