Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir authored Jan 2, 2025
1 parent 456cc23 commit 4bcd86f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lua/lspconfig/configs/ccls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down

0 comments on commit 4bcd86f

Please sign in to comment.