Extract Zig support into an extension (#9893)

This PR extracts Zig support into an extension and removes the built-in
Zig support from Zed.

There's a small workaround necessary in order for us to set the file
permissions on the `zls` binary so that it can be run. Eventually we'll
want to build this into the extension API, but for now we're just
hard-coding it on the host side.

Release Notes:

- Removed built-in support for Zig, in favor of making it available as
an extension. The Zig extension will be suggested for download when you
open a `.zig` file.
This commit is contained in:
Marshall Bowers 2024-03-27 20:56:30 -04:00 committed by GitHub
parent 9bce5e8b82
commit ff685b299d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 170 additions and 158 deletions

View file

@ -56,6 +56,19 @@ impl LspAdapter for ExtensionLspAdapter {
.host
.path_from_extension(&self.extension.manifest.id, command.command.as_ref());
// TODO: Eventually we'll want to expose an extension API for doing this, but for
// now we just manually set the file permissions for extensions that we know need it.
if self.extension.manifest.id.as_ref() == "zig" {
#[cfg(not(windows))]
{
use std::fs::{self, Permissions};
use std::os::unix::fs::PermissionsExt;
fs::set_permissions(&path, Permissions::from_mode(0o755))
.context("failed to set file permissions")?;
}
}
Ok(LanguageServerBinary {
path,
arguments: command.args.into_iter().map(|arg| arg.into()).collect(),