diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-04-04 00:15:10 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-04-04 00:15:10 +0200 |
| commit | cf9605f7a01ef90050df2f5aafa3b89db492604f (patch) | |
| tree | e008cae4c33969f78e6febd914676f2b5ed57272 /lua/alpha/snips | |
| parent | 0cde83cfa15c5c0b8d117c34a8bfae38b4dec39c (diff) | |
| download | nvim-conf-cf9605f7a01ef90050df2f5aafa3b89db492604f.tar.gz nvim-conf-cf9605f7a01ef90050df2f5aafa3b89db492604f.zip | |
feat(impro) add plugins and configs
Diffstat (limited to 'lua/alpha/snips')
| -rw-r--r-- | lua/alpha/snips/ft/go.lua | 9 |
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) |