[Question] Find an identifier's original source file and position by resolving its declaration source map
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Hi,
Is it possible to find the original definition in a `.ts` source file starting from the compiled `.d.ts` declaration file when its `.d.ts.map` source map file is also available?
To better explain this issue, I've created the following repository:
https://github.com/velut/ts-morph-goto-definition-issue
If you open the repository in VSCode and Ctrl-click on the `adder` declaration in `project/dist/index.d.ts`, you should be taken to the `adder` definition in `project/src/index.ts`.
This happens because VSCode queries the `tsserver` which in turns queries Typescript's language service.
I'm trying to replicate this behavior with `ts-morph`, however my queries to the language service resolve only to the `.d.ts` file, apparently ignoring the available source map.
Thanks for your time.
Contributor guide
Assessment
This issue has not been assessed yet.