mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-08 21:23:53 +00:00
plugins/languages: cleanup old FIXME, remove comments, complete completion config for crates-nvim
This commit is contained in:
parent
84026fed88
commit
f7ee8f86f1
1 changed files with 23 additions and 33 deletions
|
|
@ -97,22 +97,24 @@ in {
|
|||
lsp = {
|
||||
enabled = mkEnableOption "crates.nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
actions = mkEnableOption "actions for crates-nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
# completion = {
|
||||
# enabled = mkEnableOption "completion for crates-nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
# max_results = mkOption {
|
||||
# description = "The maximum number of search results to display";
|
||||
# type = int;
|
||||
# default = 8;
|
||||
# };
|
||||
# min_chars = mkOption {
|
||||
# description = "The minimum number of characters to type before completions begin appearing";
|
||||
# type = int;
|
||||
# default = 3;
|
||||
# };
|
||||
# };
|
||||
completion = mkEnableOption "completion for crates-nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
hover = mkEnableOption "hover actions for crates-nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
};
|
||||
completion = {
|
||||
crates = {
|
||||
enabled = mkEnableOption "completion for crates-nvim's in-process language server" // {default = cfg.extensions.crates-nvim.enable;};
|
||||
max_results = mkOption {
|
||||
description = "The maximum number of search results to display";
|
||||
type = int;
|
||||
default = 8;
|
||||
};
|
||||
min_chars = mkOption {
|
||||
description = "The minimum number of characters to type before completions begin appearing";
|
||||
type = int;
|
||||
default = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -202,26 +204,14 @@ in {
|
|||
})
|
||||
|
||||
(mkIf cfg.extensions.crates-nvim.enable {
|
||||
vim = let
|
||||
withCompletion = cfg.extensions.crates-nvim.setupOpts.completion.cmp.enable;
|
||||
in
|
||||
mkMerge [
|
||||
{
|
||||
startPlugins = ["crates-nvim"];
|
||||
pluginRC.rust-crates = entryAnywhere ''
|
||||
require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
|
||||
'';
|
||||
}
|
||||
|
||||
# FIXME: this will not be necessary once crates.nvim creates a new release that
|
||||
# ships improvements to the in-progress LSP module. If updating > 0.7.1, remember
|
||||
# to update this section.
|
||||
# See:
|
||||
# <https://github.com/saecki/crates.nvim/wiki/Documentation-unstable#auto-completion>
|
||||
(mkIf withCompletion {
|
||||
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
|
||||
})
|
||||
];
|
||||
vim = mkMerge [
|
||||
{
|
||||
startPlugins = ["crates-nvim"];
|
||||
pluginRC.rust-crates = entryAnywhere ''
|
||||
require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
|
||||
'';
|
||||
}
|
||||
];
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue