Skip to content

Implementing interface puts relative imports #34995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bpasero opened this issue Nov 8, 2019 · 5 comments · Fixed by #36615 or #39130
Closed

Implementing interface puts relative imports #34995

bpasero opened this issue Nov 8, 2019 · 5 comments · Fixed by #36615 or #39130
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone

Comments

@bpasero
Copy link
Member

bpasero commented Nov 8, 2019

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.');
	}

}
@andrewbranch
Copy link
Member

Needs the same fix as #32910 (#33915)

@mjbvz
Copy link
Contributor

mjbvz commented Nov 13, 2019

See #35078 for a very simple repo.

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

@bpasero
Copy link
Member Author

bpasero commented May 9, 2020

@andrewbranch @mjbvz I can still reproduce this in VSCode, please reopen. We seem to be using 3.9.1-rc.

image

@mjbvz
Copy link
Contributor

mjbvz commented May 11, 2020

@bpasero Can you please share updated steps to reproduce this too

@mjbvz mjbvz reopened this May 11, 2020
@bpasero
Copy link
Member Author

bpasero commented May 12, 2020

@mjbvz @andrewbranch I updated #34995 (comment) with the steps

@andrewbranch andrewbranch added Bug A bug in TypeScript and removed Fix Available A PR has been opened for this issue Experience Enhancement Noncontroversial enhancements labels May 12, 2020
@mjbvz mjbvz added the VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone label May 27, 2020
@andrewbranch andrewbranch added the Fix Available A PR has been opened for this issue label Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue VS Code Priority Critical issues that VS Code needs fixed in the current TypeScript milestone
Projects
None yet
4 participants