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

Enable declaration maps for hyperclick-to-implementation #3576

Open
steveluscher opened this issue Nov 15, 2024 · 3 comments
Open

Enable declaration maps for hyperclick-to-implementation #3576

steveluscher opened this issue Nov 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@steveluscher
Copy link
Collaborator

Motivation

Right now if you hyperclick on a symbol in VS Code it will take you to the typedef. If you want to go to the implementation you have to right click and select ‘Go to Implementations.’

Apparently, if you generate declaration maps (like sourcemaps, for typedefs) then hyperclick goes to the implementation instead.

Details

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---declarationmap

@steveluscher steveluscher added the enhancement New feature or request label Nov 15, 2024
@shivaji43
Copy link

shivaji43 commented Nov 17, 2024

what do we have to do exactly , can you please explain a bit more , because the declarationMap changes are already there in the tsconfig.json file , which generate the maps.

@steveluscher
Copy link
Collaborator Author

You're not wrong, @shivaji43! I was hoping that posting this issue would mean that I could stop thinking about this problem, but here we are :)

Having looked into it, it dawns on me that hyperclick (go to definition) does not work today because we don't include the source code in the published npm packages.

I really didn't want to include the source in the published npm packages, because this causes strife for people who – for instance – publish their software to cloud services like AWS Lambda, and don't want to publish megabytes of code that does nothing.

So I guess we have a few options.

  • Forget it.
  • Include source files in the npm packages (by adding them to the files field of package.json) package size be damned.
  • Generate declaration maps from the compiled source code (ie. the files in dist/*.mjs).
  • A fourth option I haven't thought of?

@shivaji43
Copy link

shivaji43 commented Nov 18, 2024

Including source files is not a good idea , I think even generating declaration maps can take significant size in the packages , as far as I know it is not possible without the source files , if you can suggest me some more options (if there) I am open to try them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants