Skip to content
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

Auto import does not work when last import is type import #44150

Closed
thibmaek opened this issue Feb 21, 2018 · 3 comments
Closed

Auto import does not work when last import is type import #44150

thibmaek opened this issue Feb 21, 2018 · 3 comments
Assignees
Labels
*extension-candidate Issue identified as good extension implementation javascript JavaScript support issues

Comments

@thibmaek
Copy link

thibmaek commented Feb 21, 2018

  • VSCode Version: 1.20.1
  • OS Version: macOS 10.13.2

Steps to Reproduce:

  1. Have 2 imports where last import is a type import
  2. Auto import from a file
  3. Imports create syntax error

Does this issue occur when all extensions are disabled?: Yes

Before auto import:

import * as SCREEN_IDS from '../../../config/screens/screenIds';
import type { TNavigationProps } from '../../navigation/NavigationHOC';

After auto import:

import * as SCREEN_IDS from '../../../config/screens/screenIds';
import typeimport { SAVE } from '../../../config/screens/navigatorButtons';
 { TNavigationProps } from '../../navigation/NavigationHOC';
@vscodebot
Copy link

vscodebot bot commented Feb 21, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added the javascript JavaScript support issues label Feb 21, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Feb 21, 2018

Type imports are a flow specific feature. Auto imports come from the TS/JS plugin so we don't offer built-in flow support

Try disabling auto imports by setting "typescript.autoImportSuggestions.enabled": false

@mjbvz mjbvz closed this as completed Feb 21, 2018
@mjbvz mjbvz added the *extension-candidate Issue identified as good extension implementation label Feb 21, 2018
@karlhorky
Copy link

For TypeScript it looks like this extension may be interesting (from a quick read through the features it seems like it supports types):

https://github.com/soates/Auto-Import

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*extension-candidate Issue identified as good extension implementation javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

3 participants