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

Go To Definition across projects via declarationMap leads to wrong line/column #28307

Closed
rosslovas opened this issue Nov 2, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")

Comments

@rosslovas
Copy link

TypeScript Version: 3.2.0-dev.20181101

Search Terms: tsc build across project reference declarationMap .d.ts.map go to definition f12 wrong line col column position

Code

Main project, main/main.ts:

import { fn1, fn2, fn3, fn4, fn5 } from '../dependency/fns'
fn1();
fn2();
fn3();
fn4();
fn5();

Dependency project, dependency/fns.ts:

export function fn1() { }
export function fn2() { }
export function fn3() { }
export function fn4() { }
export function fn5() { }

Full repro zip: badf12repro.zip. Run npm install then npm run build.

Expected behavior:

F12 (Go To Definition) on fnN in main.ts should position cursor at the beginning of the name of the corresponding function in fns.ts.

Actual behavior:

Go To Definition positions cursor in an incorrect position higher up in the file in each case aside from fn1. Gif:

badf12

As I can repro this in both VS Code and Atom I assume it's TypeScript itself doing the heavy lifting here, but I could be wrong.

@weswigham weswigham added Bug A bug in TypeScript Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects") labels Nov 2, 2018
@sheetalkamat sheetalkamat self-assigned this Nov 7, 2018
sheetalkamat added a commit that referenced this issue Nov 7, 2018
@sheetalkamat sheetalkamat added the Fixed A PR has been merged for this issue label Nov 7, 2018
sheetalkamat added a commit that referenced this issue Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Scenario: Monorepos & Cross-Project References Relates to composite projects (a.k.a references between "medium sized projects")
Projects
None yet
Development

No branches or pull requests

3 participants