TypeScript/tests/cases/fourslash/codeFixAddMissingFunctionDeclaration_all.ts
Oleksandr T 0c58edeb29
feat(26217): Add missing member fix should work for missing function (#41215)
* feat(26217): Add missing function declaration QF

* use codeFixAvailable instead of codeFix

* add diagnostics messages 'Method not implemented.' and 'Function not implemented.'

* use codeFixAvailable instead of codeFix

* fix signature types
2021-01-08 16:10:50 -08:00

50 lines
894 B
TypeScript

/// <reference path='fourslash.ts' />
// @filename: /test.ts
////export const x = 1;
// @filename: /foo.ts
////import * as test from "./test";
////
////namespace Foo {
//// export const x = 0;
////}
////
////test.f();
////Foo.f();
////f();
goTo.file("/foo.ts");
verify.codeFixAll({
fixId: "fixMissingFunctionDeclaration",
fixAllDescription: ts.Diagnostics.Add_all_missing_function_declarations.message,
newFileContent: {
"/test.ts":
`export const x = 1;
export function f() {
throw new Error("Function not implemented.");
}
`,
"/foo.ts":
`import * as test from "./test";
namespace Foo {
export const x = 0;
export function f() {
throw new Error("Function not implemented.");
}
}
test.f();
Foo.f();
f();
function f() {
throw new Error("Function not implemented.");
}
`
}
});