From bae5d77871fb3b0e5388e6a491ebbefc8ec45362 Mon Sep 17 00:00:00 2001 From: Bruno Carlin Date: Wed, 15 Jun 2022 11:19:24 +0200 Subject: [PATCH] fix(nvim.lsp.gopls): remove unused function --- nvim/.config/nvim/lua/lsp/gopls.lua | 37 ----------------------------- 1 file changed, 37 deletions(-) diff --git a/nvim/.config/nvim/lua/lsp/gopls.lua b/nvim/.config/nvim/lua/lsp/gopls.lua index d252d4d..93efe33 100644 --- a/nvim/.config/nvim/lua/lsp/gopls.lua +++ b/nvim/.config/nvim/lua/lsp/gopls.lua @@ -15,43 +15,6 @@ function OrgImports(wait_ms) end end -function goimports(timeout_ms) - local context = { only = { "source.organizeImports" } } - vim.validate { context = { context, "t", true } } - - local params = vim.lsp.util.make_range_params() - params.context = context - - -- See the implementation of the textDocument/codeAction callback - -- (lua/vim/lsp/handler.lua) for how to do this properly. - local results = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, timeout_ms) - if not results or next(results) == nil then return end - local actions - for i, result in pairs(results) do - if result then - actions = result.result - break - end - end - - if not actions then return end - local action = actions[1] - - -- textDocument/codeAction can return either Command[] or CodeAction[]. If it - -- is a CodeAction, it can have either an edit, a command or both. Edits - -- should be executed first. - if action.edit or type(action.command) == "table" then - if action.edit then - vim.lsp.util.apply_workspace_edit(action.edit) - end - if type(action.command) == "table" then - vim.lsp.buf.execute_command(action.command) - end - else - vim.lsp.buf.execute_command(action) - end -end - function format_with_imports(timeout_ms) OrgImports(1000) vim.lsp.buf.formatting()