Skip to content

getSymbolAtLocation returns wrong symbol for import alias in RHS of "import =" #5501

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
jeffreymorlan opened this issue Nov 3, 2015 · 1 comment
Assignees
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@jeffreymorlan
Copy link
Contributor

module SomeModule { export class SomeClass {} }

import M = SomeModule;  // or import M = require(...)
import C = M.SomeClass;

On the M identifier in M.SomeClass, getSymbolAtLocation returns the SomeModule module symbol, rather than the alias M to it.

This affects renaming, find references, and occurrence highlighting:

  • If you select the M in import M = ..., the second M will not be found
  • If you select the M in import C = M.SomeClass, the first M will not be found, but the two SomeModule references will be found instead.
@mhegazy mhegazy added Bug A bug in TypeScript API Relates to the public API for TypeScript labels Nov 3, 2015
@DanielRosenwasser
Copy link
Member

Yeah, rename on aliases seems to be extremely broken.

brokenaliases

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Relates to the public API for TypeScript Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants