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

Two Bugs in Organize Import Feature #47796

Closed
thoamsy opened this issue Apr 13, 2018 · 3 comments
Closed

Two Bugs in Organize Import Feature #47796

thoamsy opened this issue Apr 13, 2018 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues

Comments

@thoamsy
Copy link

thoamsy commented Apr 13, 2018

Issue Type: Bug

Lost import alias

Like the below code

import React from 'react';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';

// so on

If I use the Organize Import, the HashRouter as Router will be remove.

import React from 'react';
import {  Route, Switch } from 'react-router-dom';

// so on

Update: duplicate, please ignore it. 😅

Can't organize unsave code

When I write some new import statement, but it not yet saved.
The Organize Import can't organize the new statement.
I think, you can provide a setting: Save file before organize import, and the error be solved

VS Code version: Code 1.22.1 (950b8b0, 2018-04-06T00:21:13.607Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz (4 x 2700)
Load (avg) 2, 2, 3
Memory (System) 8.00GB (0.41GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_53261
Screen Reader no
VM 0%
Extensions (29)
Extension Author (truncated) Version
bracket-pair-colorizer Coe 1.0.28
material-icon-theme PKi 3.3.0
code-settings-sync Sha 2.9.0
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
vscode-eslint dba 1.4.8
vscode-dash dee 1.9.0
vscode-faker dee 1.3.0
githistory don 0.4.0
es7-react-js-snippets dsz 1.4.0
gitlens eam 8.2.1
vscode-html-css ecm 0.2.0
vscode-npm-script eg2 0.3.3
prettier-vscode esb 1.2.2
auto-close-tag for 0.5.6
auto-rename-tag for 0.0.15
code-runner for 0.9.3
rest-client hum 0.18.1
search-node-modules jas 1.3.0
vscode-styled-components jpo 0.0.17
vscode-scss mrm 0.6.2
atom-keybindings ms- 3.0.4
node-debug2 ms- 1.20.0
debugger-for-chrome msj 4.3.0
indent-rainbow ode 0.7.2
minapp-vscode qiu 1.0.14
sass-indented rob 1.4.8
vim vsc 0.11.3
vscode-todo-highlight way 0.5.12

(3 theme extensions excluded)

@vscodebot
Copy link

vscodebot bot commented Apr 13, 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 Apr 13, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Apr 13, 2018

I can't repo the second issue. Is the new import referenced anywhere in the file before you run organize imports? The command also removes and unused imports

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Apr 13, 2018
@thoamsy
Copy link
Author

thoamsy commented Apr 13, 2018

It's my fault 😞, I don't know

The command also removes and unused imports

My habits is write some import statements first, and use them later.

Close.

@thoamsy thoamsy closed this as completed Apr 13, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

2 participants