fix(texlab): use notify instead of print (#3256)

* 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 <>
This commit is contained in:
Thibault de Villèle 2024-08-02 14:41:19 +02:00 committed by GitHub
parent d710f5c58d
commit e6528f4613
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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