Skip to content

Latest commit

 

History

History
69 lines (44 loc) · 2.09 KB

README.md

File metadata and controls

69 lines (44 loc) · 2.09 KB

Tinymist Helix Support for Typst

Run and configure tinymist in helix for Typst.

Features

See Tinymist Features for a list of features.

Finding Executable

To enable LSP, you must install tinymist. You can find tinymist on:

You can also compile and install latest tinymist by Cargo.

cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked

Setup Server

Update .config/helix/languages.toml to use tinymist.

[language-server.tinymist]
command = "tinymist"

[[language]]
name = "typst"
language-servers = ["tinymist"]

Tips

Working with Multiple-File Projects

There is a way in Neovim, but you cannot invoke related commands with arguments by :lsp-workspace-command in helix. As a candidate solution, assuming your having following directory layout:

├── .helix
│   └── languages.toml
└── main.typ

You could create .helix/languages.toml in the project folder with the following contents:

[language-server.tinymist.config]
typstExtraArgs = ["main.typ"]

Then all diagnostics and autocompletion will be computed according to the main.typ.

Note: With that configuration, if you're seeing a file that is not reachable by main.typ, you will not get diagnostics and autocompletion correctly in that file.

Extra Settings

To configure LSP server, you can edit the language-server.tinymist section. For example, if you want to export PDF on typing and output files in $root_dir/target directory:

[language-server.tinymist]
command = "tinymist"
config = { exportPdf = "onType", outputPath = "$root/target/$dir/$name" }

See Tinymist Server Configuration for references.