mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
fix(29908): Declare static method/property quickfix can add st… (#36854)
This commit is contained in:
18
tests/cases/fourslash/codeFixAddMissingMember14.ts
Normal file
18
tests/cases/fourslash/codeFixAddMissingMember14.ts
Normal 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();`
|
||||
});
|
||||
16
tests/cases/fourslash/codeFixAddMissingMember15.ts
Normal file
16
tests/cases/fourslash/codeFixAddMissingMember15.ts
Normal 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;`
|
||||
});
|
||||
9
tests/cases/fourslash/codeFixAddMissingMember16.ts
Normal file
9
tests/cases/fourslash/codeFixAddMissingMember16.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////interface Foo {}
|
||||
////namespace Foo {
|
||||
//// export function bar() { }
|
||||
////}
|
||||
////Foo.test();
|
||||
|
||||
verify.not.codeFixAvailable();
|
||||
Reference in New Issue
Block a user