Skip to content
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

No (recursive) diagnostic for nested files using subimport #885

Closed
GTM52 opened this issue May 7, 2023 · 1 comment
Closed

No (recursive) diagnostic for nested files using subimport #885

GTM52 opened this issue May 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@GTM52
Copy link

GTM52 commented May 7, 2023

Hello, I am currently using texlab in neovim and it works well, but when I use import package to nest my files, I cannot get completion for \ref command. Here is a minimal example (download here):

.
├── main.tex
├── part 1
│   ├── chapter 1
│   │   ├── main.tex
│   │   └── section 1.tex
│   └── main.tex
└── part 2
    ├── chapter 2
    │   ├── main.tex
    │   └── section 2.tex
    └── main.tex

I use import package to input files in part 1, and input for part 2.

% main.tex
\documentclass{book}
\usepackage{import}
\begin{document}
\subincludefrom{part 1}{main}
\include{part 2/main}
\end{document}
% part 1/main.tex
\part{1}
\label{part 1}
\subimport{chapter 1}{main}
% part 1/chapter 1/main.tex
\chapter{1}
\label{chapter 1}
\subimport{./}{section 1}
%\subimport{}{section 1}
% part 1/chapter 1/section 1.tex
\section{1}
\label{section 1}
% part 2/main.tex
\part{2}
\label{part 2}
\input{part 2/chapter 2/main}
% part 2/chapter 2/main.tex
\chapter{2}
\label{chapter 2}
\input{part 2/chapter 2/section 2}
% part 2/chapter 2/section 2.tex
\section{2}
\label{section 2}

There are two problems:

  1. I cannot get completion for (deeper) labels in part 1 when I use \ref:
    image
    image
  2. In part 1/chapter 1/main.tex, the command \subimport{./}{section 1} gives a completion for \ref,
    image
    while \subimport{}{section 1} does not:
    image

Thanks for your help!

@pfoerster pfoerster added the bug Something isn't working label May 7, 2023
@pfoerster
Copy link
Member

@GTM52 Thanks for the very detailed report! 321fa26 should fix this issue.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 21, 2023
## [5.6.0] - 2023-05-20

### Added

- Add `texlab.cancelBuild` command to cancel the currently active build ([#887](latex-lsp/texlab#887))

### Fixed

- Fix resolving include commands from the `import` package ([#885](latex-lsp/texlab#885))
- Fix regression when tracking active cursor position ([#880](latex-lsp/texlab#880))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants