mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
d30361537e
This PR updates the `SlashCommand` trait to use a streaming return type. This change is just at the trait layer. The goal here is to decouple changing the trait's API while preserving behavior on either side. The `SlashCommandOutput` type now has two methods for converting two and from a stream to use in cases where we're not yet doing streaming. On the `SlashCommand` implementer side, the implements can call `to_event_stream` to produce a stream of events based off the `SlashCommandOutput`. On the slash command consumer side we use `SlashCommandOutput::from_event_stream` to convert a stream of events back into a `SlashCommandOutput`. The `/file` slash command has been updated to emit `SlashCommandEvent`s directly in order for it to work properly. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
29 lines
648 B
TOML
29 lines
648 B
TOML
[package]
|
|
name = "assistant_slash_command"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
publish = false
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/assistant_slash_command.rs"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
collections.workspace = true
|
|
derive_more.workspace = true
|
|
futures.workspace = true
|
|
gpui.workspace = true
|
|
language.workspace = true
|
|
parking_lot.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
workspace.workspace = true
|
|
|
|
[dev-dependencies]
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
pretty_assertions.workspace = true
|
|
workspace = { workspace = true, features = ["test-support"] }
|