Steep and Sorbet LSPs emit errors in vanilla Ruby projects
The extension enables Steep and Sorbet LSPs by default, which is fine, but then these emit error messages in vanilla projects that don't use them:
Failed to run steep, sorbet. Click to show error.
This makes the extension less ergonomic. One quick workaround, of course, is to disable the LSPs in settings. But this is perhaps not what you want users to do?
Specifically,
Steep complains about a missing Steepfile. It should probably gracefully handle projects (e.g. remain silent) that don't have one instead of showing an error?
And Sorbet seems to have another one of those path-escaping bugs, which surfaces on macOS:
/Users/jdoe/Library/Application Support/Zed/extensions/work/ruby/gems/sorbet-0.5.12358/bin/srb: line 55:
/Users/jdoe/Library/Application: No such file or directory
Hi, I think there is something wrong with your configuration because both steep and sorbet are disabled by default: https://github.com/vitallium/zed/blob/83d361ba694fac74a131fde835ecae26b043100f/assets/settings/default.json#L1670 Can you please share your configuration? Thanks!
Right, so they’re disabled by the default settings, but in practice, they’ll spin up if you override the language_servers array (e.g. to switch to ruby-lsp) and don’t disable them again?
Not a big deal, but two things could help:
The docs could make it clear that if you override, you need to explicitly negate them, otherwise they may still activate.
Or if feasible, refactor to only start sorbet or steep when there’s a clear signal of project intent (sorbet/config, steep.yml, the gems in Gemfile.lock?). That would avoid surprise by design.
Which is what I was doing:
"languages": {
"Ruby": {
"language_servers": [
"ruby-lsp",
"rubocop",
"tailwindcss-language-server",
"!solargraph",
"..."
]
}
}
@hakanensari Hi! Sorry for the late reply. That expandable thing ... works in a somewhat weird way. It means the rest of the language servers, even the disabled ones. In other words, your record is translated into this array:
"languages": {
"Ruby": {
"language_servers": [
"ruby-lsp",
"rubocop",
"tailwindcss-language-server",
"!solargraph",
// "..." takes the rest of the language servers, excluding those mentioned above.
"steep",
"sorbet",
]
}
}
I think it should work the other way, as you described:
"languages": {
"Ruby": {
"language_servers": [
"ruby-lsp",
"rubocop",
"tailwindcss-language-server",
"!solargraph",
// "..." takes the rest of the language servers, excluding those mentioned above but keep the disabled prefix
"!steep",
"!sorbet",
]
}
}
I will double check that with upstream. You can workaround that by removing the rest of the language servers symbol or by explicitly disabling steep and sorbet. Thanks!
Ah, I sheepishly copy-pasted the ... from the docs without realizing it also pulls in Sorbet and Steep. Easy enough to fix, so not really a bug.
Might be nice if the docs explained what the ellipsis expands to, or if Sorbet and Steep, if enabled by default, only kicked in when a project actually has a config. Happy to close, just thought I’d share in case others trip over the same thing.
Might be nice if the docs explained what the ellipsis expands to, or if Sorbet and Steep, if enabled by default, only kicked in when a project actually has a config.
That sounds like a good idea! Thanks.