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 incorrectly removes renamed imports #48979

Closed
fester88 opened this issue May 1, 2018 · 2 comments
Closed

Organize Imports incorrectly removes renamed imports #48979

fester88 opened this issue May 1, 2018 · 2 comments
Assignees
Labels
javascript JavaScript support issues

Comments

@fester88
Copy link

fester88 commented May 1, 2018

  • VSCode Version: 1.22.2
  • OS Version: Mac OS Sierra 10.12.6

Steps to Reproduce:

  1. Create a new file, set the language mode to JavaScript.

ext2. Populate the file with JS code that uses import statements, in particular a renamed import and ensure it is used in the file. For example:

import React, { Component } from 'react';
import { foo as bar } from './foo';

class Demo extends Component {
	render() {
		return <div>{bar}</div>;
	}
}
  1. Run JavaScript: Organize Imports from the command menu.

Expected results:

The renamed import is kept as it is in use.

Actual results:

The renamed import is removed as it does not resolve the renamed import as in use.

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

@vscodebot
Copy link

vscodebot bot commented May 1, 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 May 1, 2018
@vscodebot vscodebot bot added the javascript JavaScript support issues label May 1, 2018
@fester88
Copy link
Author

fester88 commented May 1, 2018

Duplicate of #47310

@fester88 fester88 closed this as completed May 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

2 participants