-
Notifications
You must be signed in to change notification settings - Fork 212
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
Update c queries and test #363
Conversation
Tests are broken. |
be0e05a
to
a3353a4
Compare
I tried to fix the error (and during this I simplified this pull request for now), but it seems to be a problem with the parser? Here is the error message:
Is the parser not updated in the GitHub tests? Or am I maybe misunderstanding the error? |
FYI, the else_clause in the C parser is fairly recent. @Danielkonge please find the fix here: https://github.com/antoinemadec/nvim-treesitter-context/tree/feat/c_else_clause You were missing the update on I will let you merge it on this MR 😉 |
Thank for you for the help @antoinemadec, I tried adding your changes, but the GitHub tests seem to still be failing. Since neovim 0.9.1 (used in the tests) is from May 2023, I guess the parser might not be updated too, but I don't really want to change to much about the tests themselves, since I don't have much knowledge on the details of them. (I can help with writing queries for treesitter or Lua code in general, but I haven't really looked into all the testing stuff for neovim yet, since I don't have a plugin myself.) (Also, if you are able to fix the tests, feel free to make a separate pull request.) |
treesitter is still experimental, so we can just support the latest release (v0.9.5) |
A lot of the current C queries include an extra line with only
{
if you format your code in this style:For the context that whole line with only
{
is wasted space, so this simplifies some queries to not include that{
. If you want to always include{
instead, I can update the queries.Also, this catches
if
,else if
andelse
with the expected pattern (see #356).If the queries should catch the extra "{", then I can rewrite this a bit so it still catches
else if
andelse
, but otherwise doesn't change anything.Note: I can rewrite the test that is currently failing if you want to merge this pull request.