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

Refactor syntax codegen to isolate one type per module #572

Closed
OmarTawfik opened this issue Aug 22, 2023 · 1 comment
Closed

Refactor syntax codegen to isolate one type per module #572

OmarTawfik opened this issue Aug 22, 2023 · 1 comment
Assignees

Comments

@OmarTawfik
Copy link
Contributor

I suggest keeping every type/API in a single place. This makes it much easier to maintain or edit together, instead of editing one version and spending the time to look for others, possibly missing them. This way, all types/APIs can evolve together, and we don't have to maintain separate hierarchies.

So instead of this:

  • src/parse_error.rs shared + rust stuff
  • src/visitor.rs shared + rust stuff
  • src/napi/parse_error.rs napi stuff
  • src/napi/visitor.rs napi stuff

I suggest this:

  • src/parse_error/mod.rs shared stuff
  • src/parse_error/rust.rs rust stuff
  • src/parse_error/napi.rs napi stuff
  • src/visitor/mod.rs shared stuff
  • src/visitor/rust.rs rust stuff
  • src/visitor/napi.rs napi stuff

This way, they can also follow (roughly) the same structure as the public API. For example, if I'm adding a new method to Cursor, it is really easy to miss its NAPI counterpart if it is not within the same module/folder. This is a trivial example, but there are more complicated scenarios.

The more atomic/holistic each type/module can be, the easier it is to update/revision accurately.

Originally posted by @OmarTawfik in #564 (comment)

@OmarTawfik
Copy link
Contributor Author

Created by mistake. Duplicate of #570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants