I have copied + pasted the proposed config for the lua-language-server:
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#sumneko_lua
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')
table.insert(runtime_path, 'lua/?/init.lua')
nvim_lsp.sumneko_lua.setup {
on_attach = on_attach,
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 = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false,
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
And have installed the server. If I type, e.g. print(
, I get the right suggestions and docs pop-up.
However, if I try to use vim.api…, I get nothing other than text matches; I don’t get the nice list of available functions and their documentation:
I’m not sure if I’m missing anything obvious, but I’d appreciate any pointers!
NVIM v0.7.0-dev+1211-g2783f4cc4
Build type: Release
LuaJIT 2.1.0-beta3
Is my NeoVim build, and I updated all my plugins today so I’m on the latest and greatest lspconfig.
Thanks!