emmet: Upgrade zed_extension_api
to v0.0.6 (#15177)
This PR upgrades the Emmet extension to use v0.0.6 of the `zed_extension_api`. Release Notes: - N/A
This commit is contained in:
parent
3053f98652
commit
aded3dfb05
3 changed files with 8 additions and 16 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -13767,7 +13767,7 @@ dependencies = [
|
||||||
name = "zed_emmet"
|
name = "zed_emmet"
|
||||||
version = "0.0.3"
|
version = "0.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zed_extension_api 0.0.4",
|
"zed_extension_api 0.0.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -13,4 +13,4 @@ path = "src/emmet.rs"
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zed_extension_api = "0.0.4"
|
zed_extension_api = "0.0.6"
|
||||||
|
|
|
@ -13,14 +13,14 @@ impl EmmetExtension {
|
||||||
fs::metadata(SERVER_PATH).map_or(false, |stat| stat.is_file())
|
fs::metadata(SERVER_PATH).map_or(false, |stat| stat.is_file())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn server_script_path(&mut self, config: zed::LanguageServerConfig) -> Result<String> {
|
fn server_script_path(&mut self, language_server_id: &zed::LanguageServerId) -> Result<String> {
|
||||||
let server_exists = self.server_exists();
|
let server_exists = self.server_exists();
|
||||||
if self.did_find_server && server_exists {
|
if self.did_find_server && server_exists {
|
||||||
return Ok(SERVER_PATH.to_string());
|
return Ok(SERVER_PATH.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
zed::set_language_server_installation_status(
|
zed::set_language_server_installation_status(
|
||||||
&config.name,
|
language_server_id,
|
||||||
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
||||||
);
|
);
|
||||||
let version = zed::npm_package_latest_version(PACKAGE_NAME)?;
|
let version = zed::npm_package_latest_version(PACKAGE_NAME)?;
|
||||||
|
@ -29,7 +29,7 @@ impl EmmetExtension {
|
||||||
|| zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version)
|
|| zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version)
|
||||||
{
|
{
|
||||||
zed::set_language_server_installation_status(
|
zed::set_language_server_installation_status(
|
||||||
&config.name,
|
language_server_id,
|
||||||
&zed::LanguageServerInstallationStatus::Downloading,
|
&zed::LanguageServerInstallationStatus::Downloading,
|
||||||
);
|
);
|
||||||
let result = zed::npm_install_package(PACKAGE_NAME, &version);
|
let result = zed::npm_install_package(PACKAGE_NAME, &version);
|
||||||
|
@ -63,10 +63,10 @@ impl zed::Extension for EmmetExtension {
|
||||||
|
|
||||||
fn language_server_command(
|
fn language_server_command(
|
||||||
&mut self,
|
&mut self,
|
||||||
config: zed::LanguageServerConfig,
|
language_server_id: &zed::LanguageServerId,
|
||||||
_: &zed::Worktree,
|
_worktree: &zed::Worktree,
|
||||||
) -> Result<zed::Command> {
|
) -> Result<zed::Command> {
|
||||||
let server_path = self.server_script_path(config)?;
|
let server_path = self.server_script_path(language_server_id)?;
|
||||||
Ok(zed::Command {
|
Ok(zed::Command {
|
||||||
command: zed::node_binary_path()?,
|
command: zed::node_binary_path()?,
|
||||||
args: vec![
|
args: vec![
|
||||||
|
@ -80,14 +80,6 @@ impl zed::Extension for EmmetExtension {
|
||||||
env: Default::default(),
|
env: Default::default(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn language_server_initialization_options(
|
|
||||||
&mut self,
|
|
||||||
_: zed::LanguageServerConfig,
|
|
||||||
_: &zed::Worktree,
|
|
||||||
) -> Result<Option<String>> {
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zed::register_extension!(EmmetExtension);
|
zed::register_extension!(EmmetExtension);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue