@@ -186,6 +186,25 @@ vim.lsp.config('clangd', {
186
186
})
187
187
vim .lsp .enable ' clangd'
188
188
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
+
189
208
-- [[ Basic Autocommands ]]
190
209
-- See `:help lua-guide-autocommands`
191
210
@@ -727,31 +746,14 @@ require('lazy').setup({
727
746
-- - filetypes (table): Override the default list of associated filetypes for the server
728
747
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
729
748
-- - 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/
731
750
local servers = {
732
751
-- pyright = {},
733
752
rust_analyzer = {},
734
753
-- ... 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 = {},
753
755
},
754
- }
756
+
755
757
756
758
-- Ensure the servers and tools above are installed
757
759
--
0 commit comments