Thibaulltt
Currently, workspace detection seems to be borked because `texlab` does not respect the full path to the document it's compiling. Let's take the following folder structure: ``` papers/ (git root) |-- latexmkrc |-- resources/ |-- bibliography.bib |-- thesis |-- thesis.tex |-- chapters/ (and some other files under chapters/) ``` Here are the relevant contents of my latexmkrc: ```perl $pdf_mode = 4; $silent = 1; # Change into the file's directory before build: $do_cd = 1; $recorder = 1; # Add those options to all TeX engines: set_tex_cmds('-file-line-error -interaction=nonstopmode -synctex=1 %O %S'); # ...snip... # # All aux/bib/build files in build: $aux_dir = './build'; $out_dir = './build'; $bibtex_use = 1.5; # Change dir for bib[tex,er] and run them: $bibtex_fudge = 1; ``` I'm compiling the file `thesis.tex` using the following command line: `latexmk thesis/thesis.tex` from the `papers/` folder. The `thesis.tex` file includes the file `bibliography.bib` as `\usebibresource{../resources/bibliography.bib}`. This structure **works** using `latexmk`. If I open up a `neovim` instance from `project/thesis` using `nvim thesis.tex`, which will automatically set the project root to the path where my `latexmkrc` file resides (so, `project/`), then all bibliography links are unknown since `texlab` does not seem to recognize that my paths for inclusion are relative to the main file `thesis/thesis.tex`. It *seems* to only be because latexmk's folder inclusion mechanism is detected as follows: https://github.com/Thibaulltt/texlab/blob/d80c436aef6cbfea1866879d5c5e67b1cf727269/crates/parser/src/latexmkrc.rs#L86-L118 This means that the 'working directory' where texlab will search all its paths from is actually `project/`, and not `project/thesis` like it would when invoqued from the command-line. What follows is my work-in-progress to see what went wrong, and how to solve it ๐