nix-community / vscode-nix-ide

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

Become self-contained (cut the nixpkgs-fmt dependency) #340

Open makoConstruct opened 1 year ago

makoConstruct commented 1 year ago

The package seems to need nixpkgs-fmt to be installed in order for code formatting to work (related forum support thread). (This seems to be completely undocumented, which is another issue, but becoming self-contained would obviate that) I think it's clear that it would be better to ship a copy of nixpkgs-fmt in the vscode extension, as it's unlikely that the user will have it installed for any other purpose.

It seems that there is a wasm version of nixpkgs-fmt, and I believe vscode can run wasm (on any platform, of course), so we could use that?

Would a pull request, making this change, be accepted?

jnoortheen commented 1 year ago

Currently it supports using some Language Server backends (Nil, rnix...) and the nixpkgs-fmt executable for formatting. So packaging a formatter would mean it can format out of the box and for deeper integration one would still need a language server. But we can explore the possibility of packaging the formatter.

What would be the size of the wasm binary ?