mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-28 22:14:28 +00:00
language/go: add gopher.nvim for impl, gomodifytags, iferr and ... support
This commit is contained in:
parent
c07410f183
commit
d1d495c826
3 changed files with 61 additions and 2 deletions
|
|
@ -9,8 +9,8 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.types) bool enum package;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
|
||||
inherit (lib.types) bool enum package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf mkPluginSetupOption;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -231,6 +231,40 @@ in {
|
|||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
extensions = {
|
||||
gopher-nvim = {
|
||||
enable = mkEnableOption "Minimalistic plugin for Go development";
|
||||
setupOpts = mkPluginSetupOption "gopher-nvim" {
|
||||
commands = {
|
||||
go = mkOption {
|
||||
description = "go binary to use";
|
||||
type = str;
|
||||
default = "go";
|
||||
};
|
||||
gomodifytags = mkOption {
|
||||
description = "gomodifytags binary to use";
|
||||
type = str;
|
||||
default = getExe pkgs.gomodifytags;
|
||||
};
|
||||
gotests = mkOption {
|
||||
description = "gotests binary to use";
|
||||
type = str;
|
||||
default = getExe pkgs.gotests;
|
||||
};
|
||||
impl = mkOption {
|
||||
description = "impl binary to use";
|
||||
type = str;
|
||||
default = getExe pkgs.impl;
|
||||
};
|
||||
iferr = mkOption {
|
||||
description = "iferr binary to use";
|
||||
type = str;
|
||||
default = getExe pkgs.iferr;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -292,5 +326,14 @@ in {
|
|||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.extensions.gopher-nvim.enable {
|
||||
vim.lazy.plugins.gopher-nvim = {
|
||||
package = "gopher-nvim";
|
||||
setupModule = "gopher";
|
||||
inherit (cfg.extensions.gopher-nvim) setupOpts;
|
||||
ft = ["go"];
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue