nix-community / vscode-nix-ide

Nix language support for VSCode editor [maintainer: @jnoortheen]
https://marketplace.visualstudio.com/items?itemName=jnoortheen.nix-ide
MIT License
286 stars 22 forks source link

Document Ability to "auto" format (format-on-save) #373

Open briceburg opened 9 months ago

briceburg commented 9 months ago

Is it possible to have the formatter (nixpkgs-fmt or language server) run automatically on file save? Is the documentation for it in the README?

remus-selea commented 7 months ago

The code formatting does not work by default for me either. Maybe I came with the wrong expectations, but the description mentions "Adds nix language support for VSCode Editor."

I expected this to do the following:

Instead, whenever I make a change to a file I get some errors: image

What platforms are supported? This issue is on Windows.

dudeofawesome commented 6 months ago

You're probably looking for the following VS Code settings:

"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.formatOnPaste": true,
szethh commented 3 months ago

Instead, whenever I make a change to a file I get some errors: image

same here, the formatting does not seem to work (macOS)