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

texlab root not being detected correctly #3262

Closed
a-torgovitsky opened this issue Aug 7, 2024 · 1 comment
Closed

texlab root not being detected correctly #3262

a-torgovitsky opened this issue Aug 7, 2024 · 1 comment
Labels
question Further information is requested

Comments

@a-torgovitsky
Copy link

Description

Directory structure is this:

tree ./texlab-root-mwe  -a --dirsfirst -L 2                                                        ─╯
./texlab-root-mwe
├── ch1
│   ├── ch1.aux
│   ├── ch1.fdb_latexmk
│   ├── ch1.fls
│   ├── ch1.log
│   ├── ch1.pdf
│   ├── ch1.synctex.gz
│   ├── ch1.tex
│   ├── .texlabroot
│   └── texlabroot
├── .git
│   ├── branches
│   ├── hooks
│   ├── info
│   ├── objects
│   ├── refs
│   ├── config
│   ├── description
│   └── HEAD
├── main.aux
├── main.fdb_latexmk
├── main.fls
├── main.log
├── main.pdf
├── main.synctex.gz
└── main.tex

7 directories, 19 files

If I open ch1.tex then :LspInfo shows that the root directory is the top level ./texlab-root-mwe. My understanding is that the presence of either .texlabroot or texlabroot (I have both) should force the root directory to be detected as ./texlab-root-mwe/ch1.
This issue was discussed in texlab, but the conclusion was that it was the domain of nvim-lspconfig.
#3005 seems aimed at addressing the same issue, but doesn't seem to have worked?

@a-torgovitsky a-torgovitsky added the bug Something isn't working label Aug 7, 2024
@DimitrisDimitropoulos
Copy link
Contributor

DimitrisDimitropoulos commented Aug 21, 2024

This is expected behavior util.root_pattern, gives priority to the first item on the list, see. If you want to change the default it is pretty easy to do on your own, for example something along the lines:

  require('lspconfig').texlab.setup {
    root_dir = util.root_pattern('.texlabroot', 'texlabroot', '.git', '.latexmkrc', 'Tectonic.toml'),
  }

I would suggest to experiment a little bit and see what order works for you

@justinmk justinmk added question Further information is requested and removed bug Something isn't working labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants