LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.24k stars 305 forks source link

Custom snippets do not show when language-server is working. #475

Closed rafamadriz closed 3 years ago

rafamadriz commented 3 years ago

Describe the bug I'm having a problem with snippets. I can't get my own snippets working when lua-language-server is "working". I get auto completion and everything working fine but my own snippets never show up, my snippets will only show up when the language-server is stopped.

To Reproduce Steps to reproduce the behavior:

  1. Create a custom snippet in a json file (snippet example)
  2. Load your snippets with a plugin that can load snippets with the same format as VSCode standard for snippets. (In my case I'm using vim-vsnip)
  3. Open a lua file and have lua-lanuage-server working
  4. Your snippets won't show up.

Expected behavior Custom snippets to show up.

Screenshots Example with server (custom snippets don't show up) withserver

Example with no server (custom snippets are working) noserver

Environment (please complete the following information):

Additional context Server config

local nvim_lsp = require "lspconfig"
local luapath = "/home/rafa/.local/share/nvim/lua/sumneko_lua"
local luabin = luapath .. "/bin/Linux/lua-language-server"

nvim_lsp.sumneko_lua.setup {
    cmd = {luabin, "-E", luapath .. "/main.lua"},
    settings = {
        Lua = {
            runtime = {
                -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
                version = "LuaJIT",
                -- Setup your lua path
                path = vim.split(package.path, ";")
            },
            diagnostics = {
                -- Get the language server to recognize the `vim` global
                globals = {"vim"}
            },
            workspace = {
                -- Make the server aware of Neovim runtime files
                library = {
                    [vim.fn.expand("$VIMRUNTIME/lua")] = true,
                    [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
                },
                maxPreload = 10000
            },
            telemetry = {
                enable = false
            }
        }
    }
}

Provide logs I have multiple files in the log directory, and I don't know which one I have to provide. Here are a couple of the last logs I've had:

lfile_homerafa.config_nvim_lua_lsp.log service.log file_home_rafa.log

sumneko commented 3 years ago

Should be a client issue

rafamadriz commented 3 years ago

Should be a client issue

By client you mean the snippets plugin ?

It seems like I'm the only one with this problem, so it is probably that.