Skip to content

Record types don't exist #11

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

Closed
Yu-Vitaqua-fer-Chronos opened this issue Sep 1, 2022 · 4 comments
Closed

Record types don't exist #11

Yu-Vitaqua-fer-Chronos opened this issue Sep 1, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Yu-Vitaqua-fer-Chronos
Copy link

Heya, @bensku is there any plans to add support for record types?

@Yu-Vitaqua-fer-Chronos
Copy link
Author

Also, is it possible to emit JSON? I want to use this project to create 'bindings' for another language I'm working on to interface with Java, and this would really be useful

@bensku bensku added the enhancement New feature or request label Sep 15, 2022
@bensku
Copy link
Owner

bensku commented Sep 15, 2022

See #10 for workaround that just skips records. I haven't looked too closely to it, but according to PR author it is a limitation of JavaParser. A better workaround that actually emits records might be possible, but I'm unlikely to work on it anytime soon.

JSON output is already available, but the format is neither documented or stable (see https://github.com/bensku/java-ts-bind/blob/master/src/main/java/io/github/bensku/tsbind/cli/Args.java for command-line option). I would not recommend using this for your own language as-is, but maybe this could serve as a starting point.

@Yu-Vitaqua-fer-Chronos
Copy link
Author

Hm fair enough, thanks! I've actually decided to use reflection to map out Java arguments and types, parameter names are included in bytecode if you specify it in javac so it's not too much of an issue thankfully

@bensku
Copy link
Owner

bensku commented Sep 21, 2022

For record, I built this to avoid loading classes (potentially with side effects in static initializers) and to convert Javadoc to JSDoc. If you don't need the latter, it is probably much easier to parse bytecode or (as you do), use reflection.

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