# tasks: Expose captured variables to ContextProvider \(\#12134\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/58796a8480943f15b8b6a04f534a58db5ecd34e8)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 58796a8480943f15b8b6a04f534a58db5ecd34e8

Requested commit: 58796a8480943f15b8b6a04f534a58db5ecd34e8

Commit: 58796a8480943f15b8b6a04f534a58db5ecd34e8

Tree: f898864ed86fe7db23167674ef4b88ef16adbe11

Author: Piotr Osiewicz

Committer: GitHub

## Message

```
tasks: Expose captured variables to ContextProvider (#12134)

This PR changes the interface of ContextProvider, allowing it to inspect
*all* variables set so far during the process of building
`TaskVariables`. This makes it possible to capture e.g. an identifier in
tree-sitter query, process it and then export it as a task variable.

Notably, the list of variables includes captures prefixed with leading
underscore; they are removed after all calls to `build_context`, but it
makes it possible to capture something and then conditionally preserve
it (and perhaps modify it).

Release Notes:

- N/A
```

## Parents

- [ba9449692eca1bd285150d8be1122073f494da4e](https://git.cafe/gitcafe/zed/commit/ba9449692eca1bd285150d8be1122073f494da4e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/58796a8480943f15b8b6a04f534a58db5ecd34e8?format=markdown)
