mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +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 =
|
server =
|
||||||
helpers.mkCompositeOption "server"
|
{
|
||||||
({
|
standalone = helpers.defaultNullOpts.mkBool true ''
|
||||||
standalone = helpers.defaultNullOpts.mkBool true ''
|
standalone file support
|
||||||
standalone file support
|
setting it to false may improve startup time
|
||||||
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 {
|
config = mkIf cfg.enable {
|
||||||
extraPlugins = with pkgs.vimPlugins; [nvim-lspconfig cfg.package];
|
extraPlugins = with pkgs.vimPlugins; [nvim-lspconfig cfg.package];
|
||||||
|
@ -176,12 +175,11 @@ in {
|
||||||
enabled_graphviz_backends = enabledGraphvizBackends;
|
enabled_graphviz_backends = enabledGraphvizBackends;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
server = with cfg.server;
|
server = {
|
||||||
helpers.ifNonNull' cfg.server {
|
inherit (cfg.server) standalone;
|
||||||
inherit standalone;
|
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
|
||||||
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
|
on_attach = helpers.mkRaw "__lspOnAttach";
|
||||||
on_attach = helpers.mkRaw "__lspOnAttach";
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
// cfg.extraOptions;
|
// cfg.extraOptions;
|
||||||
in ''
|
in ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue