@@ -186,6 +186,25 @@ vim.lsp.config('clangd', {
186186})
187187vim .lsp .enable ' clangd'
188188
189+ vim .lsp .config (' luals' , {
190+ -- Command and arguments to start the server.
191+ cmd = { ' lua-language-server' },
192+ -- Filetypes to automatically attach to.
193+ filetypes = { ' lua' },
194+ root_markers = { { ' .luarc.json' , ' .luarc.jsonc' }, ' .git' },
195+ settings = {
196+ Lua = {
197+ diagnostics = {
198+ globals = { ' vim' },
199+ },
200+ runtime = {
201+ version = ' LuaJIT' ,
202+ },
203+ },
204+ },
205+ })
206+ vim .lsp .enable ' luals'
207+
189208-- [[ Basic Autocommands ]]
190209-- See `:help lua-guide-autocommands`
191210
@@ -727,31 +746,14 @@ require('lazy').setup({
727746 -- - filetypes (table): Override the default list of associated filetypes for the server
728747 -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
729748 -- - settings (table): Override the default settings passed when initializing the server.
730- -- For example, to see the options for `lua_ls`, you could go to: https://luals .github.io/wiki/settings/
749+ -- For example, to see the options for `lua_ls`, you could go to: https://lals .github.io/wiki/settings/
731750 local servers = {
732751 -- pyright = {},
733752 rust_analyzer = {},
734753 -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
735- --
736- -- Some languages (like typescript) have entire language plugins that can be useful:
737- -- https://github.com/pmizio/typescript-tools.nvim
738- --
739- -- But for many setups, the LSP (`ts_ls`) will work just fine
740- -- ts_ls = {},
741- --
742-
743- lua_ls = {
744- settings = {
745- Lua = {
746- completion = {
747- callSnippet = ' Replace' ,
748- },
749- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
750- -- diagnostics = { disable = { 'missing-fields' } },
751- },
752- },
754+ lua_ls = {},
753755 },
754- }
756+
755757
756758 -- Ensure the servers and tools above are installed
757759 --
0 commit comments