From 4353d64fa35e48d395b2dc2f4f975b460dcf7e49 Mon Sep 17 00:00:00 2001 From: sp4ke Date: Wed, 28 Sep 2022 14:26:08 +0200 Subject: [PATCH] fix automated handling of libraries with sumneko_lua + lua-dev (#235) - This also fixes auto completion with native vim api using lua-dev and nvim-cmp (also complements #229) Co-authored-by: spike --- lua/navigator/lspclient/sumneko_lua.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/navigator/lspclient/sumneko_lua.lua b/lua/navigator/lspclient/sumneko_lua.lua index 001378f..670e6df 100644 --- a/lua/navigator/lspclient/sumneko_lua.lua +++ b/lua/navigator/lspclient/sumneko_lua.lua @@ -28,7 +28,9 @@ local sumneko_cfg = { }, }, on_new_config = function(cfg, root) - local libs = vim.tbl_deep_extend('force', {}, library) + local libs = vim.schedule(function() + vim.tbl_deep_extend('force', {}, library) + end) libs[root] = nil cfg.settings.Lua.workspace.library = libs return cfg