I was also struggling with this, make sure you enable --file-line-error-style
, for example:
lualatex -interaction=nonstopmode -file-line-error-style --shell-escape --synctex=1 %O %S
pdflatex -interaction=nonstopmode -file-line-error-style --shell-escape --synctex=1 %O %S
xelatex -interaction=nonstopmode -file-line-error-style --shell-escape --synctex=1 %O %S
Sometimes errors are not correctly located, but this is a limitation of the compiler: