typst-lsp icon indicating copy to clipboard operation
typst-lsp copied to clipboard

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

Open xingjian-zhang opened this issue 2 years ago • 4 comments

  • Component:
    • [x] VSCode Extension
    • [ ] VSCodium Extension
    • [x] LSP (used with other editor)
  • Extension version: v0.3.1
  • LSP version:
  • OS version and name:
  • [x] I am on the latest stable version of the extension/LSP.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Reproduce:

  • [VSCode Extension setting] Export PDF: onSave and onType
  • Folder structure
.
├── other.typ
├── main.pdf
├── main.typ
└── template.typ
  • In main.typ:
#include "other.typ"

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

xingjian-zhang avatar Apr 04 '23 16:04 xingjian-zhang

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

Alex-Muirhead avatar Apr 10 '23 23:04 Alex-Muirhead

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

Just also toggled the LSP checkbox.

xingjian-zhang avatar Apr 11 '23 00:04 xingjian-zhang

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

beeb avatar Apr 15 '23 08:04 beeb

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.

KronosTheLate avatar May 02 '23 12:05 KronosTheLate