Closed andreicek closed 3 months ago
@andreicek Do you happen to have a language_overrides
key in your settings as well?
Ah yes, I do have:
"language_overrides": {
"Elixir": {
"format_on_save": {
"external": {
"command": "mix",
"arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
}
}
}
}
Is this problematic? Can it be moved somewhere?
Ah yes, I do have:
"language_overrides": { "Elixir": { "format_on_save": { "external": { "command": "mix", "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"] } } } }
Is this problematic? Can it be moved somewhere?
language_overrides
is an alias for languages
, so they can both be combined under the languages
setting.
So in your case you would have this:
{
"languages": {
"Elixir": {
"language_servers": ["lexical", "!elixir-ls", "!next-ls"],
"format_on_save": {
"external": {
"command": "mix",
"arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
}
}
},
"HEEX": {
"language_servers": ["lexical", "!elixir-ls", "!next-ls"]
}
}
}
Is there a way to get the old elixir.lsp.local
behaviour?
Is there a way to get the old
elixir.lsp.local
behaviour?
We don't have that exact setting anymore.
What are you looking to do?
Controlling a version of lexical
and next-ls
for development. I guess I can try extracting the extension from zed repo, and running a dev extension with hardcoded values for the LSP.
Non the less this config, which you provided:
{
"languages": {
"Elixir": {
"language_servers": ["lexical", "!elixir-ls", "!next-ls"],
"format_on_save": {
"external": {
"command": "mix",
"arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
}
}
},
"HEEX": {
"language_servers": ["lexical", "!elixir-ls", "!next-ls"]
}
}
}
Works as expected. Thank you so much <3.
Controlling a version of
lexical
andnext-ls
for development. I guess I can try extracting the extension from zed repo, and running a dev extension with hardcoded values for the LSP.
It looks like we don't currently do it for Next LS or Lexical, but for Elixir LS we check for an elixir-ls
binary that's already on the $PATH: https://github.com/zed-industries/zed/blob/d61c47d2a9d69fbb9f7e4e30d48c444543a9de49/extensions/elixir/src/language_servers/elixir_ls.rs#L26-L28
Would that work for your use-case if we did something similar for the other two language servers?
For lexical it could work, as you could put the start script to your path:
"elixir": {
"lsp": {
"local": {
"path": "/Users/andreicek/src/lexical-lsp/lexical/_build/dev/package/lexical/bin/start_lexical.sh",
"arguments": [""]
}
}
},
However for next-ls I don't think it would not be enough, as I had to add --stdio
to arguments
for it to work (see docs). Maybe @mhanberg has some ideas?
I'm not sure I'm fully understanding.
It seems like @maxdeviant is saying that they could alter the NextLS integration to first look for next-ls
in your path, as they do for elixir-ls.
If you build a local version of next-ls, you could add it to your path and be good to go.
Ideally tho, Zed would implement a TCP adapter, if you are really trying to test the LSP in development
Yes, you're right. However, before I needed the --stdio
flag for it to work, which is now not possible to pass in.
I think I am still not understanding.
which is now not possible to pass in.
I am under the impression you can't configure a local LSP at all.
Yes, and the proposed solution to look for next-ls in the path won't work since there would be no way to pass the required argument in. Right? π
Ah, no -- I'm very dense. Sorry.
It would work well since zed already passes the correct flag in when starting next-ls.
@maxdeviant would it be OK if I tried to add the same check you do for elixir-ls to all other LSP options?
@maxdeviant would it be OK if I tried to add the same check you do for elixir-ls to all other LSP options?
That would be great! I was considering doing it myself, but I wasn't sure which of the other ones it applied to π
Check for existing issues
Describe the bug / provide steps to reproduce it
With the following config:
Both
lexical
andnext-ls
and up running.Environment
Zed: v0.133.5 (Zed) OS: macOS 14.4.1 Memory: 32 GiB Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.