From fbcc0b8d619e6f84448645f49d0a1dda9de840e5 Mon Sep 17 00:00:00 2001 From: mace Date: Sun, 22 Mar 2026 17:17:16 +0100 Subject: [PATCH] fix error message intelephense license txt --- lua/custom/lspconfig.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 = {