task: Add ZED_PACKAGE task variable in Rust files. (#9491)

This variable is experimental, as I expect it to be superseded by
whatever the extensions can provide (once we get them)

Release Notes:

- Added experimental ZED_PACKAGE task variable which contains name of
the current crate in Rust files.

---------

Co-authored-by: Kirill <kirill@zed.dev>
This commit is contained in:
Piotr Osiewicz 2024-03-18 12:18:42 +01:00 committed by GitHub
parent a69eddc081
commit 07dbee8651
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 53 additions and 2 deletions

View file

@ -171,6 +171,9 @@ fn task_context(
if let Some(symbol) = language_context.symbol {
env.insert("ZED_SYMBOL".into(), symbol);
}
if let Some(symbol) = language_context.package {
env.insert("ZED_PACKAGE".into(), symbol);
}
}
Some(TaskContext {