-
Hi! I am new to tree-sitter queries, and I am trying to capture the code placed between two comments. For example, with the following file: # A comment that should be markdown.
# #retest
println("Second cell!")
function foo(arguments)
end
# Another comment that is markdown. [test](https://klafyvel.me) I would like to capture the following code under println("Second cell!")
function foo(arguments)
end The Julia parser gives the following tree:
So I wrote the following query:
However, this captures individually each statement between comments as
I am obviously doing something wrong here, but I do not understand what. How can I write my query correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That is impossible with queries, I'm afraid. You can only capture nodes, not "stuff between nodes". You'll have to fake it using |
Beta Was this translation helpful? Give feedback.
That is impossible with queries, I'm afraid. You can only capture nodes, not "stuff between nodes". You'll have to fake it using
metadata
.