Skip to content

Conversation

@tristan-f-r
Copy link
Contributor

Closes #7854. Extracts generics along with the name to establish extra information when converting to typescript.

I would absolutely love a suggestion on this, as the current trick to un-indent the closing brace in generics is a bit hacky and may not work in different use cases.

@changeset-bot
Copy link

changeset-bot bot commented Jan 31, 2023

⚠️ No Changeset found

Latest commit: 55785cd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Did you encounter another occurence of generics in a /// file: snippet besides the one screenshotted in the issue? Because frankly, if they only look like this, we shouldn't worry about optimizing for every possible case right now

@tristan-f-r
Copy link
Contributor Author

I couldn't find any other example of generics.

@Rich-Harris
Copy link
Member

looks great — thanks so much!

@Rich-Harris Rich-Harris merged commit bb97b79 into sveltejs:master Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle generics when converting JS code samples to TS

3 participants