Open deecewan opened 5 months ago
Just out of curiosity: how are you getting Sorbet to work with Zed in the first place?
@timothyshrugged i created a custom plugin that implemented the LSP plugin interface for zed. Then just called the sorbet language server underneath that.
Check for existing issues
Describe the feature
For sorbet for Ruby, the language server needs exactly 1 input directory. This is the directory that contains the
sorbet/
directory (and by extension, the config).if I have a project that looks like this, for instance:
when I open
root/
in Zed, it will start the language server with the cwd set toroot/
. The problem is, is that Sorbet doesn't find asorbet/
directory there, so errors. Per-project, I could set a config value to say "loadapi/
" and then update the extension to launch the LSP correctly for that directory. But there's no way to check that, for the file I'm looking at, where that directory should be.Also, if I have a project that looks like this:
I can't start language servers for both, because a language server is based solely on a root, and there's no way to set config in that case, because it'd need two different values at the same time.
Ideally, I'd like to be able to get the file I'm looking at, and return a language server for that file. In the first instance, I'd get the ruby file, and return a root of
root/api
. In the second, I'd start 2 servers with unique IDs, and have the IDs cached (somehow...). Then for every file that is opened, my extension can start (or return) a language server that should handle that file.This is pretty much how neovim supports language servers right now, where the plugin is asked about each file, instead of the language as a whole.
Somewhat relatedly, even if I did set the
root/api
dir for the first case, Sorbet doesn't return fully-qualified files. Rather, it returns file names relative to theroot/api/
. When Zed tries to open them (say, for "Go to definition"), the file doesn't exist. It returnssome-file.rb
instead ofapi/some-file.rb
, for instance.If applicable, add mockups / screenshots to help present your vision of the feature
No response