From 177a4eb851fc0ff8b65979e5fc39087e1d83b1d2 Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun, 10 Apr 2022 02:36:49 +0200 Subject: fix(lua-language-server): update root-markers (#1825) --- lua/lspconfig/server_configurations/sumneko_lua.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/sumneko_lua.lua b/lua/lspconfig/server_configurations/sumneko_lua.lua index bd187909..63380957 100644 --- a/lua/lspconfig/server_configurations/sumneko_lua.lua +++ b/lua/lspconfig/server_configurations/sumneko_lua.lua @@ -1,10 +1,18 @@ local util = require 'lspconfig.util' +local root_files = { + '.luarc.json', + '.luacheckrc', + '.stylua.toml', + 'selene.toml', +} return { default_config = { cmd = { 'lua-language-server' }, filetypes = { 'lua' }, - root_dir = util.find_git_ancestor, + root_dir = function(fname) + return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname) + end, single_file_support = true, log_level = vim.lsp.protocol.MessageType.Warning, settings = { Lua = { telemetry = { enable = false } } }, @@ -49,7 +57,7 @@ require'lspconfig'.sumneko_lua.setup { ``` ]], default_config = { - root_dir = [[root_pattern(".git") or bufdir]], + root_dir = [[root_pattern(".luarc.json", ".luacheckrc", ".stylua.toml", "selene.toml", ".git")]], }, }, } -- cgit v1.2.3-70-g09d2