diff --git a/nvim/.config/nvim/lua/opdavies/lsp/handlers.lua b/nvim/.config/nvim/lua/opdavies/lsp/handlers.lua index e7abaf2..7014a57 100644 --- a/nvim/.config/nvim/lua/opdavies/lsp/handlers.lua +++ b/nvim/.config/nvim/lua/opdavies/lsp/handlers.lua @@ -25,7 +25,7 @@ if not status_ok then return end -local function lsp_keymaps() +local function lsp_keymaps(bufnr) local opts = { noremap = true, silent = true } local keymap = vim.api.nvim_buf_set_keymap @@ -38,7 +38,7 @@ local function lsp_keymaps() keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) end -M.on_attach = function() +M.on_attach = function(bufnr) lsp_keymaps(bufnr) end diff --git a/nvim/.config/nvim/lua/opdavies/lsp/settings/sumneko_lua.lua b/nvim/.config/nvim/lua/opdavies/lsp/settings/sumneko_lua.lua index 3f900d0..41ec464 100644 --- a/nvim/.config/nvim/lua/opdavies/lsp/settings/sumneko_lua.lua +++ b/nvim/.config/nvim/lua/opdavies/lsp/settings/sumneko_lua.lua @@ -2,8 +2,14 @@ return { settings = { Lua = { diagnostics = { - globals = { "vim" } + globals = { "use", "vim" } }, + workspace = { + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, }, }, }