Skip to content

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

Closed
@jeffreymorlan

Description

@jeffreymorlan
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.

Metadata

Metadata

Assignees

Labels

APIRelates to the public API for TypeScriptBugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions