-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Domain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Fix AvailableA PR has been opened for this issueA PR has been opened for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.8.0-dev.20191112
Search Terms:
- Implement interface
- quick fix
- code action
- add missing imports
Code
For a small project:
iface.ts
export interface IValue {
value: number;
}
export interface IFace {
do(value: IValue): void;
}
index.ts
import { IFace } from "./iface";
export class Foo implements IFace {}
- Run
implement interface
onFoo
Current Behavior:
The generated code is:
import { IFace } from "./iface";
export class Foo implements IFace {
do(value: import("./iface").IValue): void {
throw new Error("Method not implemented.");
}
}
Request
We would like an option to tell TypeScript to not use inline imports and instead always add normal imports at the top of the file.
import { IFace, IValue } from "./iface";
export class Foo implements IFace {
do(value: IValue): void {
throw new Error("Method not implemented.");
}
}
/cc @bpasero Since I know you were passionate about this issue
Metadata
Metadata
Assignees
Labels
Domain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.Fix AvailableA PR has been opened for this issueA PR has been opened for this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript