-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Inconsistent syntax highlighting #69
Comments
deriamis
added a commit
to deriamis/tree-sitter-gleam
that referenced
this issue
Sep 19, 2023
In the previous version of the grammar, attributes essentially "floated" in the tree, meaning they were not actually attached to anything. This was causing odd issues with syntax highlighting, such as external functions marked with an `@external` attribute causing subsequent syntax highlighting to fail in source files. This commit attaches attribute nodes only to legal parent nodes (functions and statement blocks) to make syntax highlighting more consistent. Closes gleam-lang#69
Do you have an example snippet that has this behavior? I think this may be #67 which was fixed on main recently |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When editing a source file, using attributes can cause odd syntax highlighting failures. For instance, using the
@external
attribute to mark an external function will cause the rest of the source file to be parsed incorrectly unless the function defines a fallback implementation.A solution to this problem would likely be to attach attributes to legal parent nodes, such as functions and statement blocks. This would allow tree-sitter to more consistently "complete" a tree as soon as it matches a syntax node.
The text was updated successfully, but these errors were encountered: