Tinymist Documentation

repository·main·Indexed 25 days ago

https://github.com/myriad-dreamin/tinymist

A comprehensive language service for Typst providing LSP features, a CLI, and editor integrations. Includes specialized tools such as the Tinymist GPU Viewer, Renderer Diff for visualizing rendering changes, and the crityp CLI for benchmarking Typst functions. Also provides support for embedded HTML/CSS in Typst documents via VS Code extensions and the cmark-writer library for rendering CommonMark and HTML from an AST.

Tokens
59.7K
Snippets
111
Records
461
Agent score
85%

What's inside Tinymist

  1. Overview of sync-ls

    main

    sync-ls is a synchronous LSP server implementation inspired by async-lsp. It is primarily used for tinymist.

    Key characteristics:

    • Supports both LSP and DAP with a common codebase.
    • Handlers can obtain a mutable reference to the state (unlike tower-lsp).
    • Designed for potentially better performance on stdio transport, especially on Windows.
    • Uses req_queue and transport extracted from the rust-analyzer project.

    Note: The author recommends using async-lsp whenever possible unless there is a specific reason to use sync-ls.

  2. Overview of Tinymist Renderer Diff

    main

    Tinymist Renderer Diff is a Vite/React-based viewer designed to inspect renderer comparison artifacts. It is used to visualize rendering changes produced by Tinymist renderer tests and CI processes.

    To use the viewer, you must provide a source containing a renderer-diff-manifest.json file and its associated image assets. The viewer supports:

    • Loading renderer-diff-* GitHub Actions artifacts.
    • Loading local ZIP files containing the manifest and images.
    • Displaying renderer groups, test cases, and status filters.
    • Side-by-side output for inspecting rendering differences in a browser.
  3. Overview of Tinymist IntelliJ Features

    main

    The Tinymist plugin provides comprehensive support for Typst documents within IntelliJ IDEA, including:

    Language Service (LSP) Features

    • Syntax & Semantic Highlighting: Full syntax highlighting and advanced semantic coloring.
    • Navigation: Go to Definition (Ctrl+Click), Find References, and Document Links.
    • Code Intelligence: Intelligent autocompletion, Hover Documentation, and Error Diagnostics.
    • Structure: Document Outline (headings/sections) and Folding Ranges.
    • Refactoring & Formatting: Rename Refactoring and automatic code formatting using typstfmt or typstyle.

    Advanced Features

    • Live Preview: Real-time rendering of Typst documents.
    • Exporting: Support for PDF, SVG, PNG, HTML, and more.
    • Visual Tools: Color Picker for color literals and Inlay Hints for parameter names/types.
    • Workspace Tools: Template Gallery, Code Lens, and Symbol Search.

    Productivity Features

    • Code Actions: Quick fixes and refactoring suggestions.
    • Linting: Comprehensive linting with customizable rules.
    • Status Bar: Displays compilation status and word count.
  4. Overview of the ty-wasm-bytecode-model capability

    main
    The ty-wasm-bytecode-model is an experimental capability that introduces a type bytecode model for expressions used in type deduction. It defines a semantic type value domain including meta variables, neutral residuals, closures, arguments, records, and quoted Ty output. This model is designed to allow type operations to be evaluated uniformly and eventually emitted as WebAssembly programs.
  5. Overview of Tinymist

    main

    Tinymist is an integrated language service for Typst. It provides a comprehensive development environment through several components:

    • Analyzing Library: tinymist-query for Typst analysis.
    • CLI: The tinymist command-line tool, which provides both a Language Server (LSP) and a preview server.
    • VSCode Extension: A dedicated extension for Typst development in Visual Studio Code.
  6. Overview of Tinymist Previewer Provider Fixture

    main

    The Tinymist Previewer Provider Fixture is a minimal VS Code extension designed specifically for Tinymist integration tests. It is not intended for end-users.

    Its primary functions are:

    • Exporting providePreviewer() to exercise the tinymist.previewer extension-provider contract.
    • Returning previewer/index.html as the preview HTML.
    • Reporting compatibility with the installed Tinymist extension version to verify provider resolution and preview HTML loading.