ZIm/crates/collab/src
Thorsten Ball fc4c533d0a
zed: Use CLI env for lang servers, tasks, terminal (#17075)
This changes the Zed CLI `zed` to pass along the environment to the Zed
project that it opens (if it opens a new one).

In projects, this CLI environment will now take precedence over any
environment that's acquired by running a login shell in a projects
folder.

The result is that `zed my/folder` now always behaves as if one would
run `zed --foreground` without any previous Zed version running.


Closes #7894
Closes #16293 

Related issues:
- It fixes the issue described in here:
https://github.com/zed-industries/zed/issues/4977#issuecomment-2305272027


Release Notes:

- Improved the Zed CLI `zed` to pass along the environment as it was on
the CLI to the opened Zed project. That environment is then used when
opening new terminals, spawning tasks, or language servers.
Specifically:
- If Zed was started via `zed my-folder`, a terminal spawned with
`workspace: new terminal` will inherit these environment variables that
existed on the CLI
- Specific language servers that allow looking up the language server
binary in the environments `$PATH` (such as `gopls`, `zls`,
`rust-analyzer` if configured, ...) will look up the language server
binary in the CLI environment too and use that environment when starting
the process.
- Language servers that are _not_ found in the CLI environment (or
configured to not be found in there), will be spawned with the CLI
environment in case that's set. That means users can do something like
`RA_LOG=info zed .` and it will be picked up the rust-analyzer that was
spawned.

Demo/explanation:



https://github.com/user-attachments/assets/455905cc-8b7c-4fc4-b98a-7e027d97cdfa
2024-08-29 18:09:06 +02:00
..
api collab: Fix writing LLM rate limit events to Clickhouse (#16367) 2024-08-16 14:03:34 -04:00
bin Fix .env.toml paths (#15645) 2024-08-01 15:43:29 -04:00
db Update Rust crate sqlx to 0.8 [SECURITY] (#16791) 2024-08-28 21:08:15 -07:00
llm Anthropic/OpenAI: Add country codes for territories (#17089) 2024-08-29 11:32:29 -04:00
rpc Bump collab min version to 0.134 (#16918) 2024-08-27 21:44:00 -06:00
tests zed: Use CLI env for lang servers, tasks, terminal (#17075) 2024-08-29 18:09:06 +02:00
api.rs collab: Make users.github_user_id required and unique (#16704) 2024-08-22 18:27:22 -04:00
auth.rs Introduce a separate backend service for LLM calls (#15831) 2024-08-05 20:26:21 -04:00
clickhouse.rs collab: Fix writing LLM rate limit events to Clickhouse (#16367) 2024-08-16 14:03:34 -04:00
completion.rs Supermaven (#10788) 2024-05-03 12:50:42 -07:00
db.rs collab: Setup database for LLM service (#15882) 2024-08-06 17:18:08 -04:00
env.rs collab: Add support for reading boolean values from .env.toml (#16317) 2024-08-15 17:07:17 -04:00
errors.rs Remove more unused code related to GitHub auth and errors 2022-04-21 08:57:49 -06:00
executor.rs Remove 2 suffix for collab, rope, settings, menu 2024-01-03 12:29:16 -08:00
lib.rs collab: Backfill github_user_created_at on users (#16600) 2024-08-21 12:38:51 -04:00
llm.rs collab: Report when upstream rate limit is exceeded (#17083) 2024-08-29 08:54:45 -04:00
main.rs collab: Record geoip_country_code on HTTP request spans (#17092) 2024-08-29 11:33:51 -04:00
migrations.rs collab: Remove unused parameter to run_database_migrations (#15883) 2024-08-06 17:31:52 -04:00
rate_limiter.rs Show rate limit notices (#15515) 2024-07-31 12:05:19 -07:00
rpc.rs Bump collab min version to 0.134 (#16918) 2024-08-27 21:44:00 -06:00
seed.rs collab: Make users.github_user_id required and unique (#16704) 2024-08-22 18:27:22 -04:00
tests.rs Add the ability to edit remote directories over SSH (#14530) 2024-07-19 10:27:26 -07:00
user_backfiller.rs collab: Look up users using github_user_id when backfilling (#16708) 2024-08-22 19:58:04 -04:00