1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-29 19:47:45 +00:00
alejandra/integrations/vscode
2025-04-10 16:29:41 -06:00
..
.yarnrc feat: add extension 2022-02-12 17:00:09 -05:00
CONTRIBUTING.md feat: update vscode integration docs 2024-11-03 19:52:05 -07:00
extension.js feat: finish extension 2022-02-12 19:18:21 -05:00
jsconfig.json feat: document vscode extension 2022-02-12 19:41:23 -05:00
LICENSE feat: add extension 2022-02-12 17:00:09 -05:00
package.json feat: release 4.0.0 2025-04-10 16:29:41 -06:00
README.md feat: document vscode extension 2022-02-12 19:41:23 -05:00
yarn.lock feat: release 4.0.0 2025-04-10 16:29:41 -06:00
yarn.lock.nix feat: release 4.0.0 2025-04-10 16:29:41 -06:00

Alejandra 💅

The Uncompromising Nix Code Formatter

Features

This extension adds built-in editor support for formatting Nix files automatically with Alejandra.

Getting started

  1. Make sure to install Alejandra in your system first as explained here.

  2. Install the vscode extension and reload the window (just close and open again).

  3. Open a Nix file, do a right click and you should be able to see "Format Document" in the menu.

    Alternatively, it will be formatted automatically when you save the file.

Enjoy!

Troubleshooting

If you encounter a problem please let us know in the issues section.

The most probable causes of failure are:

  • Not having Alejandra installed in your system.

    In this case please follow the instructions here.

  • A misconfiguration.

    In this case please make sure that your config contains the following values:

    {
      "[nix]": {
        "editor.defaultFormatter": "kamadorueda.alejandra",
        "editor.formatOnPaste": true,
        "editor.formatOnSave": true,
        "editor.formatOnType": false
      },
      "alejandra.program": "alejandra"
    }