mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-10 04:11:34 +00:00
modules/lsp: switch to explicit lib calls
This commit is contained in:
parent
dfc7c6737f
commit
c488f0490f
33 changed files with 285 additions and 273 deletions
|
@ -3,25 +3,29 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim optionalString;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.strings) optionalString;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspSignature.enable) {
|
||||
vim.startPlugins = [
|
||||
"lsp-signature"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"lsp-signature"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.lsp-signature = nvim.dag.entryAnywhere ''
|
||||
-- Enable lsp signature viewer
|
||||
require("lsp_signature").setup({
|
||||
${optionalString (config.vim.ui.borders.plugins.lsp-signature.enable) ''
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "${config.vim.ui.borders.plugins.lsp-signature.style}"
|
||||
}
|
||||
''}
|
||||
})
|
||||
'';
|
||||
luaConfigRC.lsp-signature = entryAnywhere ''
|
||||
-- Enable lsp signature viewer
|
||||
require("lsp_signature").setup({
|
||||
${optionalString config.vim.ui.borders.plugins.lsp-signature.enable ''
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = "${config.vim.ui.borders.plugins.lsp-signature.style}"
|
||||
}
|
||||
''}
|
||||
})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./lsp-signature.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lspSignature = {
|
||||
enable = mkEnableOption "lsp signature viewer";
|
||||
enable = mkEnableOption "lsp signature viewer [lsp-signature]";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue