nix-community.nixvim/tests/test-sources/plugins/by-name/lsp-format/default.nix
Jeremy Fleischman 64cd675ece
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
2025-05-05 14:13:25 -07:00

79 lines
1.4 KiB
Nix

{
legacy-empty = {
plugins.lsp.enable = true;
plugins.lsp-format.enable = true;
};
legacy-example = {
plugins = {
lsp = {
enable = true;
servers.gopls = {
enable = true;
onAttach.function = ''
x = 12
'';
};
};
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;
};
};
};
};
};
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;
};
};
};
};
};
}