chore(nvim): add support for intelephense license

This commit is contained in:
2025-01-14 06:46:10 +02:00
parent bfcaa26070
commit 7038da568e
2 changed files with 18 additions and 6 deletions

View File

@@ -80,3 +80,17 @@ end
-- Toggle background between light and dark
function ToggleBackground() vim.o.bg = vim.o.bg == 'light' and 'dark' or 'light' end
-- ╭─────────────────────────────────────────────────────────╮
-- │ LSP Related helper functions │
-- ╰─────────────────────────────────────────────────────────╯
-- Get the license key for intelephense
---@return string|nil -- The license key for intelephense
function GetIntelephenseLicense()
local f =
assert(io.open(os.getenv 'HOME' .. '/intelephense/license.txt', 'rb'))
local content = f:read '*a'
f:close()
return string.gsub(content, '%s+', '')[1] or nil
end