tasks: Provide task variables from matching runnable ranges in task modal (#12237)

In #12003 we found ourselves in need for precise region tracking in
which a given runnable has an effect in order to grab variables from it.
This PR makes it so that in task modal all task variables from queries
overlapping current cursor position.
However, in the process of working on that I've found that we cannot
always use a top-level capture to represent the full match range of
runnable (which has been my assumption up to this point). Tree-sitter
captures cannot capture sibling groups; we did just that in Rust
queries.

Thankfully, none of the extensions are affected as in them, a capture is
always attached to single node. This PR adds annotations to them
nonetheless; we'll be able to get rid of top-level captures in extension
runnables.scm once this PR is in stable version of Zed.


Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-05-24 21:00:23 +02:00 committed by GitHub
parent 08a3d3a0c2
commit 27229bba6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 295 additions and 183 deletions

View file

@ -1,9 +1,13 @@
; Functions with names ending in `_test`.
; This matches the standalone test style used by Startest and Gleeunit.
(
(function name: (_) @run
(#match? @run ".*_test$"))
) @gleam-test
(
(function name: (_) @run
(#match? @run ".*_test$"))
) @gleam-test
(#set! tag gleam-test)
)
; `describe` API for Startest.
(
@ -17,4 +21,5 @@
)
)
)
(#set! tag gleam-test)
) @gleam-test