Allow task context providers to access project env (#17964)

Closes #13106

Release Notes:

- Task context providers now have access to the local shell environment,
allowing local rust tool installations to work

Before:
<img width="1136" alt="Screenshot 2024-09-17 at 22 09 38"
src="https://github.com/user-attachments/assets/7d6c5606-4820-4f6f-92d1-c3d314b9ab42">

After:
<img width="1136" alt="Screenshot 2024-09-17 at 22 09 58"
src="https://github.com/user-attachments/assets/a962e607-15f5-44ce-b53e-a0dbe135f2d8">
This commit is contained in:
Stanislav Alekseev 2024-09-17 22:49:12 +03:00 committed by GitHub
parent d3d3a093b4
commit 8a6c65c63b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 50 additions and 25 deletions

View file

@ -1,5 +1,6 @@
use anyhow::Result;
use async_trait::async_trait;
use collections::HashMap;
use gpui::AppContext;
use gpui::AsyncAppContext;
use language::{ContextProvider, LanguageServerName, LspAdapter, LspAdapterDelegate};
@ -215,6 +216,7 @@ impl ContextProvider for PythonContextProvider {
&self,
variables: &task::TaskVariables,
_location: &project::Location,
_: Option<&HashMap<String, String>>,
_cx: &mut gpui::AppContext,
) -> Result<task::TaskVariables> {
let python_module_name = python_module_name_from_relative_path(