This document gives an overview of tinymist service, which provides a single integrated language service for Typst. This document doesn't dive in details unless necessary.
Principles
Four principles are followed, as detailed in Principles.
- Multiple Actors
- Multi-level Analysis
- Optional Non-LSP Features
- Minimal Editor Frontends
Command System
The extra features are exposed via LSP's workspace/executeCommand
request, forming a command system. They are detailed in Command System.
Additional Concepts for Typst Language
AST Matchers
Many analyzers don't check AST node relationships directly. The AST matchers provide some indirect structure for analyzers.
- Most code checks the syntax object matched by
get_deref_target
orget_check_target
. - The folding range analyzer and def-use analyzer check the source file on the structure named lexical hierarchy.
- The type checker checks constraint collected by a trivial node-to-type converter.
Type System
Check Type System for more details.
Notes on Implementing Language Features
Five basic analysis like lexical hierarchy, def use info and type check info are implemented first. And all rest Language features are implemented based on basic analysis. Check Analyses for more details.