diff --git a/lua/custom/lspconfig.lua b/lua/custom/lspconfig.lua index eb495aa..e2f3fd2 100644 --- a/lua/custom/lspconfig.lua +++ b/lua/custom/lspconfig.lua @@ -156,7 +156,16 @@ setup_server("intelephense", { filetypes = { "php" }, -- root_dir = fallback_root_dir, init_options = { - licenceKey = vim.fn.readfile(vim.fn.expand("$HOME/.config/intelephense/license.txt"))[1], + licenceKey = (function() + local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt") + local file = io.open(license_path, "r") + if file then + local content = file:read("*l") -- read first line + file:close() + return content + end + return nil + end)(), }, settings = { intelephense = {