latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.49k stars 51 forks source link

project detection: .latexmkrc in higher level parent directory #1118

Closed daviehh closed 3 months ago

daviehh commented 3 months ago

There have been bug fix concerning the ~/.latexmkrc in the home folder, but it seems that the .latexmkrc file in higher level parent director can also override the detection. Expected behavior or bug? Thanks!

e.g. /path/to/ contains the .latexmkrc, but files in /path/to/some/dir/a.tex would treat /path/to as the project folder

Screenshot 2024-05-11 at 14 49 53

.latexmkrc file here only has one line $pdf_mode = 1; for testing

pfoerster commented 3 months ago

There have been bug fix concerning the ~/.latexmkrc in the home folder, but it seems that the .latexmkrc file in higher level parent director can also override the detection. Expected behavior or bug?

This is currently the expected behavior and is required to handle cases like these

.latexmkrc
src/
    main.tex
    subfolder/
        child1.tex
        child2.tex

where the directory of the main source file is not equal to the compile directory.

Unfortunately, the (working) directory passed by the editor cannot be relied upon in most cases (especially with editors like vim)

daviehh commented 3 months ago

thanks for the explanation!