Go To Definition across projects via declarationMap leads to wrong line/column · Issue #28307 · microsoft/TypeScript · GitHub
Skip to content

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

Description

@rosslovas

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.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueScenario: Monorepos & Cross-Project ReferencesRelates to composite projects (a.k.a references between "medium sized projects")

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions