From 43423286a97bb11a50ba80fc517a599632e26a41 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Tue, 27 Feb 2024 17:32:20 +0100 Subject: [PATCH] fix(lsp): disable php formatting workaround --- lua/lsp.lua | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/lua/lsp.lua b/lua/lsp.lua index 35a23ba..7b306d9 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -93,27 +93,7 @@ local function on_attach(client, bufnr) vim.keymap.set( { "n", "x", }, "lf", - function () - if vim.bo.filetype ~= "php" then - return vim.lsp.buf.format() - end - - local dls = require("lsp.diagnosticls") - local formatters = dls.lspconfig.init_options.formatFiletypes.php - for _, fmt in ipairs(formatters) do - if fmt == "php_cs_fixer" then - ---@type table - local winview = vim.fn.winsaveview() - vim.cmd.write({ bang = true, }) - vim.lsp.buf.format() - vim.cmd.write({ bang = true, }) - vim.fn.winrestview(winview) - return - end - end - - return vim.lsp.buf.format() - end, + vim.lsp.buf.format, opts )