Open hanickadot opened 1 month ago
Hi Hana,
You can use worktree-local settings file to run different language servers based on the worktree you're in.
Place settings.json
in .zed/
directory at the root of your worktree. Settings from that file will apply only to this particular worktree.
Now, I'm unsure whether you want your projects to default to your custom copy of clangd or to the system clangd.
"lsp": {
"clangd": {
"binary": {
"path": "path-to-your-dev-clangd"
// you can also pass in "args" as an array.
}
}
}
That's it.
"lsp": {
"clangd": {
"binary": {
"path": "path-to-your-dev-clangd"
// you can also pass in "args" as an array.
}
}
}
"lsp": {
"clangd": {
"binary": {
"path_lookup": true,
}
}
}
Admittedly I'm unsure if 2. will actually work, as I haven't ran that kind of setup myself. Also, in case you're looking to run two different language servers within the same worktree (based on the distinction between test files and LLVM itself that you highlighted in the OP), that's not possible at the moment. You'd have to open test files subdirectory as a separate worktree. In that case, you can place .zed/settings.json at the root of tests dir.
Thanks for checking Zed out and for your work on CTRE btw. :)
Thank you!
Also, in case you're looking to run two different language servers within the same worktree (based on the distinction between test files and LLVM itself that you highlighted in the OP), that's not possible at the moment.
This is a little disappointing but totally understandable as I guess this is really a niche use-case :) I hoped there will be something similar as TextMate is doing having any setting customizable based on glob mask. Two work trees is probably a solution I can live with.
I was about to file a similar request for but for python. In short, in an editor workspace that contains multiple python projects, each with their own pyproject.toml, venv and pyrightconfig, the most robust way to run pyright or basedpyright is per-project.
There's now an extension that allows running basedpyright that's been mentioned in #7808 but since there's only a single python lsp instance running per editor workspace, you can't configure multiple python path or venv options.
Check for existing issues
Describe the feature
I need ability to run multiple instances of different language servers for same language. I'm developing changes in clang and for test files I would like to run my own modified clangd. But for llvm project itself I would like to use system clangd.
Is this scenario possible? I couldn't find a way how to set up two LSPs for same language.
If applicable, add mockups / screenshots to help present your vision of the feature
No response