Skip to content

Commit

Permalink
Fix several style lints (zed-industries/zed#17488)
Browse files Browse the repository at this point in the history
It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
  • Loading branch information
osiewicz authored Sep 6, 2024
1 parent f40c010 commit 9a6f239
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/language_servers/ruby_lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -123,6 +123,6 @@ impl RubyLsp {
})
}
_ => None,
};
}
}
}
6 changes: 3 additions & 3 deletions src/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")),
Expand Down

0 comments on commit 9a6f239

Please sign in to comment.