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

Standardised node names #195

Open
Aerijo opened this issue Aug 15, 2018 · 2 comments
Open

Standardised node names #195

Aerijo opened this issue Aug 15, 2018 · 2 comments

Comments

@Aerijo
Copy link

Aerijo commented Aug 15, 2018

This is probably useful for more than just Atom, so I'm raising it here.

To allow packages to take advantage of these grammars, it would help a lot to have a standardised list of common nodes and their expected range.

E.g., most languages have strings, so the standard might be something like

string: $ => seq('"', <stuff>, '"') // from tree-sitter-javascript

This would allow the toggle-quotes package to reliably find strings in any language, without needing to add a bunch of cases for all the possible node names.

OK. That example was a bit weak. But the idea is pretty much to have a similar set of guidelines the TextMate language docs provide. Even referencing that guide directly should be enough to keep community grammars from branching out on their own unique styles and conventions.

@maxbrunsfeld
Copy link
Contributor

This would allow the toggle-quotes package to reliably find strings in any language, without needing to add a bunch of cases for all the possible node names.

OK. That example was a bit weak.

No, I actually think that's a pretty good example! I haven't really thought about this much recently, but you're probably right; if we spent a bit more effort standardizing them, it could make the trees more useful overall.

@michaelblyons
Copy link

Another reference for scope naming conventions from the Sublime Text documentation.

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

No branches or pull requests

3 participants