-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Auto-importEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this
Milestone
Description
- VSCode Version: 1.51.1
- OS Version: 11.0.1
Steps to Reproduce:
import * as React from 'react';
const el = <div className={REPLACE_ME}>foo</div>;
yarn add @types/classnames
- Erase
REPLACE_ME
and begin typingclassNames
Does this issue occur when all extensions are disabled?: Yes
Expected: VS Code suggests an auto import of classNames
from module 'classnames
'.
Actual: no suggested auto import.
I believe this is something to do with the fact that classnames
is defined as a UMD module. If I change the type definitions for classnames
to remove the UMD definition, the auto import does work correctly:
Note that VS Code does correctly provide import suggestions after we've finished typing the identifier, when we move our cursor.
This issue is specifically about auto imports inside the suggestions that appear as you're typing.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Auto-importEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do this