-
Notifications
You must be signed in to change notification settings - Fork 18
Add node for angle bracket delimited built-in reference #11
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
base: master
Are you sure you want to change the base?
Conversation
|
@clason this is a fairly small change to fix an issue that breaks parsing of valid syntax. Are you able to review it? 🙏🏼 |
|
There's a bunch of unrelated changes in this PR; I'd prefer these to be made separately (if at all). And I'm not sure that is the correct fix, as these are not filenames. It's better to create a proper node for these constructs. |
|
I'll remove the unrelated changes and can update the PR to add a new node node for these no problem 👍🏼 |
|
@clason please let me know if this works better, happy to help get this fixed. |
|
Yes, that is better. Can you update the queries, too? (And more complex tests?) |
|
The issue is that this syntax is valid only in autocommands. |
|
@clason I'm having trouble getting the highlights to work. I've updated module.exports = grammar({
// ...
builtin_reference: ($) => /<[A-Za-z]+>/,
// ...
source_statement: ($) =>
bang_range_command(
$,
"source",
optional(field("file", choice($.filename, $.builtin_reference)))
),
// ...
});This makes the tests pass, but then in I'm able to get the right node type, and even get the proper node highlighted in the Treesitter playground with the query above: Any help or guidance to figure this out would be very much appreciated! 🙏🏼 |

This PR adds support for syntax such as

source <afile>. According to Neovim docs under:h afile, this is valid syntax but the parser currently errors out with this: