You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Package @org/b imports and re-exports package @org/a's object:
import{a}from'@org/a';a;// ✅ Go to definition works here with ^5.7.3a.foo;// 🚧 Go to definition does not work here, but seemingly fixed by https://github.com/microsoft/TypeScript/pull/60005exportconstb={
a,}asconst;
Package @org/c imports from package @org/b and tries to access the nested property:
import{b}from'@org/b';b;// 🚧 Go to definition does not work here, but seemingly fixed by https://github.com/microsoft/TypeScript/pull/60005b.a;// <--- 🚧 Go to definition does not work here, but seemingly fixed by https://github.com/microsoft/TypeScript/pull/60005b.a.foo;// <--- ❌ ❌ Go to definition on ".foo" should go to `a.foo` in `@org/a`, but instead goes to end of file in `@org/b`
In package @org/c, "Go to Definition" does not work as expected when trying to navigate through the re-exported property b.a.foo - it goes to end of file of @org/b instead of the where foo is declared in @org/a
🙂 Expected behavior
Go to definition should work through multiple levels of package imports as if the code was written in a single file.
Additional information about the issue
Partially addressed by #60005, I'm using npm:@kitchensink/typescript-pr60005@latest in the repo
The text was updated successfully, but these errors were encountered:
🔎 Search Terms
go to to definition, sub-packages, nested packages, declaration maps, sourcemap, monorepo
🕗 Version & Regression Information
npm:@kitchensink/typescript-pr60005@latest
(Add source mappings for serialized properties with available declaration #60005) as it partially fixes the problem⏯ Playground Link
https://github.com/KATT/typescript-go-to-definition-through-sub-packages
💻 Code
TypeScript's "Go to Definition" goes to the wrong place when used through multiple levels of package imports. Here's the setup:
Package
@org/a
defines a base object:Package
@org/b
imports and re-exports package@org/a
's object:Package
@org/c
imports from package@org/b
and tries to access the nested property:🙁 Actual behavior
@org/b
, TypeScript's "Go to Definition" works as expected when clicking ona.foo
if using branch Add source mappings for serialized properties with available declaration #60005@org/c
, "Go to Definition" does not work as expected when trying to navigate through the re-exported propertyb.a.foo
- it goes to end of file of@org/b
instead of the wherefoo
is declared in@org/a
🙂 Expected behavior
Go to definition should work through multiple levels of package imports as if the code was written in a single file.
Additional information about the issue
Partially addressed by #60005, I'm using
npm:@kitchensink/typescript-pr60005@latest
in the repoThe text was updated successfully, but these errors were encountered: