aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/snips
diff options
context:
space:
mode:
Diffstat (limited to 'lua/alpha/snips')
-rw-r--r--lua/alpha/snips/ft/go.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/alpha/snips/ft/go.lua b/lua/alpha/snips/ft/go.lua
index 58c6bfc..637f57d 100644
--- a/lua/alpha/snips/ft/go.lua
+++ b/lua/alpha/snips/ft/go.lua
@@ -13,7 +13,12 @@ local ts_utils = require "nvim-treesitter.ts_utils"
local get_node_text = vim.treesitter.get_node_text
-vim.treesitter.set_query(
+if vim.fn.has "nvim-0.9.0" ~= 1 then
+ vim.treesitter.query.get = vim.treesitter.get_query
+ vim.treesitter.query.set = vim.treesitter.set_query
+end
+
+vim.treesitter.query.set(
"go",
"LuaSnip_Result",
[[
@@ -83,7 +88,7 @@ local function go_result_type(info)
end
end
- local query = vim.treesitter.get_query("go", "LuaSnip_Result")
+ local query = vim.treesitter.query.get_query("go", "LuaSnip_Result")
for _, node in query:iter_captures(function_node, 0) do
if handlers[node:type()] then
return handlers[node:type()](node, info)