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

Organize imports removes needed import #47310

Closed
AMerkuri opened this issue Apr 6, 2018 · 3 comments
Closed

Organize imports removes needed import #47310

AMerkuri opened this issue Apr 6, 2018 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues

Comments

@AMerkuri
Copy link

AMerkuri commented Apr 6, 2018

Issue Type: Bug

Organize Imports will remove following needed import from code State as RootState.

import { State as RootState, NavigationState } from 'store';
import { ActionContext } from 'vuex';
import { getStoreAccessors } from 'vuex-typescript';

type NavigationContext = ActionContext<NavigationState, RootState>;

https://gyazo.com/c3491828db7c7157f844cda2e1338cad

VS Code version: Code 1.22.1 (950b8b0, 2018-04-06T02:26:57.615Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz (4 x 3492)
Memory (System) 23.88GB (8.90GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (10)
Extension Author (truncated) Version
Vue2 duc 0.1.3
gitlens eam 8.2.0
vue-snippets hol 0.1.5
vue liu 0.1.5
code-beautifier mic 2.0.3
debugger-for-chrome msj 4.3.0
vetur oct 0.11.7
LiveServer rit 3.2.1
markdown-pdf yza 0.1.8
markdown-all-in-one yzh 1.1.2

(1 theme extensions excluded)

@vscodebot
Copy link

vscodebot bot commented Apr 6, 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 assigned mjbvz Apr 6, 2018
@vscodebot vscodebot bot added the javascript JavaScript support issues label Apr 6, 2018
@raido
Copy link

raido commented Apr 6, 2018

I can confirm same issue with example of imports like so:

import { and, alias } from '@ember/object/computed';
import { computed } from '@ember/object';
import Service, { inject as service } from '@ember/service';
import RSVP from 'rsvp';

It will remove { inject as service}.

@mjbvz
Copy link
Contributor

mjbvz commented Apr 6, 2018

Duplicate of microsoft/TypeScript#22743

Already fixed in TypeScript@next and will be fixed in next release of VS Code when we move organize imports out of preview. Follow these instructions to upgrade the current build to typescript@next: https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

3 participants