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

Bug with documentation on mapped types #50728

Closed
devmanbr opened this issue Sep 11, 2022 · 4 comments
Closed

Bug with documentation on mapped types #50728

devmanbr opened this issue Sep 11, 2022 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@devmanbr
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.70.0
  • OS Version: Windows 10.0.19044

Why doesn't TypeScript/Vscode preserve documentation / JSDoc for mapped types?

Using this example that appears in the TypeScript documentation itself, which you can quickly reproduce in Vscode locally, you can see the problem.

It is expected that when remapping the keys of a type object, the documentation would remain what was defined in the original/previous keys, but this does not happen. Nothing is preserved.

This sucks in the development context, because it requires us to have to repeat the documentation of a property or method, for example, in multiple places, thousands of times. This can lead to consistency issues as the code grows and loses the point of automating things.

Another directly related problem is in Index Signatures. Even if documentation is added, nothing is preserved. This also includes Union Types. An example can be seen here.

In addition to this correction, I would also like to ask as an additional resource, if possible, the possibility of modifying the documentation during the "remapping" step. It could be something like using template literals.

P.s. I opened the issue in both places because I'm not sure if the source of the problem is in Vscode or TypeScript, or both.

@VSCodeTriageBot
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.71.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@devmanbr
Copy link
Author

Updated. The bug persists.

@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 12, 2022
@mjbvz mjbvz removed their assignment Sep 12, 2022
@jakebailey
Copy link
Member

I think this is the same as #50715, by the same author (just transferred).

@jakebailey jakebailey added the Duplicate An existing issue was already created label Sep 12, 2022
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants