From 8b36ec425498bf3e07afb7ae5d3b66680232d2ed Mon Sep 17 00:00:00 2001 From: Ilia Date: Sun, 18 Feb 2024 12:15:16 +0300 Subject: [PATCH] docs: add info about typst-lsp commands --- docs/src/language_servers.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/src/language_servers.md b/docs/src/language_servers.md index c24b1459b..f5cfbc212 100644 --- a/docs/src/language_servers.md +++ b/docs/src/language_servers.md @@ -738,6 +738,7 @@ See [Javascript/TypeScript](#javascripttypescript). } } ``` + 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 @@ -751,6 +752,33 @@ See [Javascript/TypeScript](#javascripttypescript). } ``` +5. Optional: to enable some useful commands provided by language server, add the following to the `*.sublime-commands`: + + + ```jsonc title="Packages/User/Default.sublime-commands" + [ + // ... + { + "caption": "typst-lsp - Pin the main file to the currently opened document", + "command": "lsp_execute", + "args": { + "session_name": "typst-lsp", + "command_name": "typst-lsp.doPinMain", + "command_args": ["${file_uri}"] + } + }, + { + "caption": "typst-lsp - Unpin the main file", + "command": "lsp_execute", + "args": { + "session_name": "typst-lsp", + "command_name": "typst-lsp.doPinMain", + "command_args": ["detached"] + } + }, + ] + ``` + ## Vue There are multiple options: