Open mitivic opened 4 years ago
You example code is not valid JavaScript:
Please provide a working example
as edit:
// x.js
module.exports.a = () => {return ()=>{}};
// y.js
let n = require('./x.js');
module.exports.b = n.a();
// anywhere
let m = require('./y.js');
let c = m.b(); // ctrl-click b
It seems "require" is relevant to this problem.
Thanks @mitivic. I can reproduce this issue
Just to be clear, in your example you expect go to definition
on b
to jump to module.exports.b = n.a();
in y.js
, correct?
YES
TS Template added by @mjbvz
TypeScript Version: 4.0.0-dev.20200702
Search Terms
Issue Type: Bug
ctrl-click b leads to 2 definitions and the default is a's definition instead of b's
VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z) OS version: Windows_NT x64 10.0.17134
Extensions (15)
Extension|Author (truncated)|Version ---|---|--- project-manager|ale|11.1.0 vscode-eslint|dba|2.1.5 clipboard-manager|Edg|1.4.2 vscode-npm-script|eg2|0.3.12 vscode-test-explorer|hbe|2.19.1 vscode-heroku|iva|1.2.6 docthis|joe|0.7.1 mongodb-vscode|mon|0.0.4 csharp|ms-|1.22.1 mssql|ms-|1.9.0 python|ms-|2020.6.91350 cpptools|ms-|0.28.3 prettier-now|rem|1.4.9 tabnine-vscode|Tab|2.8.6 poor-mans-t-sql-formatter-vscode|Tao|1.6.10