-- Lua LSP config handles the initialization of workspace folders to pull in library references for completion return { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, on_init = function (client) if client.workspace_folders then local path = client.workspace_folders[1].name if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end end client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { runtime = { version = 'LuaJIT', path = { 'lua/?.lua', 'lua/?/init.lua', }, }, workspace = { checkThirdParty = false, library = { vim.env.VIMRUNTIME, vim.api.nvim_get_runtime_file('lua/lspconfig', false)[1], }, }, }) end, root_markers = { '.emmyrc.json', '.git', '.luachecrc', '.luarc.json', '.luarc.jsonc', '.stylua.toml', }, settings = { Lua = { codeLens = { enable = true }, hint = { enable = true, semicolon = 'Disable' }, }, }, }