feat: add Solargraph as the built-in Ruby LSP preset

This commit is contained in:
2026-10-09 20:08:15 +02:00
parent 788638f34e
commit 099c15771f
6 changed files with 32 additions and 15 deletions
+5 -4
View File
@@ -10,9 +10,10 @@ pub fn resolve(value: Value) -> Result<Vec<ServerConfig>, String> {
if language_id.is_empty() || language_id.chars().any(char::is_control) {
return Err("LSP language keys must not be empty or contain control characters".into());
}
let preset = match language_id.as_str() {
"rust" => Some(("rust-analyzer", "rs")),
"python" => Some(("pylsp", "py")),
let preset: Option<(&[&str], &str)> = match language_id.as_str() {
"rust" => Some((&["rust-analyzer"], "rs")),
"python" => Some((&["pylsp"], "py")),
"ruby" => Some((&["solargraph", "stdio"], "rb")),
_ => None,
};
let mut options = match value {
@@ -45,7 +46,7 @@ pub fn resolve(value: Value) -> Result<Vec<ServerConfig>, String> {
let command = match options.remove("command") {
Some(value) => command(value, &language_id)?,
None => match preset {
Some((command, _)) => vec![command.into()],
Some((command, _)) => command.iter().map(|argument| (*argument).into()).collect(),
None => {
return Err(format!(
"LSP language {language_id:?} requires command argv"