Add phpcs, php-cs-fixer and phpcbf

This commit is contained in:
2023-09-13 16:05:04 +02:00
parent 19c352be41
commit 29935fa3fd
2 changed files with 113 additions and 4 deletions
+14 -1
View File
@@ -189,7 +189,20 @@ function P.on_attach(client, bufnr)
vim.keymap.set("n", "<leader>rn", ca_rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set({ "n", "x", }, "<leader>lf", function () vim.lsp.buf.format({ async = true, }) end, opts)
vim.keymap.set(
{ "n", "x", },
"<leader>lf",
function ()
if vim.bo.filetype == "php" then
vim.cmd("w")
vim.lsp.buf.format({ async = false, })
vim.cmd("e!")
else
vim.lsp.buf.format({ async = false, })
end
end,
opts
)
-- if client.server_capabilities.document_range_formatting then
-- end