Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
780 stars 35 forks source link

Set Typst compiler path manually #612

Closed jake-is-ESD-protected closed 1 month ago

jake-is-ESD-protected commented 1 month ago

Motivation

Sometimes it is useful to test/use a feature that has very recently been pushed to the Typst repo such as this very important PR. In such a case, the newest version of the Typst compiler can be downloaded, but actually working without the Tinymist extension is quite cumbersome. Here it would be nice to be able to specify the version of the Typst compiler manually with a release number or URL for very new upstream features.

Description

Add a GUI and json entry which requires an absolute path to the desired Typst compiler executable, similar to how tinymist.serverpath can be set manually.

Examples/Questions

Possible name in settings.json (VSCode):

{
...
"tinymist.typstCompiler": "/home/me/.cargo/bin/typst",
}
Myriad-Dreamin commented 1 month ago

tinymist doesn't use typst-cli but uses typst as a library, because it needs some deep integration for code analysis. You might be seeking this feature, which is already launched today. The nightly tinymist works with the typst main branch:

image

jake-is-ESD-protected commented 1 month ago

Thanks for the info! Would it still make sense to be able to specify a local clone of the repo which Tinymist then uses? For forks and experimental branches? Just a thought.

Btw, I switched to the pre-release version (0.11.27) and reloaded my window, but the scope argument for a figure as mentioned in this for this specific case, is not recognized:

unexpected argument: scope
main.typ(33, 10): error occurred while importing this module
Myriad-Dreamin commented 1 month ago

Thanks for the info! Would it still make sense to be able to specify a local clone of the repo which Tinymist then uses? For forks and experimental branches? Just a thought.

If you starts from "Building Tinymist from Source", you could patch the Cargo.toml to specify a local clone. But it is more convenient to achieve this by forking Tinymist and build it by GitHub Action, if you just want to get a custom-built extension rather than develop it. For example, https://github.com/ParaN3xus/tinymist/actions/runs/11069399861 page contains the artifacts built by the GitHub Action.

Btw, I switched to the pre-release version (0.11.27) and reloaded my window, but the scope argument for a figure as mentioned in https://github.com/typst/typst/pull/5017 for this specific case, is not recognized:

Let's wait for next nightly release. See the following response just asked by some other people:

https://discord.com/channels/1054443721975922748/1088371919725793360/1290239499749560341: Oh, it is on typst#4909, but this feature seems to be typst#5017

Myriad-Dreamin commented 1 month ago

https://github.com/Myriad-Dreamin/tinymist/releases/tag/v0.11.29