From 4bcd86fbdf8e3f49b160578217c1051de8087d7c Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 2 Jan 2025 13:19:15 +0800 Subject: [PATCH] fixup! --- lua/lspconfig/configs/ccls.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/lspconfig/configs/ccls.lua b/lua/lspconfig/configs/ccls.lua index 198ae8c89b..8098596b62 100644 --- a/lua/lspconfig/configs/ccls.lua +++ b/lua/lspconfig/configs/ccls.lua @@ -3,23 +3,23 @@ local util = require 'lspconfig.util' local function switch_source_header(bufnr) bufnr = util.validate_bufnr(bufnr) local client = util.get_active_client_by_name(bufnr, 'ccls') - local params = { uri = vim.uri_from_bufnr(bufnr) } - if client then - client.request('textDocument/switchSourceHeader', params, function(err, result) - if err then - error(tostring(err)) - end - if not result then - print 'Corresponding file cannot be determined' - return - end - vim.api.nvim_command('edit ' .. vim.uri_to_fname(result)) - end, bufnr) - else - print 'method textDocument/switchSourceHeader is not supported by any servers active on the current buffer' + if not client then + vim.notify('method textdocument/switchsourceheader is not supported by any servers active on the current buffer') end + local params = vim.lsp.util.make_text_document_params(bufnr) + client.request('textdocument/switchsourceheader', params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + vim.notify('corresponding file cannot be determined') + return + end + vim.cmd.edit(vim.uri_to_fname(result)) + end, bufnr) end + return { default_config = { cmd = { 'ccls' },