Skip to content

Commit 11660fe

Browse files
committed
language/go: add gopher.nvim for impl, gomodifytags, iferr and ... support
1 parent 62090f4 commit 11660fe

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

docs/manual/release-notes/rl-0.9.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@
198198
199199
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
200200
201+
- Added [`gopher.nvim`](https://github.com/olexsmir/gopher.nvim) for extra
202+
actions in `languages.go`.
203+
201204
- updated default filetypes for
202205
[harper-ls](https://github.com/Automattic/harper) to match what they are
203206
supposed to be.

modules/plugins/languages/go.nix

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
inherit (lib.modules) mkIf mkMerge;
1010
inherit (lib.meta) getExe;
1111
inherit (lib.generators) mkLuaInline;
12-
inherit (lib.types) bool enum package;
13-
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf;
12+
inherit (lib.types) bool enum package str;
13+
inherit (lib.nvim.types) mkGrammarOption diagnostics deprecatedSingleOrListOf mkPluginSetupOption;
1414
inherit (lib.nvim.dag) entryAfter;
1515
inherit (lib.nvim.attrsets) mapListToAttrs;
1616

@@ -231,6 +231,40 @@ in {
231231
inherit defaultDiagnosticsProvider;
232232
};
233233
};
234+
extensions = {
235+
gopher-nvim = {
236+
enable = mkEnableOption "Minimalistic plugin for Go development";
237+
setupOpts = mkPluginSetupOption "gopher-nvim" {
238+
commands = {
239+
go = mkOption {
240+
description = "go binary to use";
241+
type = str;
242+
default = "go";
243+
};
244+
gomodifytags = mkOption {
245+
description = "gomodifytags binary to use";
246+
type = str;
247+
default = getExe pkgs.gomodifytags;
248+
};
249+
gotests = mkOption {
250+
description = "gotests binary to use";
251+
type = str;
252+
default = getExe pkgs.gotests;
253+
};
254+
impl = mkOption {
255+
description = "impl binary to use";
256+
type = str;
257+
default = getExe pkgs.impl;
258+
};
259+
iferr = mkOption {
260+
description = "iferr binary to use";
261+
type = str;
262+
default = getExe pkgs.iferr;
263+
};
264+
};
265+
};
266+
};
267+
};
234268
};
235269

236270
config = mkIf cfg.enable (mkMerge [
@@ -292,5 +326,14 @@ in {
292326
cfg.extraDiagnostics.types);
293327
};
294328
})
329+
330+
(mkIf cfg.extensions.gopher-nvim.enable {
331+
vim.lazy.plugins.gopher-nvim = {
332+
package = "gopher-nvim";
333+
setupModule = "gopher";
334+
inherit (cfg.extensions.gopher-nvim) setupOpts;
335+
ft = ["go"];
336+
};
337+
})
295338
]);
296339
}

npins/sources.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,19 @@
656656
"url": "https://github.com/MagicDuck/grug-far.nvim/archive/275dbedc96e61a6b8d1dfb28ba51586ddd233dcf.tar.gz",
657657
"hash": "sha256-qn1BTNCX0Sm158Lv5JfHThqlJX9ualCIlc+RCjWa+t8="
658658
},
659+
"gopher-nvim": {
660+
"type": "Git",
661+
"repository": {
662+
"type": "GitHub",
663+
"owner": "olexsmir",
664+
"repo": "gopher.nvim"
665+
},
666+
"branch": "main",
667+
"submodules": false,
668+
"revision": "6a3924cee5a9f36d316f8e4a90c3020438d3513f",
669+
"url": "https://github.com/olexsmir/gopher.nvim/archive/6a3924cee5a9f36d316f8e4a90c3020438d3513f.tar.gz",
670+
"hash": "sha256-iXTmgdADtZFQVm+IN+JoPActGuO8r7VTeHKJdkEgmVo="
671+
},
659672
"gruvbox": {
660673
"type": "Git",
661674
"repository": {

0 commit comments

Comments
 (0)