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

Web bindings: Auto-generate Node subclasses with getters for node fields #729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmbockhorst
Copy link
Contributor

Subclasses will only generate if the node-types object is passed as the second arg to Parser.Language.Load. This makes the web bindings more like the node bindings and was modeled after this commit.

This makes tree-sitter for very powerful using TypeScript when combined with a tool like described here: #707. As many users are using the web bindings in a node environment for cross-platform compatibility (like a LSP), I think it is beneficial to allow optional node-types to passed when loading the language so they can benefit from subclasses and extra type information.

The motivation for this is I'm implementing type inference for the Elm Language Server, and this will make things much cleaner.
/cc @razzeee

@razzeee
Copy link
Contributor

razzeee commented Nov 10, 2020

@maxbrunsfeld can you let us know if you are considering this?

Subclasses will only generate if the node-types object is passed as the second arg to Parser.Language.Load
@razzeee
Copy link
Contributor

razzeee commented Nov 26, 2020

Travis error seems unrelated, probably just needs to be rerun

@razzeee
Copy link
Contributor

razzeee commented Feb 6, 2021

@maxbrunsfeld any word on if this is wanted?

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.

None yet

3 participants