about summary refs log tree commit diff
path: root/dotfiles
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-10-27 10:57:22 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-10-27 11:08:00 +0100
commitccb619bb55c7240a8a3dcb18553f76dcaee84ba0 (patch)
tree28c6e74dba90213651cd360075ba0756d987a029 /dotfiles
parentdotfiles: nvim: update lsp config with capabilities for local servers (diff)
downloadnixos-config-ccb619bb55c7240a8a3dcb18553f76dcaee84ba0.tar.gz
nixos-config-ccb619bb55c7240a8a3dcb18553f76dcaee84ba0.tar.bz2
nixos-config-ccb619bb55c7240a8a3dcb18553f76dcaee84ba0.zip
dotfiles: nvim: dont enable nvim-test go runner unless go treesitter parser installed
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/nvim/init.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua
index 03304fa..bbc76a2 100644
--- a/dotfiles/nvim/init.lua
+++ b/dotfiles/nvim/init.lua
@@ -251,9 +251,13 @@ require('lazy').setup({
 
   { 'klen/nvim-test',
     config = function()
-      require('nvim-test.runners.go-test'):setup {
-        args = { "test", "-tags", "dynamic" }
-      }
+
+      -- If go parser is installed, then we can activate the go nvim-test runner
+      if require("nvim-treesitter.parsers").has_parser('go') then
+        require('nvim-test.runners.go-test'):setup {
+          args = { "test", "-tags", "dynamic" }
+        }
+      end
       require('nvim-test').setup {
         vim.keymap.set('n', '<leader>tf', function() require('nvim-test').run('file') end, { desc = '[T]est [F]ile' }),
         vim.keymap.set('n', '<leader>tn', function() require('nvim-test').run('nearest') end, { desc = '[T]est [N]earest' }),