mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
feat(lang): added php support (#1450)
Configures tree-sitter, phpactor as LSP server and xdebug/vscode-php-debug as DAP server. --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
1891b02d9d
commit
32ba8ea3fe
1 changed files with 44 additions and 0 deletions
44
lua/lazyvim/plugins/extras/lang/php.lua
Normal file
44
lua/lazyvim/plugins/extras/lang/php.lua
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
return {
|
||||||
|
recommended = {
|
||||||
|
ft = "php",
|
||||||
|
root = { "composer.json", ".git", ".phpactor.json", ".phpactor.yml" },
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
vim.list_extend(opts.ensure_installed, { "php" })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
phpactor = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
optional = true,
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
table.insert(opts.ensure_installed, "php-debug-adapter")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
|
||||||
|
dap.adapters.php = {
|
||||||
|
type = "executable",
|
||||||
|
command = "node",
|
||||||
|
args = { path .. "/extension/out/phpDebug.js" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue