From 80f9352bb8d83f96b8708b63d64ad05c28704ccd Mon Sep 17 00:00:00 2001 From: Felix Freeman Date: Thu, 14 Sep 2023 00:04:11 -0300 Subject: [PATCH] feat(lang): PHP support --- lua/lazyvim/plugins/extras/lang/php.lua | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/php.lua diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua new file mode 100644 index 00000000..07e8debf --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -0,0 +1,47 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + "php", + }) + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + "phpactor", + }) + 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, + }, +}