From c4e7ad2b162d6318a2923ab1563e34d16e692f15 Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Mon, 21 Oct 2024 09:42:12 +0100 Subject: Set up mason.nvim and intelephense PHP language server --- neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'neovim/.config') diff --git a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua index 48a86c6..c977de6 100644 --- a/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua +++ b/neovim/.config/nvim/lua/plugins/nvim_lspconfig.lua @@ -1,15 +1,21 @@ return { { + dependencies = { + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, + }, 'neovim/nvim-lspconfig', lazy = false, priority = 800, config = function() + require("mason").setup() + require("mason-lspconfig").setup() local nvim_lsp = require('lspconfig') local capabilities = require('cmp_nvim_lsp').default_capabilities() -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches local servers = { "bashls", "clangd", "cssls", "dockerls", "gopls", "htmx", "jsonls", "marksman", - "phpactor", "psalm", "ruff", "rust_analyzer", "taplo", "yamlls" } + "ruff", "rust_analyzer", "taplo", "yamlls" } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { capabilities = capabilities, @@ -112,6 +118,17 @@ return { flags = { debounce_text_changes = 150, }, + + require 'lspconfig'.intelephense.setup { + filetypes = { 'php' }, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, + init_options = { + licenceKey = '~/.config/intelephense/license.txt', + }, + } } -- Use LspAttach autocommand to only map the following keys -- cgit v1.2.3