Open amalgame21 opened 1 year ago
@amalgame21 I am not familiar with kickstart.nvim
but texlab
reports build errors using the LSP diagnostics (textDocument/publishDiagnostics
) so there should be a way to see them from the client (either through an error list somewhere or they are shown inline)
Hi, I have the same problem.
The chktex diagnostics works well and I can see a sign wherever there's an error. But when I write something bad and the chetex couldn't recognize, I build it and only get a Build Error
message. I am confused where the error is.
but texlab compiles much faster than vimtex, so I still want to use texlab to compile.
@amalgame21 @Unpredictability Can you try the same thing with texlab 4.3.2
? ChkTeX diagnostics are published through the same channel as the build errors but the project resolution might be wrong so the build errors are not picked up properly.
Hi, I have the same problem.
I use sublime text 4
with sublimelsp/LSP-TexLab. If I compile my .tex
file successfully, I can get waring message. But if I fail to compile my .tex
file , the lsp client will only show Build error
and there is no LSP diagnostics message .
Hello, there are a couple of things that may be relevant here:
The mentioned script installs the plugin neovim/nvim-lspconfig
, which configures the LSP servers if you (or a plugin) do not override them. nvim-lspconfig
respects the TexLab
's default settings listed in the configuration wiki entry, and Mason
does not override these settings for TexLab
. In particular, it sets both of texlab.chktex.onOpenAndSave
and texlab.chktex.onEdit
to false
. Except for the last point below, changing these to true
should be sufficient to get inlay diagnostic hints after building. You could include the below in init.lua
or a lua
module required by it.
local lsp_config = require('lspconfig')
lsp_config['texlab'].setup({
settings={
texlab = {
chktex = {
onEdit = true,
onOpenAndSave = true
},
}
}
})
Then, commenting out \end{document}
should result in the inlay diagnostic hint No match found for `document'
in the line containing \begin{document}
.
Apart from inlay diagnostic hints, NeoVim
provides a couple of ways to display the diagnostics published by the server, but it does not default to applying either of them. You could use
:lua vim.diagnostic.setqflist()
or
:lua vim.diagnostic.setloclist()
to list the diagnostics in the Quickfix List
or Location List
, respectively.
TexLab
has been improving support for .latexmkrc
, but it does not handle all relevant variables yet, and some may still cause complications, e.g. failure to display diagnostics. However, given that .latexmkrc
was not explicitly mentioned in the OP, it may be better to discuss this in a separate issue.
I am using the https://github.com/nvim-lua/kickstart.nvim
init.lua
script and configure it to use texlab lsp.When I type
:TexlabBuild
to build the tex file, when all things in the .tex file is correct, the bottom left corner displayBuild Success
However when the .tex file have something wrong, like I comment out the `% \end{document}
type
:TexlabBuild
to build the tex file, bottom left corner displayBuild Error
, but nothing more.In vimtex, the Error message will pop up to show what was messed up in the file.
In texlab, how can I see the error message to see which part causing build error?