-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inlay hints in \include
d files with auxDirectory
#906
Comments
auxDirectory
for \include
d files\include
d files with auxDirectory
- Search in the same directory as well in addition to the configured aux directory - Allow configuring aux directory independent of log directory - Deprecate texlab.auxDirectory in favor of texlab.build.auxDirectory Fixes #906.
I tried out texlab = {
build = {
args = {
'-pdf',
'-interaction=nonstopmode',
'-synctex=1',
'-outdir=.aux',
'%f',
},
auxDirectory = '.aux',
logDirectory = '.aux',
}
} In my experience, the same problem occurs as I described previously (inlay hints work with |
@jdujava Thanks for the update.
No, I am no longer able to reproduce it with Also, you should not set |
@pfoerster Thank you for looking into this! The initial directory tree is (with the contents given in first comment of this issue)
Compiling with latexmk -pdf -interaction=nonstopmode -synctex=1 example.tex results in
Since I obtained The contents of % .aux/example.aux
\relax
\providecommand\hyper@newdestlabel[2]{}
\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
\global\let\oldnewlabel\newlabel
\gdef\newlabel#1#2{\newlabelxx{#1}#2}
\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
\AtEndDocument{\ifx\hyper@anchor\@undefined
\let\newlabel\oldnewlabel
\fi}
\fi}
\global\let\hyper@last\relax
\gdef\HyperFirstAtBeginDocument#1{#1}
\providecommand\HyField@AuxAddToFields[1]{}
\providecommand\HyField@AuxAddToCoFields[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {1}Working example}{1}{section.1}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces This is an example image.}}{1}{figure.1}\protected@file@percent }
\newlabel{fig:missing}{{1}{1}{This is an example image}{figure.1}{}}
\@input{files/section1.aux}
\gdef \@abspage@last{2} % .aux/files/section1.aux
\relax
\providecommand\hyper@newdestlabel[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {2}Included section}{2}{section.2}\protected@file@percent }
\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces This is a missing image. Leads to a warning/error.}}{2}{figure.2}\protected@file@percent }
\newlabel{fig:random}{{2}{2}{This is a missing image. Leads to a warning/error}{figure.2}{}}
\@setckpt{files/section1}{
\setcounter{page}{3}
\setcounter{equation}{0}
\setcounter{enumi}{0}
\setcounter{enumii}{0}
\setcounter{enumiii}{0}
\setcounter{enumiv}{0}
\setcounter{footnote}{0}
\setcounter{mpfootnote}{0}
\setcounter{part}{0}
\setcounter{section}{2}
\setcounter{subsection}{0}
\setcounter{subsubsection}{0}
\setcounter{paragraph}{0}
\setcounter{subparagraph}{0}
\setcounter{figure}{2}
\setcounter{table}{0}
\setcounter{section@level}{1}
\setcounter{Item}{0}
\setcounter{Hfootnote}{0}
\setcounter{bookmark@seq@number}{2}
} |
I tried out #913 and everything seems to work alright 👍 , thanks @pfoerster! |
## [5.11.0] - 2023-11-05 ### Added - Add `texlab.inlayHints.labelDefinitions` and `texlab.inlayHints.labelReferences` options ([#753](latex-lsp/texlab#753)) - Display inlay hints for label references by default ([#753](latex-lsp/texlab#753)) ### Fixed - Moving the build logs to the recycle bin will now clear the diagnostics ([texlab-vscode/#825](latex-lsp/texlab-vscode#825)) - Fix false positive when reporting syntax errors for BibTeX accents ([#945](latex-lsp/texlab#945)) ## [5.10.1] - 2023-10-10 ### Fixed - Fix regression when renaming commands ([#936](latex-lsp/texlab#936)) ## [5.10.0] - 2023-09-30 ### Added - Allow passing additional arguments to `ChkTeX` using `texlab.chktex.additionalArgs` ([#927](latex-lsp/texlab#927)) ### Fixed - Fix loading bibliographies from `kpathsea` search path ([#923](latex-lsp/texlab#923)) - Don't report duplicate results when using goto definition on includes ([#924](latex-lsp/texlab#924)) - Fix project detection when there exist files with the same name ([#923](latex-lsp/texlab#923)) - Do not report parse errors with `$` in paths ([#931](latex-lsp/texlab#931)) ## [5.9.2] - 2023-08-14 ### Fixed - Don't crash when using comments inside `\include`-like commands ([#919](latex-lsp/texlab#919)) - Folding ranges include only the contents instead of the entire range of the structure. For example, the folding range of an environment will start after the `\begin` and stop before the `\end` ([#915](latex-lsp/texlab#915)) ## [5.9.1] - 2023-08-11 ### Fixed - Improve performance when completing BibTeX entries ([#493](latex-lsp/texlab#493)) - Don't report unused entries for very large bibliographies - Avoid redundant reparses after saving documents ## [5.9.0] - 2023-08-06 ### Added - Use bibliographies found in `BIBINPUTS` environment variable ([#493](latex-lsp/texlab#493)) - Add `texlab.build.pdfDirectory` setting ([#911](latex-lsp/texlab#911)) ### Fixed - Fix search path for aux files when using `\include` instead of `\input` ([#906](latex-lsp/texlab#906)) ## [5.8.0] - 2023-07-30 ### Added - Report diagnostics for unused and undefined labels - Report diagnostics for unused BibTeX entries and undefined citations - Report diagnostics for duplicate BibTeX entries - Report diagnostics for duplicate labels - Add `texlab.build.auxDirectory` and `texlab.build.logDirectory` settings ([#906](latex-lsp/texlab#906)) ### Deprecated - Deprecate `texlab.auxDirectory` in favor of `texlab.build.auxDirectory` ### Fixed - Fix parsing paths with `|` ([#568](latex-lsp/texlab#568)) - Fix parsing LaTeX identifiers with `=` ([#568](latex-lsp/texlab#568))
Setup of auxDirectory
Let's have (for example) the following
aux_dir
forlatexmk
and corresponding configuration of
auxDirectory
fortexlab
. Diagnostics are then properly displayed, but the inlay hints are missing in the files which are sourced using\include
. I will try to explain in the following example.Info about my setup:
neovim
latexmk
viavimtex
pluginnvim-lspconfig
Minimal reproducible example
Consider the directory structure
where the contents are
What works and what doesn't
Inlay hint for the first figure is displayed (
example-image-a
), and also warning/error for the second figure (missing.png
).However, the inlay hint for the second one is not present. Perhaps surprisingly (at least for me), when the file
section1.tex
is sourced using\input
instead of\include
, the inlay hint is displayed.The text was updated successfully, but these errors were encountered: