Port lsp-format to use non-deprecated setup instructions

Upstream still documents the now-deprecated
`require("lspconfig").<name>.setup` mechanism. I believe the modern
alternative is to register a `LspAttach` autocmd. For more context, see:

- https://github.com/lukas-reineke/lsp-format.nvim/issues/98
- https://github.com/lukas-reineke/lsp-format.nvim/pull/99
This commit is contained in:
Jeremy Fleischman 2025-05-05 11:59:25 -07:00
parent 4016854bcc
commit 64cd675ece
No known key found for this signature in database
2 changed files with 73 additions and 22 deletions

View file

@ -1,10 +1,10 @@
{
empty = {
legacy-empty = {
plugins.lsp.enable = true;
plugins.lsp-format.enable = true;
};
example = {
legacy-example = {
plugins = {
lsp = {
enable = true;
@ -37,4 +37,43 @@
};
};
};
empty = {
plugins.lspconfig.enable = true;
plugins.lsp-format.enable = true;
};
none = {
plugins.lspconfig.enable = true;
plugins.lsp-format = {
enable = true;
lspServersToEnable = "none";
};
};
example = {
plugins = {
lspconfig.enable = true;
lsp.servers.gopls.enable = true;
lsp-format = {
enable = true;
settings = {
go = {
exclude = [ "gopls" ];
order = [
"gopls"
"efm"
];
sync = true;
force = true;
# Test the ability to provide extra options for each filetype
someRandomOption = 42;
};
};
};
};
};
}