Skip to content

VS 2015 code editor renames imports globally instead of only for a module #8171

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
ghost opened this issue Apr 19, 2016 · 1 comment
Closed
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Apr 19, 2016

This issue is in lieu of the issue #8118 (which was closed by @mhegazy , and according to his comment this should not happen as the alias is local)

TypeScript Version:
1.8.9

Code
For example we have 3 modules: app.ts, module1.ts and module2.ts

in app.ts module we have:

export class Greeter {
}

in module1.ts module we have:

import { Greeter as ChitoGreetor } from "app";

let greeter = new ChitoGreetor();

in module2.ts module we have (the same import alias as in module1!):

import { Greeter as ChitoGreetor } from "app";

let greeter = new ChitoGreetor();

Actual behavior:

If we rename in VS code editor module alias ChitoGreetor in module1 then it will be renamed
in module2 too. Besides, if we look for references using "Find all references" in module1 then
it finds references in module2 too.

Expected behavior:

Rename the alias only locally in one module which uses the import.
And find references locally either.

@ghost ghost changed the title VS 2015 code editor renames imports globally instead only for a module VS 2015 code editor renames imports globally instead of only for a module Apr 19, 2016
@mhegazy mhegazy added the Bug A bug in TypeScript label Apr 19, 2016
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Jun 7, 2016
@mhegazy mhegazy assigned ghost Jun 7, 2016
@ghost
Copy link

ghost commented Jun 8, 2016

Successfully reproduced the issue in the current VSCode, but it appears to be fixed in the next version.

@ghost ghost closed this as completed Jun 8, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jun 8, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

1 participant