Closed wmertens closed 2 years ago
I can't get it to use my preferred formatter, either. I wonder if "Enable Language Server" overwrites the setting.
Please check with the latest release.
Hmm - I used the configuration from the readme for treefmt in my workspace configuration but when I save it still uses my user setting nixpkgs-fmt. Not sure how to debug this.
Seems I was correct, if you enable the language server the formatter is ignored, and nixpkgs-fmt
is used since that's hardcoded by rnix-lsp
and can't be changed yet.
Working on dream2nix, have direnv installed and working in the shell and in other vscode projects; it uses
treefmt
for formatting.I set the workspace
nix.formatter
totreefmt
and it keeps using my previous one until I reload the window. I assume https://github.com/nix-community/vscode-nix-ide/blob/8e899868f6cd3b46ae61a402927fc04ac3c53bd4/src/formatter.ts#L12 needs to be resolved at format time instead of at module load time.But after reloading the window, it doesn't format at all. Passing
treefmt
or the full path (+reload) doesn't make a difference, vscode now says there's no formatter for nix files installed.