chore: Fix several style lints (#17488)
It's not comprehensive enough to start linting on `style` group, but hey, it's a start. Release Notes: - N/A
This commit is contained in:
@@ -28,7 +28,7 @@ impl zed::Extension for ElixirExtension {
|
||||
) -> Result<zed::Command> {
|
||||
match language_server_id.as_ref() {
|
||||
ElixirLs::LANGUAGE_SERVER_ID => {
|
||||
let elixir_ls = self.elixir_ls.get_or_insert_with(|| ElixirLs::new());
|
||||
let elixir_ls = self.elixir_ls.get_or_insert_with(ElixirLs::new);
|
||||
|
||||
Ok(zed::Command {
|
||||
command: elixir_ls.language_server_binary_path(language_server_id, worktree)?,
|
||||
@@ -37,7 +37,7 @@ impl zed::Extension for ElixirExtension {
|
||||
})
|
||||
}
|
||||
NextLs::LANGUAGE_SERVER_ID => {
|
||||
let next_ls = self.next_ls.get_or_insert_with(|| NextLs::new());
|
||||
let next_ls = self.next_ls.get_or_insert_with(NextLs::new);
|
||||
|
||||
Ok(zed::Command {
|
||||
command: next_ls.language_server_binary_path(language_server_id, worktree)?,
|
||||
@@ -46,7 +46,7 @@ impl zed::Extension for ElixirExtension {
|
||||
})
|
||||
}
|
||||
Lexical::LANGUAGE_SERVER_ID => {
|
||||
let lexical = self.lexical.get_or_insert_with(|| Lexical::new());
|
||||
let lexical = self.lexical.get_or_insert_with(Lexical::new);
|
||||
let lexical_binary =
|
||||
lexical.language_server_binary(language_server_id, worktree)?;
|
||||
|
||||
@@ -110,13 +110,10 @@ impl zed::Extension for ElixirExtension {
|
||||
language_server_id: &LanguageServerId,
|
||||
worktree: &zed::Worktree,
|
||||
) -> Result<Option<serde_json::Value>> {
|
||||
match language_server_id.as_ref() {
|
||||
ElixirLs::LANGUAGE_SERVER_ID => {
|
||||
if let Some(elixir_ls) = self.elixir_ls.as_mut() {
|
||||
return elixir_ls.language_server_workspace_configuration(worktree);
|
||||
}
|
||||
if language_server_id.as_ref() == ElixirLs::LANGUAGE_SERVER_ID {
|
||||
if let Some(elixir_ls) = self.elixir_ls.as_mut() {
|
||||
return elixir_ls.language_server_workspace_configuration(worktree);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
Ok(None)
|
||||
|
||||
@@ -34,7 +34,7 @@ impl ElixirLs {
|
||||
}
|
||||
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
||||
);
|
||||
let release = zed::latest_github_release(
|
||||
@@ -63,7 +63,7 @@ impl ElixirLs {
|
||||
|
||||
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::Downloading,
|
||||
);
|
||||
|
||||
@@ -83,7 +83,7 @@ impl ElixirLs {
|
||||
for entry in entries {
|
||||
let entry = entry.map_err(|e| format!("failed to load directory entry {e}"))?;
|
||||
if entry.file_name().to_str() != Some(&version_dir) {
|
||||
fs::remove_dir_all(&entry.path()).ok();
|
||||
fs::remove_dir_all(entry.path()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ impl Lexical {
|
||||
}
|
||||
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
||||
);
|
||||
let release = zed::latest_github_release(
|
||||
@@ -83,7 +83,7 @@ impl Lexical {
|
||||
|
||||
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::Downloading,
|
||||
);
|
||||
|
||||
@@ -103,7 +103,7 @@ impl Lexical {
|
||||
for entry in entries {
|
||||
let entry = entry.map_err(|e| format!("failed to load directory entry {e}"))?;
|
||||
if entry.file_name().to_str() != Some(&version_dir) {
|
||||
fs::remove_dir_all(&entry.path()).ok();
|
||||
fs::remove_dir_all(entry.path()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ impl NextLs {
|
||||
}
|
||||
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::CheckingForUpdate,
|
||||
);
|
||||
let release = zed::latest_github_release(
|
||||
@@ -77,7 +77,7 @@ impl NextLs {
|
||||
|
||||
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
|
||||
zed::set_language_server_installation_status(
|
||||
&language_server_id,
|
||||
language_server_id,
|
||||
&zed::LanguageServerInstallationStatus::Downloading,
|
||||
);
|
||||
|
||||
@@ -95,7 +95,7 @@ impl NextLs {
|
||||
for entry in entries {
|
||||
let entry = entry.map_err(|e| format!("failed to load directory entry {e}"))?;
|
||||
if entry.file_name().to_str() != Some(&version_dir) {
|
||||
fs::remove_dir_all(&entry.path()).ok();
|
||||
fs::remove_dir_all(entry.path()).ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user