docs: introduce language features

This commit is contained in:
Myriad-Dreamin 2024-03-09 17:13:53 +08:00
parent 166909f0ca
commit da17f723a1
3 changed files with 37 additions and 4 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ node_modules/
/local/
/editors/vscode/out/
/editors/lapce/out/
/external/typst-preview

View file

@ -8,6 +8,40 @@ It contains:
- which provides a language server for Typst.
- a VSCode extension for Typst, see [Tinymist VSCode Extension](./editors/vscode/).
## Features
Language service (LSP) features:
- [Semantic highlighting](https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide)
- Also known as "syntax highlighting".
- [Diagnostics](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#provide-diagnostics)
- Also known as "error checking" or "error reporting".
- [Document symbols](https://code.visualstudio.com/docs/getstarted/userinterface#_outline-view)
- Also known as "document outline" or "table of contents" **in Typst**.
- [Folding ranges](https://burkeholland.gitbook.io/vs-code-can-do-that/exercise-3-navigation-and-refactoring/folding-sections)
- You can collapse code/content blocks and headings.
- [Goto definition](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-definitions-of-a-symbol)
- Right-click on a symbol and select "Go to Definition".
- Or ctrl+click on a symbol.
- [Goto declaration](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#find-all-references-to-a-symbol)
- Also known as "find all references".
- [Hover tips](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-hovers)
- Also known as "hovering tooltip".
- [Inlay hints](https://www.jetbrains.com/help/idea/inlay-hints.html)
- Inlay hints are special markers that appear in the editor and provide you with additional information about your code, like the names of the parameters that a called method expects.
- [Rename symbols](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#rename-symbols)
- [Help with function and method signatures](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#help-with-function-and-method-signatures)
- [Workspace Symbols](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-all-symbol-definitions-in-folder)
Extra features:
- Compiles to PDF on save (configurable to as-you-type, or can be disabled)
## Installation
Follow the instructions to enable tinymist in your favorite editor.
+ [VSCode](./editors/vscode/README.md)
## Acknowledgements
- It is developed based on [typst-lsp](https://github.com/nvarner/typst-lsp)

View file

@ -4,9 +4,7 @@ A VS Code extension for Typst.
## Features
- Syntax highlighting, error reporting, code completion, and function signature
help
- Compiles to PDF on save (configurable to as-you-type, or can be disabled)
See [Tinymist features](../../README.md#features) for a list of features.
## Usage Tips
@ -25,5 +23,5 @@ A VS Code extension for Typst.
## Technical
The extension uses [Typst LSP](https://github.com/Myriad-Dreamin/tinymist) on the
The extension uses [Tinymist](https://github.com/Myriad-Dreamin/tinymist) on the
backend.