From aaec5d049af99e7b975bdf68aca582f1aa91b338 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 19 Sep 2024 09:07:01 +0000 Subject: [PATCH] docs: update server_configurations.md skip-checks: true --- doc/server_configurations.md | 8 +++++--- doc/server_configurations.txt | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/server_configurations.md b/doc/server_configurations.md index 462df4e813..958a6331b1 100644 --- a/doc/server_configurations.md +++ b/doc/server_configurations.md @@ -6715,9 +6715,11 @@ settings. ```lua require'lspconfig'.lua_ls.setup { on_init = function(client) - local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then - return + if client.workspace_folders then + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end end client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { diff --git a/doc/server_configurations.txt b/doc/server_configurations.txt index 462df4e813..958a6331b1 100644 --- a/doc/server_configurations.txt +++ b/doc/server_configurations.txt @@ -6715,9 +6715,11 @@ settings. ```lua require'lspconfig'.lua_ls.setup { on_init = function(client) - local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then - return + if client.workspace_folders then + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + return + end end client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {