aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lsp/lua_ls.lua26
1 files changed, 15 insertions, 11 deletions
diff --git a/lsp/lua_ls.lua b/lsp/lua_ls.lua
index 97bb6f5e..7a180ddf 100644
--- a/lsp/lua_ls.lua
+++ b/lsp/lua_ls.lua
@@ -68,21 +68,25 @@
--- * [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary)
---
+local root_markers1 = {
+ '.emmyrc.json',
+ '.luarc.json',
+ '.luarc.jsonc',
+}
+local root_markers2 = {
+ '.luacheckrc',
+ '.stylua.toml',
+ 'stylua.toml',
+ 'selene.toml',
+ 'selene.yml',
+}
+
---@type vim.lsp.Config
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
- root_markers = {
- '.emmyrc.json',
- '.luarc.json',
- '.luarc.jsonc',
- '.luacheckrc',
- '.stylua.toml',
- 'stylua.toml',
- 'selene.toml',
- 'selene.yml',
- '.git',
- },
+ root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers1, root_markers2, { '.git' } }
+ or vim.list_extend(vim.list_extend(root_markers1, root_markers2), { '.git' }),
settings = {
Lua = {
codeLens = { enable = true },