Evergreen-lxl / Evergreen.lxl

🌳 Treesitter support for Lite XL.
MIT License
36 stars 8 forks source link

c/cpp: Fix #undef #72

Closed 87flowers closed 3 weeks ago

87flowers commented 3 weeks ago

Closes #71.

Issue here is @_u captures #undef thus @preproc doesn't pick #undef up.

Here we just rename @_u to something more user-facing and then document this, which fixes the problem.

TorchedSammy commented 3 weeks ago

considering that preproc is already a thing that should be used instead of undefine which is only used for #undef in c++.

@xcb-xwii if changes to queries are required for certain languages how are those going to be addressed in the open PRs?

87flowers commented 3 weeks ago

considering that preproc is already a thing that should be used instead of undefine which is only used for #undef in c++.

For consistency, I note that define already exists which is only used for #define in c and c++.

TorchedSammy commented 3 weeks ago

well.. that can also be changed to be preproc.

xcb-xwii commented 3 weeks ago

considering that preproc is already a thing that should be used instead of undefine which is only used for #undef in c++.

@xcb-xwii if changes to queries are required for certain languages how are those going to be addressed in the open PRs?

Ideally they should not be needed at all.

In fact this issue is already fixed in the new PR. Captures starting with underscores are supposed to be ignored entirely, which has been implemented.

xcb-xwii commented 3 weeks ago

See ea55305543a6b5decb816c25bcb12e4489a97c10

87flowers commented 3 weeks ago

@xcb-xwii many thanks.