-
Notifications
You must be signed in to change notification settings - Fork 76
Labels not found in multidocument project #366
Comments
Nvm all errors are back once a file is edited. |
I'm experiencing this error too. I have a large document split in different files. Most of them have cites. These errors make even typst-lsp crash. |
Is this issue really closed? As far as I understand, #389 only proposed a workaround for editors which allow running custom LSP commands. This does not resolve the issue for me as I am using helix. So as far as I understand the PR diff, what's missing is to add the |
I don't think there are major blockers to do that, but it still needs to be done |
@lukasjuhrich Could you also check why we cannot invoke |
@Myriad-Dreamin I just found out that there is a general-purpose command picker ( Is this implicit signature knowledge of „the first argument should be a URI pointing to the desired MainFile“ hard-coded to the VSCode extension? Or are there parts of the LSP machinery that communicate this which I am unaware of? Edit: here is an excerpt of (truncated) helix logs to illustrate the execution via the command picker:
|
This is a key. You can execute The second step is to obtain a URL from wherever. In VSCode it is retrieved by getting an editor instance and then getting the current URL of that editor instance. Similarly, we might get a URL from helix. With above two steps we can customized a new command that executes the command and pins current opened file, which I think of a good supplementary of further automatic solutions.
|
Has anyone using NeoVim been able to solve this (and at the same time #402) using the doPinMain functionality? |
I have some code that (I think) sets it properly, but it doesn't fix the problem. The labels still aren't found and the language server still can't find the bibliography from my main file. vim.keymap.set("n", "<Leader>lp", function()
-- Pin `main.typ` as the main file if it exists
local main_file = vim.fs.find("main.typ", { path = vim.fn.getcwd(), type = "file" })[1]
if main_file ~= nil then
vim.lsp.buf.execute_command({
command = "typst-lsp.doPinMain",
arguments = { vim.uri_from_fname(main_file) }
})
print("Pinned to " .. vim.uri_from_fname(main_file))
end
end) |
Maybe you can try my version, lspconfig.typst_lsp.setup({
on_attach = function()
vim.lsp.buf_request_sync(0, "workspace/executeCommand", {
command = "typst-lsp.doPinMain",
arguments = { vim.uri_from_fname(vim.fn.getcwd() .. "/main.typ") },
}, 1000)
end,
}) Using |
Thanks @Cheng0Xin! |
I'm also having this problem with multi-file setups and it's kind of making the extension unusable for me at the moment. |
Is there a way to disable these specific label errors in the meantime? |
The Typst LSP for vscode is unable to handle refs in a multi-project-file, see nvarner/typst-lsp#366. We're ignoring this.
This sort of solves the issue on my end. The errors are showing. However, after opening a buffer to |
Component:
Extension version: ?
LSP version: Version: 0.11.0, commit cc7bad9 (Typst version 0.9.0)
OS version and name: MacOS 14.1.1
I am on the latest stable version of the extension/LSP.
I have searched the issues of this repo and believe that this is not a duplicate.
Issue
I have a multidocument project with the following structure:
With
thesis.typ
being:When opening e.g.
chapters/introduction.typ
, where references are cited (using@camelia2021
), I getlabel
does not exist in the document (typst)
. However, my workspace is set up correctly:The text was updated successfully, but these errors were encountered: