From 88c4c042e1e59f992e4c7aff3531033047b3aa9c Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 2 Jan 2025 15:26:38 +0800 Subject: refactor(clangd): imporve switchsourceheader handler (#3537) --- lua/lspconfig/configs/ccls.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua/lspconfig/configs/ccls.lua') diff --git a/lua/lspconfig/configs/ccls.lua b/lua/lspconfig/configs/ccls.lua index 9583fcb0..e64df3c6 100644 --- a/lua/lspconfig/configs/ccls.lua +++ b/lua/lspconfig/configs/ccls.lua @@ -1,13 +1,14 @@ local util = require 'lspconfig.util' local function switch_source_header(bufnr) + local method_name = 'textDocument/switchSourceHeader' bufnr = util.validate_bufnr(bufnr) local client = util.get_active_client_by_name(bufnr, 'ccls') if not client then - vim.notify('method textdocument/switchsourceheader is not supported by any servers active on the current buffer') + return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name)) end local params = vim.lsp.util.make_text_document_params(bufnr) - client.request('textDocument/switchsourceheader', params, function(err, result) + client.request(method_name, params, function(err, result) if err then error(tostring(err)) end -- cgit v1.2.3-70-g09d2