Skip to content

Implementing interface puts relative imports #34995

Description

TypeScript Version: 3.7.2

Code

  • git clone https://github.com/microsoft/vscode.git
  • yarn
  • open VSCode on anythingQuickAccess.ts
  • type in the top:
class FooHandler implements IEditorGroup {

}
  • fix the error by letting it implement the interface

Expected behavior:
Code that gets generated does not use inline imports.

Actual behavior:
Code that gets generated adds inline imports:

class FooHandler implements IEditorGroup {
	onDidGroupChange: Event<IGroupChangeEvent>;
	onWillDispose: Event<void>;
	id: number;
	index: number;
	label: string;
	ariaLabel: string;
	activeEditorPane: import("../../../common/editor").IVisibleEditorPane | undefined;
	activeEditor: IEditorInput | null;
	previewEditor: IEditorInput | null;
	count: number;
	stickyCount: number;
	editors: readonly IEditorInput[];
	getEditors(order: EditorsOrder, options?: { excludeSticky?: boolean | undefined; } | undefined): readonly IEditorInput[] {
		throw new Error('Method not implemented.');
	}
	getEditorByIndex(index: number): IEditorInput | undefined {
		throw new Error('Method not implemented.');
	}
	getIndexOfEditor(editor: IEditorInput): number {
		throw new Error('Method not implemented.');
	}
	openEditor(editor: IEditorInput, options?: import("../../../../platform/editor/common/editor").IEditorOptions | ITextEditorOptions | undefined): Promise<import("../../../common/editor").IEditorPane | null> {
		throw new Error('Method not implemented.');
	}
	openEditors(editors: import("../../../common/editor").IEditorInputWithOptions[]): Promise<import("../../../common/editor").IEditorPane | null> {
		throw new Error('Method not implemented.');
	}
	isOpened(editor: IEditorInput): boolean {
		throw new Error('Method not implemented.');
	}
	isPinned(editor: IEditorInput): boolean {
		throw new Error('Method not implemented.');
	}
	isSticky(editorOrIndex: number | IEditorInput): boolean {
		throw new Error('Method not implemented.');
	}
	isActive(editor: IEditorInput): boolean {
		throw new Error('Method not implemented.');
	}
	moveEditor(editor: IEditorInput, target: IEditorGroup, options?: import("../../../services/editor/common/editorGroupsService").IMoveEditorOptions | undefined): void {
		throw new Error('Method not implemented.');
	}
	copyEditor(editor: IEditorInput, target: IEditorGroup, options?: import("../../../services/editor/common/editorGroupsService").ICopyEditorOptions | undefined): void {
		throw new Error('Method not implemented.');
	}
	closeEditor(editor?: IEditorInput | undefined, options?: import("../../../services/editor/common/editorGroupsService").ICloseEditorOptions | undefined): Promise<void> {
		throw new Error('Method not implemented.');
	}
	closeEditors(editors: IEditorInput[] | import("../../../services/editor/common/editorGroupsService").ICloseEditorsFilter, options?: import("../../../services/editor/common/editorGroupsService").ICloseEditorOptions | undefined): Promise<void> {
		throw new Error('Method not implemented.');
	}
	closeAllEditors(options?: import("../../../services/editor/common/editorGroupsService").ICloseAllEditorsOptions | undefined): Promise<void> {
		throw new Error('Method not implemented.');
	}
	replaceEditors(editors: import("../../../services/editor/common/editorGroupsService").IEditorReplacement[]): Promise<void> {
		throw new Error('Method not implemented.');
	}
	pinEditor(editor?: IEditorInput | undefined): void {
		throw new Error('Method not implemented.');
	}
	stickEditor(editor?: IEditorInput | undefined): void {
		throw new Error('Method not implemented.');
	}
	unstickEditor(editor?: IEditorInput | undefined): void {
		throw new Error('Method not implemented.');
	}
	focus(): void {
		throw new Error('Method not implemented.');
	}
	invokeWithinContext<T>(fn: (accessor: import("../../../../platform/instantiation/common/instantiation").ServicesAccessor) => T): T {
		throw new Error('Method not implemented.');
	}

}

Activity

  1. andrewbranch commented on Nov 8, 2019

    @andrewbranch
    Member

    Needs the same fix as #32910 (#33915)

  2. mjbvz commented on Nov 13, 2019

    @mjbvz
    Contributor

    See #35078 for a very simple repo.

    As a side point, Benjamin Pasero (@bpasero)'s example also shows that the inline imports always use relative paths (regardless of what typescript.preferences.importModuleSpecifier is set to)

  3. bpasero commented on May 9, 2020

    @bpasero
    Author

    Andrew Branch (@andrewbranch) Matt Bierner (@mjbvz) I can still reproduce this in VSCode, please reopen. We seem to be using 3.9.1-rc.

    image

  4. mjbvz commented on May 11, 2020

    @mjbvz
    Contributor

    Benjamin Pasero (@bpasero) Can you please share updated steps to reproduce this too

  5. bpasero commented on May 12, 2020

    @bpasero
    Author
  6. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueVS Code PriorityCritical issues that VS Code needs fixed in the current TypeScript milestone

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions