Skip to content

Commit c4e3063

Browse files
committed
nvim: ftplugin iteration
1 parent 9e64c9d commit c4e3063

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

home/nvim/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"nvim/init.lua".source = ./init.lua;
2525
# "nvim/lua".source = ./lua;
2626
"nvim/lua".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/home/nvim/lua";
27-
"nvim/ftplugin".source = ./ftplugin;
27+
# "nvim/ftplugin".source = ./ftplugin;
28+
"nvim/ftplugin".source = config.lib.file.mkOutOfStoreSymlink "/etc/nixos/home/nvim/ftplugin";
2829
"nvim/parser".source = "${treesitterParsers}/parser";
2930
"nvim/after/queries/go/textobjects.scm".source = ./go-textobjects.scm;
3031
"nvim/after/queries/gotmpl/injections.scm".source = ./gotmpl-injections.scm;

home/nvim/ftplugin/go.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
9696
if not ok or not inTestfile then
9797
return
9898
end
99-
vim.lsp.buf_request_sync(0, "workspace/executeCommand", {
99+
local result = vim.lsp.buf_request_sync(0, "workspace/executeCommand", {
100100
command = "gopls.run_tests",
101101
arguments = {
102102
{
@@ -105,6 +105,11 @@ vim.api.nvim_create_autocmd("LspAttach", {
105105
},
106106
},
107107
}, 10000)
108+
if not result or result[1].error then
109+
vim.notify("Test failed", 4)
110+
else
111+
vim.notify("Test ok", 2)
112+
end
108113
end, { desc = "lsp: run test at cursor", buffer = event.buf })
109114
end,
110115
})

0 commit comments

Comments
 (0)