From f0d34ba2f56e329723047444ff068a61cf200a9b Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Sat, 14 Mar 2026 21:53:09 +0800 Subject: [PATCH 1/2] fix: get_parser don't throw error in nightly https://github.com/neovim/neovim/pull/37276 --- lua/luasnip/extras/filetype_functions.lua | 2 +- lua/luasnip/extras/snip_location.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/luasnip/extras/filetype_functions.lua b/lua/luasnip/extras/filetype_functions.lua index e7011f0c5..d7034205e 100644 --- a/lua/luasnip/extras/filetype_functions.lua +++ b/lua/luasnip/extras/filetype_functions.lua @@ -15,7 +15,7 @@ local function from_cursor_pos() -- get_parser errors if parser not present (no grammar for language). local has_parser, parser = pcall(vim.treesitter.get_parser) - if has_parser then + if has_parser and parser then local cursor = require("luasnip.util.util").get_cursor_0ind() -- assumption: languagetree uses 0-indexed byte-ranges. local lang = parser diff --git a/lua/luasnip/extras/snip_location.lua b/lua/luasnip/extras/snip_location.lua index cb4618ad6..68c310ac2 100644 --- a/lua/luasnip/extras/snip_location.lua +++ b/lua/luasnip/extras/snip_location.lua @@ -13,7 +13,7 @@ local M = {} -- function-call. local function lua_find_function_call_node_at(bufnr, line) local has_parser, parser = pcall(vim.treesitter.get_parser, bufnr, "lua") - if not has_parser then + if not has_parser or not parser then error("Error while getting parser: " .. parser) end From 0e4cf42842a155dfd0cc1ce229b34d00265e64d9 Mon Sep 17 00:00:00 2001 From: phanen Date: Sat, 14 Mar 2026 14:00:46 +0000 Subject: [PATCH 2/2] Auto generate docs --- doc/luasnip.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/luasnip.txt b/doc/luasnip.txt index b9a8376e8..cdace5ecd 100644 --- a/doc/luasnip.txt +++ b/doc/luasnip.txt @@ -1,4 +1,4 @@ -*luasnip.txt* For NeoVim 0.7-0.11 Last change: 2026 January 19 +*luasnip.txt* For NeoVim 0.7-0.11 Last change: 2026 March 14 ============================================================================== Table of Contents *luasnip-table-of-contents*