-
Notifications
You must be signed in to change notification settings - Fork 3
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
zeekygen_next_comment
attached to wrong scope
#15
Comments
bbannier
added a commit
to bbannier/tree-sitter-zeek
that referenced
this issue
Mar 30, 2023
This is a workaround for zeek/tree-sitter-zeek#15.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to extract docstrings over in https://github.com/bbannier/zeek-language-server I check for any direct previous siblings which are
zeekygen_next_comment
. This breaks for e.g., enums, see bbannier/zeek-language-server#87.The issue here is that
zeekygen_next_comment
is anextras
node which can appear anywhere. Since enums always contain a redundantenum_body
(which corresponds to nothing in the source), Tree-sitter opts to inserts the comment before the body instead of inside the body before the first element, so the comment is not a sibling of the value it documents. One fix for this would be to omitenum_body
from the grammar or at least the CST so we more directly reflect what is in the source.The text was updated successfully, but these errors were encountered: