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

BibLaTeX globbing patterns (`\addbibresource[glob]{}`) do not seem to read the `.bib` files under `nvim` #1125

Open Thibaulltt opened 3 months ago

Thibaulltt commented 3 months ago

I'm currently using nvim with texlab to write a paper using the acmart document class.

Here is my main file:

\documentclass[...options...]{acmart}
\input{preamble}
\begin{document}
% ... snip ...

And here is the relevant part of my preamble.tex file:

% ... snip ...
\usepackage[backend=biber,datamodel=acmdatamodel,style=acmauthoryear]{biblatex}
\addbibresource[glob]{../../ressources/*.bib}
% ... snip ...

However, whenever I use a \{paren|text}cite command, texlab highlights the citation as an error, with the following message:

Lorem ipsum~\textcite{foo}
%                     ^^^ - texlab: Undefined reference

Even though I know the foo key is present in my bibliography files, and the latex files get compiled to a final PDF without issues.

Here are my texlab settings (in Lua, since I'm using nvim[-lspconfig]):

local texlab_settings = {
    texlab = {
        build = {
            executable = "latexmk",
            args = {
                "-pdflua",
                "-bibtex-cond", "-bibfudge",
                "-interaction=nonstopmode",
                "-auxdir=./build/", "-outdir=./build/",
                "-synctex=1", "%f"
            },
            forwardSearchAfter = false,
            auxDirectory = "./build/",
            logDirectory = "./build/",
            pdfDirectory = "./build/",
        },
        forwardSearch = {
            executable = "okular",
            -- Ref for Okular arguments: the TexLab GitHub Wiki. See:
            -- https://github.com/latex-lsp/texlab/wiki/Previewing#forward-search-2
            args = { "--unique", "file:%p#src:%l%f" },
        },
        completion = { matcher = "prefix-ignore-case" },
        experimental = {
            -- Include custom package dependencies into the dependency graph:
            followPackageLinks = true,
            -- List of *additional* environments to consider as enumeration/math/verbatim:
            enumEnvironments = {},
            mathEnvironments = {},
            verbatimEnvironments = { 'lstlisting', },
        },
    }
}

Any intuition what might prevent texlab from parsing my bib files?

pfoerster commented 3 months ago

Any intuition what might prevent texlab from parsing my bib files?

Currently, the server does not expand glob patterns yet but supporting it should not be too difficult.