mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
treewide: make lib calls explicit
This commit is contained in:
parent
a7531186a8
commit
974bfcc78e
56 changed files with 589 additions and 496 deletions
|
@ -9,6 +9,7 @@
|
|||
inherit (lib.lists) isList;
|
||||
inherit (lib.types) enum either package listOf str bool;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.types) diagnostics mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
|
||||
|
@ -45,8 +46,8 @@
|
|||
};
|
||||
};
|
||||
|
||||
defaultDiagnostics = ["shellcheck"];
|
||||
diagnostics = {
|
||||
defaultDiagnosticsProvider = ["shellcheck"];
|
||||
diagnosticsProviders = {
|
||||
shellcheck = {
|
||||
package = pkgs.shellcheck;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -65,7 +66,7 @@ in {
|
|||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Bash treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = lib.nvim.types.mkGrammarOption pkgs "bash";
|
||||
package = mkGrammarOption pkgs "bash";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
@ -106,10 +107,10 @@ in {
|
|||
|
||||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Bash diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
types = lib.nvim.types.diagnostics {
|
||||
types = diagnostics {
|
||||
langDesc = "Bash";
|
||||
inherit diagnostics;
|
||||
inherit defaultDiagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
inherit (lib.lists) isList;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.nvim.languages) diagnosticsToLua;
|
||||
|
||||
cfg = config.vim.languages.bash;
|
||||
diagnostics = {
|
||||
diagnosticsProviders = {
|
||||
shellcheck = {
|
||||
package = pkgs.shellcheck;
|
||||
nullConfig = pkg: ''
|
||||
|
@ -72,10 +73,10 @@ in {
|
|||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.lsp.null-ls.enable = true;
|
||||
vim.lsp.null-ls.sources = lib.nvim.languages.diagnosticsToLua {
|
||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||
lang = "bash";
|
||||
config = cfg.extraDiagnostics.types;
|
||||
inherit diagnostics;
|
||||
inherit diagnosticsProviders;
|
||||
};
|
||||
})
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue