Skip to content

Unresolved import aliases are not suggested in type positions #45221

@DanielRosenwasser

Description

@DanielRosenwasser
import { ThisDoesNotExist } from "module-that-does-not-exist ;o";

let x: /**/

Request completions at /**/

Expected: ThisDoesNotExist is provided as a completion item.
Actual: ThisDoesNotExist is not in the completion list.

Basically we have some filtering in our completion list logic that says that if we're pretty certain that we're in a type position, then only provide completions for types. This works great unless you end up with an alias (ThisDoesNotExist) to a module that hasn't resolved to anything.

This is kind of a pain if you're in a partial-semantic context, where only the files that are open in the editor can be analyzed. For that reason, in cases where an import hasn't resolved to anything, it makes sense to keep it in the completion list.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions