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:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -88,7 +88,7 @@ impl RubyLsp {
pub fn label_for_symbol(&self, symbol: Symbol) -> Option<CodeLabel> {
let name = &symbol.name;
return match symbol.kind {
match symbol.kind {
SymbolKind::Method => {
let code = format!("def {name}; end");
let filter_range = 0..name.len();
@ -123,6 +123,6 @@ impl RubyLsp {
})
}
_ => None,
};
}
}
}

View file

@ -29,15 +29,15 @@ impl zed::Extension for RubyExtension {
) -> Result<zed::Command> {
match language_server_id.as_ref() {
Solargraph::LANGUAGE_SERVER_ID => {
let solargraph = self.solargraph.get_or_insert_with(|| Solargraph::new());
let solargraph = self.solargraph.get_or_insert_with(Solargraph::new);
solargraph.language_server_command(language_server_id, worktree)
}
RubyLsp::LANGUAGE_SERVER_ID => {
let ruby_lsp = self.ruby_lsp.get_or_insert_with(|| RubyLsp::new());
let ruby_lsp = self.ruby_lsp.get_or_insert_with(RubyLsp::new);
ruby_lsp.language_server_command(language_server_id, worktree)
}
Rubocop::LANGUAGE_SERVER_ID => {
let rubocop = self.rubocop.get_or_insert_with(|| Rubocop::new());
let rubocop = self.rubocop.get_or_insert_with(Rubocop::new);
rubocop.language_server_command(language_server_id, worktree)
}
language_server_id => Err(format!("unknown language server: {language_server_id}")),