mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugin/rust-tools: Correctly take into account on_attach (#737)
Nixvim uses a common function for the on attach function of lsp, __lspOnAttach. With the current implementation the function was not taken into account if no server options were present, this fixes this issue.
This commit is contained in:
parent
3577c971e7
commit
a108c2e676
1 changed files with 12 additions and 14 deletions
|
@ -123,14 +123,13 @@ in {
|
|||
};
|
||||
|
||||
server =
|
||||
helpers.mkCompositeOption "server"
|
||||
({
|
||||
{
|
||||
standalone = helpers.defaultNullOpts.mkBool true ''
|
||||
standalone file support
|
||||
setting it to false may improve startup time
|
||||
'';
|
||||
}
|
||||
// (import ../lsp/language-servers/rust-analyzer-config.nix lib pkgs));
|
||||
// (import ../lsp/language-servers/rust-analyzer-config.nix lib pkgs);
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
extraPlugins = with pkgs.vimPlugins; [nvim-lspconfig cfg.package];
|
||||
|
@ -176,9 +175,8 @@ in {
|
|||
enabled_graphviz_backends = enabledGraphvizBackends;
|
||||
};
|
||||
};
|
||||
server = with cfg.server;
|
||||
helpers.ifNonNull' cfg.server {
|
||||
inherit standalone;
|
||||
server = {
|
||||
inherit (cfg.server) standalone;
|
||||
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
|
||||
on_attach = helpers.mkRaw "__lspOnAttach";
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue