Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

rnix-lsp not keeping in sync with nixpkgs-fmt #100

@lilyball

Description

@lilyball

Describe the bug

nixpkgs-fmt 1.3.0 was released 2 months ago, and nixpkgs-unstable updated almost immediately. However rnix-lsp appears to still be using nixpkgs-fmt 1.2.0.

nixpkgs-fmt 1.3.0 produces formatting differences from 1.2.0, and this means if I have rnix-lsp and nixpkgs-fmt both installed from recent nixpkgs-unstable, formatting from within my IDE disagrees with formatting from the command-line. This is very frustrating.

Steps to reproduce

With this code snippet:

{
  x = let x = {
    y = 1;
  }; in x;
}

Ask rnix-lsp to format it (e.g. with VSCode), and then ask nixpkgs-fmt 1.3.0 to format it. In this case, nixpkgs-fmt converts it to

{
  x =
    let
      x = {
        y = 1;
      };
    in
    x;
}

(I actually disagree with 1.3.0's formatting here but that's beside the point)

Expected behavior

rnix-lsp's formatting should match that of nixpkgs-fmt.

I realize that when nixpkgs-fmt updates, rnix-lsp might lag a little bit, but it should try to update as soon as is reasonable, so that way pulling rnix-lsp and nixpkgs-fmt from the same nixpkgs revision should result in identical formatting most of the time.

Additional context

  • Version of rnix-lsp: 0.2.5
  • Name and version of the editor you've used: VSCode
  • Operating system: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions