
## Description `conform.nvim` was not using the correct formatter name for `php-cs-fixer` (which is the name of the binary). Also move `conform.nvim` spec outside of `nvim-lint` spec. <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> ## Related Issue(s) Fixes #3985 <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. --> ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
88 lines
1.8 KiB
Lua
88 lines
1.8 KiB
Lua
if lazyvim_docs then
|
|
-- LSP Server to use for PHP.
|
|
-- Set to "intelephense" to use intelephense instead of phpactor.
|
|
vim.g.lazyvim_php_lsp = "intelephense"
|
|
end
|
|
|
|
local lsp = vim.g.lazyvim_php_lsp or "phpactor"
|
|
|
|
return {
|
|
recommended = {
|
|
ft = "php",
|
|
root = { "composer.json", ".phpactor.json", ".phpactor.yml" },
|
|
},
|
|
|
|
{
|
|
"nvim-treesitter/nvim-treesitter",
|
|
opts = { ensure_installed = { "php" } },
|
|
},
|
|
|
|
{
|
|
"neovim/nvim-lspconfig",
|
|
opts = {
|
|
servers = {
|
|
phpactor = {
|
|
enabled = lsp == "phpactor",
|
|
},
|
|
intelephense = {
|
|
enabled = lsp == "intelephense",
|
|
},
|
|
[lsp] = {
|
|
enabled = true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
"williamboman/mason.nvim",
|
|
opts = {
|
|
ensure_installed = {
|
|
"phpcs",
|
|
"php-cs-fixer",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"mfussenegger/nvim-dap",
|
|
optional = true,
|
|
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,
|
|
},
|
|
{
|
|
"nvimtools/none-ls.nvim",
|
|
optional = true,
|
|
opts = function(_, opts)
|
|
local nls = require("null-ls")
|
|
opts.sources = opts.sources or {}
|
|
table.insert(opts.sources, nls.builtins.formatting.phpcsfixer)
|
|
table.insert(opts.sources, nls.builtins.diagnostics.phpcs)
|
|
end,
|
|
},
|
|
{
|
|
"mfussenegger/nvim-lint",
|
|
optional = true,
|
|
opts = {
|
|
linters_by_ft = {
|
|
php = { "phpcs" },
|
|
},
|
|
},
|
|
},
|
|
{
|
|
"stevearc/conform.nvim",
|
|
optional = true,
|
|
opts = {
|
|
formatters_by_ft = {
|
|
php = { "php_cs_fixer" },
|
|
},
|
|
},
|
|
},
|
|
}
|