LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

"undefined variable: json" after luasnip upgrade to current master

Open torstello opened this issue 1 year ago • 1 comments

after upgrading the plugin with lazy, it get this error when calling snippets that contain a placeholder:

~/.local/share/nvim/lazy/LuaSnip/lua/luasnip/util/functions.lua:39: nvim_exec2(): Vim(echo):E121: Undefined variable: json

Version: branch master commit 98d9cb5

my plugin configuration:

return {
      {
        "L3MON4D3/LuaSnip",
        build = vim.fn.has "win32" ~= 0 and "make install_jsregexp" or nil,
        dependencies = {
          "rafamadriz/friendly-snippets",
          "benfowler/telescope-luasnip.nvim",
          "molleweide/LuaSnip-snippets.nvim",
        },
        config = function(_, opts)
          if opts then require("luasnip").config.setup(opts) end
          vim.tbl_map(
            function(type) require("luasnip.loaders.from_" .. type).lazy_load() end,
            { "vscode", "snipmate" }
          )

          require("luasnip.loaders.from_vscode").lazy_load({ paths = { "./snippets" } })

          require("luasnip").filetype_extend("go", { "godoc" })
          require("luasnip").filetype_extend("lua", { "luadoc" })
          require("luasnip").filetype_extend("python", { "pydoc" })
          require("luasnip").filetype_extend("sh", { "shelldoc" })
        end,
      },
}

any help is very much appreciated.

torstello avatar Jan 25 '25 10:01 torstello

Hello :)

I think this is caused by a vim-function-evaluation done by a snippet, is something like that happening in your snipmate-snippets? Sorry about that error-message, it could be clearer 😅

L3MON4D3 avatar May 04 '25 17:05 L3MON4D3