This commit is contained in:
Dev'A'Lot 2024-01-23 09:39:21 +01:00 committed by GitHub
commit 77d719143c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,88 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"php",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
intelephense = {
cmd = { "intelephense", "--stdio" },
filetypes = { "php" },
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git"),
},
phpactor = {
cmd = { "phpactor", "language-server" },
filetypes = { "php" },
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git"),
},
},
},
},
-- Ensure PHP tools are installed
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "intelephense", "phpactor", "phpcbf" })
end,
},
{
"nvimtools/none-ls.nvim",
optional = true,
dependencies = {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "phpcbf" })
end,
},
},
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = vim.list_extend(opts.sources or {}, {
nls.builtins.formatting.phpcbf,
})
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
php = { "phpcbf" },
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "php-debug-adapter" })
end,
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"olimorris/neotest-phpunit",
},
opts = {
adapters = {
["neotest-phpunit"] = {},
},
},
},
}

View file

@ -0,0 +1,83 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"php",
})
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
intelephense = {
cmd = { "intelephense", "--stdio" },
filetypes = { "php" },
root_dir = require("lspconfig.util").root_pattern("composer.json", ".git"),
},
},
},
},
-- Ensure PHP tools are installed
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "intelephense", "phpcbf" })
end,
},
{
"nvimtools/none-ls.nvim",
optional = true,
dependencies = {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "phpcbf" })
end,
},
},
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = vim.list_extend(opts.sources or {}, {
nls.builtins.formatting.phpcbf,
})
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
php = { "phpcbf" },
},
},
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "php-debug-adapter" })
end,
},
},
},
{
"nvim-neotest/neotest",
optional = true,
dependencies = {
"olimorris/neotest-phpunit",
},
opts = {
adapters = {
["neotest-phpunit"] = {},
},
},
},
}