Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Conform plugin config using deprecated syntax for stop after first formatter #2064

Closed
1 task done
347Online opened this issue Aug 22, 2024 · 4 comments · Fixed by #2070
Closed
1 task done
Labels
bug Something isn't working

Comments

@347Online
Copy link

Field Description
Plugin conform-nvim
Nixpkgs unstable
Home Manager unstable
  • I have read the FAQ and my bug is not listed there.

Description

Conform has deprecated the nested list syntax for stopping after the first available formatter (#491). New syntax for this uses a flat table, with an additional option stop_after_first. Using the previous syntax causes a warning to be shown the first time you the formatter in a given instance of neovim.

I find I end up closing and re-opening Neovim quite often, so I'm seeing this warning extremely frequently and it is very disruptive.

Minimal, Reproducible Example (MRE)

programs.nixvim = {
    enable = true;
    plugins.conform-nvim = {
        # See https://github.com/nix-community/nixvim/blob/1854d591cb0e5be6ad97f5091766cdf28e948265/plugins/lsp/conform-nvim.nix#L30
        # Use a sub-list to run only the first available formatter
        javascript = [ [ "prettierd" "prettier" ] ];
    };
}
@347Online 347Online added the bug Something isn't working label Aug 22, 2024
@khaneliman
Copy link
Contributor

khaneliman commented Aug 23, 2024

Documentation looks like that option supports an attribute set of anything. https://nix-community.github.io/nixvim/plugins/conform-nvim/index.html#pluginsconform-nvimformattersbyft You should be able to do this yourself in its current form.

        javascript = {
          __unkeyed-1 = "prettierd";
          __unkeyed-2 = "prettier";
          timeout_ms = 2000;
          stop_after_first = true;
        };

I tested in this commit; khaneliman/khanelivim@12e5f03

@347Online
Copy link
Author

slick!

@khaneliman
Copy link
Contributor

Thanks for bringing this up... while looking through documentation for the refactor, it looks like we were multiple versions behind on options and examples.

@347Online
Copy link
Author

My pleasure! Thanks for the lightning-fast response 😁

@mergify mergify bot closed this as completed in #2070 Aug 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants