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

`typst-lsp` doesn't take environment variables from shell the editor was spawned in

Open MangoIV opened this issue 2 years ago • 2 comments

  • ~~VSCode Extension~~
  • [x] LSP (used with other editor)
  • extension version: HEAD
  • OS version and name:
 - system: `"x86_64-linux"`
 - host os: `Linux 6.4.7-zen1, NixOS, 23.11 (Tapir), 23.11.20230822.b85ed9d`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix Super) 2.18.0pre20230813_65e8aba`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
  • [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

Typst-lsp compiles without the font dir specified in ~TYPST_FONT_PATHS

Logs

n/a

MangoIV avatar Aug 26 '23 11:08 MangoIV

Any progress of this? I'm got same trouble with the vscode extension.

PhyX-Meow avatar Oct 27 '23 18:10 PhyX-Meow

In this case, the problem is that the LSP doesn't implement that feature. TYPST_FONT_PATHS and similar environment variables are implemented by the Typst CLI (a frontend for the Typst compiler), not by the Typst compiler itself, so other frontends for the compiler need to manually read those environment variables (if they're applicable).

As such, we'd need a PR to implement support for custom font paths in the LSP (which could optionally involve environment variables, but that's not strictly necessary in principle).

PgBiel avatar Nov 19 '23 00:11 PgBiel