mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-19 13:55:01 +00:00
chore(nvim): add support for intelephense license
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
-- │ LSP Setup and configuration │
|
-- │ LSP Setup and configuration │
|
||||||
-- ╰─────────────────────────────────────────────────────────╯
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
require 'utils'
|
||||||
|
|
||||||
-- LSP Servers are installed and configured by lsp-setup.nvim
|
-- LSP Servers are installed and configured by lsp-setup.nvim
|
||||||
-- Mason formatters Conform uses to format files
|
-- Mason formatters Conform uses to format files
|
||||||
-- These are automatically configured by zapling/mason-conform.nvim
|
-- These are automatically configured by zapling/mason-conform.nvim
|
||||||
@@ -27,12 +29,8 @@ local lsp_servers = {
|
|||||||
},
|
},
|
||||||
html = {},
|
html = {},
|
||||||
intelephense = {
|
intelephense = {
|
||||||
commands = {
|
init_options = {
|
||||||
IntelephenseIndex = {
|
licenceKey = GetIntelephenseLicense(),
|
||||||
function()
|
|
||||||
vim.lsp.buf.execute_command { command = 'intelephense.index.workspace' }
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
jsonls = {},
|
jsonls = {},
|
||||||
|
|||||||
@@ -80,3 +80,17 @@ end
|
|||||||
|
|
||||||
-- Toggle background between light and dark
|
-- Toggle background between light and dark
|
||||||
function ToggleBackground() vim.o.bg = vim.o.bg == 'light' and 'dark' or 'light' end
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user