nvarner / typst-lsp

A brand-new language server for Typst, plus a VS Code extension
MIT License
1.19k stars 76 forks source link

PDF not exported when non-main source files are changed (onSave or onType) #70

Open xingjian-zhang opened 1 year ago

xingjian-zhang commented 1 year ago

Issue

Reproduce:

When other.typ is modified, the PDF will not be rendered automatically.

Alex-Muirhead commented 1 year ago

This behaviour is also present when using only the LSP component.

xingjian-zhang commented 1 year ago

This behaviour is also present when using only the LSP component.

Just also toggled the LSP checkbox.

beeb commented 1 year ago

Related https://github.com/nvarner/typst-lsp/issues/11

KronosTheLate commented 1 year ago

I was table to work around this by running typst watch main.typ and changing ctrl+s to File: Save all files. This leads to a smooth workflow with multiple files.

It should be possible to configure a langage-dependent binding of ctrl+s to save all files, and make a command that is Typst: watch X.typ, which when selected, opens a list of all typst files in current directory, and when the user presses enter on one of them, watches that file.

I am not sure how to incoperate a log upon errors with this approach, which is something that I miss. This is no problem with the manual approach of opening a terminal and running typst watch main.typ in the same group as the PDF, allowing easy swiching between terminal and PDF.