From e6528f4613c8db2e04be908eb2b5886d63f62a98 Mon Sep 17 00:00:00 2001 From: Thibault de Villèle <25150288+Thibaulltt@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:41:19 +0200 Subject: fix(texlab): use notify instead of print (#3256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(texlab): change all print() to vim.notify() Some texlab-specific functions were using `print`, some were using `vim.notify`. Changed all uses of `print` to `vim.notify` with levels: - `vim.log.levels.INFO` for `build` and `forwardSeach` LSP methods, - `vim.log.levels.ERROR` when the `texlab` client cannot be found. * fix(lint): integrate linter changes of #3256 --------- Co-authored-by: Thibault de Villèle <> --- lua/lspconfig/server_configurations/texlab.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/texlab.lua b/lua/lspconfig/server_configurations/texlab.lua index 3f559317..7b079d27 100644 --- a/lua/lspconfig/server_configurations/texlab.lua +++ b/lua/lspconfig/server_configurations/texlab.lua @@ -27,10 +27,13 @@ local function buf_build(bufnr) if err then error(tostring(err)) end - print('Build ' .. texlab_build_status[result.status]) + vim.notify('Build ' .. texlab_build_status[result.status], vim.log.levels.INFO) end, bufnr) else - print 'method textDocument/build is not supported by any servers active on the current buffer' + vim.notify( + 'method textDocument/build is not supported by any servers active on the current buffer', + vim.log.levels.WARN + ) end end @@ -47,10 +50,13 @@ local function buf_search(bufnr) if err then error(tostring(err)) end - print('Search ' .. texlab_forward_status[result.status]) + vim.notify('Search ' .. texlab_forward_status[result.status], vim.log.levels.INFO) end, bufnr) else - print 'method textDocument/forwardSearch is not supported by any servers active on the current buffer' + vim.notify( + 'method textDocument/forwardSearch is not supported by any servers active on the current buffer', + vim.log.levels.WARN + ) end end -- cgit v1.2.3-70-g09d2