latex-lsp / texlab-vscode

LaTeX for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=efoerster.texlab
GNU General Public License v3.0
89 stars 4 forks source link

non-root file getting auto-build & resultant invalid log errors cached in extensions memory #825

Open goyalyashpal opened 1 year ago

goyalyashpal commented 1 year ago

titles/summaries:

non-root file getting auto-build & resultant invalid log errors cached in extensions memory

details

the build command is somehow getting auto-triggered on the title.tex file in my project and the extension is then staying stuck on these errors till the title.log file is deleted and vscodium window reloaded.

LaTeX Error: Environment titlepage undefined.
LaTeX Error: \begin{document} ended by \end{titlepage}.

following is an example of reproduction of the errors - with the difference that here shown is manually triggering the build, whereas in the main project, it is happening by itself.

MWE directory structure:

$ tree --dirsfirst
.
├── tex
│   └── title.tex
└── document.tex

2 directories, 2 files

$ cat document.tex
\documentclass[12pt,a4paper,oneside,titlepage,final]{report}
\begin{document}
\input{./tex/title.tex}
\maketitle%
Hi!
\end{document}

$ cat tex/title.tex 
\begin{titlepage}
    \title{My Title}
    \author{My Authors}
    \date{}
\end{titlepage}

steps to reproduce:

$ cd tex/
$ latexmk -pdf
   === Press ctrl-c on Error ===

open the root directory in vscodium with texlab enabled.

pfoerster commented 1 year ago

@goyalyashpal Thanks for the report.

the extension is then staying stuck on these errors till the title.log file is deleted and vscodium window reloaded.

This is a bug in the server is now fixed with the latest commit on master.

following is an example of reproduction of the errors

Unfortunately, I am not able to reproduce this issue with a fresh VSCodium install.

Regarding the automatic builds:

Also, it is unusual that the server would try to build the title.tex file, it should build the document.tex file instead. What happens if you trigger a build manually while title.tex is open and focused?

goyalyashpal commented 1 year ago

now fixed with the latest commit

thanks 😃 https://github.com/latex-lsp/texlab/commit/a67d3406a9755252277fa25ab5e1766a600e003b when will it be possible to update to that via extension itself?

Do you have texlab.build.onSave enabled?

following are all the entries in my settings.json related to texlab:

    "texlab.chktex.onOpenAndSave": false,
    "texlab.bibtexFormatter": "none",
    "texlab.latexFormatter": "none",
    // 2023-11-01 Self - not externally guided
    "texlab.build.auxDirectory": "./build/auxx",
    "texlab.build.args": [
        "-pdf",
        "-interaction=nonstopmode",
        "-synctex=1",
        "%f",
        "-output-directory=./build",
        "-aux-directory=./build/auxx",
    ],
    "[latex]": {
        "editor.defaultFormatter": "efoerster.texlab"
    },

Do you have enabled continuous mode in your latexmkrc?

no, i didn't have any latexmkrc file whatsoever.

What happens if you trigger a build manually while title.tex is open and focused?

if in root directory, triggering latexmk via terminal cli in vscodium, with no latexmkrc file in this MWE - no, the title.tex is not build standalone.

as for the full project, there're way too many things happening there in regards to minted package, not possible to trim it to narrow down.