-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Hi there I saw there was an existing ticket here: #426
However the proposed solution does not seem to resolve this issue.
I've ensures that nixd and nixfmt are installed though i am using nixfmt-rfc-style as opposed to nixfmt directly
I've used the exact same vscode configuration as defined here:
https://github.com/nix-community/vscode-nix-ide/blob/main/docs/snippets/advanced-nixd-settings.jsonc
Package versions:
❯ nixfmt --version
nixfmt nixpkgs-unstable-2024-12-04
❯ nixd --version
nixd, version: 2.5.1
To recreate the error you'll need to make a syntax error and then try and save the file, this is when the problem shows. I would cause this by removing the closing semi-colon from an attribute set.
The error appearing in vscode is:
I[00:06:22.947] 5301: <-- textDocument/formatting(67)
I[00:06:22.978] 5301: --> reply:textDocument/formatting(67) formatting nixfmt command exited with 256, error: 3
[Error - 00:06:22] Request textDocument/formatting failed.
Message: formatting nixfmt command exited with 256
Code: -32001
When running this locally using nixfmt directly against the file in question:
❯ nixfmt zsh.nix
zsh.nix:22:5:
|
22 | };
| ^
unexpected '}'
expecting expressionReviewing the exit code here I don't see the 256 error.
❯ echo $?
1Any help is much appreciated. Thanks