zed/crates/extension_api/wit
Marshall Bowers f92e6e9a95
Add support for context server extensions (#20250)
This PR adds support for context servers provided by extensions.

To provide a context server from an extension, you need to list the
context servers in your `extension.toml`:

```toml
[context_servers.my-context-server]
```

And then implement the `context_server_command` method to return the
command that will be used to start the context server:

```rs
use zed_extension_api::{self as zed, Command, ContextServerId, Result};

struct ExampleContextServerExtension;

impl zed::Extension for ExampleContextServerExtension {
    fn new() -> Self {
        ExampleContextServerExtension
    }

    fn context_server_command(&mut self, _context_server_id: &ContextServerId) -> Result<Command> {
        Ok(Command {
            command: "node".to_string(),
            args: vec!["/path/to/example-context-server/index.js".to_string()],
            env: Vec::new(),
        })
    }
}

zed::register_extension!(ExampleContextServerExtension);
```

Release Notes:

- N/A
2024-11-08 16:39:21 -05:00
..
since_v0.0.1 Remove duplicated code for unchanged parts of different extension API versions (#10218) 2024-04-08 10:16:12 -04:00
since_v0.0.4 Remove duplicated code for unchanged parts of different extension API versions (#10218) 2024-04-08 10:16:12 -04:00
since_v0.0.6 Clarify CodeLabel.filter_range doc (#11383) 2024-05-17 12:09:35 -04:00
since_v0.1.0 Further improve /tabs command and slash arguments completion (#16216) 2024-08-14 17:11:51 +03:00
since_v0.2.0 Add support for context server extensions (#20250) 2024-11-08 16:39:21 -05:00