Skip to content

Commit

Permalink
add info about tinymist and show how to pass initialization options t…
Browse files Browse the repository at this point in the history
…o it
  • Loading branch information
istudyatuni committed May 7, 2024
1 parent 68c7031 commit cb16d7b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/src/language_servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -760,21 +760,35 @@ See [Javascript/TypeScript](#javascripttypescript).
## Typst

1. Install the [Typst](https://packagecontrol.io/packages/Typst) package from Package Control for syntax highlighting.
2. Download the [typst-lsp](https://github.com/nvarner/typst-lsp/releases) language server executable for your platform.
2. There are 2 available languages servers, and their configuration is mostly the same:
1. [tinymist](https://github.com/Myriad-Dreamin/tinymist) - has more features, like go to definition, rename, etc.
2. [typst-lsp](https://github.com/nvarner/typst-lsp/releases).
3. Open `Preferences > Package Settings > LSP > Settings` and add the `"typst-lsp"` client configuration to the `"clients"`:

```jsonc
{
"clients": {
"typst-lsp": {
"enabled": true,
"command": ["C:\\path\\to\\typst-lsp-win32-x64.exe"], // adjust this path according to your platform/setup
"command": ["path/to/typst-lsp"], // adjust this path according to your platform/setup
"selector": "text.typst"
}
}
}
```

If you want to provide some initialization options to tinymist, like exportPdf of typstExtraArgs, set it like

```jsonc
"tinymist": {
// ...
"initializationOptions": {
"exportPdf": "never",
"typstExtraArgs": [],
}
}
```

4. Optional: to enable auto-completions for the relevant situations in Typst files, adjust Sublime's `"auto_complete_selector"` and/or `"auto_complete_triggers"` setting (`Preferences > Settings`); for example
```jsonc
Expand All @@ -793,7 +807,7 @@ See [Javascript/TypeScript](#javascripttypescript).
<!-- how to call: see https://github.com/nvarner/typst-lsp/blob/master/editors/vscode/src/extension.ts -->
```jsonc title="Packages/User/Default.sublime-commands"
[
// ...
// typst-lsp:
{
"caption": "typst-lsp - Pin the main file to the currently opened document",
"command": "lsp_execute",
Expand Down

0 comments on commit cb16d7b

Please sign in to comment.