-
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
Simplify project resolution algorithm #839
Conversation
I tested this branch (0d85e20 to be exact) with the project structure described in #838. When using an explicit Log for 0d85e20 without any `texlabroot`[Note:] I removed the contents of
In neovim, TexLab is configured as follows: TexLab Configuration texlab = {
cmd = {"/home/leon/Projects/texlab/target/release/texlab", "-vvvv", "--log-file", "/tmp/texlab.log"},
settings = {
texlab = {
build = {
args = { "-lualatex", "-shell-escape", "-file-line-error", "-synctex=1", "-interaction=nonstopmode",
"%f" },
onSave = true,
},
chktex = { onOpenAndSave = true },
formatterLineLength = 100,
forwardSearch = { executable = 'zathura', args = { '--synctex-forward', '%l:1:%f', '%p' } },
},
},
commands = {
TexlabForwardSearch = {
function()
local pos = vim.api.nvim_win_get_cursor(0)
local params = {
textDocument = { uri = vim.uri_from_bufnr(0) },
position = { line = pos[1] - 1, character = pos[2] },
}
lsp.buf_request(0, 'textDocument/forwardSearch', params, function(err, _, _, _)
if err then
error(tostring(err))
end
end)
end,
description = 'Run synctex forward search',
},
},
}, |
One more thing: Shouldn't the project discovery behavior be documented somewhere? Or are you intentionally holding off on documenting behavior until it is considered robust enough to make it into a major release? |
c436a74
to
45703b4
Compare
Thanks for catching this one! Should be fixed now :)
Definitely! At the moment, most of the documentation is part of the Wiki and the project detection definitely deserves its own page now. I think that we should stick to this approach implemented with this PR because it is a lot easier for the user to reason about. I will write something up in the Wiki. EDIT: https://github.com/latex-lsp/texlab/wiki/Project-Detection-(v6.0.0-or-later) |
Just tested again with 45703b4 and can confirm it is fixed indeed 👍 |
The goal of this PR is to simplify the algorithm used to determine the project files and the dependency graph:
.texlabroot
/texlabroot
marker fileTectonic.toml
keeps overriding the root directory (if found).latexmkrc
and.chktexrc
files and the.git
directory are no longer used to determine the root directorytexlab.rootDirectory
in favor of thetexlabroot
marker fileFixes #826.