-
Notifications
You must be signed in to change notification settings - Fork 105
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
Hard to get some symbols inside macro calls and definitions on the user side #71
Comments
No, I think it's reasonable to change the definition of |
Maybe because it is allowed any kind of string, for example I could do But I would like to at least the normal Rust operators be able to be captured inside macros. |
In the case of Atom, it should be re-parsing the body of the macro with the Rust parser, in order to highlight it correctly. There aren't well-documented APIs for accessing these nested parse trees, but I think you can use this method to access nodes from 'syntax layers' other than the root layer. |
I can use this method inside of the Atom tree-sitter grammar definition? And how so? |
Oh, I thought you were wanting to access the symbols programatically. For highlighting, I believe that should already work out of the box, because Atom re-parses the contents of token trees as rust source code. This is set up here: https://github.com/atom/atom/blob/0b34be796312a94331acbc4602944cfe3666c76a/packages/language-rust-bundled/lib/main.js#L2-L13. |
Yeah, true, doing that it does reparse the token tree, but that I would like to happen on |
This seems to be of similar concern to #98 |
They're treated separately now |
Not sure if it's a proper bug, but I got myself unable to classify some symbols on Atom inside macros.
Like, when I define something like:
It will classify all
+
signs, except inside macro invocations and macro definitionsThe same are true for all operator-like symbols and the
in
, but other keywords work just fine.Looking at the code, I suspect that this happens inside
_non_special_token
, wherein
is not there and the operator-like symbols are defined by a regular expression/[/_\-=->,;:::!=?.@*=/='&=#%=^=+<>|~]+/
, not separated strings.Again, not sure if it can be considered a bug or if it should be handled in some way on the user side.
The text was updated successfully, but these errors were encountered: