hrsh7th / vim-vsnip

Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
MIT License
876 stars 37 forks source link

Solution to vscode-go snippets not loading #276

Open mgnsk opened 6 months ago

mgnsk commented 6 months ago

I started noticing that go snippets stopped working some time ago. vscode-go has moved the extension into the extension subdirectory: https://github.com/golang/vscode-go/commit/690cf2e3ff37d77314bbe2835bcfde80cad086a9

This results in vim-vsnip not being able to find the package.json file since the subdirectory is not in vim's runtime path. All I needed to do was to add the new path to rtp.

An example lazy.nvim config:

{
    "golang/vscode-go", -- For go snippets.
    config = function(plugin)
        vim.opt.rtp:append(vim.fn.resolve(plugin.dir .. "/extension"))
    end,
},