mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: Add php lang
This commit is contained in:
parent
879e29504d
commit
cf3b4d8792
2 changed files with 171 additions and 0 deletions
88
lua/lazyvim/plugins/extras/lang/php-above-81.lua
Normal file
88
lua/lazyvim/plugins/extras/lang/php-above-81.lua
Normal 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"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
83
lua/lazyvim/plugins/extras/lang/php-under-81.lua
Normal file
83
lua/lazyvim/plugins/extras/lang/php-under-81.lua
Normal 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"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue