-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zig's formatting doesn't work using editor: format
command
#22415
Comments
See also #10122 |
Thank you, in my case I don't get a timeout but Zed just does not send an RPC call to zls. Also noticed that other LSP features in zls does not work such as renaming and go to definition. |
I wonder if the issue is the same as mine: I've had |
Part of #22415 I've noticed that I cannot work with any Zig projects, as there were no "go to definition", formatting and inlay hints. After debugging, I've discovered that `typos` was registered as a first language server, becoming the "primary" one for Zig. That one does not have any proper capabilities, hence all corresponding LSP requests were no-op. While this solution is not ideal (I wonder, how many other set-ups are broken due to the same thing?), we'd better fix things for now this way at least. Release Notes: - Fixed `zls` not working properly when `typos` extension is installed
I really can't thank you enough, that was the problem yeah, although I don't know what server took precedence over Could I ask how did you manage identifying the problem? I've spent nearly 2 days trying to fix this :"" |
Great, thank you for confirming, I wonder how many other set-ups are broken this way.. Opened a Zig project, it showed nothing, started to place Noted instant, empty inlay data in my debug messages and no hint LSP queries at all — that was enough to start digging around the query code and soon I've discovered that the capabilities' check is not working and those capabilities are totally off. |
Thank you for your explanation I also checked around server capabilities / RPC messages from zls and there wasn't any calls except on code actions / hover. Also setting I'll probably check if zls's docs are open source and add that line to the example configuration as a precaution. Sorry for the amount of questions, I've been interested in LSPs recently so.. |
All dbg! and printing is about altering the code first, nothing that noisy exists in the logs by default. |
Understood! Thank you again for your time |
Part of #22415 I've noticed that I cannot work with any Zig projects, as there were no "go to definition", formatting and inlay hints. After debugging, I've discovered that `typos` was registered as a first language server, becoming the "primary" one for Zig. That one does not have any proper capabilities, hence all corresponding LSP requests were no-op. While this solution is not ideal (I wonder, how many other set-ups are broken due to the same thing?), we'd better fix things for now this way at least. Release Notes: - Fixed `zls` not working properly when `typos` extension is installed
…22511) (#22513) Cherry-picked Ensure zls is used for Zig as a primary language server (#22511) Part of #22415 I've noticed that I cannot work with any Zig projects, as there were no "go to definition", formatting and inlay hints. After debugging, I've discovered that `typos` was registered as a first language server, becoming the "primary" one for Zig. That one does not have any proper capabilities, hence all corresponding LSP requests were no-op. While this solution is not ideal (I wonder, how many other set-ups are broken due to the same thing?), we'd better fix things for now this way at least. Release Notes: - Fixed `zls` not working properly when `typos` extension is installed Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Check for existing issues
Describe the bug / provide steps to reproduce it
Using
editor: format
on zig files does not format them, neither manually nor on save.Trying vscode or using zig format manually works though.
LSP logs:
Zed config:
Zed Version and System Specs
Zed: v0.166.1 (Zed)
OS: Linux Wayland fedora 41
Memory: 15.4 GiB
Architecture: x86_64
GPU: Intel(R) UHD Graphics (CML GT2) || Intel open-source Mesa driver || Mesa 24.2.7
If applicable, add screenshots or screencasts of the incorrect state / behavior
No response
If applicable, attach your Zed.log file to this issue.
Zed.log
The text was updated successfully, but these errors were encountered: