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

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

Open
lilyball opened this issue Aug 16, 2022 · 0 comments
Open

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

lilyball opened this issue Aug 16, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@lilyball
Copy link

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
@lilyball lilyball added the bug Something isn't working label Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant