diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index de0b7e9..9b05f82 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -98,19 +98,24 @@ local switch_source_header = function() if clangd_client then clangd_client.request('textDocument/switchSourceHeader', params, function(err, result) if err then - print 'Error dane' - error(tostring(err)) + vim.schedule(function() + vim.notify('Clangd: switchSourceHeader gave error: ' .. tostring(err), vim.log.levels.ERROR) + end) end if not result then - print 'Corresponding file cannot be determined' + vim.schedule(function() + vim.notify('Clangd: switchSourceHeader, corresponding file not determined', vim.log.levels.ERROR) + end) return end vim.cmd.edit(vim.uri_to_fname(result)) end, 0) else - print 'Method switchSourceHeader is not supported by server active on the current buffer' + vim.schedule(function() + vim.notify('Clangd: switchSourceHeader is not supported', vim.log.levels.ERROR) + end) end end