Skip to content

Auto completion for interface method should not automatically add an import #22672

@AlCalzone

Description

@AlCalzone

TypeScript Version: 2.7.2, 2.8.0-dev.20180317

Search Terms: automatic import interface method

When writing an interface with overloaded methods, using names that exist in some NodeJS core module causes the auto completion to contain entries from that module.

Code

export interface Foo {
	removeListener(event: "foo", callback: () => void): this;
	removeLi // BUG HERE!
}

Expected behavior:
Either no auto completion at all or auto completion for the overloaded method name removeListener from the interface Foo

Actual behavior:
The auto completion contains 3 methods from the cluster module with an auto import quick fix:
import
Pressing TAB causes my code to end up with an unnecessary import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions