* Refactor fix-all-missing-imports to be reusable by other codefixes * Migrate infer-from-usage to use ImportAdder * Add infer from usage test importing more than one thing in a single fix * Migrate implement interface / abstract members fixes to use ImportAdder * Update old tests * Use type-only imports when it would be an error not to * Add another test * Rename stuff
26 lines
481 B
TypeScript
26 lines
481 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @Filename: /I.ts
|
|
////export interface J {}
|
|
////export interface I {
|
|
//// x: J;
|
|
//// m(): J;
|
|
////}
|
|
|
|
// @Filename: /C.ts
|
|
////import { I } from "./I";
|
|
////export class C implements I {}
|
|
|
|
goTo.file("/C.ts");
|
|
verify.codeFix({
|
|
description: "Implement interface 'I'",
|
|
newFileContent:
|
|
`import { I, J } from "./I";
|
|
export class C implements I {
|
|
x: J;
|
|
m(): J {
|
|
throw new Error("Method not implemented.");
|
|
}
|
|
}`,
|
|
});
|