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

Declaration mapping #416

Open
Indy-rbo opened this issue Sep 12, 2024 · 2 comments
Open

Declaration mapping #416

Indy-rbo opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
area/vrotsc Relates to `vrotsc` module kind/enhancement Enhancement or improvement of existing features lang/typescript Related to typescript code triage/needed Needs to be discussed by project maintainers

Comments

@Indy-rbo
Copy link

Description

To improve the Developer Experience I'd love to have it so that clicking on an imported dependency opens the actual file, instead of opening a *.d.ts file only showing the type declarations.

There is the declarationMap setting for tsconfig.json which states:

Generates a source map for .d.ts files which map back to the original .ts source file. This will allow editors such as VS Code to go to the original .ts file when using features like Go to Definition.

You should strongly consider turning this on if you’re using project references.

But setting that locally didn't seem to change anything for me.
Should this already be possible to do? Otherwise I would like to request the Build Tools to do this for us.

@VenelinBakalov VenelinBakalov added kind/enhancement Enhancement or improvement of existing features area/vrotsc Relates to `vrotsc` module triage/needed Needs to be discussed by project maintainers lang/typescript Related to typescript code labels Sep 12, 2024
@Michaelpalacce Michaelpalacce self-assigned this Sep 18, 2024
@Michaelpalacce
Copy link
Collaborator

Taking this one, I want to research it

@Michaelpalacce Michaelpalacce added the triage/needs-clarification The issue needs further clarification from the contributor label Sep 18, 2024
@Michaelpalacce
Copy link
Collaborator

So I took a look at it.

From what I could see, we do generate the maps you need for this to work, the problem is the way we bundle things.

  1. Currently, we bundle only the definitions as there is no point in bundling the actual source files themselves. This is actually a practice in ts development, to just provide the types rather than the whole source code and have the source code as a normal dependency. There is however the option to bundle them together as well, which brings me to:
  2. In order for this to work, we'll need to add the source files as well as the mapping inside of the definitions.
  3. It's not as simple as copy pasting things in the right place, as the structure needs to be kept in mind

We'll need to triage internally :)

@Michaelpalacce Michaelpalacce removed the triage/needs-clarification The issue needs further clarification from the contributor label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vrotsc Relates to `vrotsc` module kind/enhancement Enhancement or improvement of existing features lang/typescript Related to typescript code triage/needed Needs to be discussed by project maintainers
Projects
None yet
Development

No branches or pull requests

3 participants