Skip to content

Auto import adds value import to type-only import statement #36002

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
ajafff opened this issue Jan 4, 2020 · 1 comment · Fixed by #36412
Closed

Auto import adds value import to type-only import statement #36002

ajafff opened this issue Jan 4, 2020 · 1 comment · Fixed by #36412
Assignees
Labels
Bug A bug in TypeScript Domain: Auto-import Domain: Quick Fixes Editor-provided fixes, often called code actions. Fix Available A PR has been opened for this issue

Comments

@ajafff
Copy link
Contributor

ajafff commented Jan 4, 2020

TypeScript Version: 3.8.0-dev.20200104

Search Terms:

Code

import type {SourceFile} from 'typescript';
const file: SourceFile = createSourceFile(

While typing createSourceFile use auto import.

Expected behavior:

Adds a named import for createSourceFile and removes the type keyword from the import.

Actual behavior:

Adds a named import for createSourceFile while keeping it a type-only import. This causes an error as createSourceFile does not exist in the type space.

Related Issues: Introduced by #35200 @andrewbranch

@andrewbranch andrewbranch self-assigned this Jan 6, 2020
@andrewbranch
Copy link
Member

Already working on this one (it’s one of the two unchecked to-do boxes on the original PR)

@andrewbranch andrewbranch added the Bug A bug in TypeScript label Jan 6, 2020
@andrewbranch andrewbranch added this to the TypeScript 3.8.1 milestone Jan 6, 2020
@andrewbranch andrewbranch added Domain: Auto-import Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Jan 9, 2020
@andrewbranch andrewbranch added the Fix Available A PR has been opened for this issue label Jan 24, 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 Domain: Auto-import Domain: Quick Fixes Editor-provided fixes, often called code actions. Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants