Compare commits

...

1597 commits
ng ... main

Author SHA1 Message Date
Myriad-Dreamin
0bfe655ada
build: bump world crates to v0.14.6-rc2 (#2312)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-12-16 11:37:50 +08:00
Myriad-Dreamin
506a97d495
fix: avoid duplicated @preview packages (#2313) 2025-12-16 08:11:10 +08:00
Hong Jiarong
0e334a2bfd
fix: change checkOnSave to check in .zed/settings.json (#2314)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
To resolve warning `invalid config value: /checkOnSave: invalid type:
map, expected a boolean;`. See rust-lang/rust-analyzer#13799.
2025-12-15 22:14:30 +08:00
Mikkelsej
ede7fcaed7
feat: add char count to vs code status bar (#2308)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
I have added character counter to the vscode status bar with

`const formatString = statusBarFormatString()
    .replace(/\{wordCount\}/g, `${words} ${plural("Word", words)}`)
    .replace(/\{charCount\}/g, `${chars} ${plural("Character", chars)}`)
    .replace(/\{pageCount\}/g, `${pages} ${plural("Page", pages)}`)
    .replace(/\{fileName\}/g, fileNameWithoutExt);
`
in editors/vscode/src/ui-extends.ts, and modified
`en = "Set format string of the server status. For example,
`{compileStatusIcon}{wordCount} [{fileName}]` will format the status as
`$(check) 123 words [main]`. Valid placeholders are:\n\n-
`{compileStatusIcon}`: Icon indicating the compile status\n-
`{wordCount}`: Number of words in the document\n`{charCount}`: Number of
characters in the document\n- `{fileName}`: Name of the file being
compiled\n\nNote: The status bar will be hidden if the format string is
empty."
`
in locales/tinymist-vscode.toml

This small change should make the option charCount possible for the
statusbar in vscode requested in
https://github.com/Myriad-Dreamin/tinymist/issues/2307 and a nice to
have feature.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-14 10:46:43 +08:00
Myriad-Dreamin
ea824b521f
revert: fix: remove Clone trait bounds from diagnostics iterators (#2136) (#2138)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-12-08 15:51:01 +08:00
Myriad-Dreamin
26f51f7a74
test: avoid test touching fs (#2298) 2025-12-08 14:15:37 +08:00
Myriad-Dreamin
0bc10c4152
feat: clear local package read cache (#2299) 2025-12-08 12:27:24 +08:00
Myriad-Dreamin
991add1a4a
feat: scan namespaces in package directories (#2297)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This enables package completions in other namespaces like `@npm` or
`@some-org`
2025-12-08 06:44:21 +08:00
QuadnucYard
626c51ce4c
feat: store full package information and cache local packages (#2291)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
from #2095

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-12-07 20:22:40 +08:00
QuadnucYard
c26dc8de85
feat: add new pdf opts and image page number template to exporter (#2281)
Enhanced the exporter tool:
- For PDF format, added `pdf.pdfVersion`, `pdf.pdfValidator` and
`pdf.pdfTags`. `pdf.pdfVersion`, and `pdf.pdfValidator` will be combined
into `pdfStandard`, and `pdf.pdfTags` will be inverted into `noPdfTags`.
- Use `datetime-local` input for `pdf.pdfCreationTimestamp`.
- For image formats, added `pageNumberTemplate` option, since we cannot
customize that with output path for now.

<img width="1028" height="391" alt="image"
src="https://github.com/user-attachments/assets/1c0c44c9-0ea3-4f7c-a316-5a2746cb8a96"
/>

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-12-07 20:00:26 +08:00
ParaN3xus
ff76fb17d6
build: bump version to 0.14.6-rc1 (#2293)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
+tag v0.14.6-rc1
2025-12-04 05:26:48 +08:00
Myriad-Dreamin
6528e36919
feat: only implement Ord for interned values (#2294)
Since we compare values by pointer (`ptr_cmp`), only interned instances
are comparable.
2025-12-04 05:26:12 +08:00
ParaN3xus
ba8f1deaaa
fix: bring back global function handleTypstLocation (#2287)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This PR fixes #2285
2025-12-02 10:36:41 +08:00
Myriad-Dreamin
a90cd25a87
fix: try impl Ord for typst values (#2279)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-11-27 01:43:17 +08:00
Myriad-Dreamin
8661aea1d0
build: bump version to 0.14.4 (#2282)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.14.4
2025-11-26 08:13:59 +08:00
Myriad-Dreamin
5954e76ae3
fix: inherit no-pdf-tags flag when running exportPdf command (#2277)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
close #2268
2025-11-25 07:12:37 +08:00
Myriad-Dreamin
5310b9dd98
build: bump version to 0.14.4-rc1 (#2276)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.14.4-rc1
2025-11-25 04:49:27 +08:00
Hong Jiarong
bc61e150ec
feat: add module item layout tracking to expression analysis (#2250)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This pr adds support for tracking the layout information of module
import items in the source code and refactors the expression analysis
pipeline to accommodate this feature, which introduces a new
`ModuleItemLayout` struct that records the parent module declaration,
the byte range of each import clause, and the bound identifier span.
Expression analysis (`expr_of` / `ExprWorker`) is updated to initialize,
collect, and store this layout data in a new `module_items` field within
`ExprInfoRepr`, which is now also included in its `Hash` implementation.
During import declaration handling, each import item—including renamed
items—is recorded through the new `record_module_item` method, ensuring
that all layout information is captured consistently as part of the
analysis workflow.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-24 02:29:14 +08:00
ParaN3xus
b2e286dfb5
fix: fix preview viewport & scrolling to use the preview container instead of window (#2269)
This is a follow-up to #2145 that fixes a series of resulting issues,
including #2267.
2025-11-23 21:02:30 +08:00
Myriad-Dreamin
3c5bba0ad4
build: bump version to 0.14.2 (#2263)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
+tag v0.14.2
2025-11-22 18:12:55 +08:00
Copilot
0714d19e29
feat: add c alias for compile command (#2261)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Adds `c` as an alias for the `compile` subcommand to match `typst-cli`
behavior where `c = compile`.

## Changes

- Added `#[clap(alias = "c")]` attribute to the `Compile` command
variant
- Added test coverage for `tinymist c --help` and actual compilation via
alias

## Usage

```bash
# Both commands now work identically
tinymist compile input.typ output.pdf
tinymist c input.typ output.pdf
```

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Support command alias `c` in tinymist-cli</issue_title>
> <issue_description>### Motivation
> 
> As `typst-cli` has a alias `c = compile`, `tinymist compile` receives
exactly same arguments as `typst compile`, it will be suprise if the
alias itself is not supported.
> 
> May not also applies to other subcommands.
> 
> If this is feasible, I'd be willing to write a PR. This should be
easy.
> 
> ### Description
> 
> _No response_
> 
> ### More Examples/Questions
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

- Fixes Myriad-Dreamin/tinymist#2259

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
2025-11-20 03:29:31 +08:00
Myriad-Dreamin
391d40ce42
build: bump version to 0.14.2-rc1 (#2253)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
+tag v0.14.2-rc1
2025-11-18 02:56:04 +08:00
Myriad-Dreamin
2a0a5ab3ae
feat: hot reload compiler respecting typst font, package and library options (#2252)
they were not adding to the `Config::primary_opts` which is used to
detect whther to restart (reconstruct) a compiler.
2025-11-18 01:40:22 +08:00
QuadnucYard
a42700c04b
feat: export tool with page/text preview features (#2182)
Added an editor tool to export and preview documents, with all
configurable options.

Not supported: output path customization (requires changes in server)

<img width="1381" height="1458" alt="image"
src="https://github.com/user-attachments/assets/d27e6e19-bcf4-4d1a-a20e-9bea0258be24"
/>
<img width="1392" height="877" alt="image"
src="https://github.com/user-attachments/assets/53d93601-3e05-4e36-b4fd-26384fda1347"
/>

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-11-17 21:59:12 +08:00
CGMossa
91d11177ba
fix: typo in helix docs (#2251) 2025-11-17 19:30:49 +08:00
Myriad-Dreamin
f3762eb40a
fix: change typo 'Code Compilation' to 'Cold Compilation' (#2249)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Updated resource usage terminology for clarity.
2025-11-16 09:35:03 +08:00
Myriad-Dreamin
f5db6e8d31
fix: update code and docs about syntax mode (#2248)
which was detected by gemini review.
2025-11-16 09:15:04 +08:00
Myriad-Dreamin
9d5beb196b
feat: minimal viable support for syntax-only mode (#2247)
Configure whether to enable syntax-only mode for the language server. In
syntax-only mode, the language server will only provide syntax checking
and basic code completion, but will not perform full document
compilation or code analysis. This can be useful for improving
performance on low-end devices, devices under power-saving mode, or when
working with large documents.

Default behavior: Always disable syntax-only mode. The strategy may be
changed in the future, for example, automatically enable syntax-only
mode when the system is in power-saving mode.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-16 08:30:20 +08:00
Hong Jiarong
575b0e301e
fix: destructuring pattern handling in ExprWorker (#2244)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR corrects destructuring handling in `ExprWorker` by switching
`DestructuringItem::Named` to use `named.pattern()` rather than
`named.expr()`. According to ast definition (see `Named::pattern` in
0da0165954/crates/typst-syntax/src/ast.rs (L1418-L1433)
, the rhs of a `Named` pair must be interpreted as a pattern when it
appears inside a destructuring context, not as an expression. This
change ensures nested destructuring patterns are analyzed correctly.
Also, spread items (`..rest`) are normalized into pattern form and
registered as proper declarations.

So that now complex patterns like `#let (x: (used_a, unused_x), y: (c1,
c2, c3)) = (...)` and array spreads like `#let (first, ..rest) = (1, 2,
3)` are allowed to resolve and lint as intended.
2025-11-15 23:41:04 +08:00
Myriad-Dreamin
15100abdde
docs: add editor notes (#2239) 2025-11-15 20:58:53 +08:00
Myriad-Dreamin
06c2240caa
feat: customize paste behaviors in vscode (#2238)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Close #1830 and close #2063 

The hook script feature is available since `tinymist` v0.14.2.

Hook Scripts allow you to hook and customize certain behaviors of tinymist by providing code snippets that will be executed at specific events.

The hook scripts are run as typst scripts with some predefined variables. Since typst is sandboxed, the hook scripts cannot access system directly. However, you can still bind lsp commands to perform complex operations.

See https://myriad-dreamin.github.io/tinymist/feature/script-hook.html.

- [x] run a demo
- [x] finish tests
- [x] add docs
2025-11-11 20:26:58 +08:00
Myriad-Dreamin
c206933bf5
feat: add PathAt code context query (#2232)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This is used for custom paste scripts

- by pattern: e.g. `$root`
- by code: e.g. `{ root }`
- on conflict callback: e.g. `{ (dir: root, on-conflict: root + "/" +
random() + ".png") }`
2025-11-11 02:43:02 +08:00
Myriad-Dreamin
c63162959d
feat: group compilation statistics (#2231)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-11-09 08:16:02 +08:00
Myriad-Dreamin
9f8501c42a
fix: specially identify text that is starts with @ (#2233)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Since typst v0.14, a single `@` are not longer parsed as reference
syntax, because empty reference are not allowed since typst v0.14.
However, the IDE should still handle case where user inputs a single
`@`.
2025-11-09 02:20:10 +08:00
Myriad-Dreamin
052149a509
build: update to macos-14 runner (#2234)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-11-06 19:46:42 +08:00
Myriad-Dreamin
1e761e8f00
feat: merge StatefulRequest and SemanticRequest (#2226)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This would help:
- compile compiled typst document on demand for analysis.
- remove the concept about `StatefulRequest`
- prepare for introducing stateful code context query (lsp command
`interactCodeContext`).
2025-11-04 22:29:39 +08:00
Myriad-Dreamin
a6adbaa926
feat: add no_pdf_tags, ppi, and more pdf_standard to extra args (#2220)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
- `--no-pdf-tags` to disable tagged PDF
- `--ppi` to specify the PPI (pixels per inch) for PNG export
- `--pdf-standard`: add all rest commonly used PDF standards, which was
introduced in `typst` v0.14.0
2025-11-04 18:23:07 +08:00
Myriad-Dreamin
7c00eba127
feat: introspect and show complation statistics happening in the language server (#1958)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Adds capability to introspect complations happening in the language
server, to help improve efficiency. I expect most compilations are
caused by tracing for analyzing dynamic expressions, but I haven't
really profiled a document. Then introspection will help confirm or
refute the expectation.
2025-11-03 19:28:42 +08:00
QuadnucYard
f13532964d
feat: update symbol list and preserve definition order (#2217)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
- Updated symbols to the latest. Simplified category map initialization.
- Preserve the definition order of symbols. This is more natural.

There are still issues with symbol rendering and clipping, but that will
not be covered here.

<img width="1255" height="583" alt="image"
src="https://github.com/user-attachments/assets/4bdfdcb6-25b4-4821-85fd-50e945871b32"
/>
<img width="1220" height="409" alt="image"
src="https://github.com/user-attachments/assets/22124806-db58-42d7-b834-96508199fcb5"
/>
2025-11-03 02:13:58 +08:00
odilf
bb5d3f476f
feat: scroll preview with hjkl (#2111)
Closes #2107 

Sorry for not getting confirmation on the issue first, but I had some
free time and thought it would be easy to implement and, indeed, it is
just a few lines of code. I'll attach a video of how it looks.


https://github.com/user-attachments/assets/60e6f7ef-cdff-4f85-a1e8-385058f87966

For the small nudges I think the instant jump is better, even though it
looks kind of janky. The problem with the smooth scroll is that you
can't press it repeatedly and I think that you use `jk` for small
adjustments where it's clear what is being scrolled. However, for the
big hl jumps I think the smooth scroll is better to not disorient you.

Happy to change anything, of course :)

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-11-02 21:31:35 +08:00
ParaN3xus
70d3443656
feat: replace window global with windowElem in preview web frontend (#2145)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
The preview feature heavily relies on the global `window` object. This
forces the preview to be used only as a standalone page.

In this PR, I replaced `window` with `windowElem` to make the preview
component modular and reusable.

TODO:
- [x] Fix `handleTypstLocation`
- [x] Fix zoon center
- [x] Fix drag
- [ ] Do a comprehensive test
  - [x] `handleTypstLocation` under both canvas mode and SVG mode
  - [ ] other stuff (idk what yet)
2025-11-02 17:34:20 +08:00
Myriad-Dreamin
358301cf6c
build: bump version to 0.14.0 (#2215)
+tag v0.14.0
2025-11-02 16:15:26 +08:00
Myriad-Dreamin
e23530b96e
build: bump version to 0.14.0-rc2 (#2213)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.14.0-rc2
2025-11-02 04:47:10 +08:00
Myriad-Dreamin
00e1c07782
fix: {table,grid}.cell are ignored during HTML export (#2209)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
in typst v0.14. Not sure whether there is some bug since typst v0.14

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-11-02 01:36:15 +08:00
Myriad-Dreamin
e1edf1e719
feat: clear global timing objects before and after user profiling (#2210) 2025-11-01 23:13:45 +08:00
Myriad-Dreamin
f2a10fec2f
build: bump version to 0.14.0-rc1 (#2189)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
+tag v0.14.0-rc1
2025-10-29 12:22:35 +08:00
Myriad-Dreamin
f6abe0c800
build: bump dependencies (#2206)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-10-29 04:30:38 +08:00
Myriad-Dreamin
6b6a1bdad2
feat: match pdf images for path completion (#2205) 2025-10-29 04:03:26 +08:00
Myriad-Dreamin
f011022097
feat: bump typst to v0.14.0 (#2201)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Co-authored-by: paran3xus <paran3xus007@gmail.com>
2025-10-28 23:27:31 +08:00
Myriad-Dreamin
a6c39d4306
build: bump version to 0.13.30 (#2198)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.30
2025-10-27 18:57:31 +08:00
Hong Jiarong
4bcb4dad40
build: update cmark-writer version to 0.9.0 (#2199)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-10-27 18:06:17 +08:00
Myriad-Dreamin
cba1d34064
build: bump version to 0.13.30-rc2 (#2195)
+tag v0.13.30-rc2
2025-10-27 13:54:11 +08:00
Myriad-Dreamin
8c07fbefe6
build: bump version to 0.13.30-rc1 (#2187)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
+tag v0.13.30-rc1
2025-10-21 22:07:04 +08:00
Myriad-Dreamin
d561ec5f14
build: upgrade apple runner to macos 14 (#2185)
macos-13 will be deprecated
2025-10-21 18:49:22 +08:00
Myriad-Dreamin
5feebb31d2
fix: local registry feature was not enabled (#2186)
There was a typo of the feature and it was never enabled. This was
introduced when compiling tinymist for wasm targets.
2025-10-21 18:35:04 +08:00
Joseph Wilson
850852fc3b
fix: don't ignore user inputs in typlite (#2164)
I noticed that existing inputs specified on the command line such as
`typlite --input key-value ..` are ignored.

Test this as follows:
```zsh
$ echo '#sys.inputs' > test.typ
$ typlite test.typ --input key=value
```
Before this PR:
```zsh
$ cat typ.md
`(x-target: "md")`
```
After this PRL
```zsh
$ cat typ.md
`(key: "value", x-target: "md")`
```

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-21 17:18:01 +08:00
Hong Jiarong
38f6b40ee7
refactor: typlite table parsing and diagnostic (#2181)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This PR depends on #2180 and should be merged after it.
2025-10-18 22:37:07 +08:00
Myriad-Dreamin
2c198a3d6a
fix: set position_encoding on handshake and fix to utf-16 (#2153)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Although we don't have enough tests about utf-8 position encoding, i.e.
it is not good to decide to use utf-8, it is completely wrong to not
passing a decided encoding back to client on initialization.

Edit: it doesn't work correctly under utf-8, so we currently always use
utf-16. We may fix it in v0.14
2025-10-17 11:39:20 +08:00
Hong Jiarong
cee5bfa4e6
feat: warning collector and logging for diagnostics in typlite (#2180)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR depends on #2173 and should be merged after it.
2025-10-16 18:18:57 +08:00
Myriad-Dreamin
29a10c144e
fix: import type inference result from other modules (#2168)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
fix #2131
2025-10-15 11:22:39 +08:00
Copilot
d80199d744
docs: improve code comments in expr.rs and RefExpr struct (#2169)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
## Overview

This PR enhances documentation in the expression analysis system to
clarify how goto_definition works and when the `RefExpr` fields are set
versus `None`. This addresses feedback from @BlueQuantumx and @jo3-l who
requested better documentation to understand the expression analysis
flow.

## Problem

The existing documentation was insufficient for developers trying to
understand:
1. How the goto_definition feature works through the expression analysis
system
2. When the `root`, `step`, and `term` fields in `RefExpr` are `Some`
versus `None`
3. The overall flow of expression analysis in `expr_of`

The brief one-line comments didn't provide enough context about the
resolution chain concept or concrete examples of when fields are
populated.

## Changes

### RefExpr Structure Documentation
(`crates/tinymist-analysis/src/syntax/def.rs`)

Added comprehensive documentation including:
- Explanation of the resolution chain concept: `root` -> `step` ->
`decl`
- Three concrete examples showing different use cases:
  - Simple identifier reference (`let y = x`)
  - Module field access (`mod.field`)
  - Import with rename (`import: old as new`)
- Detailed field documentation explaining when each is set:
- `step`: Set for imports, field access, chained references, renamed
imports
- `root`: Set for module imports, field selection, propagated in chains
- `term`: Set when type inference succeeds, `None` when type unknown or
deferred

### Expression Analysis Documentation
(`crates/tinymist-query/src/syntax/expr.rs`)

Enhanced `expr_of` function documentation to explain:
- Two-pass analysis architecture (init_stage for forward references,
then full resolution)
- How it builds the resolves map that powers goto_definition
- Caching strategy based on source content and import hashes

Added detailed documentation for helper functions:
- `resolve_ident_`: Resolution process and reference chain building
- `eval_ident`: Lexical scope lookup order and type availability
- `extract_ref`: Reference chain propagation mechanism

Added inline comments at all RefExpr creation sites explaining the
context and field values for:
- Module imports
- Import/include paths
- Named imports with rename
- Module field selection

## Example

**Before:** The RefExpr struct had minimal documentation
```rust
/// The intermediate step in resolution (if any).
pub step: Option<Expr>,
```

**After:** Clear explanation of when the field is set
```rust
/// The intermediate expression in the resolution chain.
///
/// Set in the following cases:
/// - **Import/include**: The module expression being imported
/// - **Field access**: The selected field's expression
/// - **Chained references**: When an identifier resolves to another reference
/// - **Renamed imports**: The original name before renaming
///
/// `None` when the identifier is a direct definition (not a reference).
pub step: Option<Expr>,
```

## Testing

-  All core tests pass (expr module, tinymist-analysis package)
-  Clippy passes with no warnings
-  Build succeeds
-  Code formatted with `yarn fmt`

Note: Package-related test failures (cetz, fletcher, tidy, touying,
import_package) are expected in environments without network access per
project guidelines.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `packages.typst.org`
> - Triggering command:
`/home/REDACTED/work/tinymist/tinymist/target/debug/deps/tinymist_query-1cacdd437723df09
--skip=e2e` (dns block)
> - Triggering command:
`/home/REDACTED/work/tinymist/tinymist/target/debug/deps/tinymist_query-1cacdd437723df09
goto_definition::tests::test --exact` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/Myriad-Dreamin/tinymist/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Improve code comments in expr.rs</issue_title>
> <issue_description>> I'd like to push this forward, but I need some
tips/docs about how the goto_definition works. I've walked through `fn
def_of_syntax_or_dyn`, `fn definition` ... and finally focused on
`crates/tinymist-query/src/syntax/expr.rs -> fn expr_of`. Maybe there
could have some concise code comments?
> 
> _Originally posted by @BlueQuantumx in
[#1960](https://github.com/Myriad-Dreamin/tinymist/issues/1960#issuecomment-3294723078)_
> 
> > I read those comments when I was originally writing the code, but
I'm mainly interested in when `type` and `root` are set (or, conversely,
when they are `None`.) The comments don't really go into that detail
AFAICS?
> 
> _Originally posted by @jo3-l in
https://github.com/Myriad-Dreamin/tinymist/pull/2065#discussion_r2315906981_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

Fixes Myriad-Dreamin/tinymist#2122

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-14 21:51:24 +08:00
Hong Jiarong
baca369c29
fix: fallback for tables with block-level cells (#2173)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
fix https://github.com/Myriad-Dreamin/tinymist/issues/1845

Fallback for tables with block-level cells now converts the Typst
`HtmlElement` tree into a `cmark_writer::ast::Node::HtmlElement` and
lets `HtmlWriter` render it.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-14 12:00:43 +08:00
QuadnucYard
bcd6af975e
feat: multi-page export and no-write support (#2098)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
## Features

- Support multi-page export in the server export command. Added an extra
arg to decide whether to write to the file or only return data for
client use (page preview in exporter). VSCode users can use this feature
via the quick-export command or code lens.
- (refactor) Move most export logic from tinymist to tinymist-task,
excluding typlite-related, which already depends on tinymist-task.
- Added relevant export tests. The export e2e test now includes hash
checking for all targets.

## Not done

- Support new args in `TypstExtraArgs` for CLI compilation.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-13 23:02:44 +08:00
Hong Jiarong
1ca1d82901
fix: render figure images during docx export (#2175)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
fix https://github.com/Myriad-Dreamin/tinymist/issues/2104
2025-10-13 02:56:17 +08:00
Hong Jiarong
80ae0e5277
fix: update VerbatimNode to use trusted HTML writing method (#2178)
So that
515747c0b7
pass the test.
2025-10-13 01:18:55 +08:00
Hong Jiarong
515747c0b7
fix: enable HTML rendering for VerbatimNode and add regression test (#2172)
fix https://github.com/Myriad-Dreamin/tinymist/issues/1844
2025-10-12 22:55:01 +08:00
Hong Jiarong
8a28ff4afc
chore: switch cmark-writer dependency to local path (#2171)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Further fix and refactor may base on this pr.

also refactor: centralize CommonMark spacing and fix inline custom node
handling

- add `FormatPolicy` to manage trailing newline / blank-line rules and
expose prepare_block_sequence
- route document, blockquote, and list content through the policy so
nested blocks get consistent spacing
- adjust `Node::is_block` / `is_inline` to respect
`CustomNode::is_block`, preventing inline custom nodes from forcing HTML
fallbacks
- ensure table rendering stays in Markdown by recognizing inline custom
cells correctly

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-10-12 15:50:19 +08:00
Luyan Zhou
6876a38c99
fix: re-correct order of scope merging & make test stronger (#2166)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Sadly the #2154 is still false. This PR fixed it and made test stronger.
2025-10-11 02:58:29 +08:00
Myriad-Dreamin
42e3a3eb73
fix: bad refactor in "fix: invalidate cached snapshot after compile" (#2165)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
fix #2163, partially reverts Myriad-Dreamin/tinymist#2057 @jo3-l

---------

Co-authored-by: Joseph Liu <jo3.l.dev@outlook.com>
2025-10-11 02:19:39 +08:00
Luyan Zhou
9961cc9b69
dev: update build scripts to use correct cargo dev profile (#2157)
The `debug` profile is deprecated and reserved. We should use `dev`
profile instead.
2025-10-11 01:34:53 +08:00
Myriad-Dreamin
9ab2ecdc4d
fix: ignore non-typst files to focus implicitly (#2152)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
When a file, for example a rust source file, is sent to the language
server by `didOpen`, it is implicitly focused and starts a typst
compilation with the file. However, this is not expected. The error is
rarely triggered because vscode extension also explicitly send focus
events which prevents the implicit focus happens. So in conclusion this
bug was triggered stably by following steps:
- activate tinymist for some reason, and no typst source file is opened.
- open a rust source file and tinymist reports typst syntax error in the
file.
2025-10-10 12:04:19 +08:00
Luyan Zhou
a03d715fa7
fix: correct scope merging order (#2154)
fixed #1960 and added test case.
2025-10-10 10:18:25 +08:00
Luyan Zhou
8ce498751b
fix: update tinymist-project features to include 'system' (#2156)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
The missing feature causes build failure with test profile. Since we
currently only conduct tests locally(without web), this change should
not be bad.
2025-10-10 08:28:12 +08:00
ParaN3xus
b239224a63
feat: add js package registry support for tinymist-wasm (#2102)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-10-01 16:40:21 +08:00
Myriad-Dreamin
c8e723fac7
feat: test and lower glibc version requirement (#2143)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Lock Linux to minimum supported version (Ubuntu 18.04 / RHEL 8, glibc
2.28).
2025-09-30 16:48:41 +08:00
Myriad-Dreamin
d617b145e2
feat: support offline definition queries (LSIF) (#2032)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
The purpose of the [Language Server Index Format (LSIF)][LSIF] is to
define a standard format for language servers or other programming tools
to dump their knowledge about a workspace.

Use cases:
- providing stable json format of package docs:
  - The unstable export was supported in #1809
- cache analyze results in such format.
- if we export typst docs to LSIF, some tools can help read typst code,
such as [lsif-node](https://github.com/Microsoft/lsif-node)
- if we have a typst package helping render typst docs according to
LSIF, it can also be used to render docs for other programming
languages, for example [OCaml](https://github.com/rvantonder/lsif-ocaml)
and [TypeScript](https://github.com/sourcegraph/lsif-node)

LSIF is not the only index format, so we may reconsider to use other one
in future, such as [SCIP](https://sourcegraph.com/blog/announcing-scip)


[LSIF]:
https://microsoft.github.io/language-server-protocol/specifications/lsif/0.6.0/specification/
2025-09-29 23:19:49 +08:00
Myriad-Dreamin
a4d256d75b
build: bump version to 0.13.28 (#2140)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.28
2025-09-29 01:32:00 +08:00
Myriad-Dreamin
326c54ec75
build: bump version to 0.13.28-rc2 (#2139)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.28-rc2
2025-09-27 20:23:51 +08:00
Myriad-Dreamin
53488dad22
fix: remove Clone trait bounds from diagnostics iterators (#2136)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This requires new release of world crates, while we didn't plan it.
2025-09-27 17:02:06 +08:00
Myriad-Dreamin
d2a747372f
feat: add install vscode command (#2135)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-09-27 11:46:20 +08:00
Myriad-Dreamin
34bc516466
build: bump version to 0.13.28-rc1 (#2134)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.28-rc1
2025-09-26 15:58:50 +08:00
Joseph Liu
6b52aa70ba
feat: new lint warning for unknown math vars (#2065)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Add a lint warning for unknown math variables[^1], powered by Tinymist's
existing reference analysis. This allows users to see all such undefined
variables at once if they have the linter enabled, instead of just the
first error from the compiler. The autofix from #2062 is also applicable
to these warnings.

Example:
![example of new warning in VS
Code](https://github.com/user-attachments/assets/42672d50-e637-49b2-907b-aa413431e55e)
(The first error is pre-existing and emitted by the Typst compiler; the
second warning is new from this PR and emitted by us.)

Implementation notes:
- The generated diagnostic tries to closely match the corresponding
Typst compiler error, with one deliberate change: to differentiate the
Tinymist warning and the compiler error, we use the message `potentially
unknown variable: ...` instead of `unknown variable: ...`. I am not the
biggest fan of this choice, but I think it is very important that users
don't blame the Typst compiler for warnings that we generate; changing
the message so that it isn't an exact clone is the best way I thought of
for now.
- We avoid duplicating a warning if the compiler has already generated
an error for a given identifier by computing a set of `KnownLintIssues`
from the compiler diagnostics and threading this information through the
lint routines.

[^1]: If users like this warning, we can extend it later to apply to
undefined variables outside of math as well.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-09-24 01:09:10 +08:00
ParaN3xus
3b6de80a2f
fix: correct parent_last_loc for heading children in folding ranges (#2123)
This PR fixes #1796 by correcting the parent_last_loc parameter passed
to child elements when processing heading folding ranges.

This is because heading's `lsp_range` only covers the line it is on, but
it has children. This causes the `parent_last_loc` passed when
recursively calling the `calc_folding_range` function to be incorrect:
it is expected to be the end of the line before the next sibling
heading, but actually it is the end of the current heading's line. This
further prevents the correction of the heading's `folding_range` from
working properly, ultimately causing the returned `folding_range` to
retain the original `lsp_range`, which is just the heading line itself.

The fix uses the already-calculated `folding_range.end_line` for
headings when determining the `parent_last_loc` for child elements,
ensuring consistency between the parent's actual folding boundary and
the boundary passed to its children.
2025-09-24 00:24:31 +08:00
ParaN3xus
5ac358ef6a
ci: update toml-edit-js (#2125)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
New version of `toml-edit-js` fixes
https://github.com/rainbowatcher/toml-edit-js/issues/8, which will keep
comments in our `Cargo.toml`.
2025-09-22 01:52:14 +08:00
Luyan Zhou
51f9cdec81
refactor: refine get_ident method by unwrapping unnecessary Option (#2117)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-09-14 18:28:33 +08:00
Luyan Zhou
45100d6d16
fix: correct the lexical hierarchy of comment group (#2116)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Hierarchy of comment group is always wrong previously, causing #2021.

This PR fixed it and added a test case.

BTW, the changes in the lexical hierarchy module influenced a folding
range test case, but it's just changed the order of items, which doesn't
affect the correctness (the order is even more correct).
2025-09-14 09:49:13 +08:00
Allan Chain
22089e5e27
fix: extend origin check for vscode servers (#2106)
Previously, Tinymist preview does not work on VS Code web (code-server)
because it tries to connect to the `localhost`, which is impossible
since we are doing remote development.

Even if we fix this error, the HTTP origin check will also fail because
the domain of our VS Code web is not trusted by Tinymist. One possible
fix is to grab the `VSCODE_PROXY_URI` environment variable and check if
the incoming request matches the URI. This will fix the issue for most
standard code-server installations.

However, GitHub Codespace is an exception. I did some logging, and found
that GitHub Codespace used different origins:
- `<random>.assets.github.dev`
- `https://localhost:<port>` (note HTTP**S**)
- `None`

This is very weird and difficult to debug. Moreover, the ports forwarded
by GitHub Codespaces require authentication before visiting, which the
VS Code webview does not support. One have to open the URL in another
browser tab to authenticate. This is frustrating and is difficult to
workaround. Therefore, currently, GitHub Codespaces are not supported.

(I asked LLM to generate some of the Rust code. It works, but may need
improvements.)

Fixes #625
2025-09-14 08:08:30 +08:00
Myriad-Dreamin
3bc77f06bf
build: bump version to 0.13.26 (#2119)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.26
2025-09-13 10:52:34 +08:00
Myriad-Dreamin
8be6a12256
dev: remove useless glibc version overrides (#2118)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
#2115
2025-09-13 02:57:51 +08:00
Myriad-Dreamin
ab20cfc988
feat: update global runner configuration to ubuntu 22.04 (#2115)
min-glibc-version is only used for detecting in the installer script,
i.e. not useful to limit a minimal glibc version. A global runner is
needed to be specified for running with older glibc.
2025-09-13 00:32:09 +08:00
Myriad-Dreamin
916a5cea7d
build: update readme docs (#2114)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-09-12 00:50:56 +08:00
Myriad-Dreamin
3324b12620
fix: update CI badge link in documentation (#2113)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-09-11 07:47:39 +08:00
Myriad-Dreamin
f74c104b9c
docs: add badgers (#2112) 2025-09-11 07:33:37 +08:00
QuadnucYard
4c8d34cdb2
feat: generate resource symbol svg in server and improve viewBox (#2109)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
- feat: move symbol svg generation logic from client to client, and
directly display svg elements instead of mask-image. This significantly
boosts loading speed.
- fix: use font ascender and descender to bound view box, avoid
clipping.
2025-09-10 19:17:06 +08:00
Myriad-Dreamin
6799951ee3
build: bump version to 0.13.26-rc1 (#2108)
+tag v0.13.26-rc1
2025-09-10 18:06:22 +08:00
QuadnucYard
4ebdd906c2
feat: revamp symbol view and add optional details (#2101)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
- Restructured files.
- Render non-printable symbols, following typst documentation's
convention.
- Add a toggle to show details: symbol name and unicode, both of which
can be copied to clipboard on click.
- Make detypify import async, so that it will not block symbol
rendering.
- Show detypify canvas only when available.

<img width="1289" height="421" alt="image"
src="https://github.com/user-attachments/assets/ed6469c4-57a0-4d17-a4be-206875a03e43"
/>

<img width="1238" height="632" alt="image"
src="https://github.com/user-attachments/assets/e6bba758-7836-4230-9ab9-f9550454b4de"
/>

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-09-10 11:27:44 +08:00
Copilot
a1be6a6824
feat: add missing server info (#2093)
- [x] Explore repository structure and understand current LSP
initialization
- [x] Locate server info collection logic in ServerState
- [x] Understand the InitializeResult structure and identify server_info
field
- [x] Add server_info field to InitializeResult with name and version
- [x] Extract version information from Cargo.toml
- [x] Update e2e test redaction logic to handle server_info fields
- [x] Test the implementation with LSP clients

Fixes #2092.

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-09-10 11:09:54 +08:00
Myriad-Dreamin
ef08eaa93b
feat: enhance CLI and argument documentation (#2072)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This PR improves the help message of the CLL. Also, we change the verbs
in the help message from plural (e.g. `compiles`) to singular (e.g.
`compile`). This matches the style of `clap-rs`.

Added tests about critical help messages.
2025-09-03 17:02:42 +08:00
hyrious
c7b10d1b6c
feat: preview page remove extra space and do not invert background (#2094)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
| Before | After |
| ------ | ----- |
| <img width="300" height="246" alt="image"
src="https://github.com/user-attachments/assets/3f1e9d69-390c-46ce-8469-52d90c052fed"
/> | <img width="303" height="243" alt="image"
src="https://github.com/user-attachments/assets/4b70a9d2-07c6-496e-82df-d0ad27bd582e"
/> |

1. The `svg` element by default has `display: inline`, which adds extra
space at bottom (line height), change that to `block` can remove the
space.
2. The `svg` element and its outer `div` both set background color,
which will be inverted to another color that are not equal to the whole
page's background (I was setting `--main-margin` to see the outside).
This PR prevents the background from getting inverted.

There's another tiny thing: `#typst-container.mode-doc` has `margin-top:
-1px` which shifts the whole Typst doc 1px up. That will cause the page
always has 1px margin at bottom because the SVG element has the full
height. One possible fix is to always `- 1px` on the SVG `height`
attribute but I'm not sure if this affects some calculation. So I'm not
adding this trivial change.
2025-09-02 12:55:12 +08:00
Myriad-Dreamin
6e386e2838
feat: use card/button styles from vscode themes (#2100) 2025-09-02 11:10:43 +08:00
QuadnucYard
8d4052e612
feat: revamp font view with more features and better styles (#2060)
## Features

- Added font filters.
- Greatly improved styles. Now it follows the VSCode theme.
- Added tailwindcss-like utility classes.

<img width="713" height="941" alt="3H L7HDJOZ`X(UJU)L2PEYS"
src="https://github.com/user-attachments/assets/2a239bde-e01e-497c-803e-3d1c958319b6"
/>
2025-09-02 10:02:32 +08:00
Myriad-Dreamin
985c0c16b8
fix: build script for editor tools (#2099) 2025-09-02 09:14:50 +08:00
QuadnucYard
ce447185d1
dev: drop if_chain and collapse if statements (#2097)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-09-01 16:46:54 +08:00
Myriad-Dreamin
1c9db1ce69
build: make use of async io of js to speed up vscode builds (#2069)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-31 18:34:20 +08:00
Joseph Liu
731cd23ec8
dev: fix lint warnings introduced by #2062 (#2096)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
> Hm. Sorry about the lint failures here, they slipped my attention
locally since they show up as warnings, not errors, in my editor. I'm
happy to put a PR fixing them later unless you get to it first.
>
> Not too sure how to deal with the unused DiagWorker::check method,
since it is used, just in a test-only module. We can certainly mark it
as #[cfg(test)] but that feels a little nasty.


https://github.com/Myriad-Dreamin/tinymist/pull/2062#issuecomment-3237812684

I ended up inlining the logic of `DiagWorker::check` into the test.
2025-08-30 10:50:23 +08:00
Joseph Liu
4324f8fd70
feat: offer quickfix to add spaces separating letters in unknown math var (#2062)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Examples:

| Input | Suggested fix |
| -- | -- |
| `$xyz$` | `$x y z$` |
| `$a_ij$` | `$a_(i j)$` |
| `$a_(ij)$` | `$a_(i j)$` |
| `$xy/z$` | `$(x y)/z$` |

If the unknown identifier appears as a subscript or as the
numerator/denominator of a fraction, we parenthesize the suggested fix.
For example, `a_ij` turns into `a_(i j)`, not `a_i j`, because the
latter is unlikely to be what the user intended.
2025-08-30 01:47:51 +08:00
Myriad-Dreamin
25d5bfa222
feat: add release script for automated release PR creation (#2089) 2025-08-30 01:44:24 +08:00
QuadnucYard
955af95c20
refactor: restructure server-side editor tools (#2088)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
This PR splits `editors/vscode/src/features/tool.ts` into a few modules
to make it extensible and more maintainable:
- For tools, I put each one in a separate file.
- For messages, I grouped them into an object for dispatching.
- The disposal is better managed.
2025-08-28 15:26:07 +08:00
Myriad-Dreamin
b938914ecf
feat: execute cpu tasks in place in wasm (#2086)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-28 00:30:58 +08:00
Joseph Liu
66351570a6
fix(tinymist-project): invalidate cached snapshot after compile (#2057)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR fixes a latent cache invalidation issue with project snapshots.
I recommend reviewing commit-by-commit, even though this is a small
change. Only the last commit changes behavior; the rest are cleaning up
code to make it easier to see what is happening.

---

Here's what I think is the problem.

Project instance states (`ProjectInsState`) provide access to a snapshot
of the latest compilation result. This snapshot is cached for
performance:
```rust
match self.snapshot.as_ref() {
    Some(snap) if snap.world().revision() == self.verse.revision => snap.clone(),
    // otherwise recompute
}
```
Unfortunately, it turns out that the cached snapshot may be outdated
even if the revision matches. (In practice, it will usually just lag one
compilation behind, and I think this is why it hasn't caused any
observable issues--one compilation behind is not that much, especially
if the user is continuously typing.)

To see the issue, consider the following sequence of steps. Assume
initially all revisions are `0`.
1. User triggers a recompilation, say by typing into the file.
     - This triggers an `Interrupt::Memory` or similar.
2. The changes are applied to the vfs and recompilation begins.
     - `verse.revision` is incremented to `verse.revision = 1`.
3. Before compilation finishes, a project snapshot is requested.
- The project compiler checks the cached snapshot first, which still has
`snap.world().revision() == 0`.
- Since `verse.revision = 1` was already incremented before the
compilation finished, a new snapshot is created and cached--even though
nothing has actually been recompiled yet.
    - The cached snapshot now has `snap.world().revision() == 1`.
4. Compilation finishes, and some data from the resulting compilation
artifact is recorded.
5. Another project snapshot is requested.
- Since the snapshot was recomputed already in (3), the revisions appear
to match and the outdated, cached snapshot is returned.

The fix here is to just clear the cached snapshot in (4) after
recompilation finishes.

---

I would add a regression test, but it didn't seem easy to write an
automated test that can differentiate the change here. I tested this
locally by adding some logging around when the cached snapshot is used
and when it is recomputed.

As mentioned on Discord, I noticed this problem when adding some more
data to project snapshots on a local fork of Tinymist, which caused the
slightly outdated state to become a little more obvious.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-27 00:45:38 +08:00
Myriad-Dreamin
6573ed917b
feat: make watch access model (#2067)
<img width="2087" height="1144" alt="0c29317922c3c829deb7f364b22ccaee"
src="https://github.com/user-attachments/assets/cfb8143e-21c6-45c8-9492-a4237473c0f0"
/>
2025-08-26 23:54:41 +08:00
Myriad-Dreamin
2fc5d919e9
build: bump version to 0.13.24 (#2085)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.24
2025-08-26 16:15:03 +08:00
Myriad-Dreamin
856a1e4485
revert: "feat: rename labels (#1858)" (#2084)
This reverts commit 14c7a92944. Didn't
pass the test `label_indir.typ.snap`.
2025-08-26 14:07:42 +08:00
Myriad-Dreamin
2cbf081408
fix: handle list should be camelCase (#2083)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-26 10:37:19 +08:00
Copilot
fee9b27e00
docs: add Neovim specification and canonical implementation documentation (#2082)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR adds comprehensive documentation for the Neovim Tinymist plugin,
establishing it as the canonical implementation of a Tinymist editor
language client.

## Changes Made

### Added `editors/neovim/Specification.md`
The specification was a mess, so I the reviewer deleted it.

### Enhanced `editors/neovim/CONTRIBUTING.md`
Expanded the contributing guide to document:
- **Canonical Implementation Status**: Establishes this as the
heavily-documented reference implementation for other editors
- **Bootstrap Script Commands**: 
  - `./bootstrap.sh editor` - Interactive editing experience in Docker
  - `./bootstrap.sh test` - Headless test execution
  - `./bootstrap.sh bash` - Development shell access
- **Test Suite Structure**: Overview of all spec files and their testing
purposes
- **Contribution Patterns**: Guidelines for maintaining the reference
implementation

### Updated `.github/copilot-instructions.md`
Added guidance for working with editor integrations:
- **Repository Structure**: Notes the Neovim plugin as canonical
implementation with documentation links
- **Editor Integration Guidelines**: New section specifically for
referencing Neovim patterns
- **Development Workflow**: References to bootstrap commands and
documentation

## Why This Matters

The Neovim plugin now serves as the **canonical implementation** that
other editor integrations can reference for:
- LSP client setup patterns and configuration handling
- Event subscription mechanisms for development events
- Project resolution modes (singleFile vs lockDatabase)
- Export functionality patterns (onSave, onType, never)
- Comprehensive test coverage examples

This documentation enables maintainers and contributors to understand
the complete scope of the Neovim integration and provides a reference
for implementing similar functionality in other editors.

Fixes #2081.

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-25 11:48:23 +08:00
Myriad-Dreamin
468e993649
build: bump version to 0.13.24-rc3 (#2080)
+tag v0.13.24-rc3
2025-08-25 10:44:49 +08:00
Myriad-Dreamin
6f4b5f773d
fix: bad cargo build command (#2079) 2025-08-25 09:46:21 +08:00
Copilot
3699450369
feat: Add comprehensive Claude/Copilot localization instructions (#2076)
Adds comprehensive instructions for AI assistants (Claude/Copilot) to
work with the tinymist localization (l10n) system. The new
`.github/copilot-instructions-l10n.md` file provides detailed guidance
on both phases of the localization process:

## Marking and Extracting Messages

**Rust Backend (`crates/`):**
```rust
// Simple localized message
let message = tinymist_l10n::t!("error.file-not-found", "File not found");

// With parameters
let message = tinymist_l10n::t!(
    "error.invalid-config", 
    "Invalid configuration: {key}", 
    key = config_key
);
```

**TypeScript VSCode Extension (`editors/vscode/`):**
```typescript
import { l10nMsg } from "../l10n";

// Simple message
const message = l10nMsg("Export as PDF");

// With parameters  
const message = l10nMsg("Processing {count} files", { count: fileCount });
```

After adding localized messages, run `yarn build:l10n` to extract them
to TOML files.

## Translating Messages

The system uses TOML format designed for easy LLM modification:

```toml
[export.pdf.success]
en = "PDF exported successfully"
zh = "PDF 导出成功"
fr = "PDF exporté avec succès"
```

## Key Features

- **Complete workflow examples** for both Rust and TypeScript
- **Hierarchical key naming conventions** (e.g.,
`component.category.action`)
- **Translation guidelines** with parameter preservation
- **Best practices** for when to localize vs. when not to
- **Troubleshooting section** for common issues
- **File structure reference** showing the relationship between source
files and locale files

The instructions enable AI assistants to properly add new localizable
strings, update existing translations, and maintain the multilingual
support across the entire tinymist ecosystem.

Fixes #2075.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
2025-08-25 06:36:54 +08:00
Myriad-Dreamin
9a8476ecfb
build: bump version to 0.13.24-rc2 (#2077)
+tag v0.13.24-rc2
2025-08-25 06:16:18 +08:00
Myriad-Dreamin
40cbe07ea5
build: bump reflexo to 0.6.1-rc3 (#2074) 2025-08-25 05:22:30 +08:00
Myriad-Dreamin
e584beb926
fix: update cargo metadata and crate release script (#2073)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR fixes the release script to remove the `tinymist-analysis` crate
from the release process.

This PR also fixes the `crityp` crate to include the `system` feature in
the `cli` feature.
2025-08-25 03:03:55 +08:00
Myriad-Dreamin
b7845cb785
build: bump world crates to 0.13.24-rc1 (#2047) 2025-08-24 23:22:06 +08:00
Myriad-Dreamin
cfe6d95261
test: add probe command test for CLI (#2071)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-24 08:57:58 +08:00
Myriad-Dreamin
d85717f81e
feat: init log in web (#2068) 2025-08-24 08:45:51 +08:00
Myriad-Dreamin
5ee01b59a9
refactor: create main files (#2054) 2025-08-24 06:12:11 +08:00
Myriad-Dreamin
846e6ffbbf
fix(ci): build tinymist.wasm before building tinymist-web.vsix (#2066)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-23 12:22:50 +08:00
Myriad-Dreamin
532f25abe9
docs: document all public items in rust codebase (#2058)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
2025-08-21 12:50:03 +08:00
Copilot
4ce0a59862
docs: Add documentation for pub items in expr.rs (#2051)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This PR adds comprehensive documentation for all public items in
`crates/tinymist-query/src/syntax/expr.rs` following Rust documentation
conventions.

## Changes Made

The following public items now have proper documentation comments:

- **`ExprRoute`** type alias - Documents its purpose as a mapping
structure for file identifiers to lexical scopes during expression
analysis routing
- **`expr_of`** function - Describes its role in analyzing expressions
within source files and producing expression information including
resolves, imports, docstrings, and lexical scoping data
- **`ExprWorker`** struct - Explains its functionality as a worker for
processing expressions during source file analysis, handling expression
checking, scope management, symbol resolution, and docstring collection

## Documentation Style

All documentation follows Rust conventions by:
- Using third person singular verbs
- Focusing on the purpose and functionality rather than implementation
details
- Providing clear, concise descriptions of what each item does

The code has been formatted with `cargo fmt` and compiles successfully
after the changes.

Fixes #2048.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-20 12:27:43 +08:00
Myriad-Dreamin
b78b5fa48c
docs: add guide to develop editor tools (#2050) 2025-08-20 11:53:38 +08:00
Copilot
dc233fe436
docs: add comprehensive documentation to all public items in syntax/def.rs (#2024)
This PR adds comprehensive documentation comments to all public items in
`crates/tinymist-analysis/src/syntax/def.rs`. The file contained
numerous public structs, enums, functions, and fields that lacked
documentation, making it difficult for contributors to understand the
purpose and usage of these types in the syntax analysis system.

## Changes Made

- **Public Types**: Added documentation to 40+ public types including
core expression types (`ExprInfo`, `ExprInfoRepr`, `Expr`), declaration
types (`Decl`, `DefKind`), and expression-specific structs
- **Public Functions**: Added documentation to 60+ public functions
including:
- Constructor methods for all declaration types (`Decl::func`,
`Decl::var`, etc.)
- Utility methods across all major types (`get_def`, `is_exported`,
`span`, etc.)
- Expression and operation constructors (`SelectExpr::new`,
`UnInst::new`, etc.)
- **Public Fields**: Added documentation to all public fields in 35+
structs, explaining their purpose and usage context
- **Type Aliases**: Documented utility types like `LexicalScope`,
`DeclExpr`, `ExportMap`

All documentation follows the existing codebase style using triple-slash
comments (`///`) and focuses on explaining the purpose, usage context,
and behavior of each item within the syntax analysis pipeline.

## Verification

- Code formatting applied using `cargo fmt`
- No functional changes made - purely documentation additions
- All public API items in the file now have appropriate documentation

This significantly improves the developer experience for anyone working
with the syntax analysis components of tinymist.

Fixes #2023.

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/Myriad-Dreamin/tinymist/issues/new?title=Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-20 11:47:33 +08:00
Myriad-Dreamin
4bec3e4ac1
docs: remove - hint (#2046)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Closes #2038
2025-08-19 13:15:16 +08:00
Myriad-Dreamin
f964d9d91a
build: bump version to 0.13.24-rc1 (#2043)
+tag v0.13.24-rc1
2025-08-19 11:56:46 +08:00
Myriad-Dreamin
05280aec4d
feat: bump edition of most crates to rust 2024 (#2042)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-18 16:48:41 +08:00
Myriad-Dreamin
d227ad2a53
feat: schedule async tasks when running the server on bare-metals (#2040) 2025-08-18 15:00:04 +08:00
Myriad-Dreamin
310c911996
feat: fix build:web and add watch:web command (#2041) 2025-08-18 14:31:02 +08:00
QuadnucYard
3a51577b28
fix: eliminate clippy warnings (#2036)
using clippy 0.1.91 (898aff704d 2025-08-14), but some warnings already
exist in the latest stable version
mostly about elided lifetime and if-chain

only remaining warnings:
```
warning: struct `HashRepr` is never constructed
   --> crates\tinymist-query\src\tests.rs:462:12
    |
462 | pub struct HashRepr<T>(pub T);
    |            ^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

warning: a method with this name may be added to the standard library in the future
   --> crates\tinymist\src\actor\editor.rs:103:30
    |
103 | ...                   .map_or_default(|fid| unix_slash(fid.vpath().as_rooted_path()));
    |                        ^^^^^^^^^^^^^^
    |
    = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
    = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
    = help: call with fully qualified syntax `typst::typst_utils::OptionExt::map_or_default(...)` to keep using the current method
    = note: `#[warn(unstable_name_collisions)]` on by default
help: add `#![feature(result_option_map_or_default)]` to the crate attributes to enable `std::option::Option::<T>::map_or_default`
   --> crates\tinymist\src\lib.rs:3:1
    |
  3 + #![feature(result_option_map_or_default)]
    |
```
2025-08-18 12:42:03 +08:00
QuadnucYard
c73e7f5863
feat: add range formatting support to the language server (#1984)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-18 07:54:34 +08:00
Myriad-Dreamin
98062430b4
docs: update commands to install tinymist cli (#2037)
closes #2033
2025-08-18 07:17:33 +08:00
Myriad-Dreamin
bf081ec347
feat: export package docs to json format and render to html (#1809)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
It provides a `package-doc.json` and HTML is rendered using a
`package-doc` function.

```typ
#let package-doc(info, path: none) [
  #metadata((
    // more sub paths
  )) <static-paths>
  #render-page(info, path) // the content of $path/.html
]
#package-doc(json("package-doc.json"))
```
2025-08-13 12:12:08 +08:00
Myriad-Dreamin
2c552ce985
feat: make enter feature in list or enum work (#2022)
Continue work on Myriad-Dreamin/tinymist#1446
2025-08-13 11:15:31 +08:00
Myriad-Dreamin
a561059a4e
feat: add js transport to sync-ls (#2029)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-12 06:07:23 +08:00
Myriad-Dreamin
5613bd29be
fix: rename tinymist-cli artifacts back to tinymist (#2030)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-12 05:29:03 +08:00
Myriad-Dreamin
f7f2760520
feat: use tinymist_std::time for wasm32 targets (#2028)
`std::time` are not implemented for wasm32 targets, so we should use the
time crate made by ourselves.
2025-08-12 04:40:04 +08:00
Myriad-Dreamin
ce5ab81760
feat: move and compile tinymist crate for wasm32 target (#2027)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-11 13:14:26 +08:00
Myriad-Dreamin
79f68dc94d
feat: compile tinymist-query for wasm32 target (#1947)
- #2025 
- #2026

---------

Co-authored-by: Momijiichigo <ichigomomiji436@gmail.com>
2025-08-11 09:35:07 +08:00
Myriad-Dreamin
b102b42d2c
feat: compile diag crate for wasm32 target (#2026) 2025-08-11 08:49:37 +08:00
Myriad-Dreamin
8431f386ce
feat: compile lock crate for wasm32 target (#2025) 2025-08-11 08:17:20 +08:00
Hong Jiarong
7a9e1cfb3c
fix: clean typlite markers from doc strings (#2017)
When there's HTML comments in list, the markdown syntax won't be parsed
as expected. This pr cleans typlite markers from doc string to avoid
this behavior.

<img width="654" height="223" alt="bfedf840bc92a34c44212006232a7e17"
src="https://github.com/user-attachments/assets/9015952b-a5de-4d59-a8ff-61a5e3d09d1b"
/>
<img width="641" height="257" alt="0267db904824cf09b67234bdcb0919e7"
src="https://github.com/user-attachments/assets/938fabaa-d6fe-42d4-adca-6c96b59443e2"
/>
2025-08-11 07:03:53 +08:00
Myriad-Dreamin
14c7a92944
feat: rename labels (#1858)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
closes #549
2025-08-09 19:54:22 +08:00
Myriad-Dreamin
a732861f67
feat: completes both #f and #f.paren in some cases (#1940) (#2014)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
Reverts Myriad-Dreamin/tinymist#2003
2025-08-08 01:19:16 +08:00
Myriad-Dreamin
039d911d1e
dev: enable logs in route.rs (#2015) 2025-08-08 00:53:28 +08:00
Myriad-Dreamin
7406cc273e
fix(docs): correct hallucination of copilot in project model docs (#2016) 2025-08-08 00:04:47 +08:00
ParaN3xus
8367f3a606
fix: allow non-commit in nightly release (#2013)
Since #1986 eliminates the need to bump world crates for nightly
releases, commits after cargo update may be empty
2025-08-07 22:12:40 +08:00
Myriad-Dreamin
12c1a0abf8
docs: continue improve project model docs (#2012)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-07 16:41:04 +08:00
Myriad-Dreamin
f511aa005a
docs: add concrete usage of the lock file feature (#2011) 2025-08-07 15:47:39 +08:00
Myriad-Dreamin
5838c7d300
docs: add docs about project model (#2009)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-07 07:42:22 +08:00
Myriad-Dreamin
c3fa0c5cb2
fix: ensure that the lockfile is respected (#2000) 2025-08-07 07:42:02 +08:00
Myriad-Dreamin
bd688f354e
build: bump version to 0.13.22 (#2008)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.22
2025-08-07 00:37:19 +08:00
Myriad-Dreamin
a0d0b17206
build: bump version to 0.13.22-rc2 (#2007)
+tag v0.13.22-rc2
2025-08-06 22:19:32 +08:00
Myriad-Dreamin
7455d11629
fix: emit save events to cover issue of notify (#2006) 2025-08-06 21:15:56 +08:00
Myriad-Dreamin
58b43c006c
fix: don't check or change state if no reasons (#2005)
Otherwise, `pending_reasons` is cleared.
2025-08-06 20:12:56 +08:00
sjfhsjfh
39e23e18b3
fix(L10n): small fix (#1785)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
也许可以攒到多一点一起 merge
2025-08-06 16:34:29 +08:00
Myriad-Dreamin
920a318df4
build: upgrade tinymist-{derive,l10n,package,std}, typst-shim edition… (#1995)
… to 2024
2025-08-06 14:01:01 +08:00
Myriad-Dreamin
46e7eca2b4
revert: "feat: completes both #f and #f.paren in some cases (#1940)" (#2003)
Reverts Myriad-Dreamin/tinymist#1940. Hasn't released v0.13.22, will be
merged again after release.
2025-08-06 13:59:04 +08:00
Myriad-Dreamin
8898a2a45f
feat: completes both #f and #f.paren in some cases (#1940)
When `f` is a scope with at least one member:
- completes `#f` as `#f()` if `f` will never be a type or element
(merely a function).
- Otherwise, completes `#f` as `#f` and adds a variant `#f.paren`
completed as `#f(|)` or `#f()|`

This excepts for the following cases:
- When the surrounding syntax doesn't like parentheses (for example,
function fields)
    > Complete the field name along with its value. Notes:
    > No parentheses since function fields cannot currently be called
    > with method syntax;
- When the surrounding syntax requires parentheses, for example set
rules, e.g. `#set r|` is completed as `#set raw(|)`.
2025-08-06 13:37:39 +08:00
Myriad-Dreamin
858831993d
build: bump version to 0.13.22-rc1 (#2002)
+tag v0.13.22-rc1
2025-08-06 11:42:30 +08:00
Copilot
65ee92b1ac
fix: ensure full git history available in web and Alpine container builds (#1996)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
The GitHub Action builds for Alpine containers (`alpine-{x64,arm64}`)
were producing warning messages that cluttered the build logs:

```
warning: tinymist-core@0.13.18: not within a suitable 'git' worktree!
warning: tinymist-core@0.13.18: VERGEN_GIT_DESCRIBE set to default
warning: tinymist-core@0.13.18: VERGEN_GIT_SHA set to default
```

These warnings occurred because the vergen crate was attempting to
access git repository information in containerized environments where
the full git history wasn't available due to shallow cloning.

**Root cause:** The Alpine workflow was using `actions/checkout@v4` with
default settings, which performs a shallow clone that doesn't include
the full git history that vergen needs for `git_describe` functionality.

**Solution:** Added `fetch-depth: 0` to the checkout step in the Alpine
workflow to ensure the full git history is available during builds. Git
is already properly installed in the Alpine environment via `apk add
--no-cache git`.

This approach maintains consistent behavior across all build
environments while eliminating the warnings in Alpine container builds.
The `tinymist --version` command continues to show proper git
information when available.

Fixes #1983.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-08-06 10:58:16 +08:00
Myriad-Dreamin
bc09736cc6
fix: always send compiled interrupt to main thread (#2001)
We have to always inform the main thread about the compilation. If such
interrupt is not sent, the main thread will be stalled forever.
2025-08-06 10:30:56 +08:00
Rik Huijzer
4c242c54e8
docs: make translation of pinning clearer (#1997)
Thanks for making this awesome extension. I find it very useful.

This PR suggests a small rewording for a sentence. With this, I hope it
becomes a bit clearer what the command does. This is also closer to
Google Translate's translation of "将主文件固定到当前打开的文档".
2025-08-06 09:53:47 +08:00
Myriad-Dreamin
27893b5302
revert: "fix(ci): detect create intead of push (#1962)" (#1994)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Reverts Myriad-Dreamin/tinymist#1962
2025-08-06 00:56:53 +08:00
Myriad-Dreamin
451a10869a
build: bump msrv to 1.88 (#1993)
Co-authored-by: paran3xus <paran3xus007@gmail.com>
2025-08-05 23:18:16 +08:00
Myriad-Dreamin
ce43c4bbd9
build: bump version to 0.13.20 (#1999)
+tag v0.13.20
2025-08-05 22:53:53 +08:00
Myriad-Dreamin
c08b63bd3d
fix: changelog (#1992)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-05 14:18:24 +08:00
Myriad-Dreamin
615f834822
build: bump version to 0.13.20-rc1 (#1989)
+tag v0.13.20-rc1
2025-08-05 12:12:11 +08:00
Myriad-Dreamin
d7fa34f2fe
fix: ignore outdated signal (#1991) 2025-08-05 11:04:07 +08:00
Myriad-Dreamin
a2f8928066
fix: clean up signal when revision is updated (#1990)
Forgot to clean up signal when evision is updated

```
// The signal must be reset to the current one.
*n_signal = art.snap.signal;
```
2025-08-05 10:53:23 +08:00
Myriad-Dreamin
fb1c8b3b35
feat: make configuration items null-safe (#1988)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
When passing configuration items with null values, the default
configurations are used. Note: I don't ensure this to be always true,
some configuration items may have different non-default behaviors when
accepting a null value now or in future. The `deserialize_null_default`
is taken from https://github.com/serde-rs/serde/issues/1098.

Configuration parsing changes:
+ some configurations only accepting boolean now coerce null to `false`
(default).
+ some configurations only accepting an object now coerce null to
default.
+ The `tinymist.preview.invertColors` now now coerces null to `"never"`
(default).
2025-08-05 10:31:52 +08:00
ParaN3xus
f33f612f43
feat: maintain workflows for nightly releases (#1986) 2025-08-05 10:27:44 +08:00
Luyan Zhou
2667fdb91b
fix: set VS Code default configuration for invertColors to "never" (#1987)
Since #1807 , VS Code pops up a warning when starting tinymist: 
<img width="464" height="162" alt="image"
src="https://github.com/user-attachments/assets/aeefac88-5515-4dcd-be52-82e402db74c5"
/>

Because the default value was not set, it's trying to deserialize a
`null`. I complete the corresponding configuration entry in the VS Code
extension's package.json and package.other.json with default value
"never".
2025-08-05 09:59:57 +08:00
Wenzhuo Liu
5c686f4641
build: bump typstyle to v0.13.17 (#1979)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-04 07:54:48 +08:00
Myriad-Dreamin
24f4900025
build: bump version to 0.13.18 (#1980)
+tag v0.13.18
2025-08-04 03:25:40 +08:00
Myriad-Dreamin
959174e236
build: update cargo hash in the flake.nix (#1976)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+tag v0.13.18-rc2
2025-08-03 15:05:16 +08:00
Myriad-Dreamin
700745e46e
build: bump version to 0.13.18-rc2 (#1975) 2025-08-03 14:04:21 +08:00
Myriad-Dreamin
1eb1828d92
fix: properly handle v-prefix in release tag to announce (#1971) 2025-08-03 10:52:15 +08:00
Myriad-Dreamin
6406870391
build: bump version to 0.13.18-rc1 (#1969)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-08-02 22:31:40 +08:00
Myriad-Dreamin
55228c76a6
feat: update links in vscode docs (#1967) 2025-08-02 21:45:58 +08:00
Myriad-Dreamin
e8e6df319a
test: add tests about workspace/symbol requests (#1966) 2025-08-02 21:45:42 +08:00
Myriad-Dreamin
ab774377f7
feat: make symbol queries infallible (#1964) 2025-08-02 20:50:14 +08:00
ParaN3xus
2ecdbd42a5
fix: use proper commit hash when generating nightly release changelog (#1965) 2025-08-02 20:39:44 +08:00
Myriad-Dreamin
9e96aefa0e
fix(ci): detect create intead of push (#1962)
According to https://github.com/actions/runner/issues/1007, the push
events was not created when bot creating tags.
2025-08-02 19:51:23 +08:00
ParaN3xus
bf30b5458a
fix: do full cargo update when releasing nightly (#1961) 2025-08-02 19:21:19 +08:00
Myriad-Dreamin
e8a72a5fe3
fix: remove some compatiblility to preview configuration and fix tinymist.preview.refresh (#1807)
Some checks failed
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled
`tinymist.preview.refresh` should work.
- [x] ensure that `--refresh-style` is respected
- [x] not need to pass `--refresh-style` in
extension/src/features/preview.ts
- [x] ensure configuration to work
2025-08-02 03:55:06 +08:00
ParaN3xus
cf0fb1c00d
fix: several fixes to auto release (#1959)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
+ use `GITHUB_TOKEN` to checkout tinymist in `release-nightly.yml`.
Therefore, GitHub Actions should be granted write permission.
+ tag directives must start from the line start.
+ use the same bot name and email in actions.
2025-08-01 16:08:08 +08:00
Myriad-Dreamin
f118d81464
fix: run ci on nightly branch (#1955)
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-31 22:25:30 +08:00
Myriad-Dreamin
cf82fc78c2
feat: add rust and yarn to nix devShell (#1953)
by default, we assume people would like develop the language server and
editor tools. The building of tinymist-cli is moved to the neovim shell.
2025-07-31 22:22:32 +08:00
ParaN3xus
3aa9c9def0
feat: create git tag automatically to trigger releases (#1951)
This PR introduces multiple GitHub Actions to automate the release
procedure. In brief, it contains:

- **For nightly releases**: A fully automated GitHub Action that updates
dependencies (including dependencies of typstyle, typst.ts, and
typst-ansi-hl), releases nightly RC (aka canary version in the action
script) and nightly builds, along with its helper script (which can also
be useful for manually updating versions).

- **For stable releases**: Two GitHub Actions, one that detects newly
opened PRs containing tagging directives (`+Tag vx.y.z-rcw`) and leaves
comments, and another that detects merged tagging PRs and performs the
actual tagging.


Examples:
- Nightly release:
4708018995
- Stable release: ParaN3xus/tinymist#1, ParaN3xus/tinymist#2

Extra work needed to merge this PR:
- [ ] Remove all `nightly/*` branches and create `nightly` branch
- [ ] Add `NIGHTLY_REPO_TOKEN` secret to this repo

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-07-31 20:59:11 +08:00
Myriad-Dreamin
9f7c21bb0c
fix: remove explicit requirement of secrets (#1952) 2025-07-31 20:13:57 +08:00
Myriad-Dreamin
7e925890fa
feat: build and bundle tinymist wasm into web extension (#1945)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-31 01:45:25 +08:00
Myriad-Dreamin
3a4fa98b42
feat: implement delegate access model (#1943)
This is to avoid touching underlying file system if the extension is run
with liveshare.
2025-07-31 01:21:17 +08:00
Myriad-Dreamin
f9c348c7d7
feat: introduce dyn access model for futher development (#1898)
prepare for #1413 and #836
2025-07-31 00:30:13 +08:00
Myriad-Dreamin
cf20c66b26
test: ensure compile output works correctly (#1942)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Validate fix and prevent regression of
https://github.com/Myriad-Dreamin/tinymist/pull/1941
2025-07-30 23:25:59 +08:00
moeleak
3821861134
fix: correctly handle relative user-specified output paths in compile command (#1941)
This change ensures that user-specified output paths in the compile
command are properly handled, including relative paths.

Previously, the export task would reject relative output paths with an
error. This change converts relative paths to absolute paths by joining
them with the current working directory, allowing users to specify
relative paths like 'output/test.pdf' when compiling documents.

The fix adds path normalization using PathClean and handles the
conversion gracefully while maintaining the existing behavior for
absolute paths.

Fixes the issue where commands like:
  tinymist compile resume-en.typ ./output/test.pdf
would fail with "output path is relative" error.
2025-07-30 21:35:36 +08:00
Hong Jiarong
641b28fc45
fix: update VerbatimNode attribute to inline (#1926)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-30 13:39:19 +08:00
Myriad-Dreamin
75fc5f3bca
fix: emit onSaved signal to exporter when vfs is clean (#1939)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
This bugs involves two main component: the compiler and the exporter,
the compiler compiles first and then exporter exports then. it is useful
to emit `CompileSignal::by_fs_events` to exporter even if vfs is clean
at the time we save a document.

An example triggering this bug. When user sets `exportPdf` to `onSave`,
It *bugged*:
1. OnTyped first: User types some character at T1. compiler learns that
the file content is of revision R1. the compiler compiles with revision
R1, which is needed by diagnostics event.
2. OnSaved then: Editor saves the document at T2. the compilation is
skipped early because file content is still under revision R1. In
previous version, The compilation is skipped and therefore the export is
also skipped. This is *bugged* if user sets `exportPdf` to `onSave`,
because the exporter is not run in both steps.

This PR emits the onSaved signals to both the compiler and the exporter
in the step 2.
2025-07-30 04:49:30 +08:00
Myriad-Dreamin
5d2f32945c
feat: run announce workflow in ci (#1938)
Some checks are pending
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-29 17:15:51 +08:00
Myriad-Dreamin
e9ae352dfd
build(ci): call VS Code CI tasks in release.yml workflow (#1920)
Since this PR, CI runs VS Code tasks exact after built binaries and
before `dist host`. This is to ensure that the vscode artifacts are
available when undraft the releases.
2025-07-29 16:21:34 +08:00
Myriad-Dreamin
315168da1f
docs: update release date in changelog (#1937)
Some checks are pending
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-29 15:18:45 +08:00
Myriad-Dreamin
d59a15df1a
build: bump version to 0.13.16 (#1934) 2025-07-29 15:16:18 +08:00
Myriad-Dreamin
0025a71951
fix: passing secrets to reused workflows (#1936) 2025-07-29 15:15:50 +08:00
Sam Estep
42b7a1205b
build: update flake.lock (#1933)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
This doesn't actually change any of the dependencies, it just makes the
changes to `flake.lock` that are automatically made when running `nix
develop`. See also #1932.
2025-07-28 11:53:49 +08:00
Myriad-Dreamin
9181619e95
build: bump version to 0.13.16-rc3 (#1928)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
* build: bump version to 0.13.16-rc3

* build: update asset crates
2025-07-26 17:54:25 +08:00
Myriad-Dreamin
ca22cf9e05
feat: auto-hide presentation toolbar when not hovered (#1923)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* docs: update changelog

* feat: auto-hide presentation toolbar when not hovered

* fix: grab state

* fix: bugs
2025-07-25 18:31:35 +08:00
Myriad-Dreamin
2dc138f4d3
docs: annotate pinyin with ruby (#1924)
* docs: generate ruby

* dev: move ruby function

* dev: move ruby function
2025-07-25 18:20:09 +08:00
Myriad-Dreamin
2955d67751
revert: "feat: auto-hide presentation toolbar when not hovered (#1887)"
Reverts #1887

In test of v0.13.16-rc2, The CSS doesn't work as expected when previewing in both tab and browser.
2025-07-25 16:15:54 +08:00
Myriad-Dreamin
c58a6d2a5e
docs: update release instruction (#1921)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
* docs: update release instruction
2025-07-24 03:37:35 +08:00
Myriad-Dreamin
3c40385cd2
build: bump version to 0.13.16-rc2 (#1919)
* build: bump version to 0.13.16-rc2

* docs: update changelog

* fix: update reflexo versions

* build: bump asset crates
2025-07-24 01:37:42 +08:00
Wenzhuo Liu
489689063d
chore: update typstyle-core version to 0.13.16 and adjust changelog (#1915) 2025-07-24 00:51:03 +08:00
Y.D.X.
b12bd4b694
fix: update the docs link from pattern to tiling (#1906) 2025-07-24 00:49:59 +08:00
Myriad-Dreamin
debab53887
feat: attach config to software spec for LLM (#1918) 2025-07-23 22:45:38 +08:00
Myriad-Dreamin
3b732c9750
feat: add software specification for LLM (#1917)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-23 15:34:57 +08:00
Myriad-Dreamin
357210c678
build: bump world crates to 0.13.16-rc1 (#1905)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* docs: update changelog

* build: bump world crates to 0.13.16-rc1

* build: bump reflexo crates to pre v0.6.1-rc2
2025-07-16 12:28:21 +08:00
Myriad-Dreamin
e6c1894ce4
build: bump world crates to 0.13.16-rc1 (#1905)
* docs: update changelog

* build: bump world crates to 0.13.16-rc1

* build: bump reflexo crates to pre v0.6.1-rc2
2025-07-16 12:28:05 +08:00
Myriad-Dreamin
1359e9975b
feat: resolve definitions with dynamic analysis (#1904)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
* feat: dyn resolve targets

* fix: test cases

* feat: static analysis again based on dyn analysis result
2025-07-15 01:15:33 +08:00
Wenzhuo Liu
35e8f447b0
build: bump typstyle to v0.13.14 (#1902)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
2025-07-12 16:44:27 +08:00
Myriad-Dreamin
97b5325f68
fix: alpine arm64 was not built (#1901)
* fix: alpine building

* dev: check build

* Revert "dev: check build"

This reverts commit ae71095ef2.
2025-07-12 15:53:23 +08:00
Myriad-Dreamin
d571f1680f
build: bump version to 0.13.16-rc1 (#1899)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* build: bump version to 0.13.16-rc1

* docs: add changelog

* fix: wrong assets

* fix: assets
2025-07-11 15:50:22 +08:00
Copilot
d409b30f03
feat: auto-hide presentation toolbar when not hovered (#1887)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* Initial plan

* Implement auto-hide presentation toolbar feature in slide mode

Co-authored-by: Enter-tainer <25521218+Enter-tainer@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Enter-tainer <25521218+Enter-tainer@users.noreply.github.com>
2025-07-11 14:47:45 +08:00
Copilot
b4a53274c2
fix: Cargo.toml default-features warning for typlite workspace dependency (#1895)
Some checks failed
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
* Initial plan

* Fix Cargo.toml default-features warning for typlite workspace dependency

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* feat: better feature assignment

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-07-09 21:57:59 +08:00
Myriad-Dreamin
4c676c1a8d
fix: update copilot instructions for offline testing (#1896)
* fix: update copilot instructions for offline testing

* efat: add PR title convention

* feat: add PR title convention

* feat: add PR title convention
2025-07-09 21:34:11 +08:00
Copilot
c5e4136add
docs: missing docs in crates/tinymist-vfs/src/path_mapper.rs (#1892)
* Initial plan

* Remove #![allow(missing_docs)] and prepare for documentation

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* Add comprehensive documentation for all public items in path_mapper.rs

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
2025-07-09 20:47:03 +08:00
Myriad-Dreamin
9bb784e6f0
feat: run prettier correctly (#1893) 2025-07-09 19:34:57 +08:00
Myriad-Dreamin
0849d6c641
feat: compilation respect SOURCE_DATE_EPOCH (#1631)
* Changes before error encountered

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* feat: errors caused by copilot

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2025-07-09 19:09:58 +08:00
Myriad-Dreamin
1258c0f2ca
feat: add copilot instructions (#1890) 2025-07-09 19:04:59 +08:00
Myriad-Dreamin
f7e04d1d2c
fix: markdown link (#1886)
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-09 00:36:40 +08:00
Myriad-Dreamin
6821eea6a8
feat: generate config reference by typst (#1885)
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* feat: in draft config

* feat: generate config by typst

* feat: remove config-man
2025-07-08 13:36:35 +08:00
Myriad-Dreamin
1210b54515
feat: finally directly generate markdown files (#1881)
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* feat: finally directly generate markdown files

* fix: trim

* fix: await
2025-07-07 13:11:23 +08:00
Myriad-Dreamin
0f748d24ba
fix: show svg in vscode-remote (#1878)
Some checks are pending
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-07 11:10:09 +08:00
Myriad-Dreamin
355fac08bd
perf: add cache for docstrings (#1877)
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-07 02:16:11 +08:00
Myriad-Dreamin
4426b31ed7
feat: pretty errors in docstrings (#1876)
Some checks are pending
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* feat: print doc errors

* fix: test errors on windows

* fix: tests on windows again

* fix: tests on windows again 2

* Revert "fix: tests on windows again 2"

This reverts commit 63973dcc1f.

* fix: tests on windows again 3
2025-07-06 19:40:02 +08:00
Myriad-Dreamin
9787432029
fix: errors in the template (#1875) 2025-07-06 14:33:45 +08:00
Myriad-Dreamin
f897f5ac47
feat: update bug_report.yml
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-06 11:04:59 +08:00
Myriad-Dreamin
5d27a8668e
feat: update bug_report.yml 2025-07-06 11:03:25 +08:00
Myriad-Dreamin
f74ef0ef67
feat: update bug_report.yml 2025-07-06 08:56:52 +08:00
Myriad-Dreamin
f5a7a30164
feat: update bug_report.yml 2025-07-06 08:55:37 +08:00
Myriad-Dreamin
2b7482b263
fix: bidirectional jump in slide mode (#1873)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-06 00:34:24 +08:00
Myriad-Dreamin
32bd813be6
refactor: fmt (#1872) 2025-07-05 23:25:27 +08:00
Andreas Willi
25418e9d2f
fix: read formatterProseWrap from server (#1856) 2025-07-05 21:13:01 +08:00
Myriad-Dreamin
c767c37cc1
fix: complete where and with after dots (#1871) 2025-07-05 20:53:39 +08:00
Myriad-Dreamin
1478280a07
docs: generate typlite readme (#1868)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* docs: generate typltie readme

* dev(ci): add docs check

* fix: don't cache error

* dev(ci): install typst

* docs: update docs

* feat: mark shell scripts
2025-07-03 01:41:19 +08:00
Myriad-Dreamin
38a1d48a6f fix: site title
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-02 12:02:15 +08:00
Myriad-Dreamin
cec7019b1a docs: use themed nodes 2025-07-02 11:54:12 +08:00
Myriad-Dreamin
dc4e43c5d8
docs: use theme-box to improve documentation diagrams (#1840)
* dev: use theme-box to improve documentation diagrams

* feat: better fletcher

* feat: set raw
2025-07-02 11:41:18 +08:00
Myriad-Dreamin
4cd8c634d5
test: ensure pdf export onType to work (#1865)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* test: ensure pdf export `onType` to work

* fix: dirty changes
2025-07-02 02:56:17 +08:00
Myriad-Dreamin
9ca77d5382
fix: build pdf docs (#1864)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: pdf docs

* fix: dirty change

* fix: pollyfill theme-box

* fix: pollyfill rules

* fix:  rules

* fix: again

* fix: 2019 retired
2025-07-01 23:05:41 +08:00
Myriad-Dreamin
eedcbc477c
fix: _10MB for truncation is not 10MB (#1850)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-07-01 05:43:46 +08:00
Myriad-Dreamin
5c6c118b9c fix: set code block rules 2
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-30 16:42:28 +08:00
Myriad-Dreamin
80c4bd9848 fix: set code block rules 2025-06-30 16:38:38 +08:00
Myriad-Dreamin
b13b020933 feat: use shiroa v0.3.1-rc3 2025-06-30 15:11:07 +08:00
Myriad-Dreamin
c46b6e1166
fix: upgrade builder for windows binaries (#1794)
* fix: change windows builder to windows latest

* build: upgrade cargo-dist

* chore: update

* chore: update

* fix: tinymist.3
2025-06-30 11:27:49 +08:00
Myriad-Dreamin
a0d5d7bee7
feat: move neovim config files (#1857)
* feat: move neovim config files

* fix: bootstrap
2025-06-30 10:49:42 +08:00
Myriad-Dreamin
d0a478929e
fix: don't export on entry change and first filesystem sync (#1854)
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: make real onSave export conditions

* fix: remove fix

* feat: pass export tests

* fix: revert bootstrap changes

* feat: reduce num of exports

* fix: diag tests
2025-06-29 21:54:05 +08:00
Myriad-Dreamin
db7e031bbe
chore: delete unused files (#1851)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-29 10:06:24 +08:00
Myriad-Dreamin
c03898cd3d
feat: add a neovim plugin as the canonical lsp client implementation (#1842)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
* fix: bad link

* feat(neovim): init lsp

* feat(neovim): add bootstrap script

* build: add notice
2025-06-25 22:12:55 +08:00
Wenzhuo Liu
0191e55978
docs: update typstyle changelog links to the correct URL (#1848)
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-25 11:49:15 +08:00
Wenzhuo Liu
592c9d53ea
feat: skip exporting style elements in HTML nodes (#1849)
* feat: skip exporting style elements in HTML nodes

* dev: use interned strs

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-25 10:46:02 +08:00
Myriad-Dreamin
f4bab00168
docs: update language server dev docs (#1838)
Some checks are pending
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* docs: update language server dev docs

* docs: link in inputs.typ

* docs: server-level profiling
2025-06-24 16:58:07 +08:00
Myriad-Dreamin
878d8aaf08
feat: add flake.nix (#1843)
Some checks are pending
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* dev: add flake.nix

* feat: init dev, unstable, and nixvim config

* docs: update description

* dev: split neovim with nixvim

* feat: init tinymist server

* x

* g

* g
2025-06-24 14:24:25 +08:00
Myriad-Dreamin
d76cd90ef5
docs: mention tidy compatibility in docs.typ (#1841)
Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-23 13:13:55 +08:00
Myriad-Dreamin
b0c9b2ef86
feat(vscode): add alpine-arm64 support (#1837)
* feat(vscode): add alpine-arm64 support

* dev: deduplicate
2025-06-23 12:54:19 +08:00
Myriad-Dreamin
9f458f8630
feat: remove debug symbol links (#1836) 2025-06-23 12:17:59 +08:00
Myriad-Dreamin
4bfb5c22da
fix: stop atom expressions before backslash (#1835)
* fix: stop atom expressions before marks

* dev: fix it
2025-06-23 11:32:55 +08:00
Myriad-Dreamin
96510385a1
fix: vesrion in package.json files are wrong (#1834)
Some checks are pending
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-22 22:31:36 +08:00
Myriad-Dreamin
ba7fcb588f
build: bump version to 0.13.14 (#1833)
* build: update changelog

* build: update permalink

* docs: fix bad link

* build: bump version to 0.13.14

* build: bump assets to 0.13.14
2025-06-22 22:15:17 +08:00
Myriad-Dreamin
756075a161
build: bump version to 0.13.14-rc3 (#1813)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* build: bump version to 0.13.14-rc3

* build: update cargo.lock

* build: update cargo.lock

* build: downgrade url crate

* build: update asset crates
2025-06-22 16:27:04 +08:00
Myriad-Dreamin
b58334cd0e
docs: better typlite.typ (#1832) 2025-06-22 15:30:24 +08:00
Myriad-Dreamin
483de6f00d
build: generate docs with internal links (#1831)
* build: generate docs with internal links

* build: detect link kind
2025-06-22 15:28:27 +08:00
Tache David Stefan
4658fe7218
docs: mention background preview in helix docs (#1829)
* Update helix.typ

add background.args

* Update helix.typ
2025-06-22 15:25:27 +08:00
Myriad-Dreamin
59c6e1c48e
docs: add typlite docs (#1828)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* docs: add typlite docs

* docs: update typlite docs

* chore: reduce trim
2025-06-19 14:15:17 +08:00
Myriad-Dreamin
7ee2e53189
feat: export to tex by tasks (#1826)
* feat: export to tex by tasks

* test: update snapshot
2025-06-19 14:10:42 +08:00
Myriad-Dreamin
8e86a401ff
feat: update typlite crate features (#1825)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* build: turn off docx export feature in library mode

* feat: make less default feature and rename fonts feature

* dev: remove unused code
2025-06-19 11:16:18 +08:00
Myriad-Dreamin
bc15eb55ce
feat: add processor flag and finish sample to convert into tex paper (#1824)
* feat: add processor flag and finish sample to convert into tex paper

* test: update snapshot remove tex {document} env wrapping
2025-06-19 09:57:11 +08:00
Hong Jiarong
ee528810fb
fix: trailing linebreaks at end of paragraph (#1820)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
2025-06-17 17:57:02 +08:00
bluss
79fee262d7
fix(docs): small typo in typlite README (#1819)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
2025-06-16 19:47:41 +08:00
Wenzhuo Liu
9a11729eda
build: bump typstyle-core to v0.13.11 and update changelog (#1814)
Some checks are pending
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-16 16:14:39 +08:00
Hong Jiarong
a24c516148
feat: import_context and contexual convert (#1816)
* feat: impl import_context

* dev: fmt, clippy

* fix: update import path handling to use rootless paths and normalize separators

* feat: fix errors for fletcher v0.5.8

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-16 16:13:40 +08:00
Eric Long
9d9d360db9
fix(test): running test as root (#1817)
* fix(test): running test as root

The dummy root path /root conflicts with root user's home directory on Linux and redacts incorrectly. Our downstream CI environment builds tinymist in docker as root and encounters the problem. Change the path to `/dummy-root` fixes it. To ensure consistency, other similar occurences are also prefixed with `dummy-`.

* dev: deduplicate a bit

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-16 13:01:25 +08:00
Hong Jiarong
c0d5f0c800
refactor(typlite): use EcoString instead (#1815)
Some checks are pending
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
* feat: update cmark-writer to version 0.7.6 and refactor string handling to use EcoString

* dev: make use of eco string

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-16 06:20:09 +08:00
Hong Jiarong
8fb118f3ff fix(typlite): table with table.header did not convert properly (#1812)
* chore: add TODO comment for table.header rendering in md-table function

* feat: enhance table parsing to support thead/tbody structure and complex cells

* fmt

* feat: add InlineNode for handling flattened inline content in table cells

* feat: update snapshot files and enhance DOCX/LaTeX writer to support InlineNode processing

* refactor: custom node handling in DOCX and LaTeX writers

* dev: md-grid should have similar signature to grid

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-16 05:28:39 +08:00
Hong Jiarong
9a44074629
build: enable typlite distribution in dist.toml (#1810)
Some checks failed
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
* dev: enable typlite distribution

* dev: add cli feature to typlite distribution
2025-06-12 18:05:37 +08:00
Myriad-Dreamin
aa7e71fef3
build: bump version to 0.13.14-rc2 (#1805)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
* build: bump version to 0.13.14-rc2

* build: update cargo.lock

* build: bump assets
2025-06-09 12:21:31 +08:00
Myriad-Dreamin
25a446cd99
dev: fix meta and rename preview crates for publish crates (#1804)
* dev: fix meta and rename preview crates for publish crates

* dev: fix meta for publish crates
2025-06-09 09:40:05 +08:00
Myriad-Dreamin
5a2509327d
test: add a ieee paper sample workspace (#1803)
* test: add ieee paper sample workspaces

* chore: add a newline

* docs: update ieee template document
2025-06-09 08:57:22 +08:00
Wenzhuo Liu
5343fb5fc2
chore: bump typstyle-core to v0.13.10 and update changelog (#1797)
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-06-09 07:42:34 +08:00
Myriad-Dreamin
ed3704b0a3
build: bump version to 0.13.14-rc1 (#1793)
* build: bump version to 0.13.14-rc1

* docs: draft changelog

* docs: finish changelog

* docs: add co-author
2025-06-09 07:21:25 +08:00
Myriad-Dreamin
c85247a85c
fix: example impl is not correct (#1770)
Some checks are pending
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: example impl is not correct

* fix(typlite): example impl (#1800)

* fix: readme generation (#1754)

* fix: readme generation

* feat: markdown-aware export

* feat: add ieee example

* fix: fix wrong behavior of list parsing and <div> elem parsing

* test: update snapshot

Co-authored-by: Hong Jiarong <me@jrhim.com>

* fix: clippy warnings

* fix: handle br tag as hard break in HTML parsing (#1769)

* fix: handle br tag as hard break in HTML parsing

* Revert "svg gen"

This reverts commit 1ff4c0af33c209a9f653c879f2f7d504bad1ff32.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* feat: some md-specific impl

* test: bad changes

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>

* fix(typlite): recover readme (#1759)

* fix: recover readme

* docs: rewrite readme

* fix: compile warnings (#1774)

* fix: correct link to Automattic/haper (#1748)

* fix: correct link to Automattic/haper

* build: generate readme

* fix: heading-hash is broken by readme generation (#1779)

* feat: bump typstyle to v0.13.4 and add config for hard wrap (#1737)

* feat: only scroll when selection is not adjacent (#1787)

* fix: quote should work as a blocks container; escape special chars in text (#1771)

* feat: add protip component with markdown note block conversion

* refactor: remove ProtipNode and update related parsing and tag definitions

* fix: escape special characters in markdown output and update cmark-writer dependency

* fix: try getting font index again (#1213, #1645) (#1790)

* feat: build theme-aware pictures (equations) (#1772)

* revert: "test: bad changes"

* feat: m1source

* fix: example impl

* fix(typlite): highlight in docx export (#1798)

* fix: highlight in docx export

* fmt

* fix: correct hover docs generated by typlite (#1761)

* fix: annotate fn

* fix(typlite): duplicate docs description (#1799)

* fix: avoid duplicate docs description

* fix: clippy error

* test: flat repr of hover snapshots

* g

* test: update snapshots

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>

* feat: `expr_tooltip` should not return docs (#1801)

* fix: render example

* fix: clean code

---------

Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>
Co-authored-by: Wenzhuo Liu <mgt@oi-wiki.org>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
Co-authored-by: Wenzhuo Liu <mgt@oi-wiki.org>
2025-06-08 13:44:59 +08:00
Myriad-Dreamin
7a30cbdc73
feat: expr_tooltip should not return docs (#1801)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-07 12:31:14 +08:00
Myriad-Dreamin
3d24320674
fix: correct hover docs generated by typlite (#1761)
* fix: annotate fn

* fix(typlite): duplicate docs description (#1799)

* fix: avoid duplicate docs description

* fix: clippy error

* test: flat repr of hover snapshots

* g

* test: update snapshots

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-06-07 09:14:20 +08:00
Hong Jiarong
ae99016cd9
fix(typlite): highlight in docx export (#1798)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: highlight in docx export

* fmt
2025-06-06 23:01:33 +08:00
Myriad-Dreamin
51db97ffcc
feat: build theme-aware pictures (equations) (#1772)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* revert: "test: bad changes"

* feat: m1source
2025-06-05 11:10:04 +08:00
Myriad-Dreamin
646dd81a35
fix: try getting font index again (#1213, #1645) (#1790)
Some checks are pending
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-06-04 15:06:19 +08:00
Hong Jiarong
08a104cd9c
fix: quote should work as a blocks container; escape special chars in text (#1771)
Some checks are pending
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
* feat: add protip component with markdown note block conversion

* refactor: remove ProtipNode and update related parsing and tag definitions

* fix: escape special characters in markdown output and update cmark-writer dependency
2025-06-03 23:49:15 +08:00
Myriad-Dreamin
cecb424b1e
feat: only scroll when selection is not adjacent (#1787)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
2025-05-31 01:10:32 +08:00
Wenzhuo Liu
39368da55f
feat: bump typstyle to v0.13.4 and add config for hard wrap (#1737)
Some checks failed
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
2025-05-29 00:00:25 +08:00
Myriad-Dreamin
b46b341d90
fix: heading-hash is broken by readme generation (#1779)
Some checks are pending
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
2025-05-27 08:03:18 +08:00
Myriad-Dreamin
ac0f8fbef7
fix: correct link to Automattic/haper (#1748)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* fix: correct link to Automattic/haper

* build: generate readme
2025-05-22 13:26:48 +08:00
Myriad-Dreamin
7de64aefe5
fix: compile warnings (#1774) 2025-05-22 11:37:44 +08:00
Myriad-Dreamin
7499dcb8c4
fix(typlite): recover readme (#1759)
* fix: recover readme

* docs: rewrite readme
2025-05-22 08:01:30 +08:00
Myriad-Dreamin
223a337736
fix: readme generation (#1754)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: readme generation

* feat: markdown-aware export

* feat: add ieee example

* fix: fix wrong behavior of list parsing and <div> elem parsing

* test: update snapshot

Co-authored-by: Hong Jiarong <me@jrhim.com>

* fix: clippy warnings

* fix: handle br tag as hard break in HTML parsing (#1769)

* fix: handle br tag as hard break in HTML parsing

* Revert "svg gen"

This reverts commit 1ff4c0af33c209a9f653c879f2f7d504bad1ff32.

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* feat: some md-specific impl

* test: bad changes

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-05-21 17:45:37 +08:00
Hong Jiarong
dd03bf22c8
fix(typlite): nodes nested in HTML element should render as HTML, disable strict mode (#1767)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: nodes nested in HTML element should render as HTML

* fix: set strict mode to false to prevent panic

* chore: update cmark-writer to 0.7.3
2025-05-21 00:03:45 +08:00
Myriad-Dreamin
a33ab6a79b
fix: block math align center (#1762)
Some checks failed
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
* fix: block math align center

* fix: block math align center (#1764)

* fix: process block children

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-05-18 03:08:35 +08:00
Myriad-Dreamin
953f997281
build: rearrange and test dependency meta (#1760)
Some checks failed
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Has been cancelled
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Has been cancelled
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Has been cancelled
tinymist::ci / build-binary (push) Has been cancelled
tinymist::ci / build-vsc-assets (push) Has been cancelled
tinymist::ci / build-vscode (push) Has been cancelled
tinymist::ci / build-vscode-others (push) Has been cancelled
tinymist::ci / publish-vscode (push) Has been cancelled
* build: rearrange dependency meta

* feat: add feature testing about typlite

* dev: reorder
2025-05-14 14:45:43 +08:00
Hong Jiarong
28d416b852
fix: enhance error handling (#1758) 2025-05-14 13:43:40 +08:00
Myriad-Dreamin
5bf177637a
fix: stop hash expressions before "operators" (#1756)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: distinguish markup math and code math

* fix: stop hash expressions before "operators"

* fix: corner cases
2025-05-13 18:06:19 +08:00
Myriad-Dreamin
7e54270bda
fix: terminate many expressions before dollar (#1755) 2025-05-13 17:10:39 +08:00
sjfhsjfh
864f8aed2a
fix: stop parsing markup call before math dollar (#1752)
* fix(WIP, textmate): split math markup with shorthand

* test: add snapshot

* dev: revert changes

* fix: terminate markup call before math end

* fix: remove changes

* fix: remove changes

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-05-13 16:56:14 +08:00
Myriad-Dreamin
8b0cef92b9
feat(typlite): print diagnostics (#1753)
* feat: print diagnostics

* fix: rebase errors
2025-05-13 16:26:28 +08:00
Hong Jiarong
58b5df97e1
feat(typlite): add plain text output support (#1731)
* feat: add plain text output support

* fix: correct task chaining in Typlite implementation

* feat: add process-math-eq function for improved math equation handling

* fix: simplify ordered and unordered list output formatting

* tests: update insta

* 更新 media.rs

* 更新 media.rs

* fix: expose a bit and remove unused deps

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-05-13 11:58:26 +08:00
Myriad-Dreamin
38974a3b5e
feat: autofix unknown variable: a and file not found (searched at a.typ) by code action (#1743)
* feat: check context

* feat: implement it

* fix: warnings

* test: update snapshot
2025-05-09 23:44:12 +08:00
Myriad-Dreamin
d6d3766b6f
feat: add command to profile the entire server (#1438)
* feat: declare and bind tinymist.profileServer command

* feat: editor bridge with the frontend

* feat: start and stop server profiling

* feat: add profile-server prototype (#1440)

* Add profile-server prototype

* fix: use branch

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* feat: make it good

* build: update cargo.lock

* dev: ls profile impl and hook

* test: update snapshot

---------

Co-authored-by: Derived Cat <hooyuser@outlook.com>
2025-05-09 15:29:24 +08:00
Myriad-Dreamin
890ecd93a5
fix: checkout repository in publish step to get yarn.lock (#1722) 2025-05-06 15:48:59 +08:00
Myriad-Dreamin
4ded5a624a
feat: forbid signature help in some cases (#1742)
* feat: forbid signature help in some cases

* test: update snapshot
2025-05-06 14:55:24 +08:00
Myriad-Dreamin
29893aa15f
fix: escape snippet syntax in the completing code (#1741) 2025-05-06 11:38:35 +08:00
Myriad-Dreamin
90efb38c7e
feat: only complete if the next line is a function definition (#1740)
* test: add `paper.typ` for e2e testing

* feat: only complete if the next line is a function definition
2025-05-05 18:40:52 +08:00
Myriad-Dreamin
8f0d9c25d7
feat: re-identify ref colon syntax and perform IDE operations (#1735)
* test: add cases about ref syntax

* feat: re-identify ref syntax and perform IDE operations
2025-05-03 19:03:07 +08:00
Myriad-Dreamin
e4ed9defb1
refactor: tidy up main and let converter know the target (#1729) 2025-05-01 18:48:29 +08:00
Myriad-Dreamin
d85bd7428a
refactor: remove unused code (#1728) 2025-05-01 17:58:15 +08:00
Myriad-Dreamin
6b7ca47f23
feat: typlite supports docx export (#1727)
* feat: docx impl

Revert "build: remove other cargo deps"

This reverts commit 059b480b1f635d1e8f5be7c191075efcf959b40b.

feat(typlite): Docx export and export markdown in cmark-writer (#1698)

* feat: docx export support

* refactor: simplify DocxConverter structure and improve content handling

* tests: add binary insta for docx

* feat: add MathBlock style and improve frame rendering in DocxConverter

* fix: enhance paragraph creation(silly method)

* fix: enhance math equation rendering

* use md5 instead of docx binary

* feat: enhance list numbering and paragraph handling in DocxConverter

* Refactor DOCX converter to improve list handling and document structure

- Introduced separate methods for creating ordered and unordered list numbering.
- Enhanced list management by tracking next numbering IDs.
- Consolidated paragraph and run management within the DocxConverter.
- Improved image processing with better error handling and placeholder support.
- Streamlined the handling of various HTML elements, including headings, lists, and images.
- Added functionality for processing captions and preformatted blocks.
- Updated methods for processing inline styles and links.

* feat: update cmark-writer to version 0.2.0

* feat: refactor code block handling in DOCX converter for improved readability

* refactor: refactor DOCX converter to enhance document structure

* refactor docx to separated files

* chore: update cmark-writer version to 0.3.0

* fix: ol custom value

* feat: table and grid processing

* use cmark-writer's ast node for consistency

* fix: update snapshot hashes for document generation tests

* fix: add preamble

* update snapshot hashes

* refactor DOCX conversion: Split writer functionality into separate module, enhance image processing, and clean up utility functions

* update comments in LaTeX and Markdown converters for clarity and consistency

* fmt

* delete utils

* feat: support figure node by custom node in cmark-writer

* fix

* fix: frame

* feat: enhance table conversion logic in MarkdownConverter

* refactor: simplify FigureNode implementation by removing CustomNode trait

* chore: update cmark-writer to version 0.5.0

* fix: update figure and raw inline snapshots for consistency

* fix: update snapshot hashes and correct caption reference in markdown.typ

* refactor proj structure

* feat: update CompileArgs to support multiple output files and remove debug option

* docs: update README to clarify usage of multiple output formats and comment out feature section

* remove DocxConverter module

* fix: update snapshots for figure caption, list, outline, and docx generation

* update tests

Co-Authored-By: Hong Jiarong <me@jrhim.com>

* test: docx snapshots

* fix: use old resvg

* feat: make docx opt-in

* fix: image process on our hand

* dev: remove support to rarely used image formats

* feat: use new base64

* test: update snapshot

* fix: dim calc

* fix: dim calc 2

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-05-01 17:23:46 +08:00
Myriad-Dreamin
3ba3211d1a
feat: typlite supports latex export (#1718)
* fix: remove global variable use

* dev: don't ignore rest variants

* feat: latex impl

feat: pass tests

refactor lib.rs to separated files (#1692)

* feat: add all_elements test

* refactor

* reimpl md export in cmark-writer

* feat: add support for highlight tag in MarkdownConverter

* feat: refactor LaTeXConverter to improve element processing and add new methods

* feat: impl assets-path feature and add ExternalFrameNode for handling external frames and update writers to support it

* feat: enhance HTML element conversion to include attributes and children handling

* feat: update cmark-writer to 0.6.1 and refactor related code

* feat: refactor HTML element conversion to use create_html_element method and enhance table processing

* fix

* feat: add HighlightNode for highlighted text and integrate with HTML to AST parser and LaTeX writer

* refactoor

refactor: simplify MarkdownDocument structure and parsing logic (#1724)

Co-Authored-By: Hong Jiarong <me@jrhim.com>

* feat: snapshot latex

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-05-01 16:16:43 +08:00
Myriad-Dreamin
33a9ea6088
fix: tests broken by new typlite (#1720)
* Revert "test: update bad snapshot"

This reverts commit 7ba7eb1793.

* fix: update cmark-writer to version 0.6.3 and adjust related snapshots (#1721)

* fix: annotate_docs_error and list level, but bring up 2 new errors.. (#1723)

* fix: adjust list level handling in ListParser during conversion

* fix: manually eval instead of include

* fix: annotate_docs_error, but bring up 2 new errors..

* fix: spaces

* fix: example

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* fix: no html

* test: update snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-05-01 15:42:08 +08:00
Myriad-Dreamin
f35d1056ff
feat: reimplement typlite by html export (#1684)
* dev: init markdown file

* dev: typlite element derive

* feat: pass tests

refactor lib.rs to separated files (#1692)

feat(typlite): Docx export and export markdown in cmark-writer (#1698)

* feat: docx export support

* refactor: simplify DocxConverter structure and improve content handling

* tests: add binary insta for docx

* feat: add MathBlock style and improve frame rendering in DocxConverter

* fix: enhance paragraph creation(silly method)

* fix: enhance math equation rendering

* use md5 instead of docx binary

* feat: enhance list numbering and paragraph handling in DocxConverter

* feat: add all_elements test

* refactor

* reimpl md export in cmark-writer

* feat: add support for highlight tag in MarkdownConverter

* feat: refactor LaTeXConverter to improve element processing and add new methods

* fmt

* Refactor DOCX converter to improve list handling and document structure

- Introduced separate methods for creating ordered and unordered list numbering.
- Enhanced list management by tracking next numbering IDs.
- Consolidated paragraph and run management within the DocxConverter.
- Improved image processing with better error handling and placeholder support.
- Streamlined the handling of various HTML elements, including headings, lists, and images.
- Added functionality for processing captions and preformatted blocks.
- Updated methods for processing inline styles and links.

* feat: update cmark-writer to version 0.2.0

* feat: refactor code block handling in DOCX converter for improved readability

* refactor: refactor DOCX converter to enhance document structure

* refactor docx to separated files

* update instas

* fmt

* chore: update cmark-writer version to 0.3.0

* fix: ol custom value

* feat: table and grid processing

* use cmark-writer's ast node for consistency

* fix: update snapshot hashes for document generation tests

* fix: add preamble

* update snapshot hashes

* refactor DOCX conversion: Split writer functionality into separate module, enhance image processing, and clean up utility functions

* update comments in LaTeX and Markdown converters for clarity and consistency

* fmt

* delete utils

* feat: support figure node by custom node in cmark-writer

* fix

* fix: frame

* feat: enhance table conversion logic in MarkdownConverter

* refactor: simplify FigureNode implementation by removing CustomNode trait

* chore: update cmark-writer to version 0.5.0

* fix: update figure and raw inline snapshots for consistency

* fix: update snapshot hashes and correct caption reference in markdown.typ

* refactor proj structure

* feat: update CompileArgs to support multiple output files and remove debug option

* docs: update README to clarify usage of multiple output formats and comment out feature section

* remove DocxConverter module

* feat: impl assets-path feature and add ExternalFrameNode for handling external frames and update writers to support it

* feat: enhance HTML element conversion to include attributes and children handling

* feat: update cmark-writer to 0.6.1 and refactor related code

* fix: update snapshots for figure caption, list, outline, and docx generation

* feat: refactor HTML element conversion to use create_html_element method and enhance table processing

* fix

* feat: add HighlightNode for highlighted text and integrate with HTML to AST parser and LaTeX writer

* refactoor

* update tests

Co-Authored-By: Hong Jiarong <me@jrhim.com>

* feat: revert latex/docx conversions

* fix: warnings

* bad: convert docs

* build: remove other cargo deps

* build: update cargo.lock

* test: update snapshot

* chore: remove useless parser trait

* feat: annotate v1

* feat: annotate v2

* test: update snapshot

* question: is it a bug?

* test: update bad snapshot

---------

Co-authored-by: Hong Jiarong <me@jrhim.com>
2025-04-30 22:12:25 +08:00
Myriad-Dreamin
170dd7b948
fix: don't count dedent on the empty comment lines (#1690)
* fix: don't count dedent on the empty comment lines

* fix: more tests

* test: update snapshot
2025-04-30 21:47:07 +08:00
Myriad-Dreamin
3103f3933c
test(typlite): add more cases (#1719)
* test: add more cases

* test: update snapshot
2025-04-30 21:36:54 +08:00
Myriad-Dreamin
c66d2996dd
test: typlite use snapshot_testing (#1717)
* feat: use snapshot_test

* test: add snapshots
2025-04-30 20:31:02 +08:00
Myriad-Dreamin
647cda29a0
dev: split test functions for multiple crates (#1695)
* dev: split test functions for multiple crates

* build: update cargo.lock

* fix: compile error
2025-04-30 19:01:29 +08:00
Myriad-Dreamin
1108b39e3f
feat(ci): setup and cache minimal toolchain (#1683)
* feat(ci): setup and cache minimal toolchain

* dev: components

* fix: broken rpds

* fix: edition 2024??
2025-04-30 17:45:13 +08:00
Luyan Zhou
6118b346d6
feat: add path conversion actions for absolute and relative paths (#1696)
* feat: add path conversion actions for absolute and relative paths in special function call

* feat: implement matchers

* docs: edit comment

* fix: path on windows

* feat: add a comment

* dev: edit a bit

* dev: use `resolved`

* refactor: simplify path rewriting logic using `diff`

* feat: add absolute path import fixture

* fix: update path check for absolute paths to use `starts_with` to work with windows

* feat: add path expression import fixture

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-30 17:15:42 +08:00
Myriad-Dreamin
11cfb08be5
docs: update readme (#1716) 2025-04-30 16:55:16 +08:00
Myriad-Dreamin
4871cd3917
build: bump version to 0.13.12 (#1715)
* docs: update changelog

* build: bump version to 0.13.12

* build: bump assets  to v0.13.12
2025-04-30 14:45:23 +08:00
Myriad-Dreamin
c869cde2c5
docs: update readme and docs about linting (#1714)
* docs: update readme about linting

* docs: update documentation
2025-04-30 14:40:36 +08:00
Myriad-Dreamin
0552d4bb4f
build: bump version to 0.13.12-rc6 (#1713)
* fix: sync-ls warnings

* build: bump version to 0.13.12-rc6

* fix: lint config bug

* build: fix assets ver

* feat: bump asset crate
2025-04-30 13:53:28 +08:00
Myriad-Dreamin
48976dd1dd
fix: sync-ls warnings (#1711) 2025-04-30 02:39:56 +08:00
Myriad-Dreamin
f4a6d2b271
build: bump version to 0.13.12-rc5 (#1710)
* build: bump version to 0.13.12-rc5

* build: bump assets to v0.13.12-rc5

* docs: edit changelog
2025-04-30 02:09:28 +08:00
Myriad-Dreamin
9a91e77ee9
feat: add memory registry (#1709) 2025-04-30 01:49:11 +08:00
Myriad-Dreamin
7df144ccff
feat: disable linting by default (#1708) 2025-04-29 22:15:34 +08:00
Myriad-Dreamin
f33ea4913c
build: bump typst.ts to v0.6.0-rc1 (#1707)
* build: bump typst.ts to v0.6.0-rc1

* build: update lock and docs
2025-04-29 12:46:16 +08:00
Myriad-Dreamin
f503298f48
feat: model and make reset_read public (#1705) 2025-04-25 21:24:59 +08:00
Myriad-Dreamin
042fc2a477
feat: forbid weird embedded font uses and make toml dep optional (#1701)
* cg

* fix: forbid weird embedded

* feat: optional toml
2025-04-25 17:56:17 +08:00
Luyan Zhou
2b3eb252f0
fix: built-in CSL styles are recognized as path link (#1704) 2025-04-25 13:42:02 +08:00
Luyan Zhou
3520c90244
fix: correct parameter name in diff function for clarity (#1700)
* fix: correct parameter name in `diff` function for clarity

* fix: update parameter names in `diff` function for clarity
2025-04-23 17:26:42 +08:00
Myriad-Dreamin
84569fb98c
refactor: update comments and refactor (#1694)
* docs: update comments

* docs: refactor
2025-04-21 18:48:25 +08:00
Patrick Dewey
5ee874d6b3
docs: change pinning to use non-deprecated function client:exec (#1678)
* docs: Update pinning commands to use non-deprecated function `client:exec`

* dev: update tinymist.lua

* docs: update comment

* docs: remove redundant config code block

* build: edit a bit and update readme

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-21 18:00:17 +08:00
Myriad-Dreamin
bef0f839e2
feat: update docs and remove unnecessary shared access model (#1693) 2025-04-21 17:35:36 +08:00
Myriad-Dreamin
670f2713a5
docs: update sync-ls comments (#1689)
* docs: update `sync-ls` comments

* fix: fmt
2025-04-20 16:42:42 +08:00
Myriad-Dreamin
e26d817b79
feat: optionally make symbol completion stepless (#1313)
* feat: support to steplessly complete symbols

* fix: default enum

* feat: implement it

* fix: bad nest

* dev: order

* fix: modifier
2025-04-19 11:32:53 +08:00
Myriad-Dreamin
258cf85601
dev(ci): restrict patterns to release (#1682) 2025-04-18 04:10:54 +08:00
Myriad-Dreamin
d3134926e5
fix: fix warnings in publish dry runs (#1681) 2025-04-18 03:42:49 +08:00
Myriad-Dreamin
923155a2e2
build: bump version to 0.13.12-rc4 (#1680) 2025-04-18 02:40:51 +08:00
Myriad-Dreamin
dddae6f549
fix: build arm-unknown-linux-gnueabihf (#1679)
* fix: build arm-unknown-linux-gnueabihf

* fix: runner
2025-04-18 02:19:57 +08:00
Myriad-Dreamin
8f4f07673f
build: bump version to 0.13.12-rc3 (#1676)
* build: bump version to 0.13.12-rc3

* build: update assets
2025-04-17 20:23:38 +08:00
Myriad-Dreamin
94416c4b5d
fix: errors in ci scripts (#1675)
* fix: order to publish

* fix: bad build binary

* test: update it
2025-04-17 19:16:14 +08:00
Myriad-Dreamin
a3758038ee
build: bump version to 0.13.12-rc2 (#1674)
* build: bump version to v0.13.12-rc2

* build: update targets

* build: update assets

* fix: warning
2025-04-17 17:02:34 +08:00
Myriad-Dreamin
c4090158b1
feat: tries to publish tinymist to crates.io (#1667)
* feat: publish tinymist to crates.io

* fix: first attempt is failed

* fix: first attempt is failed

* fix: the block is assumed to be used in block expressions
2025-04-17 16:57:38 +08:00
Myriad-Dreamin
d5aad257e7
build: bump version to 0.13.12-rc1 (#1669)
* docs: update changelog

* docs: update changelog

* build: bump version to v0.13.12-rc1

* build: update assets
2025-04-17 15:35:03 +08:00
Patrick Dewey
8dff9b953e
docs: fix syntax error in Neovim docs (#1672)
* docs: Fix syntax error in Neovim docs

* build: update readme

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-17 14:34:20 +08:00
Myriad-Dreamin
2345607df7
fix: vscode check command (#1665) 2025-04-17 13:54:22 +08:00
Myriad-Dreamin
fc5757a5bc
feat: delay doc switch (#1662) 2025-04-17 02:34:38 +08:00
Myriad-Dreamin
b56ba42984
fix: the block is assumed to be used in expressions (#1668) 2025-04-16 18:47:08 +08:00
Myriad-Dreamin
84c211c7eb
feat: extract package implementation (#1647)
* feat: extract registry implementation

* feat: tinymist package

* fix: guard

* fix: guard 2

* feat: no specifier

* fix: temp_dir_in impl

* fix: impls

* feat: UniversePack::new

* feat: clone into memory

* feat: implement some pack for testing

* build: update cargo.lock

* feat: fit for web

* fix: guard
2025-04-16 18:19:03 +08:00
Myriad-Dreamin
9d1007a4f3
feat: refactor and add page count for the status bar format (#1666)
* feat: refactor and add page count for the status bar format

* chore: edit code style

* chore: edit code style

* chore: edit code style

* chore: edit code style

* chore: edit code style
2025-04-16 17:45:53 +08:00
Myriad-Dreamin
212c575415
docs: update configuration.md (#1660) 2025-04-16 16:45:58 +08:00
Myriad-Dreamin
14f0a20ed6
fix: value used by exprs are not warned (#1664) 2025-04-16 15:37:11 +08:00
Myriad-Dreamin
4d13734fed
feat: clean up log and watch lints (#1659) 2025-04-16 15:02:49 +08:00
Myriad-Dreamin
92c5e40abd
feat: resolve roots of typst packages (#1663) 2025-04-16 13:51:33 +08:00
Myriad-Dreamin
979e0b2a55
fix: bad root change cause incorrect vfs cache frequently (#1661) 2025-04-16 12:54:34 +08:00
Myriad-Dreamin
2709aaf429
feat: allow to disable lint or lint on save (#1658)
* feat: allow to disable lint or lint on save

* fix: description
2025-04-16 03:15:56 +08:00
Myriad-Dreamin
39d13c83f6
refactor: simplify world font impl and add docs (#1645)
* fix: remove unnecessary &mut in FontResolverImpl::append_font()

* refactor: better readablity in FontResolverImpl::rebuild()

* feat: FontResovlerImpl::clone_and_rebuild()

Change FontSlot to store Arc to QueryRef<Font, FontLoader>, so we can
clone FontSlot and share the cached loaded font between different slots.

Since CompilerUniverse only holds a immutable Arc to FontResovlerImpl,
adding clone_and_rebuild method allow us to append and rebuild without
mutable access to FontResovlerImpl.

* refactor: remove partial_book and modify methods from FontResolverImpl

partial_book is removed from FontResolverImpl, all the modifying methods
are also removed.
new method get_fonts and new_with_fonts are added.
If you want to modify fonts, you can get all fonts and modify them, then
call new_with_fonts to create a new FontResolverImpl.

* refactor: SystemFontSearch, BrowserFontSearch

- Both font searcher now is just a wrapper for Vec<(FontInfo,
  FontSlot)>, typst::FontBook will be built when converting into
  FontResolverImpl.

- Provide a method with_fonts_mut() so user can get a direct mutable
  access to the under lying fonts vector to do any changes.

- Support searcher -> resolver and resolver -> searcher conversion.

* refactor: api change to biulder pattern

Method new_with_resolver() is added since CompilerUniverse only holds
Arc reference to resolver, and we can't move it out.

* fix: add fontdb::Database to SystemFontSearcher

Store fonts info in db, load them in bulk when calling flush()

* chore: merge `FontResolverImpl` and `TinymistFontResolver`

* feat: remove font profile feature

* feat: remove project font

* docs: comment the font resolver trait

* docs: comment the font slot struct

* docs: comment the crate

* test: move system tests

* dev: clean resolver

* dev: clean searchers

* dev: clean par iters

* feat: enrich memory font resolver

* todo: useless reuse

* dev: remove reuse api

* dev: build font book in `fn build`

* fix: make clippy happy

* fix: bad use

---------

Co-authored-by: c0per <60544162+c0per@users.noreply.github.com>
2025-04-15 22:23:13 +08:00
Kilian
031b56205b
feat: add reasonable default value for setting formatterMode (#1655) 2025-04-15 22:22:52 +08:00
Myriad-Dreamin
3d6c712565
feat: pass world to linter (#1650) 2025-04-14 21:37:29 +08:00
Wenzhuo Liu
9c98876dfb
chore: update typstyle-core version to 0.13.3 (#1651) 2025-04-14 21:04:19 +08:00
Wenzhuo Liu
58ec6ab1e1
feat(lint): add warning for vf font (#1649)
* feat(lint): add warning for vf font

* feat: detect font object

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-12 20:55:39 +08:00
zica
1cd566aedc
fix: in preview, click on empty area now clears selection (#1644)
also fix selection disappears temporarily while dragging
2025-04-12 03:46:55 +08:00
QuadnucYard
a7a22c0d70
feat: show rendered bibliography in bib hover and improve label hover (#1611)
* feat: show rendered bibliography in citation details

* adjust code and revert changes to completions

* refactor: refactor a bit

* refactor: refactor two bit

* feat: improve hover docs a bit

* test: add hover tests for label and ref

* test: add html tests

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-11 17:29:03 +08:00
Myriad-Dreamin
4265bc25bc
feat: simple lint types comparing with strings (#1643)
* feat: simple lint types comparing with strings

* dev: edit message

* fix: message
2025-04-10 20:02:56 +08:00
Myriad-Dreamin
23f10a2648
feat: lint ignored statements before break/continue/return (#1637)
* feat: impl it

* g

* g2

* feat: add tests

* fix: snapshot
2025-04-09 18:17:46 +08:00
Myriad-Dreamin
6cf7739fb6
feat: feed more information to linter (#1642)
* feat: move expr struct to common crate

* feat: feed more information to linter
2025-04-09 16:57:33 +08:00
Myriad-Dreamin
fcb060280d
fix: bad route to reference pages (#1641)
* test: add tests

* fix: bad route
2025-04-09 05:08:47 +08:00
Patrick Dewey
5c6d9a5dee
docs: Update Neovim config to use non-blocking system call (#1607)
* doc: Update Neovim config to use non-blocking system call

* docs: Update Neovim config to use non-blocking system call--mention issue in comment on older versions

* docs: turn comments out of code block

* fix: word

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-04-09 04:35:23 +08:00
Myriad-Dreamin
054d3aecc0
refactor: prepare for linting on syntaxes (#1640)
* refactor: for query

* refactor: for diag

* feat: lazy hash expr info

* feat: hash resolves

* fix: update snapshot
2025-04-09 04:10:47 +08:00
Myriad-Dreamin
01afa463f4
fix: don't highlight breaks in contextual (#1635) 2025-04-08 11:55:40 +08:00
Myriad-Dreamin
d6bce89e68
feat: lint on bug-like show/set rules (#1634)
* feat: init linter

* feat: init structure

* feat: init tests

* feat: warn on bad set rules

* feat: refactor struct

* feat: run check

* chore: update message

* chore: add hints
2025-04-08 07:36:03 +08:00
Myriad-Dreamin
ac506dcc31
refactor: move expr and ty defs to analysis crate (#1633) 2025-04-08 05:50:55 +08:00
Myriad-Dreamin
72e33e461d
refactor: remove once_cell use from tinymist (#1632)
* refactor: remove `once_cell` use from tinymist

* feat: remove more
2025-04-08 02:11:44 +08:00
Myriad-Dreamin
769fc93df9
fix: remove system time deps from crates (#1621)
* fix: remove system time deps from crates

* fix: remove system time deps from crates

* fix: smater feature gate

* docs: add some todos

* Update time.rs

* Update Cargo.toml

* build: remove hard dep chrono
2025-04-08 01:46:05 +08:00
Myriad-Dreamin
35b718452e
feat: scroll or kill all preview panels (#1451)
* feat: scroll or kill all preview panels

* feat: implement it

* docs: update comment
2025-04-07 22:04:55 +08:00
Myriad-Dreamin
d3bcef5fd9
docs: update localization and maintainers section (#1629)
* docs: update localization and maintainers section

* build: generate docs
2025-04-06 22:18:50 +08:00
Myriad-Dreamin
e3f41f81ef
feat: check field of literals (#1619)
* feat: check field of literals

* test: add more tests

* test: update snapshot
2025-04-06 20:33:26 +08:00
Myriad-Dreamin
7f5bb5dc45
feat: resolve full ranges of bib items (#1627)
* feat: resolve full ranges of bib items

* chore: update todo
2025-04-04 17:06:09 +08:00
Myriad-Dreamin
04c013f3a4
dev: add Definition::file_id (#1626) 2025-04-04 16:08:38 +08:00
Myriad-Dreamin
ec5be5d2b0
fix: sync-ls doesn't have target feature (#1625) 2025-04-04 15:34:15 +08:00
Myriad-Dreamin
bceb93b944
fix: correct name_range impl (#1623) 2025-04-04 06:25:21 +08:00
Myriad-Dreamin
d7424abed8
docs: add sponsoring section to readme (#1620)
* docs: add sponsoring section to readme

* build: generate readme

* docs: wording

* docs: wording also mention contributors

* docs: wording also mention contributors
2025-04-02 15:20:53 +08:00
Myriad-Dreamin
59fda809d5
feat: provide AST view (#1617)
* feat: provide AST view

* test: update snapshot
2025-04-02 13:24:35 +08:00
Myriad-Dreamin
195b717eda
feat: math quote are not strings (#1618) 2025-04-02 12:32:02 +08:00
Myriad-Dreamin
d0c5b28d26
feat: cache yarn packages (#1615) 2025-04-02 10:19:53 +08:00
Myriad-Dreamin
677983075d
build: hard disable targets to build on CI (#1613)
* build: hard disable targets to build on CI

* feat: remove x86 darwin e2e
2025-04-01 17:58:50 +08:00
Myriad-Dreamin
03a30f241e
feat: reduce deps of the tests crate (#1612)
* feat: reduce deps of the tests crate

* feat: reduce deps of the tests crate (2)
2025-04-01 16:42:25 +08:00
Myriad-Dreamin
64044ea514
feat: use html export to render docs (#1610)
* feat: use html export to render docs

* feat: merge page
2025-03-31 22:32:04 +08:00
Myriad-Dreamin
b97335c0ef
fix: order to publish crates (#1609)
* fix: order to publish crates

* fix: bad version
2025-03-31 17:03:26 +08:00
Myriad-Dreamin
71116758ef
build: bump world crates to 0.13.12-rc1 (#1608)
* refactor: move `debug_loc`

* build: fix rev

* build: bump tinymist inner version

* build: bump tinymist world version

* build: bump world crates to 0.13.12-rc1

* fix: used bad patch

* fix: clippy errors
2025-03-31 16:01:51 +08:00
Myriad-Dreamin
4844419bd8
fix: tolerate the fact that plugin functions don't have params (#1605) 2025-03-31 10:24:48 +08:00
QuadnucYard
daf0c5381b
build: bump typstyle to 0.13.2 (#1600)
* build: bump typstyle to 0.13.2

* Update CHANGELOG.md

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-03-30 23:21:37 +08:00
Luyan Zhou
e6c0a9b10d
feat: fold list and enum items (#1598)
* feat: fold list and enum item content

* chore: format code

* feat: add new fixtures for folding range tests with list and enum structures

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-03-30 22:17:27 +08:00
Myriad-Dreamin
53ceba2801
refactor: bib worker (#1585)
* refactor: bib worker

* fix: stupid slash
2025-03-30 21:47:06 +08:00
QuadnucYard
7b74506dcc
feat: remove extra linebreak in diagnostic message (#1599) 2025-03-30 21:03:44 +08:00
Myriad-Dreamin
d49695b884
fix: disable all diagnostics testing on windows (#1603) 2025-03-30 21:03:09 +08:00
Myriad-Dreamin
96e0f0dfe6
fix: skip diagnostics test on windows (#1602)
* fix: skip diagnostics test on windows

* fix: again
2025-03-30 19:06:56 +08:00
zica
9376b89b08
fix: allow drag preview horizontally (#1597) 2025-03-28 20:14:34 +08:00
Myriad-Dreamin
90f9949f8c
feat: support --feature and --pdf-standard. (#1596) 2025-03-28 17:42:03 +08:00
Myriad-Dreamin
e443c3172b
feat: build pdf docs for all platforms (#1592)
* feat: build pdf docs for all platforms

* fix: name

* feat: others

* feat: remove dispatch trigger

* fix: checkout

* fix: workaround the bug

* feat: build one for all

* feat: build one for all

* feat: build one for all 2

* fix: bundle syntaxes

* fix: orders

* fix: too slow windows
2025-03-27 18:43:13 +08:00
Myriad-Dreamin
c33542739c
feat: hot update editor actor config (#1584)
* feat: hot update editor actor config

* feat: apply update
2025-03-27 17:05:18 +08:00
Myriad-Dreamin
8c4bfe21c7
feat: run e2e tests on major platforms (#1590)
* feat: run e2e tests on major platforms

* fix: conflict snapshot
2025-03-27 11:33:25 +08:00
Myriad-Dreamin
c234e86070
feat(ci): vscode extensions use binaries built by cargo-dist (#1560)
* build: rename filename of vscode workflow

* build: archive

* dev: permissions

* fix: cache name

* fix: ci file name

* edit

* edit2

* fix: release crates rule

* fix: announce permission

* fix: publish permission

* fix: errors

* fix: ???

* fix: cargo test

* chore: rename

* feat: upgrade ubuntu version

* feat: upgrade cargo-dist

* feat: upgrade cargo-dist

* feat: pr run with tag be `''`

* feat: upload

* feat: upgrade cargo-dist??

* feat: fix workflow

* fix: announce deps

* fix: permission

* fix: dir to download

* fix: unpack

* fix: unpack 2

* fix: list command

* fix: executable name

* fix: executable name 2

* fix: executable name 3

* fix: executable name 4

* fix: remove the macos e2e test challenge

* fix: prebuilt location

* fix: compile arguments
2025-03-27 04:20:58 +08:00
Myriad-Dreamin
41f8881e8e
fix: correct jump_from_cursor and add tests (#1589)
* test: add tests to jump from cursor

* fix: fuzzy search

* fix: stupid filter

* docs: add comments

* docs: add some todos

* fix: comment wording

* dev: add a todo

* dev: edit a todo

* fix: comment
2025-03-27 01:44:49 +08:00
Myriad-Dreamin
ee1c0ace46
refactor: order of functions in link expression (#1583) 2025-03-26 14:13:50 +08:00
Myriad-Dreamin
e4a4fc568f
fix: correct rename on unix platforms caused by pathdiff#8 (#1587)
* fix: correct rename on unix platforms caused by pathdiff#8

* fix: ensure all calls to pathdiff

* fix: names

* fix: file path on windows
2025-03-26 12:46:33 +08:00
7mile
c102ace9ab
feat: use atomic file writing for export (#1586)
* feat: use atomic file writing for export

* chore: refactor

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-03-26 12:13:31 +08:00
Myriad-Dreamin
d4fffe3543
fix: resolve relative path in subfolders (#1574) 2025-03-26 11:10:51 +08:00
Myriad-Dreamin
9790153381
refactor: clean up the tool::preview crate (#1582) 2025-03-25 17:21:57 +08:00
Myriad-Dreamin
10ec787cc9
dev: stateful requests now accept snapshot (#1581)
* dev: stateful requests now accept snapshot

* dev: add some convenient methods

* dev: remove unused latest_doc state

* dev: use graph

* docs: comment

* fix: bad flag
2025-03-25 16:28:00 +08:00
7mile
5b42231a77
feat: eject preview panel to browser (#1575)
* feat: eject preview panel to browser

* refactor global state

* fix typo for kind

* await kill preview

* add isNotPrimary launch option

* fix isNotPrimary for eject

* fix async syntax error in compat
2025-03-25 13:40:32 +08:00
Myriad-Dreamin
9d38c8fd38
fix: prereleas flag faked us (#1573) 2025-03-25 12:43:13 +08:00
Myriad-Dreamin
6ea14bb180
build: bump version to 0.13.10 (#1572)
* feat: expose the test command

* docs: edit CLI and testing sections

* docs: edit changelog

* build: bump version to v0.13.10

* build: bump assets to v0.13.10
2025-03-23 16:46:30 +08:00
Myriad-Dreamin
553b53e173
fix: broken ask and show/export commands (#1571) 2025-03-23 15:57:06 +08:00
Myriad-Dreamin
6f945c0c80
feat: make test dashboard optional (#1568) 2025-03-23 14:12:29 +08:00
Myriad-Dreamin
97bcc486fd
build: bump version to 0.13.10-rc2 (#1566)
* build: bump version to 0.13.10-rc2

* build: update changelog

* build: set typst tag to v0.13.10 (typst v0.13.1)

* fix: bugged tag

* build: update assets
2025-03-21 16:40:49 +08:00
Myriad-Dreamin
87651913af
fix: correct bound self checking (#1564) 2025-03-21 14:40:07 +08:00
Myriad-Dreamin
af78414788
fix: replace last scope when checking import wildcard (#1563)
* fix: replace last scope when checking import wildcard

* test: add some tests
2025-03-21 13:31:25 +08:00
Myriad-Dreamin
d86205d181
fix: downgrade notify to v6 (#1562) 2025-03-21 12:27:14 +08:00
Myriad-Dreamin
10c8fa8852
feat: exclude a bunch of files from watching memory change (#1554) 2025-03-21 09:31:35 +08:00
Myriad-Dreamin
ff920b1a96
chore: update zed configuration (#1548) 2025-03-21 00:27:55 +08:00
Myriad-Dreamin
92e9f797de
feat: don't trigger parameter hints when skipping parameters (#1557)
* build: record command in completion snapshots

* feat: don't trigger parameter hints when skipping parameters

* test: update snapshot
2025-03-20 21:53:38 +08:00
Myriad-Dreamin
27c31c7238
feat: forbid bad postfix completion in math mode (#1556) 2025-03-20 20:30:47 +08:00
Myriad-Dreamin
67c4e6e24c
feat: bump cargo-dist to v0.28.0-tinymist.2 (#1555)
* feat: bump cargo-dist to 0.28.0-tinymist.2

* feat: upgrade tempfile to 3.19.1
2025-03-20 19:51:50 +08:00
Myriad-Dreamin
e33688336d
feat: forbid bad field access syntax in math mode (#1550) 2025-03-20 19:44:28 +08:00
Myriad-Dreamin
f555fc3840
test: add vscode e2e testing for export feature (#1553)
* test: add vscode e2e testing for export feature

* fix: tests
2025-03-20 19:21:29 +08:00
Myriad-Dreamin
92bb24b4ac
feat: configure word pattern to exclude -A like words (#1552) 2025-03-20 18:52:36 +08:00
Myriad-Dreamin
3ae8b01325
feat: use quick exports in code lens context (#1551)
* feat: move export commands to the module

* feat: use quick exports in code lens context
2025-03-20 18:31:04 +08:00
Myriad-Dreamin
d4f00b86b0
feat: export to format regardless of export target (#1549)
* feat: export to format regardless of export target

* chore: move todo comment
2025-03-20 17:11:55 +08:00
Myriad-Dreamin
fadf85e68a
feat: make all export available by commands (#1547) 2025-03-20 16:18:13 +08:00
Myriad-Dreamin
1039e6f4fe
feat: publish tinymist-l10n and use ubuntu-latest runner (#1543) 2025-03-20 15:48:09 +08:00
7mile
8d9a8f8bed
feat: fledge diagnostic hint patterns by updating 2 refiners (#1544)
* feat: support more diagnostic hint patterns about typst v0.13 deprecation

* feat: add out of root hint diagnostic refiner

* optimize multi-pattern search with `RegexSet`

* add "cannot spread content"

* fix test

* Revert "add "cannot spread content""

This reverts commit 7d6c981413.
2025-03-20 14:30:35 +08:00
Myriad-Dreamin
766a41f4d5
build: bump version to 0.13.10-rc1 (#1540)
* docs: edit changelog

* build: bump version to 0.13.10-rc1

* build: bump typst to 0.13.1

* build: pre-rc1

* build: build with l10n

* build: lock version
2025-03-19 17:14:53 +08:00
Myriad-Dreamin
fd7fa57925
test: a hard hint about missing binary for e2e tests (#1541) 2025-03-19 16:55:43 +08:00
7mile
57ce935f54
feat: add diagnostics refiner to provide extra hints from tinymist side (#1539)
* feat: add diagnostics refiner to provide extra information from tinymist side

* apply naming suggestion

* add note for caching

* fix the migration guide url

* reorganize tests

* fix clippy
2025-03-19 16:19:42 +08:00
Myriad-Dreamin
88eeef978d
feat: don't override single_file_support in tinymist.lua (#1524)
e35fd81524
2025-03-19 14:26:54 +08:00
Myriad-Dreamin
13fb22f4fa
feat: downgrade some config errors and show warnings (#1538) 2025-03-19 13:30:00 +08:00
Myriad-Dreamin
9b9a674118
fix: revert the explicit detection again (#1525)
* fix: revert the explicit detection again

* test: revert the snapshot

* test: add more tests
2025-03-19 13:07:10 +08:00
Myriad-Dreamin
5ebc7224e4
feat: add zed configuration (#1537)
* feat: add zed configuration

* feat: update linguist info
2025-03-19 12:58:21 +08:00
Myriad-Dreamin
c8c891fbc3
feat: pass tests if warnings happens (#1535) 2025-03-19 12:02:40 +08:00
Myriad-Dreamin
4bb16b5b93
feat: watch tests and print test information (#1534)
* feat: test watch support

* feat: terminal printer

* feat: print coverage

* feat: update docs
2025-03-18 16:13:08 +08:00
Myriad-Dreamin
4e8959851a
fix: example output (#1533) 2025-03-18 14:01:23 +08:00
Myriad-Dreamin
157703ef67
docs: update description about testing (#1532) 2025-03-18 00:11:13 +08:00
Myriad-Dreamin
b4e5f4ff62
feat: add test framework with coverage support (#1518)
* feat: test framework with coverage support

* feat: clean up

* fix: dangling else block

* feat: implement show set

* feat: implement show replace content

* feat: compare framework

* feat: preserve extension

* feat: exit 1 if failed testing

* docs: update docs about it

* docs: wording

* docs: wording

* docs: wording
2025-03-17 22:41:33 +08:00
Myriad-Dreamin
c67b2020e5
refactor: clean up the config crate (#1528)
* feat: clean up config crates

* refactor: reorder config items

* refactor: a bit
2025-03-17 20:04:25 +08:00
Myriad-Dreamin
6a5bea8bcf
feat: add instrument-based breakpoints support to dap (#1529)
* dev: clean up debug crate

* feat: instrument support

* feat: evaluate infra
2025-03-17 18:19:31 +08:00
Myriad-Dreamin
42fd5d3bc9
feat: use window/showDocument to show previewing document (#1450)
* feat: use `window/showDocument` to show previewing document

* feat: implement it

* feat: take focus
2025-03-17 17:52:59 +08:00
Myriad-Dreamin
c65b69be26
refactor: remove useless "feature" in the activate functions (#1526) 2025-03-17 16:35:38 +08:00
Myriad-Dreamin
7fb81604be
feat: paste uri smartly (#1500) 2025-03-17 16:00:11 +08:00
Myriad-Dreamin
8a8cac096e
feat: implement debugging console (#1445)
* feat: dap server parts

* dev: remove comments

* feat: dap client parts

* fix: test
2025-03-17 13:06:22 +08:00
Myriad-Dreamin
b5a629435a
feat: download font assets for compiling pdf docs (#1511)
* feat: download font assets for compiling pdf docs

* fix: gate
2025-03-17 12:51:02 +08:00
Myriad-Dreamin
1b5d4ac786
refactor: split testing feature code (#1523) 2025-03-17 12:06:38 +08:00
Andrew Voynov
47410c89e8
build: fix docs:typ using wrong root dir (#1522) 2025-03-17 10:54:50 +08:00
Andrew Voynov
1e9fea0337
docs: fix Neovim name casing everywhere (#1520) 2025-03-17 10:12:06 +08:00
Myriad-Dreamin
b2e9d7bbcd
feat: implements dap-server scaffold (#1517)
* feat: implements dap-server scaffold

* dev: revert

* fix: diagnostics is only available when typst is enabled

* feat: proper feature gating and testing

* feat: reduce dep and publish sync-ls

* docs: update readme

* fix: compile error

* fix: permission

* fix: examples

* fix: doc example
2025-03-17 09:33:59 +08:00
Myriad-Dreamin
520a26f088
feat: split config crate (#1516) 2025-03-16 17:33:41 +08:00
Myriad-Dreamin
ffb8ebd52f
chore: update workflow files (#1513) 2025-03-16 16:41:13 +08:00
Myriad-Dreamin
478842c6bc
feat: exit if compile errors happen (#1512) 2025-03-16 16:41:04 +08:00
Myriad-Dreamin
3d83885778
feat: improve the export error message (#1510) 2025-03-15 21:43:34 +08:00
Myriad-Dreamin
36bc5226ba
feat: improve the error formatting (#1509) 2025-03-15 14:31:17 +08:00
Myriad-Dreamin
bc5960ec39
feat: support l10n message with arguments (#1508)
* feat: support l10n message with arguments

* dev: edit message

* dev: edit message

* fix: message error
2025-03-15 12:50:50 +08:00
Myriad-Dreamin
75aa73ba69
feat: initialize locale as soon as possible (#1507) 2025-03-15 12:19:06 +08:00
Myriad-Dreamin
c96ea6d77f
feat: profile and visualize coverage of the current document (#1490)
* feat: draft

* feat: run coverage command in vscode

* feat: create and move location crate

* feat: run and visualize coverage

* feat: l10n
2025-03-15 11:49:51 +08:00
tmistele
99900b2c76
fix: cleanup CORS checks (v2) (#1382)
* fix: cleanup CORS checks

* Add back the warning on empty Origin header for websocket requests

* Don't accidentally revert change from other PR

* docs: edit comment

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-03-15 11:01:46 +08:00
Myriad-Dreamin
4cbe35a286
feat: employ l10n to tinymist-cli and vscode extension (#1505)
* feat: runtime translation

* feat: poc of rust translation

* feat: clean up implementation

* feat: initialize correctly

* dev: remove dirty log

* dev: rename l10nMsg

* fix: desc

* feat: update assets building

* feat: update assets building

* build: update cargo.lock

* fix: warnings

* fix: warnings

* dev: expose api

* fix: compile error

* fix: compile errors in scripts
2025-03-15 10:38:07 +08:00
Myriad-Dreamin
dc9013e253
feat: translate all tinymist config text using llm (#1504)
* feat: translate all tinymist config text using llm

* fix: bug translation
2025-03-14 09:43:07 +08:00
Myriad-Dreamin
1f22001cd3
feat: translate rest titles by deepseek v3 (#1503)
Co-authored-by: sinofine <i@sinofine.me>
2025-03-13 20:05:27 +08:00
Myriad-Dreamin
bcb6cf559a
docs: update readme for locales folder (#1502)
* docs: update readme for locales folder

* docs: update readme for locales folder
2025-03-13 18:19:20 +08:00
Myriad-Dreamin
7a78d039c2
feat: translate all tinymist commands using llm (#1501) 2025-03-13 17:45:46 +08:00
Myriad-Dreamin
e81a071a00
docs: update roadmap (#1499) 2025-03-13 16:00:54 +08:00
Myriad-Dreamin
be79119b61
build: bump version to 0.13.8 (#1498)
* build: update changelog

* build: bump version to 0.13.8

* build: bump assets to v0.13.8
2025-03-13 12:42:42 +08:00
Myriad-Dreamin
648523967c
fix: forbid some bad cases of dot access (#1497)
* fix: forbid some bad cases of dot access

* test: add a countercase

* fix: revert a case
2025-03-13 12:29:25 +08:00
Myriad-Dreamin
7399fccd5a
feat: detect explicit completion from vscode (#1496)
* fix: prevent completion list from showing on bad pos

* feat: detect explicit completion from vscode

* fix: cases

* test: update snapshot
2025-03-13 12:05:47 +08:00
Myriad-Dreamin
8424df13f9
feat: don't check context type if parent is a block (#1494) 2025-03-13 10:08:27 +08:00
Myriad-Dreamin
774227d328
fix: more rules to forbidden arg completion (#1493)
* fix: more rules to forbidden arg completion

* fix: fix case

* feat: revert one
2025-03-13 09:56:31 +08:00
Myriad-Dreamin
a68399c92e
build: bump version to 0.13.6 (#1492)
* build: bump version to 0.13.6

* build: update cargo.lock

* build: update assets

* build: update changelog
2025-03-13 06:16:09 +08:00
Myriad-Dreamin
a0140a6263
build: bump version to 0.13.6-rc2 (#1491)
* build: bump version to 0.13.6-rc2

* build: bump assets to v0.13.6-rc2
2025-03-12 16:27:13 +08:00
Myriad-Dreamin
4bf6cdb9ed
fix: correct field access dot target (#1489)
* fix: correct field access dot target

* test: add cases about #1267
2025-03-11 23:33:46 +08:00
Myriad-Dreamin
db1ff20a6d
fix: identify chained dot access (#1488) 2025-03-11 23:03:24 +08:00
Myriad-Dreamin
b4312eea83
docs: edit changelog (#1487) 2025-03-11 12:35:24 +08:00
Myriad-Dreamin
57d6c8a830
Merge pull request #1486 from Myriad-Dreamin/edit-changelog
docs: edit changelog
2025-03-11 12:28:13 +08:00
Myriad-Dreamin
e1ddb0e585 docs: edit changelog 2025-03-11 12:26:00 +08:00
Myriad-Dreamin
d9442409bd
Merge pull request #1485 from Myriad-Dreamin/pdf-documentation
feat: generate documentation in PDF format
2025-03-11 12:23:19 +08:00
Myriad-Dreamin
288243c2f5 feat: gen on ci 3 2025-03-11 11:16:35 +08:00
Myriad-Dreamin
732b1488f6 feat: gen on ci 2 2025-03-11 11:07:41 +08:00
Myriad-Dreamin
a572e3c5c0 feat: gen on ci 2025-03-11 10:56:02 +08:00
Myriad-Dreamin
ce90489017 feat: generate documentation in PDF format 2025-03-11 10:56:02 +08:00
Myriad-Dreamin
5a038c99ec
Merge pull request #1471 from Myriad-Dreamin/bump-version-0.13.6-rc1
build: bump version to 0.13.6-rc1
2025-03-11 10:42:56 +08:00
Myriad-Dreamin
d4ca9870d4 docs: add since hints 2025-03-11 09:13:35 +08:00
Myriad-Dreamin
3e3196baba docs: update changelog 2025-03-11 09:06:47 +08:00
Myriad-Dreamin
da5abdfa42 build: bump assets to 0.13.6-rc1 2025-03-11 09:01:53 +08:00
Myriad-Dreamin
ab24e90679 docs: update changelog 2025-03-11 00:30:44 +08:00
Myriad-Dreamin
795c51c3a5 docs: update changelog 2025-03-10 23:20:36 +08:00
Myriad-Dreamin
06971443d0 build: bump version to 0.13.6-rc1 2025-03-10 23:20:36 +08:00
Myriad-Dreamin
512f93176f
feat: accept arbitrary expressions in show rules (#1484)
* feat: accept arbitray expressions in show rules

* test: update snapshot
2025-03-10 23:20:13 +08:00
Myriad-Dreamin
e8507fea96
feat: complete std which isn't in any builtin scopes (#1483)
* feat: complete `std` which isn't in any builtin scopes

* test: update snapshot

* test: update snapshot

* test: update snapshot
2025-03-10 23:03:43 +08:00
Myriad-Dreamin
be9c0478f6
fix: distinguish content value from content type (#1482)
* fix: distinguish content value from content type

* docs: add comments

* fix: repr
2025-03-10 22:53:38 +08:00
Myriad-Dreamin
62815ae028
feat: ignore type completion having no constructors (#1481) 2025-03-10 22:13:16 +08:00
Myriad-Dreamin
7b35973741
fix: don't match the right paren for arg completion (#1480)
* fix: don't match the right paren for arg completion

* feat: arg_range_math

* fix: fmt
2025-03-10 20:50:29 +08:00
Myriad-Dreamin
1b141868eb
feat: unify and improve method completion (#1478)
* feat: unify func completion

* refactor: move value_completion logic

* feat: bound self checking

* f1

* feat: bound self type checking

* feat: type completion and typetype completion

* test: update snapshot
2025-03-10 17:42:32 +08:00
Myriad-Dreamin
20746e3acd
feat: improve ArgSlots a bit (#1479) 2025-03-10 17:42:23 +08:00
Myriad-Dreamin
a21c68ba91
feat: wait lsp until ready when fetching summary info (#1477) 2025-03-10 16:17:04 +08:00
Myriad-Dreamin
ab944669f3
fix: don't wrap ProjectInsId with quotes (#1476) 2025-03-10 13:43:04 +08:00
Myriad-Dreamin
17417e4259
feat: log update_by_map to debug zed configuration (#1474) 2025-03-10 12:07:09 +08:00
Myriad-Dreamin
be1bf802c0
feat: clean up logs (#1473) 2025-03-10 11:41:41 +08:00
Myriad-Dreamin
2639dbd49e
feat: identify files ignoring case (#1472) 2025-03-09 23:53:51 +08:00
Myriad-Dreamin
d35afa679a
refactor: rearrange imports (#1461) 2025-03-09 23:12:54 +08:00
Myriad-Dreamin
2ec7a26420
perf: parallelize font loading and sync wait it (#1470)
* x

* test memory fonts iter

* perf: impl par
2025-03-09 22:29:33 +08:00
Myriad-Dreamin
987758869f
chore: add recommended extensions (#1469) 2025-03-09 22:04:41 +08:00
Myriad-Dreamin
1ad14833dd
fix: bad refactor suggested by eslint (#1468) 2025-03-09 22:04:30 +08:00
risc
689fa914b8
fix: combine VS Code language specific default settings into one block (#1462)
This works around VS Code's undocumented behavior which is described in https://github.com/microsoft/vscode-docs/issues/7773 that language specific settings for a single language take precedence over language specific settings set for multiple languages the same time. Before this change, if a user wanted to overwrite the defaults, they would have to set it for each language individually.

After this change, users can overwrite `configurationDefaults` whether or not they chose to specify them for one language or multiple languages at the same time. Fixes #1460.
2025-03-09 22:04:01 +08:00
Myriad-Dreamin
65fdf33263
fix: make typescript-eslint happy (#1453)
* g

* fix: make typescript-eslint happy
2025-03-07 12:51:49 +08:00
Myriad-Dreamin
368aaa087c
fix: placeholder in issue template (#1458) 2025-03-06 20:38:04 +08:00
Myriad-Dreamin
40e5bcfb68
fix: render property 2 (#1457) 2025-03-06 20:36:31 +08:00
Myriad-Dreamin
f2355ac3b7
fix: render property (#1456) 2025-03-06 20:33:29 +08:00
Myriad-Dreamin
03cd35e9a0
chore: update feature request template (#1455)
* chore: update feature request template

* feat: update labels

* chore: update
2025-03-06 20:30:20 +08:00
Myriad-Dreamin
621f8f2de0
chore: update bug report template (#1454)
* chore: update bug report template

* chore: update

* chore: update

* chore: update
2025-03-06 20:21:56 +08:00
Myriad-Dreamin
156896c4b3
feat: add tinymist.startDefaultPreview and revise documentation about preview (#1448)
* feat: add `tinymist.startDefaultPreview` and revise documentation about preview

* test: update snapshot
2025-03-06 15:49:53 +08:00
Myriad-Dreamin
10962ae0a0
fix: get task options from configuration (#1449) 2025-03-06 15:42:04 +08:00
Myriad-Dreamin
334cb2ba1c
feat: run preview server in background (#1233)
* feat: run preview server in background

* feat: pass configuration

* feat: implement it

* feat: touch docs and finish details
2025-03-06 13:49:41 +08:00
Myriad-Dreamin
d76494380b
fix: revert enter feature in list or enum (#1446) 2025-03-06 12:32:42 +08:00
Myriad-Dreamin
4e9460758f
feat: adjust label and ref completion range (#1444)
* feat: adjust label and ref completion range

* docs: comment
2025-03-05 14:45:53 +08:00
Myriad-Dreamin
3ef71747c9
test: add completion cases about references (#1443)
* test: ref-label cases

* feat: more cases
2025-03-05 14:19:55 +08:00
Myriad-Dreamin
f13b632ad2
feat: handle enters in list or enum items (#1442)
* test: add tests about `onEnter`

* feat: handle enters in list or enum items
2025-03-05 12:30:47 +08:00
Myriad-Dreamin
78b80d41e4
build: bump version to 0.13.4 (#1439)
* build: bump version to 0.13.4

* build: lock tinymist-assets
2025-03-02 23:10:26 +08:00
Myriad-Dreamin
9acf9fbfa7
fix: nightly condition (#1437) 2025-03-02 15:20:28 +08:00
Myriad-Dreamin
7f0131c333
feat(ci): create release directly (#1436)
* feat(ci): create release directly

* fix: env position to read inputs

* fix: env position to read inputs

* fix: invalid word

* docs: update changelog

* fix: gh-token

* fix: grant permissions
2025-03-02 02:16:36 +08:00
Myriad-Dreamin
2c235a4259
fix: allow dirty to publish frontend assets (#1435)
* fix: allow dirty to publish frontend assets

* build: publish it
2025-03-01 23:23:32 +08:00
Myriad-Dreamin
7c78171987
build(pkg): bump version to 0.13.4-rc1 (#1433) 2025-03-01 23:17:54 +08:00
Myriad-Dreamin
5babd2b8f8
feat(ci): publish asset crate in CI (#1434)
* feat(ci): publish asset crate in CI

* feat: update name
2025-03-01 23:17:40 +08:00
Myriad-Dreamin
afc5d31377
fix: don't check context type of hash token (#1432) 2025-03-01 21:49:29 +08:00
Myriad-Dreamin
51530034f7
fix: use the background rect to calculate cursor position in the page (#1427) 2025-02-28 01:40:19 +08:00
Myriad-Dreamin
5102017777
build: bump version to 0.13.2 (#1423) 2025-02-27 18:34:44 +08:00
Myriad-Dreamin
0c89cd82c7
build: bump version to 0.13.2-rc2 (#1421)
* build: bump version to 0.13.2-rc2

* build: update assets

* docs: update the date

* docs: revise changelog
2025-02-27 17:56:56 +08:00
Myriad-Dreamin
0cb12786b3
fix: don't allow type completion in string content (#1420) 2025-02-27 16:50:27 +08:00
Myriad-Dreamin
1fe422f963
fix: complete type of type having constructors (#1419)
* fix: complete type of type having constructors

* test: update snapshot

* test: update snapshot
2025-02-27 16:26:02 +08:00
Myriad-Dreamin
96cdab38f6
feat: match named arg parent in literals (#1418) 2025-02-27 14:48:57 +08:00
Myriad-Dreamin
ebfc93c104
feat: post check element types of array and dict (#1417) 2025-02-27 14:20:36 +08:00
Myriad-Dreamin
a191b7c852
feat: adjust builtin types for typst v0.13.0 (#1416)
* feat: adjust builtin types for typst v0.13.0

* todo

* test: update snapshot

* test: update snapshot
2025-02-27 13:28:35 +08:00
Myriad-Dreamin
7faef58186
build: bump reflexo to v0.5.5-rc7 (#1414) 2025-02-27 11:41:45 +08:00
Myriad-Dreamin
4c06ffeaa9
fix: add more kind checking about MathText (#1415) 2025-02-27 11:41:30 +08:00
Myriad-Dreamin
8da796c8bc
build: bump typst-ansi-hl to v0.4.0 (#1412) 2025-02-27 02:32:01 +08:00
Myriad-Dreamin
8fcd045f37
fix: pass origin checking anyway in v0.13 (#1411)
* fix: pass origin checking anyway

* feat: log it for developers and users

* test: add test

* chore: remove an unwrap
2025-02-27 01:17:09 +08:00
Myriad-Dreamin
ddd503f180
feat: add no-content-hint feature to crityp (#1408) 2025-02-26 22:15:24 +08:00
Myriad-Dreamin
4145139534
build: bump version to 0.13.2-rc1 (#1403)
* docs: update changelog

* build: bump version to 0.13.2-rc1

* fix: horrible prerelease

* fix: bump that in package.json
2025-02-26 14:42:10 +08:00
Myriad-Dreamin
bbed728b82
feat: bump msrv and rust to v1.83 and v1.85 (#1407) 2025-02-26 14:40:23 +08:00
Myriad-Dreamin
208ce3dbad
feat(ci): use rust-toolchain.toml (#1406)
* feat(ci): use `rust-toolchain.toml`

* test: check toolchain

* fix: again

* fix: name
2025-02-26 14:33:30 +08:00
Myriad-Dreamin
1c313e4d7f
fix: bad uri usages when restoring preview (#1402) 2025-02-25 23:02:26 +08:00
Myriad-Dreamin
78b2d57a81
feat: add shebang related support (#1400) 2025-02-25 22:21:30 +08:00
Myriad-Dreamin
21c6492254
feat: use jump_from_click from typst-ide (#1399) 2025-02-25 19:15:05 +08:00
Hong Jiarong
791a7f8314
docs(typlite): add examples for --assets-path and --assets-src-path (#1396)
* Update README.md

* docs: update README.md to enhance usage instructions and contextual content rendering details
2025-02-25 15:30:46 +08:00
Myriad-Dreamin
15f2329bc1
fix: use new wasm renderer (#1398) 2025-02-25 14:47:54 +08:00
Myriad-Dreamin
9b3ff2c319
fix: deactivate features correctly when restarting server (#1397) 2025-02-25 13:04:34 +08:00
Myriad-Dreamin
7abf925a10
refactor: specify type of trait method Default::default (#1392) 2025-02-25 00:53:30 +08:00
Myriad-Dreamin
0e9d8933af
test: TYPST_PACKAGE_CACHE_PATH should be applied on server start (#1391)
* g1

* test: `TYPST_PACKAGE_CACHE_PATH` should be applied on server start

* fix: update with lock
2025-02-24 17:27:05 +08:00
Myriad-Dreamin
dc3482594b
feat: let tinymist::Config pull environment variables on start of server (#1390)
* feat: add `Config::new`

* feat: use `Config::new`

* fix: lose config if errors happens
2025-02-24 13:43:52 +08:00
Myriad-Dreamin
99bc4ac03d
feat: make tinymist.configureDefaultWordSeparator opt in (#1389)
* feat: make `tinymist.configureDefaultWordSeparator` opt in

* docs: add some comment
2025-02-24 12:20:26 +08:00
Myriad-Dreamin
3590774383
test(ci): test about completion script generation (#1387) 2025-02-24 11:59:47 +08:00
Myriad-Dreamin
d003db776c
fix: make tinymist-cli's argument names unique (#1388) 2025-02-24 11:39:09 +08:00
Myriad-Dreamin
a5e210813a
fix: term math text as content instead of string (#1386) 2025-02-24 11:31:27 +08:00
Myriad-Dreamin
1589cdd5df
feat: print type representation of anonymous modules (#1385)
* feat: print type representation of anonymous modules

* test: update snapshot
2025-02-24 11:26:32 +08:00
LN Liberda
7c0d9130eb
fix: expose and default to no-content-hint in typlite (#1381) 2025-02-24 10:28:25 +08:00
Myriad-Dreamin
e9eb6e6c95 chore: remove dirty log 2025-02-23 19:30:31 +08:00
Myriad-Dreamin
c5c33e3c77
docs: edit changelog (#1379) 2025-02-23 19:01:04 +08:00
Myriad-Dreamin
548f64aec9
feat: initialize tinymist-vscode-html extension (#1378)
* feat: migrate eslint

* feat: workspace prettierrc

* feat: workspace eslint

* chore: format files

* build: update yarn.lock

* feat: init html extension

* feat: html extension first working flow

* feat: css class support

* feat: update package metadata

* feat: check string context

* feat: clean code

* feat: delete unused yarn.lock
2025-02-23 18:56:47 +08:00
Myriad-Dreamin
c877c2bb9d build: lock typstyle to v0.13.0 2025-02-23 18:49:52 +08:00
Myriad-Dreamin
489d2b9595 build: lock reflexo to 0.5.5-rc6 2025-02-23 18:49:52 +08:00
Myriad-Dreamin
09b79330b8 build: bump version to 0.13.0 2025-02-23 18:49:52 +08:00
Myriad-Dreamin
3858fbb440 docs: update changelog 2025-02-23 18:49:52 +08:00
Myriad-Dreamin
5fefec6e5e docs: mention script to download nightly prebuilts 2025-02-23 17:34:08 +08:00
Myriad-Dreamin
fee3da7195 fix: disable hack feature when verifying publish of crates 2025-02-23 10:47:13 +08:00
Myriad-Dreamin
4af0784f6d docs: update changelog 2025-02-23 03:08:26 +08:00
Myriad-Dreamin
af64fc13d9 build: set typst dep to tag v0.13.0 2025-02-23 02:52:39 +08:00
Myriad-Dreamin
213951aff6 dev: remove log 2025-02-22 22:04:19 +08:00
Myriad-Dreamin
2a67f1a153 chore: check stop all 2025-02-22 22:04:19 +08:00
Myriad-Dreamin
3db931a1bb fix: stop all will make it address change 2025-02-22 22:04:19 +08:00
Myriad-Dreamin
91ba33b274 chore: add log 2025-02-22 22:04:19 +08:00
Myriad-Dreamin
265a6f09c4 refactor: style 2025-02-22 22:04:19 +08:00
Myriad-Dreamin
8004ae646e
fix: remove diagnostics when removing a project (#1372) 2025-02-22 20:54:33 +08:00
Myriad-Dreamin
6130a0062c
fix: apply memory changes to dedicate instances (#1371) 2025-02-22 20:54:18 +08:00
Myriad-Dreamin
5278a9ef45
fix: share preview handler among states (#1370) 2025-02-22 20:53:57 +08:00
Myriad-Dreamin
9ad8722ac8
feat: iterating find dedicate instance is not needed (#1369) 2025-02-22 20:53:30 +08:00
Myriad-Dreamin
876e402b26
build: bump version to 0.13.0-rc1 (#1361)
* build: bump version to 0.13.0-rc1

* build: update cargo.lock

* fix: weird dependencies
2025-02-22 17:11:53 +08:00
Myriad-Dreamin
5c56ade2c4
fix: simplify dependency features in cargo.toml (#1363) 2025-02-21 18:42:38 +08:00
Myriad-Dreamin
98bdd3c788
fix: browsing/regular preview's effect were switched (#1358) 2025-02-21 14:18:58 +08:00
Myriad-Dreamin
400dc7b722
fix: don't change focus main if is pinning by preview (#1357) 2025-02-21 14:18:44 +08:00
Myriad-Dreamin
b4a0957f6e
fix: add console diagnostics printing back for tinymist preview (#1359)
* fix: add console diagnostics printing back

* feat: print conditionally
2025-02-21 14:17:23 +08:00
Myriad-Dreamin
4f57e0f0b1
docs: update configuration documents (#1356) 2025-02-21 14:16:50 +08:00
Myriad-Dreamin
4ce4e79d4c
fix: loose and test origin checking of the preview server (#1353)
* fix: loose and test origin checking of the preview server

* feat: check scheme

* feat: check expected origin without hacking
2025-02-21 13:18:47 +08:00
Myriad-Dreamin
22ce78dd1e
fix: handle compile events in standalone preview server (#1349) 2025-02-21 11:44:36 +08:00
Myriad-Dreamin
d21ebc38dc
feat: bump typst to v0.13.0-rc1 (#1342)
* dev: use range type from lsp-types

* feat: add html document variant

* feat: use new-style bytes constructors

* fix: broken span usages

* fix: syntax kind is changed

* fix: label use pico str

* fix: bib element is changed

* fix: raw element is changed

* fix: typst use codex

* fix: package fn is removed from world trait

* feat: reflexo accept typst document

* docs: update changelog

* dev: cargo patch

* fix: typst pdf timestamp is changed

* fix: pattern is renamed to tiling

* dev: make eval compat

* test: update snapshots

* build: bump version to nightly 0.12.19-rc4

* build: bump version to 0.12.19-rc1 (#1164)

  * build update changelog

  * build: bump version to 0.12.19-rc1

* build: bump version to nightly 0.12.19-rc2 (#1221)

  * feat: update typst to `85d1778`

  * deps: lock git deps version

  * build: bump version to 0.12.19-rc2

  * docs: remove rc in changelog

  * fix: mathtext formatting of typstyle

  * fix: completion related to mathtext

  * build: update cargo.lock

* build: bump version to nightly 0.12.19-rc3 (#1232)

* build: bump version to nightly 0.12.19-rc4 (#1239)

* feat: add typst-html

* feat: add typst-html

* cargo patch

* fix: features doesn't take effect

* fix: casting

* fix: broken no-content-hint

* fix: snapshot

* fix: remove unnecessary `fs` feature

* fix: move system features feature

* feat: remove nightly shim

* test: update snapshot

* dev: nightly v0.12.21 (#1279)

* feat: update typst to `0ea6680`

feat: update typst to `0ea6680`

build: bump version to nightly 0.12.19 (#1261)

* fix: fix lint errors

* styl: fotmat

* fix: build web ci

* build: update cargo.toml

* build: bump version to nightly 0.12.21-rc1 (#1280)

* build: update typstyle & reflexo (#1336)

* build: update typstyle & reflexo

* dev: remove useless patches

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>

* build: update version

* fix: pdf gate were broken (#1285)

* fix: panic on convert_datetime (#1286)

* feat: run language sever with targeting html (#1284)

* dev: add some debug logging

* feat: html compilation

* fix: revert changes

* feat: adjust html interfaces

* feat: lock reflexo

* feat: provide exportTarget configuration

* feat: export html actions when target is html

* build: bump reflexo

* fix: system feature gate

* fix: feature gate 2

* fix: feature gate 3

* feat: make tinymist-world featured by lsp

* feat: text export over typst's HTML export (#1289)

* feat: add more doc, world, and task apis (#1290)

* feat: add num of pages method

* feat: add from_snapshot_inner method

* feat: add clear_dedicates method

* feat: more convertion traits

* feat: add doc_get_as_value method

* feat: add doc_get_as_value method

* feat: add cast_run method

* fix: set is compiling flag (#1293)

* feat: publish {tinymist-{derive,analysis,std,vfs,world,project},typlite,crityp} crates (#1310)

* build: bump version to 0.12.21-pre-rc1

* fix: deps

* build: set nightly in nightly branch

* docs: add readmes for publish

* feat: add release crates action

* dev: remove publish of sync-lsp

* dev: remove useless setup

* fix: remove readme

* fix: publish ignore errors

* fix: specify version for publish

* fix: specify version for publish

* feat: update tinymist-web version

* test: update snapshot

* fix: diverged deps

---------

Co-authored-by: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com>
2025-02-21 03:18:04 +08:00
Myriad-Dreamin
0260bfb527
feat: don't bump rust toolchain in ci casually (#1348) 2025-02-21 01:42:16 +08:00
Myriad-Dreamin
f3329b8dc4
build: bump version to 0.12.20 (#1345)
* docs: editing changelog

* build: bump version to 0.12.20

* docs: update changelog

* build: bump dependencies

* fix: snapshot and compile error
2025-02-21 01:37:38 +08:00
Myriad-Dreamin
cdd9282c37
fix: log error on channel closed (#1347) 2025-02-20 20:45:44 +08:00
Myriad-Dreamin
98c36483fc
build: bump version to 0.12.20-rc2 (#1341) 2025-02-20 02:36:34 +08:00
Myriad-Dreamin
82ed2a1aa5
build: bump version to 0.12.20-rc1 (#1339)
* docs: draft changelog

* build: bump version to 0.12.20-rc1
2025-02-20 01:53:53 +08:00
Myriad-Dreamin
d470cb061f
dev: remove some heavy logging (#1338) (#1340) 2025-02-20 01:48:42 +08:00
Yifan Song
5285da4ae0
build: upgrade typstyle to v0.12.15 (#1324)
* build: upgrade typstyle to v0.12.14

* update doc

* dev: change name

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-02-20 01:05:28 +08:00
Myriad-Dreamin
6d2de24a05
fix: respect that the port of the expected_origin can be zero (#1295) (#1337) 2025-02-20 01:04:33 +08:00
Myriad-Dreamin
5a05d12fdd
fix: don't remove path mapping when invalidating vfs cache (#1316) (#1333)
* fix: don't remove path mapping when invalidating vfs cache (#1316)

* fix: don't clean path mapping when invalidate vfs cache

* fix: remove duplicated insert

* refactor: name

* fix: use correct path to ecow
2025-02-20 00:52:39 +08:00
Myriad-Dreamin
9904189910
fix: the path to join is shadowed by a local variable (#1322) (#1335)
* fix: the path to join is shadowed by a local variable

* fix: redact target uri
2025-02-20 00:50:10 +08:00
Myriad-Dreamin
cb51d67e7d
chore: remove a finished todo (#1320) (#1334) 2025-02-20 00:49:55 +08:00
Myriad-Dreamin
497c82588d
dev: log vfs on didChanged (#1311) (#1332) 2025-02-20 00:47:16 +08:00
Myriad-Dreamin
803cc1ffaf
feat: support more path types and add path parameters (#1312) (#1331)
* feat: support more path types and add path parameters added in typst … (#1312)

* feat: support more path types and add path parameters added in typst 0.13.0

* test: update snapshot

* test: update snapshot
2025-02-20 00:43:47 +08:00
Myriad-Dreamin
5b72f760bb
fix: set is compiling flag (#1293) (#1328) 2025-02-20 00:35:59 +08:00
Myriad-Dreamin
63e368c2bb
feat: disable logs in stable span2vec (#1291) (#1327) 2025-02-19 23:57:47 +08:00
Myriad-Dreamin
d3e7027d67
feat: add FromArc and ArcInto (#1288) (#1326) 2025-02-19 22:57:34 +08:00
Myriad-Dreamin
0c64bea89e
fix: emit latest status and artifact with correct signals (#1294) (#1330)
* fix: emit latest compiled artifact with correct signals

* fix: bad guard
2025-02-19 22:34:11 +08:00
Myriad-Dreamin
26fd50febf
fix: invalidate and increment revision in vfs correctly (#1292) (#1329)
* fix: invalid fs changes

* chore: print clean vfs state

* fix: increment revision in vfs correctly
2025-02-19 22:15:34 +08:00
Myriad-Dreamin
5920b1b671
feat: ensure main in compile function (#1287) (#1325) 2025-02-19 22:01:28 +08:00
Hong Jiarong
f5fb352a2a
fix(typlite): correct the wrong path (#1323)
* fix: wrong path

* fmt
2025-02-19 21:12:12 +08:00
Hong Jiarong
55f8392692
feat(typlite): render context block contextually (#1305)
* feat: render contexual node with environment at context

* fix: extend value check to include additional node types

* feat: add assets_path and assets_src_path, support render to external svg file

* fix: clippy

* fix

* fix test error

* fix: simplify write_error function

* refactor: rename 'pref' to 'prepend_code' for clarity; fix: wrong render_inner

* refactor: simplify file name generation for asset paths

* fix: use PathBuf instead of EcoString for path display

* fix: handle Hash

* fix: clippy

* tests: update test@annotate_docs_error.typ.snap
2025-02-19 12:04:05 +08:00
Myriad-Dreamin
7b8e275089
feat: browsing preview (#1234)
* feat: browsing preview

* feat: add browsing-preview command

* refactor: check pin status on main thread

* feat: preview without specifying main

* feat: implement tinymist.doStartBrowsingPreview

* test: update snapshot
2025-02-18 20:51:19 +08:00
Myriad-Dreamin
deb1425e74
feat: move less used codelens into a single "more" codelens (#1315)
* feat: move less used codelens into a single "more" codelens

* dev: update snapshot
2025-02-18 20:16:48 +08:00
Myriad-Dreamin
f4f3e24cb1
feat: cancel codelens if the any picker is cancelled (#1314) 2025-02-18 17:15:21 +08:00
Hong Jiarong
33df227b17
feat: embed Markdown codes (#1296)
* feat: directly output raw language 'typlite'

* docs: raw output
2025-02-18 10:14:17 +08:00
Hong Jiarong
b24a7fd497
feat: evaluate table and grid (#1300)
* feat: add table and grid functions evaluating

* fix: clippy

* refactor: simplify table and grid functions by extracting common logic

* fix: handle invalid columns argument and set default value; handle no header situation
2025-02-18 10:14:02 +08:00
Myriad-Dreamin
cddb193b18
feat: copy code from builtin markdown extension (#1306) 2025-02-18 00:01:36 +08:00
Myriad-Dreamin
0badfac6de
refactor: rename source file name of the drop feature (#1309)
* refactor: rename source file name of the drop feature

* fix: dep
2025-02-17 20:28:46 +08:00
Myriad-Dreamin
d05a0d1104
feat: add more known image extensions (#1308) 2025-02-17 20:24:54 +08:00
Hong Jiarong
47fff57cbb
fix: add tinymist-task/no-content-hint to tinymist-project (#1297) 2025-02-17 20:20:05 +08:00
Myriad-Dreamin
ca11890426
build: bump dependencies of js packages (#1304)
* build: bump dependencies of js packages

* fix: update vscode engine version
2025-02-17 20:18:14 +08:00
Myriad-Dreamin
c38a1a52ad
fix: consider interpret mode when classifying dot accesses (#1302)
* fix: consider interpret mode when classifying dot accesses

* chore: unwrap if

* test: cases mentioned in #1209

* test: more cases mentioned in #1209
2025-02-17 17:54:14 +08:00
Myriad-Dreamin
25624baad3
feat: add release crates action (#1298) 2025-02-16 13:47:16 +08:00
Myriad-Dreamin
3799db6dd4
feat: split tinymist-task (#1277)
* feat: split tinymist-task

* cargo lock

* revert html changes

* Revert "revert html changes"

This reverts commit b82662e441.

* Revert "Revert "revert html changes""

This reverts commit b42643399c.

* fix: examples
2025-02-08 23:10:02 +08:00
Y.D.X.
2c335b25d1
docs: fix typo (#1276)
* docs: fix typo

The typo was introduced in #1090.

* dev: generate docs

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-02-08 23:09:39 +08:00
Myriad-Dreamin
70d4d82cdb
feat: move snapshot structs to tinymist-world (#1275)
* feat: move snapshot structs to tinymist-world

* fix: new typst compile

* Revert "fix: new typst compile"

This reverts commit 1d181cd48d.

* Revert "Revert "fix: new typst compile""

This reverts commit 12fe1fbfb0.

* fix: broken link

* fix: broken example
2025-02-08 19:58:01 +08:00
Myriad-Dreamin
4b5a99adcf
refactor: make variable names clear (#1274) 2025-02-08 15:15:55 +08:00
Myriad-Dreamin
9864d438c9
feat: remove uses of CompileEnv and Compiler (#1272)
* feat: remove uses of `CompileEnv` and `Compiler`

* build: update cargo.lock

* fix: new typst

* Revert "fix: new typst"

This reverts commit ca624d391a.

* Revert "Revert "fix: new typst""

This reverts commit 012d3cff03.
2025-02-08 15:15:13 +08:00
Myriad-Dreamin
6b31d4418d
feat: store raw diag in error (#1271) 2025-02-08 15:11:48 +08:00
Myriad-Dreamin
a4ac6780fe
fix(ci): clippy check default feature 2025-02-08 15:07:31 +08:00
Myriad-Dreamin
d0188a768e dev: make eval compat (#1269)
* fix: compile when preview feature is disabled

* build: update cargo.lock

* old

* old

* old

* back
2025-02-08 14:55:47 +08:00
Myriad-Dreamin
5b2b34ee9e fix: make preview feature gate work 2025-02-08 14:55:47 +08:00
Myriad-Dreamin
a82d96bc2c
docs: documenting Myriad-Dreamin's workspace setting (#1264)
* docs: documenting Myriad-Dreamin's workspace setting

* chore: add eof new line
2025-02-08 13:41:18 +08:00
Myriad-Dreamin
a778c8c10c
build: upgrade typstyle to v0.12.14 (#1260)
* build: upgrade typstyle to 0.12.14

* typstyle version

* build: update cargo.lock

---------

Co-authored-by: ParaN3xus <paran3xus007@gmail.com>
2025-02-03 11:19:55 +08:00
Myriad-Dreamin
39bc123866
build: downgrade tempfile to 3.15.0 (#1259)
Co-authored-by: ParaN3xus <paran3xus007@gmail.com>
2025-02-03 11:19:36 +08:00
Myriad-Dreamin
1178d4fbe9
build: update cc version (#1162) (#1258)
* build: lock `cc` version

* build: update cargo.lock

* docs: detailed comment

* build: remove the unneeded change

---------

Co-authored-by: ParaN3xus <paran3xus007@gmail.com>
2025-02-03 11:19:22 +08:00
Myriad-Dreamin
3bc5f19cf5
feat: convert TypstDocument to enum (#1256)
* feat: convert `TypstDocument` to enum

* fix: errors

* build: update cargo.lock

* fix: warnings

* fix: error

* html changes

* Revert "html changes"

This reverts commit f9fc0e4872.

* Revert "Revert "html changes""

This reverts commit 7dc554a9e4.

* use std typst docs

* span

* paged

* paged

* html change

* paged

* html change

* bytes

* paged

* paged

* paged

* html changes

* paged

* html changes

* paged
2025-02-03 11:17:58 +08:00
Myriad-Dreamin
30a08e79ab
refactor: remove state crate again (#1255) 2025-02-02 16:32:50 +08:00
Myriad-Dreamin
d1196bffd6
refactor: review project state (#1254) 2025-02-02 16:27:28 +08:00
Myriad-Dreamin
7b8739487e
fix: cannot build clap/wrap_help in web (#1253) 2025-02-02 16:25:33 +08:00
Myriad-Dreamin
5069a89d5d
refactor: rearrange state methods (#1252) 2025-02-02 16:24:12 +08:00
Myriad-Dreamin
4ce405a89b
refactor: improve code styles (#1250) 2025-02-02 15:27:00 +08:00
Myriad-Dreamin
0eb6837fd6
fix(ci): use upload-pages-artifact and configure-pages (#1251) 2025-02-02 15:01:06 +08:00
Myriad-Dreamin
85cb9096d2
perf: scatter-gather the editor diagnostics (#1246) 2025-02-02 14:56:55 +08:00
Myriad-Dreamin
8aef1974db
fix(ci): use deploy-pages v4 (#1249) 2025-02-02 14:56:39 +08:00
Myriad-Dreamin
8d05e5081c
feat: adapt main file mutations (#1247) 2025-02-02 14:56:17 +08:00
Myriad-Dreamin
88912bc12e
feat: prepublish tinymist-world (#1248) 2025-02-02 14:51:49 +08:00
Myriad-Dreamin
d534325c83
docs: add comments to the editor actor (#1245) 2025-02-02 14:02:44 +08:00
Myriad-Dreamin
36d07464c1
refactor: tail log error that is ignorable (#1244) 2025-02-02 13:59:55 +08:00
Myriad-Dreamin
74c68f5485
feat: adapts build meta for wasm target (#1243) 2025-02-02 13:59:44 +08:00
Myriad-Dreamin
4eb747f883
refactor: finally remove all headless logging (#1242) 2025-02-02 13:15:54 +08:00
Myriad-Dreamin
902b9c6d8c
refactor: rearrange project state a bit (#1241) 2025-02-02 13:15:28 +08:00
Myriad-Dreamin
2b56e71435
feat: watch dependencies of multiple projects (#1231) 2025-01-30 01:44:57 +08:00
Myriad-Dreamin
8d588c1057
fix: correct impl WorldProvider::entry for CompileOnceArgs (#1230) 2025-01-30 00:26:12 +08:00
Myriad-Dreamin
0451a1089d
dev: handle compilation notifications for multiple projects (#1229)
* dev: handle multiple-project notifications

* dev: remove todo
2025-01-30 00:25:59 +08:00
Myriad-Dreamin
eac275c28d
refactor: remove z_internal_error and outdated comments (#1228) 2025-01-30 00:25:42 +08:00
Myriad-Dreamin
af47f578e4
dev: cleanup project creation (#1227) 2025-01-29 20:57:34 +08:00
Myriad-Dreamin
3227b2f6f7
fix: sync memory changes on restart (#1226) 2025-01-29 20:14:36 +08:00
Myriad-Dreamin
7647d807ec
feat: replace diag_group id with project_id (#1224) 2025-01-29 19:40:31 +08:00
Myriad-Dreamin
0f588c99d7
refactor: build and move comment and matcher crates to analysis crate (#1223) 2025-01-29 12:34:28 +08:00
Myriad-Dreamin
1979469f28
refactor: move debug_loc crate to analysis crate (#1222) 2025-01-29 11:30:34 +08:00
Myriad-Dreamin
f1f88cb548
build: eliminate dependencies of tinymist-analysis (#1220) 2025-01-28 17:37:22 +08:00
Hong Jiarong
ecd6cf97e9
feat: support drag-and-drop feature for .ods format (#1217)
* fix: update xlsx-parser package version to 0.3.0

* feat: add support for ODS file type in drag-and-drop feature
2025-01-28 15:15:46 +08:00
Myriad-Dreamin
0b4014be80
feat: CLI generate shell build script (#1219)
* feat: CLI generate shell build script

* dev: update build script sample
2025-01-28 15:13:59 +08:00
Myriad-Dreamin
b541daf50e
feat: CLI compile documents with lock updates (#1218) 2025-01-28 13:57:27 +08:00
Myriad-Dreamin
ebd811db13
fix: typos and clippy warnings (#1215) 2025-01-28 12:00:36 +08:00
tmistele
ea331a5aa6
fix: Prevent malicious websites from connecting to http / websocket server (#1157)
* fix: Prevent malicious websites from connecting to http / websocket server

Browsers allow any website to connect to websockets on `127.0.0.1` and,
therefore, to spy on users of tinymist. Disallow this by checking the
`Origin` header. Note: This does not protect against malicious users
that share the same `127.0.0.1` as us (e.g. multi-user systems where
the users don't trust each other). That requires additional changes
that may be added in the future.

* Add VSCode exception

* Also prevent malicious connections to trace/profiling http server

Allow VSCode only for now.
2025-01-27 13:56:05 +08:00
Myriad-Dreamin
1b80d8c31d
feat: execute export and query on the task model (#1214)
* feat: extract id and doc id from config

* dev: merge `TaskWhen` and move `PathPattern`

* g

* dev: let it compile

* dev: rename a bit

* dev: finish cmd conversions

* dev: configure server

* dev: run export

* dev: clean code

* dev: parse gap on export

* fix: when test
2025-01-27 13:14:17 +08:00
Myriad-Dreamin
86d3b912d4
fix: try getting font index which is hit by comemo (#1213) 2025-01-27 09:58:24 +08:00
Myriad-Dreamin
5ee0e4e21d
docs: add documentation about publish tokens (#1212)
* docs: add documentation about publish tokens

* docs: wording
2025-01-27 01:41:01 +08:00
Myriad-Dreamin
4bebc00df2
feat: delete useless async snapshot (#1206) 2025-01-21 08:52:45 +08:00
Myriad-Dreamin
0a91f0d2b4
refactor: rearrange state crates (#1205)
* refactor: rearrange states

* feat: remove MemoryFileMeta

* feat: split server.rs
2025-01-21 01:32:19 +08:00
Myriad-Dreamin
ac25cc1365
refactor: rearrangement and document about tinymist-project (#1204)
* refactor: rearrangement and document about tinymist-project

* refactor: more rearrangement and document about tinymist-project
2025-01-21 00:56:30 +08:00
Myriad-Dreamin
8ca6c8118c
feat: merge fs and std crate (#1203)
* feat: merge fs and std crate

* fix: errors
2025-01-20 23:00:31 +08:00
Myriad-Dreamin
04f688e122
feat: model and document project tasks (#1202)
* feat: model and document project tasks

* fix: compile error
2025-01-20 20:24:54 +08:00
Myriad-Dreamin
6d1e40d3a9
feat: resolve projects by lockDatabase (#1142)
* feat: implement lock-based project resolution

* feat: first working example
2025-01-20 14:51:09 +08:00
Myriad-Dreamin
89c178295a
feat: initiate lockDatabase project resolution (#1201)
* feat: create a configuration

* docs: edit description

* docs: edit description

* feat: add lock update

* test: make configuration work
2025-01-20 12:45:23 +08:00
Myriad-Dreamin
a325c6f6c8
test: add test_entry_by_extra_args test (#1200) 2025-01-20 09:51:44 +08:00
Myriad-Dreamin
d5ecf052d4
feat: detect compilation-related vfs changes (#1199) 2025-01-20 01:38:40 +08:00
Myriad-Dreamin
e4bf2e9e46
feat: run project compilations on main thread (#1197)
* dev: handle compile interrupt

* dev: remove cache task use

* feat: create project crate again

dev: changes

feat: delete unused code

fix: errors

fix: errors

* feat: extra compilation is not needed

* dev: implement all todos

* fix: make event queue unbounded

* fix: make preview work again

* feat: event-driven recompilation

* feat: evict vfs cache

* feat: update evict strategy

* feat: remove lock update
2025-01-19 22:28:38 +08:00
Myriad-Dreamin
02a14c9cc9
fix: push resolved span to editor (#1194) 2025-01-19 18:49:01 +08:00
Myriad-Dreamin
40c176ccf6
fix: capture docs before check init (#1195) 2025-01-19 18:48:38 +08:00
Myriad-Dreamin
3577ed3b2f
feat: add CLI compile command and bench script (#1193) 2025-01-19 18:48:19 +08:00
Myriad-Dreamin
1f01ec1f6c
feat: track fine-grained revisions of font, registry, entry, and vfs (#1192)
* feat: set flag to indicate whether we are compiling files

g1

dev: stateless compile

dev: vfs revise apis

g1

feat: bump revision on state changes

feat: track font and package changes

dev: some cases that can change state of cache

changes

* feat: implement shared source cache

* fix: take db state

* dev: update take state location

* fix: example
2025-01-19 18:23:41 +08:00
Myriad-Dreamin
8481b77e3c
perf: remove meta watch (#1191)
* dev: remove meta watch

* feat: watch.rs changes

* dev: remove `is_file` checking

* dev: remove `is_file` checking (cont.)
2025-01-19 12:40:06 +08:00
Myriad-Dreamin
884a4b50e7
perf: reduce size of the watch entry (#1190)
* dev: reduce size of the watch entry

* feat: watch.rs changes
2025-01-19 12:26:57 +08:00
Myriad-Dreamin
56714675b7
feat: encode and use workspace information into PackageSpec (#1187)
* feat: remove an unused API

* feat: encode workspace information into `PackageSpec`

* feat: remove unused real_path

* feat: remove unused mtime

* feat: add ResolveAccessModel

* feat: implement id overlay semantics

* feat: remove mtime checking in overlay model

* feat: remove mtime checking in notify model

* feat: format ids

* fix: cases

* feat: resolve root by world

* dev: add untitled root

* fix: warnings

* fix: a wrong usage

* fix: snapshots

* fix: tests
2025-01-19 11:51:00 +08:00
Myriad-Dreamin
a25d208124
dev: intentionally leak paths in vfs (#1186) 2025-01-19 09:50:13 +08:00
Myriad-Dreamin
a5cf15a701
feat: remove do_reparse flag (#1185) 2025-01-19 09:50:03 +08:00
Myriad-Dreamin
1779209337
feat: build tinymist-world on web (#1184)
* feat: build tinymist-world on web

* fix: features

* dev: edit readme
2025-01-19 09:49:52 +08:00
Myriad-Dreamin
6180e343e0
feat: move world implementation (#1183)
* feat: move world implementation

* dev: remove vector ir

* fix: errors

* fix: clippy

* fix: don't build world in web

* fix: unused patches

* fix: fmt

* fix: docs example

* fix: doc examples
2025-01-19 08:25:35 +08:00
Myriad-Dreamin
a9437b2772
dev: remove unused deps (#1182) 2025-01-17 12:12:17 +08:00
Myriad-Dreamin
68f451715a
dev: change log level of diagnostics from info! to debug! (#1181)
* dev: change log level of diagnostics from `info` to `debug`

* dev: clean code

* dev: enable them again
2025-01-17 12:11:53 +08:00
Myriad-Dreamin
c5630aa7bd
feat: copy pdb file before launching extension on windows (#1180)
* feat: copy pdb file before launching extension on windows

* dev: update comments
2025-01-17 11:24:50 +08:00
Myriad-Dreamin
270734612d
dev: merge tinymist-project and tinymist-world crate (#1179)
* dev: merge tinymist-project and tinymist-world crate

* fix: warnings and errors
2025-01-17 11:24:36 +08:00
Myriad-Dreamin
5659b0bc6c
dev: move package to reflexo_world part (#1177)
* dev: move package to reflexo_world part

fix: compile error

* dev: update the package.json

* fix: compile error

* dev: remove dry compile
2025-01-16 10:13:37 +08:00
Myriad-Dreamin
448ce484d8
fix: clippy error in rust 1.84 and deny warnings in CI (#1178)
* fix: clippy error in 1.84

* fix: deny warnings

* fix: clippy warnings and doc errors

* fix: warnings

* fix: warnings

* fix: warnings

* fix: compile error
2025-01-15 20:26:34 +08:00
Myriad-Dreamin
31b22d9333
dev: add send_event to the lsp client (#1176) 2025-01-15 17:14:24 +08:00
Myriad-Dreamin
faf807edb2
feat: prefer to select the previous token when cursor is before a marker (#1175)
* feat: prefer to select the previous token when cursor is before a marker

* test: update snapshot
2025-01-15 14:33:26 +08:00
Myriad-Dreamin
0aafee1d13
test: add more rename tests (#1174)
* test: add tests

* dev: add more tests
2025-01-15 13:05:32 +08:00
ParaN3xus
7d6311e8fb
docs: clarify typst version in nightly releases (#1173)
* docs: clarify typst version in nightly releases

* docs: add more detailed clarification

* fix: typst markup copied to markdown files

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-01-15 12:50:03 +08:00
Myriad-Dreamin
dcef04c867
chore: draft-release script strips v prefix (#1172) 2025-01-14 20:41:09 +08:00
Myriad-Dreamin
25bb1b2fbc
fix(ci): broken script (#1171) 2025-01-14 20:39:04 +08:00
Myriad-Dreamin
17192ca9ae
ci: generate announcement (#1170)
* ci: generate announcement

* dev: delete comment
2025-01-14 20:32:56 +08:00
Myriad-Dreamin
92f1d7fa18
dev: edit deps and features (#1168) 2025-01-14 19:09:01 +08:00
Myriad-Dreamin
2168b22b16
build: add notes before release instructions (#1169) 2025-01-14 19:08:44 +08:00
Hong Jiarong
3dd76f7a3d
feat: update xlsx-parser package version to 0.2.3 (#1166) 2025-01-14 18:24:25 +08:00
Myriad-Dreamin
8ceb78f699
feat: micro benchmark support (#1160)
* feat: init crityp

* feat: delete the dirty patch

* feat: clean up unwraps in the tool

* feat: split cli main function

* docs update readme

* docs update readme

* docs: add comments

* docs: lint code
2025-01-14 18:20:58 +08:00
Myriad-Dreamin
a33f12ea7b
docs: update release instruction (#1163) 2025-01-14 16:10:59 +08:00
Hong Jiarong
4ab9680078
feat: support convert to typst table from xlsx file (#1100)
* feat: add support for XLSX resource kind in drag-and-drop feature

* fix: use ResourseKind.Xlsx

* fix: update xlsx-parser package version to 0.2.1 in drag-and-drop feature

* fix: add a missing parenthesis

* fix: update xlsx-parser to 0.2.2

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-01-14 12:55:38 +08:00
Sylvan Franklin
e3581e452d
docs: revise neovim's install section (#1090)
* docs: revise install section

* fix: typos

* docs: reformat

* docs: fix words and markers

* docs: fix install section

* docs: revise preview section

* Add the section "Working with Multiple-Files Projects" back

* Edit a bit

* build: generate the neovim readme

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-01-13 13:24:26 +08:00
Myriad-Dreamin
9cf5f294e9
fix: clean up the render actor a bit and fix the issue that editor_conn_sender is not used (#1159) 2025-01-13 11:27:11 +08:00
tmistele
0149663a6f
fix(vscode): make label view work when there's exactly one label (#1158)
* fix: vscode: make label view work when there's exactly one label

* test: add a test case

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-01-13 10:55:21 +08:00
Myriad-Dreamin
18d37433b3
feat: remove the typst actor (#1156)
* feat: remove the typst actor

* feat: merge the editor server and the compile host

* feat: change the naming a bit
2025-01-13 10:36:46 +08:00
tmistele
6813a1081e
feat: rescale with ctrl/cmd + =/- in browser (#1110)
* feat: Rescaling with Ctrl+=/- in browser (in addition to ctrl+wheel)

* Change function name also in comment

* Use Command instead of Ctrl on Macs

to match default key bindings in browsers
2025-01-13 10:05:17 +08:00
Myriad-Dreamin
8e918cb132
docs: documenting sync-lsp crate (#1155) 2025-01-11 18:09:45 +08:00
Myriad-Dreamin
0e2874a6c9
dev: update route model (#1154)
* dev: update route model

* build: update cargo.lock
2025-01-11 18:09:36 +08:00
Myriad-Dreamin
c0d8f0db1c
dev: change first arg of LockFile::update to workspace root (#1153) 2025-01-11 18:09:26 +08:00
Myriad-Dreamin
6fa10f63fc
feat: add more kinds of export task (#1152) 2025-01-11 18:09:15 +08:00
Myriad-Dreamin
da16d14d2d
feat: implement From<ResourcePath> for Id (#1151) 2025-01-11 17:44:50 +08:00
Myriad-Dreamin
f43a8e116c
feat: add depended_{paths,{source_,}files} methods (#1150) 2025-01-11 17:44:23 +08:00
Myriad-Dreamin
ec121070d8
fix: legalized unspecified document and task in lock file (#1149) 2025-01-11 17:42:03 +08:00
Myriad-Dreamin
5a23d41cb7
feat: allow server to set owned internal event handler (#1148)
* xx

* feat: allow server to set owned internal event handler

* fix: permission ext

* fix: strict permission
2025-01-11 17:30:47 +08:00
Myriad-Dreamin
30f242d393
feat: show main file in the status bar (#1147) 2025-01-11 17:16:03 +08:00
Myriad-Dreamin
c0e0e330c3
dev: remove tinymist-query dependency from sync-lsp crate (#1146)
* feat: remove tinymist-query dependency from sync-lsp crate

* build: update cargo.lock
2025-01-11 17:02:26 +08:00
Myriad-Dreamin
c2e8f6e5f6
dev: split tinymist-project crate (#1144)
* dev: split tinymist-project crate

* build: update cargo.lock
2025-01-11 16:02:01 +08:00
Myriad-Dreamin
50ae35a623
feat: associate lock file with toml language (#1143) 2025-01-11 15:54:45 +08:00
Myriad-Dreamin
bdfc1ed648
feat: generate declarative project lock file (#1133)
* build: update cargo.lock

* feat: generate declarative project lock file

* dev: clean up commands and naming

* dev: add preview task command and naming

* dev: lock and update lock file

* dev: experiment multiple tasks
2025-01-09 22:56:58 +08:00
Myriad-Dreamin
59390aced5
feat: copy flock implementation from cargo (#1140) 2025-01-09 22:30:20 +08:00
Myriad-Dreamin
c2aa453af4
build: bump version to 0.12.18 (#1141) 2025-01-09 22:27:00 +08:00
Myriad-Dreamin
fb717ef4d5
test: add completion tests about nodes in math calls (#1139) 2025-01-09 21:42:45 +08:00
Myriad-Dreamin
db62791908 build: update tinymist-assets dependency 2025-01-09 20:54:20 +08:00
Myriad-Dreamin
ce1d4f4f43
build: bump version to 0.12.18-rc2 (#1135) 2025-01-09 20:52:40 +08:00
Myriad-Dreamin
fcb9fec712
feat: identify identifier-like text as ident in math mode (#1138) 2025-01-09 18:50:03 +08:00
Myriad-Dreamin
34fe823ab7
fix: terminate heading on newline (#1136) 2025-01-09 18:26:26 +08:00
Myriad-Dreamin
d831d1183e
fix: identify mode as math in math call arguments (#1137)
* fix: identify mode as math in math call arguments

* fix: move spread kind
2025-01-09 18:25:26 +08:00
Myriad-Dreamin
c9cd572bea test: add test about underline 2025-01-09 14:32:02 +08:00
Myriad-Dreamin
470386dabb
feat: handle minus and asterisk marker confidently (#1134)
* feat: handle minus and asterisk marker confidently

* test: add some tests about assign
2025-01-09 14:27:39 +08:00
Sylvan Franklin
354022d2be
feat: add Sylvan Franklin as maintainer (#1091) 2025-01-09 11:08:41 +08:00
Myriad-Dreamin
6aa9138131
build: bump version to 0.12.18-rc1 (#1132)
* build: bump version to 0.12.18-rc1

* docs: update announcement
2025-01-08 19:47:02 +08:00
Myriad-Dreamin
fe34e2c6de
docs: documenting textmate grammar (#1131) 2025-01-08 12:40:19 +08:00
Myriad-Dreamin
903a2fe41b
feat: generate wider look-behind pattern for pcre-compatible grammar (#1130) 2025-01-08 11:33:16 +08:00
Myriad-Dreamin
02591124a3
feat: stop expressions before hash and comma (#1129)
* feat: stop expression before hash

* feat: stop expression before comma
2025-01-08 11:26:44 +08:00
Myriad-Dreamin
13e7325b7b
feat: parse arrow functions like binary expr (#1128) 2025-01-08 11:24:55 +08:00
Myriad-Dreamin
691a28ef55
feat: conditionally satisfy PCRE regex features (#1126) 2025-01-07 20:49:38 +08:00
Myriad-Dreamin
d4d8345166
fix: match special identifiers in calls (#1125) 2025-01-07 14:20:00 +08:00
Myriad-Dreamin
a6a6d88143
fix: exclude content block syntax when parsing math arguments (#1124) 2025-01-07 14:18:11 +08:00
Myriad-Dreamin
bc2e07bb0c
fix: parse field access in math (#1123) 2025-01-07 14:17:15 +08:00
Myriad-Dreamin
42bfb8de1c
feat: add more termination rules about FIRST tokens (#1122)
* feat: terminate call arguments before some FIRST tokens

* feat: terminate braces before some FIRST tokens

* feat: terminate set clause on some FIRST tokens

* feat: refine rules to terminate a math call
2025-01-07 14:15:31 +08:00
Myriad-Dreamin
f6dd6f782c
feat: add scripts to test syntax highlight (#1121)
* feat: script to make bundle to test syntax highlight

* feat: add scripts to test syntax highlight (cont.)
2025-01-07 14:15:20 +08:00
Myriad-Dreamin
9fb7b3f289
feat: ignore vscode workspace (#1120) 2025-01-07 14:15:06 +08:00
Myriad-Dreamin
03ac73bd52
feat: change some names of textmate scopes (#1119)
* feat: change some special kind of string tokens

* feat: change some special kind of constant tokens

* feat: change some special kind of keyword tokens

* test: update snapshot
2025-01-07 14:00:21 +08:00
Myriad-Dreamin
4a44a69196
feat: parse name identifier of parameters or arguments (#1118)
* test: add arg name tests

* feat: parse name identifier of parameters or arguments
2025-01-07 10:16:23 +08:00
Myriad-Dreamin
a00e5f12e5
fix: terminates math calls before identifier start (#1117) 2025-01-06 21:53:38 +08:00
Myriad-Dreamin
b7feb5dcca
fix: correct order to insert definitions in scope (#1116) 2025-01-06 15:28:22 +08:00
Myriad-Dreamin
bb66b4b97a
feat: complete parameters by capture information (#1114)
* feat: complete parameters by capture information

* dev: wording
2025-01-06 06:33:49 +08:00
Myriad-Dreamin
fd33024915
feat: match param names for completion (#1113)
* feat: match param names for completion

* docs: update comment

* test: update snapshot
2025-01-06 01:07:46 +08:00
Myriad-Dreamin
957e017966
fix: parse math calls with text braces inside or around (#1112)
* fix: parse math calls with text braces inside or around

* test: add some test cases
2025-01-05 21:21:34 +08:00
Myriad-Dreamin
975e4a27bf
feat: rearrange hover providers (#1108)
* feat: rearrange hover providers

* fix: warnings

* test: update snapshot

* test: update hover snapshot
2025-01-05 14:05:13 +08:00
Myriad-Dreamin
671783a964
feat: enable experimental math syntax highlighting (#1107) 2025-01-04 05:41:57 +08:00
Myriad-Dreamin
626efa0d78
feat: parse math parentheses after [_^\/√∛∜] (#1106)
* test: move math syntax highlight tests

* feat: parse math parentheses after `_` and `^`

* feat: all opening/closing kinds

* dev: more kinds
2025-01-04 02:22:27 +08:00
Myriad-Dreamin
d4ba43c773
feat: add experimental math syntax highlighting (#1096)
* feat: add experimental math syntax highlighting

* dev: math identifier can be after some text brace

* dev: math identifier must contain multiple chars
2025-01-03 23:15:42 +08:00
Myriad-Dreamin
d7dd2f30cf
feat: bootstrap lsp-free features in web (#1105)
* feat: bootstrap lsp-free features in web

* ci: update build script

* ci: update system build script

* dev: touch extension file in web

* dev: touch extension file in system

* fix: bug import

* fix: bug touch
2025-01-03 13:47:52 +08:00
Myriad-Dreamin
d32f6261f1
feat: build tinymist targeting web (#1102)
* feat: add web target

* dev: simple package rule

* dev: update web release

* dev: update workspace

* ci: setup wasm pack

* ci: correct path to upload

* ci: build artifact

* fix: update metadata and launch config
2025-01-03 10:30:38 +08:00
wzy
2464c5b66c
chore: change vscode extension name (#1097)
Avoid:
  Error: Duplicate workspace name tinymist: /the/path/of/tinymist/editors/vscode conflicts with /the/path/of/tinymist

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2025-01-02 23:19:58 +08:00
Myriad-Dreamin
c8b6c123c4
chore: wording in changelog (#1101) 2025-01-02 23:14:00 +08:00
Myriad-Dreamin
0ba8be333f
build: bump version to 0.12.16 (#1099)
* build: bump version to 0.12.16

* docs: truncate changelog
2025-01-02 21:28:50 +08:00
Myriad-Dreamin
cd64e4019d
build: bump version to 0.12.16-rc1 (#1095)
* docs: update changelog

* build: bump version to 0.12.16-rc1

* docs: add announcement

* docs: syntax

* docs: syntax

* dev: syntax
2024-12-31 13:08:40 +08:00
Myriad-Dreamin
d526469d1f
docs: document preview feature in vscode extension (#1092)
* docs: document preview feature in vscode extension.

* dev: adjust columns

* fix: bad refactor
2024-12-30 15:01:02 +08:00
Sylvan Franklin
b686b11018
docs: state shiroa as a requirement (#1086)
* docs: state `shiroa` as a requirment

Building the docs via `yarn docs` wraps `shiroa`, I could not build them without first installing `shiroa` which should be stated clearly in the development guide.

* dev: be more polite

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-29 20:32:35 +08:00
Yifan Song
3d805e0511
test: testcases for resource include (#1082) 2024-12-28 14:58:06 +08:00
Myriad-Dreamin
98c61d0023
docs: add a few comments to completion (#1084) 2024-12-28 13:23:48 +08:00
Myriad-Dreamin
81d3ea64c2
refactor: split completion functions by topics (#1083) 2024-12-28 12:45:45 +08:00
Yifan Song
c5981b81db
feat: fold continue line comments (#1043)
* feat: fold continue line comments

* update e2e hash

* fix: duplicate comment add to fold

* add test

* test: update snapshot

* feat: remove a clone and assign comment kind folding range

* test: update snapshot

* move to hierachy

* refact hierachy

* add todo

* update collapsed text

* fix: format

* add todo

* refactor: to help review

* refactor: no need to return error

* feat: split `CommentGroupMatcher`

* dev: reimplement nodes checker

* update e2e hash

* test: update snapshot

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-28 12:17:34 +08:00
Yifan Song
978e4d6f4e
fix: check file paths on renaming files (#1080) 2024-12-28 09:56:11 +08:00
Myriad-Dreamin
ef4714c195
dev: make eco completion repr and reduce clones (#1079)
* dev: create pair

* dev: make eco completion repr

* dev: reduce some clones
2024-12-28 09:52:47 +08:00
Myriad-Dreamin
451dc9dbdd
refactor: enclose contextual information in CompletionCursor (#1078)
* refactor: reduce some useless code

* refactor: move contextual things to a context

* refactor: force range calculation in place
2024-12-27 22:38:14 +08:00
Myriad-Dreamin
282b1d7b4d
refactor: merge some calculation stuff in completion worker (#1077) 2024-12-27 16:55:07 +08:00
Myriad-Dreamin
fb528ec70a
refactor: move completion code in request into worker (#1076)
* refactor: matcher tests

* refactor: move completion code in request into worker

* dev: move one use
2024-12-27 13:59:04 +08:00
Myriad-Dreamin
9c8d1461b7
refactor: merge completion stuff (#1074)
* dev: move two syntax completion to ext

* feat: move mode completion in ext.rs

* dev: clean code

* refactor: merge completion stuff

* test: update snapshot
2024-12-27 13:00:38 +08:00
Myriad-Dreamin
1059ea7e66
fix: complete raw language again (#1073) 2024-12-26 17:00:21 +08:00
Myriad-Dreamin
38941b8169
fix: complete body of let/closure in markup mode (#1072) 2024-12-26 16:47:57 +08:00
Myriad-Dreamin
1dcb034b91
fix: complete hash expression in math mode (#1071)
* fix: complete hash expression in math mode

* fix: `interpret_mode_at_kind` on hash
2024-12-26 16:19:46 +08:00
Myriad-Dreamin
98a0e60b20
fix: complete context expression in code mode (#1070) 2024-12-26 16:05:20 +08:00
Myriad-Dreamin
53b19dda24
test: add more completion tests (#1069)
* test: add more completion tests

* test: add more completion tests

* test: add more tests

* test: update snapshot
2024-12-26 15:54:02 +08:00
Myriad-Dreamin
db20807153
build: bump version to 0.12.14 (#1066) 2024-12-25 21:05:07 +08:00
Myriad-Dreamin
c66615934c
docs: add dev guide of tinymist-query (#1064) 2024-12-25 12:20:09 +08:00
Myriad-Dreamin
dd67518248
chore: fix naming of universal platform (#1063) 2024-12-24 12:30:16 +08:00
Myriad-Dreamin
7e3c0b2e18
dev: improve types when accessing element fields (#1062)
* dev: improve types when accessing element fields

* test: update snapshot
2024-12-24 10:34:16 +08:00
Myriad-Dreamin
223a142931
dev: generate extension installation table (#1061)
* dev: generate extension installation table

* dev: collapse style
2024-12-24 09:42:36 +08:00
Myriad-Dreamin
e5f88431dd
build: bump version to 0.12.14-rc1 (#1060)
* docs: update changelog

* docs: update changelog

* build: bump version to 0.12.14-rc1

* dev: exclude typlite from dist publish
2024-12-23 21:15:15 +08:00
Myriad-Dreamin
8f88f248a9
ci: build universe target vscode extension for other platforms (#1059)
* ci: build universe target vscode extension for other platforms

* chore: add comments
2024-12-23 20:21:24 +08:00
Yifan Song
7fdfca9201
docs: doc preview dev (#1058)
* doc: doc preview

* fix to uncomment

* docs: improve a bit

* docs: improve a little bit

* chore: add link to root cargo.toml

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-23 19:08:43 +08:00
Myriad-Dreamin
a5133b0146
build: bump typst-ansi-hl to v0.3.0 (#1057) 2024-12-23 16:22:50 +08:00
Myriad-Dreamin
0078874088
build: bump typstfmt to v0.12.1 (#1056)
* build: bump typstfmt to v0.12.0

* build: bump typstfmt to 0.12.1
2024-12-23 14:45:07 +08:00
Myriad-Dreamin
fde578c7a6
refactor: construct formatting configuration earlier (#1048)
* dev: construct configuration earlier

* dev: rename

* test: recover `formatter_print_width` test

* test: add `set_width` test
2024-12-23 14:03:53 +08:00
Myriad-Dreamin
249de8250f
fix: words in typst document should not contain dollars (#1054) 2024-12-23 13:46:05 +08:00
Myriad-Dreamin
b7f44e882a
test: add more tests about completing in middle of strings/labels (#1052) 2024-12-22 20:15:23 +08:00
Myriad-Dreamin
8a88b50cb1
fix: adjust offset from start when completing labels (#1051) 2024-12-22 19:19:01 +08:00
Myriad-Dreamin
362f625949
feat: complete fields by type (#1050)
* feat: complete fields by type

* test: update snapshot

* dev: store documentation

* test: check content type

* test: update snapshot

* test: update snapshot
2024-12-22 15:27:03 +08:00
Wenzhuo Liu
1cf20585f4
build: bump typstyle to v0.12.13 (#1047)
* chore: bump typstyle to v0.12.13

* dev: code style

* dev: code style cont

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-22 15:11:00 +08:00
Myriad-Dreamin
497a1e0aea
refactor: simplify and document lsp_typst_boundary crate (#1049) 2024-12-22 11:21:04 +08:00
Myriad-Dreamin
5db1cf984a
feat: infer types of show rule transformers (#1045)
* feat: infer types of show rule transformers

* test: add test for show rules

* feat: more selector cases

* test: update snapshot
2024-12-22 10:42:07 +08:00
Myriad-Dreamin
458695b3a0
feat: check input constraints of simple functions (#1042) 2024-12-21 17:57:42 +08:00
Myriad-Dreamin
a814c7a63d
dev: move field_access_completions (#1041) 2024-12-21 13:51:09 +08:00
Myriad-Dreamin
a4de68a1ca
fix: determine name_started in sig constructors (#1038)
* fix: name_started in sig constructors

* fix: test it
2024-12-21 13:50:37 +08:00
Myriad-Dreamin
97541d54f8
fix: identify closure as regular surrounding syntax (#1040) 2024-12-21 13:23:36 +08:00
Myriad-Dreamin
1c157adadf
fix: don't check context of field accesses' target (#1039) 2024-12-21 13:23:21 +08:00
Myriad-Dreamin
6d36195964
dev: less sync and clone (#1037) 2024-12-21 12:52:36 +08:00
Yifan Song
d9cec6e89b
feat: comment complete for tidy style doc comment (#1029)
* feat: basic dot comment completion

* fix: add parameter desc placeholders

* add todo

* fix: spread repr

* update snapshot hash

* fix: handle pattern single ident

* refactor: remove a useless log

* update e2e hash

* fix: rename Tidy Doc into Document function

* fix: get rid of additional edit with trim prefix

* fix: strict doc comment condition
2024-12-21 10:42:55 +08:00
Myriad-Dreamin
1eb63870fd
refactor: final touch and complete matchers (#1036)
* perf: minor optimize matches to dot access

* refactor: final touch and complete matchers

* dev: change name back
2024-12-20 20:56:45 +08:00
Myriad-Dreamin
980571ad61
feat: use field access classifier for completion (#1035)
* feat: use field access classifier for completion

* dev: more cases about dot access
2024-12-20 19:15:59 +08:00
Myriad-Dreamin
39243ba626
feat: classify field accesses for ide functions (#1034)
* feat: classify field accesses for ide functions

* test: update snapshot
2024-12-20 18:47:44 +08:00
Myriad-Dreamin
7dbaca8851
refactor: update names and documentation of matchers (cont.) (#1033) 2024-12-20 18:35:36 +08:00
Myriad-Dreamin
2ba650a0fd
dev: make compiler task async (#1032)
* dev: make compiler task async

* dev: reduce some clones
2024-12-20 16:48:45 +08:00
Myriad-Dreamin
de8e45a539
refactor: rename local variables (cont.) (#1026) 2024-12-18 19:48:34 +08:00
Myriad-Dreamin
9017e05afa
refactor: merge typlite bin and lib crate (#1024) 2024-12-18 19:24:44 +08:00
Myriad-Dreamin
be1d659719
refactor: rename local variables and some types (#1023)
* fix: naming

* refactor: rename local variables and some types
2024-12-18 19:23:31 +08:00
Myriad-Dreamin
ad0c1e8aca
refactor: improving names of matched structs and documenting matchers (#1022) 2024-12-18 16:35:15 +08:00
Myriad-Dreamin
902bd17cba
test: add tests about math dot completion (#1021) 2024-12-18 15:53:54 +08:00
Myriad-Dreamin
0f512dd09e
fix: forbid ident code completion in field access (#1020)
* feat: forbid ident code completion in field access

* test: update snapshot
2024-12-18 15:53:34 +08:00
Myriad-Dreamin
142138297e
fix: complete field access even if its parent is a closure (#1019)
* dev: complete field access even if it's parent is a closure

* test: update snapshot
2024-12-18 15:06:57 +08:00
Myriad-Dreamin
e116b0b645
test: cover cases about completing after the dot operator (#1017)
* test: add field tests

* dev: add a snapshot
2024-12-18 13:12:55 +08:00
Myriad-Dreamin
c0c6503f17
test: cases about completing field access in function call (#958) 2024-12-18 11:59:36 +08:00
Yifan Song
5f8a11bdc0
fix: resolve #986 avoid wrong offset on Neovim for some postfix snippets (#966)
* fix: avoid additional text_edit

* unify redundant to_lsp_snippet

* fix: remove redundant default_postfix_snippet

* fix: with single complete

* clean import

* chore: revert move to_lsp_snippet
2024-12-18 11:27:52 +08:00
Myriad-Dreamin
b1bb3196b7
ci: build binaries for riscv64-linux-musl, loongarch64-linux-{musl,gnu} (#1014)
* dev: patch cargo-dist

* dev: patch cargo-dist 2
2024-12-17 15:53:34 +08:00
Myriad-Dreamin
83fe1e7987
ci: generate binaries using cargo-dist (#1009)
* ci: generate binaries using `cargo-dist`

* chore: clean script

* fix: checking

* dev: update dist workspace

* dev: fix script

* docs: move announcement
2024-12-17 01:55:54 +08:00
Myriad-Dreamin
df03b36880
build: remove native-tls from dependencies (#1012) 2024-12-17 01:52:53 +08:00
Myriad-Dreamin
d3269f521a
build: bump version to 0.12.12 (#1013) 2024-12-17 01:45:02 +08:00
Myriad-Dreamin
80d9106520
build: bump tinymist to 0.12.12-rc3 (#1011) 2024-12-17 00:24:16 +08:00
Wenzhuo Liu
0a42b8728f
build: bump typstyle to v0.12.12 (#1010) 2024-12-17 00:10:35 +08:00
Myriad-Dreamin
9d93e3bb27
ci: check that the specified msrv is tested correctly (#1008) 2024-12-16 22:34:11 +08:00
Myriad-Dreamin
3cdd9f2508
build: bump version to 0.12.12-rc2 (#1005)
* build: bump version to 0.12.12-rc2

* build: upload crates

* docs: edit changelog
2024-12-15 18:49:50 +08:00
Myriad-Dreamin
2712654457
fix: account for preview jump bugs introduced in #997 (#1004)
* fix: many bugs in #997

* fix: definition of x, y
2024-12-15 16:35:41 +08:00
Myriad-Dreamin
0a97de3cf5
feat: check affiliated column for a hidden typst source document (#1003) 2024-12-15 16:06:24 +08:00
Myriad-Dreamin
def730f32a
feat: update way and add config about word separator (#1002) 2024-12-15 16:06:07 +08:00
Myriad-Dreamin
2a42ff67f5
build: bump version to 0.12.12-rc1 (#1000)
* build: bump version to 0.12.12-rc1

* docs: add changelog

* docs: update reference in changelog
2024-12-15 14:36:09 +08:00
Yifan Song
c54d1d31cb
feat: jump to neareast position in preview from cursor (#997)
* return multiple positions from jump_to_cursor

* format

* remove an alert

* add a simple doc for jump test

* feat: resolve currentPosition

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-14 16:49:23 +01:00
Wenzhuo Liu
cb3b648fcb
chore: bump typstyle to v0.12.10 (#987) 2024-12-14 14:59:04 +08:00
b18c3ca71c
fix: compatibility for some old chromium core (#995)
* fix: compatibility for some old chromium core

* feat: resolve relative URL manually

* dev: revert the change

* dev: add some comment

* fix: wrong regrex in 50228956

* dev: upgrade version to use

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-14 14:41:28 +08:00
Yifan Song
b19810ea6f
feat: add in postfix snippet (#963) 2024-12-12 15:01:55 +08:00
Myriad-Dreamin
511ec2b5a8
feat: configure word separator and pattern specific for typst (#990)
* feat: configure word separator and pattern specific for typst

* dev: async and catch
2024-12-12 14:23:52 +08:00
Myriad-Dreamin
382d73ddeb
refactor: remove inlay_hint function for simplicity (#992)
* refactor: remove `inlay_hint` function for simplicity

* test: update snapshots of inlay hints

* test: update snapshot
2024-12-12 14:21:04 +08:00
Myriad-Dreamin
ca3c29fc2d
docs: rename link_exprs crate to link_expr (#991) 2024-12-12 13:48:04 +08:00
Myriad-Dreamin
57e209f7e0
docs: split and documenting document highlight worker (#989) 2024-12-12 13:26:01 +08:00
Myriad-Dreamin
5747dd6ba6
feat: explicitly trigger suggest after completed import/include snippets (#984)
* feat: explicitly trigger suggest on completing import/include snippets

* fix: comment

* test: update snapshot
2024-12-11 14:40:57 +08:00
Myriad-Dreamin
a86f7a494a
perf: prefetch package index for completion (#983) 2024-12-11 14:05:52 +08:00
Myriad-Dreamin
4f5c9c7735
feat: convert mode-aware snippets to static data (#982) 2024-12-11 13:58:08 +08:00
Myriad-Dreamin
3473fb88a5
refactor: rename code_exprs crate to code_expr (#981) 2024-12-11 13:38:53 +08:00
Myriad-Dreamin
dd60ce5781
refactor: remove a closure in code lens solver (#979) 2024-12-11 11:26:32 +08:00
Myriad-Dreamin
10d72f139e
docs: documenting color expr worker (#980) 2024-12-11 11:04:08 +08:00
Myriad-Dreamin
dde3f5dff1
docs: rearrange and documenting cache structures (#978) 2024-12-11 11:03:58 +08:00
Myriad-Dreamin
678b2d2111
docs: split and documenting code action worker (#977)
* docs: split and documenting code action worker

* dev: update prelude
2024-12-11 11:03:47 +08:00
Myriad-Dreamin
0d4cd77d2c
docs: improve contributing and development guide (#976)
* docs: improve contributing and development guide

* wording
2024-12-10 22:30:25 +08:00
Myriad-Dreamin
c430e3d051
feat: type check labels with tolerating syntax error (#975)
* feat: type check labels with tolerating syntax error

* fix: naming

* fix: use and type
2024-12-10 18:49:06 +08:00
Myriad-Dreamin
2f882378bc
dev: complete labels with tolerating syntax error (#974) 2024-12-10 16:05:19 +08:00
Myriad-Dreamin
00195884de
test: add test about half-completed labels (#973)
* test: add test about half-completing labels

* space
2024-12-10 15:38:23 +08:00
Myriad-Dreamin
f665d7c50c
test: add test about path completion (#972) 2024-12-10 15:05:51 +08:00
Myriad-Dreamin
969cc6d339
refactor: complete paths without hacking (#971)
* refactor: complete paths without hacking

* dev: move code after refactor
2024-12-10 14:29:24 +08:00
Myriad-Dreamin
ab234634a9
fix: complete import path by syntax instead of type (#968)
* fix: complete import path by syntax instead of type

* test: add import package tests

* fix: unused item
2024-12-08 21:59:35 +08:00
Myriad-Dreamin
fee46d2123
fix: other two wrong usages of analyze_import (#967) 2024-12-08 21:33:53 +08:00
Myriad-Dreamin
2eddcbd87f
feat: check surrounding syntax when performing type completion (#965)
* feat: check surrounding syntax when performing type completion

* test: add testcases
2024-12-08 16:44:33 +08:00
Myriad-Dreamin
a54bc5d80c
feat: enrich all type completions consistently (#964) 2024-12-08 12:00:18 +08:00
Yifan Song
0464af6acf
fix: complete import items on spaces, colons, and commas (#962)
* fix: import item complete

* fix: cursor better than start

* fix: strengthen snapshot

* fix: cases on empty import list

* feat: matches on comma in import list

* test: simplify testcases and update snapshots

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-08 11:54:33 +08:00
Wenzhuo Liu
9dd14d0232
build: bump typstyle to v0.12.8 (#961) 2024-12-08 09:48:12 +08:00
Yifan Song
44b3f3f8c1
fix: simplify types of variables for hover tooltip (#959)
* feat: type for hover on var

* test: update snapshots for hover on params

* fix: simplify type before formatting

* test: update snapshot

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-07 19:32:40 +08:00
Myriad-Dreamin
4a236e88cd
build: bump version to 0.12.10 (#960)
* docs: update changelog

* wording

* build: bump version to 0.12.0
2024-12-07 15:39:32 +08:00
Myriad-Dreamin
5dd9badc11
build: bump version to 0.12.10-rc1 (#957)
* docs: update changelog

* build: bump version to 0.12.10-rc1

* wording
2024-12-07 12:30:34 +08:00
Myriad-Dreamin
b73bafd269
build: bump dependencies (#954) 2024-12-07 11:29:13 +08:00
Myriad-Dreamin
9efc3d55d5
fix: typos in tinymist-query (#956) 2024-12-07 11:25:34 +08:00
Myriad-Dreamin
0d40da4ada
docs: add docs to cargo patches (#955)
* docs: add docs to cargo patches

* wording

* hint
2024-12-07 11:24:27 +08:00
Myriad-Dreamin
22d2ed88a3
fix: don't complete import items across line (#952) 2024-12-06 13:29:21 +08:00
Myriad-Dreamin
9b3eaf9926
fix: bind this to showLog function (#951) 2024-12-06 11:36:55 +08:00
Yifan Song
b4ecb7f14b
feat: complete on import item path (#949)
The import item path syntax was introduced in typst 0.12.0 and had ruin the completion on import items.

* fix: grandparent is ImportItems

Fix: for `import "lib.typ": tes|`, the parent syntax is import item
path, then parent is import items

* feat: identify syntax context in import list

* feat: check the path under cursor for import completion

* fix: adjust from correctly

* dev: remove useless log

* fix: the unknown font on windows

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-06 11:35:59 +08:00
Myriad-Dreamin
a7f203a31c
fix: don't assert well-formed named parameters in docstring (#948) 2024-12-05 16:10:27 +08:00
Myriad-Dreamin
d5c07b1ae3
refactor: move entry resolver to query crate (#944) 2024-12-04 13:13:26 +08:00
Myriad-Dreamin
356fc2daad
refactor: reduce state and add tests (#943) 2024-12-04 11:45:26 +08:00
Myriad-Dreamin
00aecd9eae
refactor: split entry resolver (#942)
* refactor: split entry resolver

* refactor: naming
2024-12-04 11:05:28 +08:00
Myriad-Dreamin
c0d20cd1b2
refactor: make shared root paths (#929) 2024-12-04 06:44:55 +08:00
Myriad-Dreamin
27460a9c53
build: bump version to 0.12.8 (#940)
* build: bump version to 0.12.8

* fix: bump versions in package.json files
2024-12-03 22:27:57 +08:00
Myriad-Dreamin
d88cd90899
build: bump version to 0.12.6 (#939)
* docs: update changelog

* build: bump version to 0.12.6
2024-12-03 20:32:14 +08:00
Myriad-Dreamin
7efbaf35d2
build: bump version to 0.12.6-rc3 (#938)
* docs: update changelog

* build: bump version to 0.12.6-rc3
2024-12-03 17:28:57 +08:00
Myriad-Dreamin
c6fcfb4d96
docs: maintain editor docs (#937)
* docs: maintain editor docs

* docs: maintain editor docs (cont.)
2024-12-03 17:16:27 +08:00
Myriad-Dreamin
62c91b5286
feat: provide tool view (#936) 2024-12-03 17:16:08 +08:00
Myriad-Dreamin
ace3df5409
feat: dynamic analyze import source for star imports (#935) 2024-12-03 17:02:54 +08:00
Myriad-Dreamin
e8b8188c1f
fix: convert two touched panics to log::warn in signature checker (#934) 2024-12-03 17:02:40 +08:00
Myriad-Dreamin
b38e9bdf0e
feat: resolve module references in import at syntax level (#933) 2024-12-03 16:15:48 +08:00
Yifan Song
672a95c908
feat: search in template gallery (#922)
* feat: Search Gallery by name

* dev: use minisearch

* feat: highlight search

* feat: all query terms for highlight

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-12-03 12:23:34 +08:00
Myriad-Dreamin
3c98d574a2
feat: provide elementary font view (#932)
* dev: font view

* dev: tune functionality

* dev: add a todo
2024-12-03 12:20:27 +08:00
Myriad-Dreamin
fb98a7102a
build: bump version to 0.12.6-rc2 (#930)
* build: bump version to 0.12.6-rc2

* dev: reformat

* chore: update date to publish
2024-12-02 22:47:42 +08:00
Wenzhuo Liu
0001121432
build: bump typstyle to v0.12.6 (#928) 2024-12-02 22:02:41 +08:00
Myriad-Dreamin
0ded9e7d79
test(ci): also run tests on windows (#925)
* test(ci): also runs tests on windows and macos

* dev: remove tests on macos
2024-12-02 20:28:51 +08:00
Myriad-Dreamin
d9717fffa2
test(ci): add fmt, clippy, doc, and msrv tests to CI (#926)
* test(ci): add fmt, clippy, doc, and msrv tests to CI

* test(ci): check and build typst-preview

* fix: checks
2024-12-02 20:28:29 +08:00
Myriad-Dreamin
e1a5f0cdd7
dev: remove unused typst-kit (#924) 2024-12-02 18:08:26 +08:00
Myriad-Dreamin
032c81e93a
feat: add package related arguments to typstExtraArgs (#923)
* feat: use typst-kit's package functions

* feat: add package related arguments to `typstExtraArgs`

* feat: don't use typst-kit's downloader

* dev: improve a bit

* dev: less lazy

* dev: less interfaces
2024-12-02 17:47:28 +08:00
Myriad-Dreamin
531b8d6737
feat: check interface of all scope-like values (#920)
* feat: check interface of all scope-like values

* test: update snapshot
2024-11-30 23:24:22 +08:00
Myriad-Dreamin
63b31c6186
feat: convert values in builtin modules to definition (#919) 2024-11-30 23:05:00 +08:00
Myriad-Dreamin
982c430338
test: add tests about signature help (#917) 2024-11-30 22:50:58 +08:00
Myriad-Dreamin
1a41dfeb2d
build: bump version to 0.12.6-rc1 (#915)
* docs: update changelog

* build: bump version to 0.12.6-rc1

* fix: wording
2024-11-30 16:30:36 +08:00
Wenzhuo Liu
e158ba63fc
chore: bump typstyle to v0.12.4 (#904) 2024-11-30 16:10:39 +08:00
Myriad-Dreamin
d4141c8e74
fix: detect surrounding syntax of argument lists in show rule (#914) 2024-11-29 20:21:28 +08:00
Myriad-Dreamin
692e53880b
dev: deduplicate type bounds early (#913)
* case: package subpar:0.2.0
2024-11-29 20:04:35 +08:00
Myriad-Dreamin
ed79045588
dev: disable all runtime check to log::debug! (#912) 2024-11-29 19:52:42 +08:00
Myriad-Dreamin
8b495fe2ab
feat: recursively parse markup link according to typst syntax (#911) 2024-11-29 15:43:38 +08:00
Myriad-Dreamin
6fa07b6777
fix: stop show until new line or code terminator (#910) 2024-11-29 15:31:02 +08:00
Myriad-Dreamin
adef0381be
fix: continue parsing expression on func/method call (#909) 2024-11-29 15:30:51 +08:00
Myriad-Dreamin
5423976278
fix: stop import-as clause before colon (#908) 2024-11-29 15:17:00 +08:00
Myriad-Dreamin
b8f65cf2ec
fix: clippy warnings in rust 1.83 (#907) 2024-11-29 14:50:22 +08:00
Myriad-Dreamin
6d5c353fc0
fix: replace separator of type check snapshots from '---' to '=====' (#903) 2024-11-26 20:32:45 +08:00
Myriad-Dreamin
f75dc17e02
fix: rollback typo fixes in tokyo-hight.tmTheme (#899) 2024-11-26 16:37:57 +08:00
Wenzhuo Liu
e189b46be5
build: bump typstyle to v0.12.3 (#893)
* chore: bump typstyle to v0.12.2

* chore: keep changelog
2024-11-26 16:37:40 +08:00
Myriad-Dreamin
b3573029cc
fix: match braces in math mode as content (#901) 2024-11-25 13:14:36 +08:00
Yifan Song
3ed4323089
feat: restart server command in vscode (#894)
* add vscode command to restart server

* refactor: dispose all resources for restart function

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-11-25 09:42:07 +08:00
Caleb Maclennan
146d33e0a3 chore: Fix typos throughout code base (manual)
These are ones `typos` was not confident on how to fix but these seem
like reasonable resolutions to me.
2024-11-25 09:26:53 +08:00
Caleb Maclennan
6f4aba4aa8 chore: Fix typos throughout code base (automatic)
This is all the typos that `typos` is confident can just be fixed
automatically, minus the overrides added to the manifest for the false
positives I found.
2024-11-25 09:26:53 +08:00
Caleb Maclennan
3eee445dab chore: Add typos configuration to manifest for project level spellchecking 2024-11-25 09:26:53 +08:00
Caleb Maclennan
709946ce54
chore: copy-edit Neovim readme (#888)
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-11-25 09:25:46 +08:00
Myriad-Dreamin
162ff73f0f
fix: remove buggy term list parsing (#897) 2024-11-24 18:02:11 +08:00
Myriad-Dreamin
da6d6e970f
fix: undefined references in preview's html (#896)
* fix: undefined references in preview's html

* dev: publish preview html
2024-11-24 16:34:04 +08:00
Yifan Song
27816e421f
docs: describe use case of value "tinymist" in tinymist.serverPath (#895)
"tinymist" means looking up Tinymist in PATH
2024-11-24 13:09:42 +08:00
Myriad-Dreamin
ce125a2ed1
build: bump version to 0.12.4 (#892) 2024-11-23 16:03:58 +08:00
Myriad-Dreamin
e1848488f0
revert: undo "feat: add package related arguments to typstExtraArgs (#832 and #833)" (#891)
* Revert "fix: cross build with `vendor-openssl` feature and bump version to 0.12.4-rc2 (#884)"

This reverts commit 254c4ce087.

* Revert "feat: add package related arguments to `typstExtraArgs` (#833)"

This reverts commit 8e36f25cf2.

* Revert "feat: use typst-kit's package functions (#832)"

This reverts commit d2afe78fee.

* build: bump version to 0.12.4-rc3

* docs: update changelog
2024-11-23 14:17:40 +08:00
Myriad-Dreamin
254c4ce087
fix: cross build with vendor-openssl feature and bump version to 0.12.4-rc2 (#884)
* fix: cross build with `vendor-openssl` feature

* build: bump version to 0.12.4-rc2
2024-11-22 17:53:09 +08:00
Myriad-Dreamin
42e97d83f7
build: bump version to 0.12.4-rc1 (#883)
* docs: update changelog

* build: bump version to 0.12.4-rc1
2024-11-22 16:43:32 +08:00
Myriad-Dreamin
422971c8b6
fix: skip code completion when editing length (#882) 2024-11-22 16:15:40 +08:00
Caleb Maclennan
49d33e5047
feat: add alerque as maintainer (#810)
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-11-22 16:15:23 +08:00
Yifan Song
30d619a348
feat: add Eric-Song-Nop to maintainer list (#796)
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-11-22 16:05:36 +08:00
Myriad-Dreamin
94ea230645
feat: add code action to wrap content blocks (#881) 2024-11-22 16:03:07 +08:00
Myriad-Dreamin
3207f57a78
feat: add more postfix snippets (#880) 2024-11-22 15:39:59 +08:00
ParaN3xus
5e498ef864
Merge pull request #784 from max397574/patch-1
feat: Request to be a maintainer
2024-11-22 12:14:23 +08:00
Myriad-Dreamin
5ad2113e2b Merge remote-tracking branch 'origin/main' into patch-1 2024-11-22 11:43:30 +08:00
Myriad-Dreamin
b72eee6b84 feat: add CODEOWNERS 2024-11-22 11:39:17 +08:00
ParaN3xus
b336a7ad69
feat: add ParaN3xus as maintainer (#783) 2024-11-22 11:30:23 +08:00
Myriad-Dreamin
a2cf51a790
docs: update roadmap (typst v0.13.0+) (#876)
* docs: update roadmap (typst v0.13.0+)

* fix: wording
2024-11-21 14:27:12 +08:00
Myriad-Dreamin
67e659a878
feat: prefer to guide coding by signature help (#874)
* feat: prefer to guide coding by signature help

* test: update markdown description

* test: update configuration for testing
2024-11-21 13:14:58 +08:00
Myriad-Dreamin
1ba6b6c1e0
test: update snapshots in legacy format (#873) 2024-11-21 12:55:57 +08:00
Myriad-Dreamin
a13c8e41ba
fix: replace [] with .bracket in label (#870)
* fix: replace `[]` with `.bracket` in label

* test: update snapshot
2024-11-20 20:46:03 +08:00
Myriad-Dreamin
644494b1dc
feat: rename links in files (#869) 2024-11-20 16:55:48 +08:00
Myriad-Dreamin
6f4b916598
feat: provide both bracket and paren completion (#867)
* feat: provide both bracket and paren completion

* test: update snapshot
2024-11-20 16:55:34 +08:00
Myriad-Dreamin
9885c45fb2
dev: cache link expressions (#866) 2024-11-20 16:24:12 +08:00
Myriad-Dreamin
19a83bc942
feat: reorder snippet completion items (#865) 2024-11-20 16:19:45 +08:00
Myriad-Dreamin
18c6cdd9d4
feat: add search index to quickly filter unrelated files (#864) 2024-11-20 16:14:32 +08:00
Myriad-Dreamin
06773da8af
feat: pass completion configs via context (#863) 2024-11-20 16:06:28 +08:00
Myriad-Dreamin
ba2f1bcfb2
fix: refine some scope condition for type completion (#862) 2024-11-20 16:06:15 +08:00
Myriad-Dreamin
d8ee287b77
feat: replace rule completion with scoped type completion (#861)
* feat: replace rule completion with scoped type completion

* test: update snapshot
2024-11-20 15:49:58 +08:00
Yifan Song
e2c8418c35
fix: use correct base directory for path completion (#854)
* fix wrong diff_path

* refactor: simplify no base.parent()
2024-11-20 11:14:29 +08:00
Myriad-Dreamin
6c342eb23e
dev: don't complete bracket in math context (#860) 2024-11-20 09:20:20 +08:00
Myriad-Dreamin
698d86f9b0
dev: check previous syntax first for show/set syntax (#859) 2024-11-20 02:43:10 +08:00
Myriad-Dreamin
6f8d9750d7
feat: improve and filter completion in show/set syntax (#858) 2024-11-20 02:15:53 +08:00
Myriad-Dreamin
37ea3b8d3d
dev: filter settable parameter if is in set context (#857) 2024-11-20 01:47:56 +08:00
Myriad-Dreamin
e95e4284b1
fix: match brackets in content block recursively (#856)
* feat: only match brackets in content block

* test: update snapshot
2024-11-19 23:28:12 +08:00
Myriad-Dreamin
ac62abeb0b
fix: reliably check value of "tinymist.showExportFileIn" (#855)
* fix: reliably check value of "tinymist.showExportFileIn"

* feat: show warning message
2024-11-19 23:04:39 +08:00
Myriad-Dreamin
ab3716d866
feat: postfix completion on values (#850)
* feat: postfix completion on values

* dev: delete an ovo-log
2024-11-19 13:36:14 +08:00
Myriad-Dreamin
d0b40dbfa6
feat: provide UFCS-style completion on content types (#849)
* feat: UFCS completion on content types

* dev: cleanup panics

* feat: add configuration about postfix completion

* test: update snapshot

* fix: lazily determine default values
2024-11-19 12:48:04 +08:00
Myriad-Dreamin
a1a15a6795
feat: complete bracket if the function accepts an only content arg (#848)
* feat: complete bracket if the function will accept an only content argument

* test: update snapshot
2024-11-19 11:04:27 +08:00
Myriad-Dreamin
ccd3cea08c
feat: improve caches of calls and module exports type checking (#847)
* dev: optimize log on critical paths

* dev: optimize `check_module_item`

* dev: cache source queries

* dev: cache call checking

* dev: remove source cache
2024-11-18 17:20:05 +08:00
Myriad-Dreamin
256dd3b3a5
feat: replace param_completions with post type checking (#846)
* feat: replace param_completions with post type checking

* dev: dirty code and snapshot
2024-11-18 17:01:28 +08:00
Myriad-Dreamin
90626f0a5f
test: add more completion tests (#845) 2024-11-18 13:12:57 +08:00
Myriad-Dreamin
8a15eb9d66
dev: simplify let type (#844)
* fix: simplify let type

* test: update snapshot
2024-11-18 13:09:37 +08:00
Myriad-Dreamin
a9800bc802
dev: introduce TypeType and Module type (#843)
* dev: introduce `TypeType` and `Module` type

g

* test: update snapshot

* test: update snapshot
2024-11-18 12:52:27 +08:00
Myriad-Dreamin
c551950a85
feat: check union type annotation (#842) 2024-11-18 11:44:28 +08:00
Myriad-Dreamin
a2e7e4c88c
fix: bugs in post checking node and call (#841)
* fix: bugs in post checking node and call

* test: update snapshot

* test: update snapshot
2024-11-18 11:44:13 +08:00
Myriad-Dreamin
378d412cf7
fix: check signature of partially specialized functions (#840) 2024-11-18 11:10:12 +08:00
Myriad-Dreamin
78a4117ec6
fix: open exported files using rust's open crate (#838)
* fix: open exported files using rust's `open` crate

* feat: explorer as file opener on windows

* dev: link related issue
2024-11-17 22:08:13 +08:00
Myriad-Dreamin
263458a80b
feat: take configuration items from tinymist section (#835)
* feat: take configuration items from `tinymist` section

* docs: update configuration guide in emacs
2024-11-16 17:32:11 +08:00
Myriad-Dreamin
8e36f25cf2
feat: add package related arguments to typstExtraArgs (#833) 2024-11-16 17:16:56 +08:00
Myriad-Dreamin
d2afe78fee
feat: use typst-kit's package functions (#832) 2024-11-16 16:27:17 +08:00
Myriad-Dreamin
0a8010fe53
dev: update header description of snapshots (#831)
* dev: update header description of snapshots

* dev: update header description of snapshots
2024-11-16 14:41:45 +08:00
Myriad-Dreamin
57c6c7a4f6
dev: replace FieldTy with ParamTy (#830) 2024-11-16 13:50:50 +08:00
MrLego8_9
d618430f6e
fix: statically register formatting and semantic tokens capabilities (#814)
* fix: statically register formatting and semantic tokens capabilities

* fix: inline variables and remove comment

* dev: inline variables

* fix: not working on vscode

* test: update snapshot

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-11-15 22:28:51 +08:00
Myriad-Dreamin
434f222855
build: bump version to 0.12.2 (#829) 2024-11-15 21:38:23 +08:00
Myriad-Dreamin
5ce0a8feba
fix: enclose fallback docs in code block (#828) 2024-11-15 20:59:26 +08:00
Myriad-Dreamin
52a8d0e678
build: bump version to 0.12.2-rc1 (#827)
* build: bump packages

* docs: update changelog

* build: bump version to 0.12.2-rc1

* chore: wording

* fix: errors

* fix: wording
2024-11-15 15:19:59 +08:00
Myriad-Dreamin
9f36fea62b
docs: maintain docs for tinymist 0.12.2 (#825) 2024-11-15 14:17:43 +08:00
Myriad-Dreamin
da1e68ad1f
feat: conditionally render code in docs (#824)
* feat: conditionally render code in docs

* fix: fmt

* fix: config
2024-11-15 13:40:30 +08:00
Myriad-Dreamin
8b3a0e986a
feat: fully support onEnter edits inside comments (#823)
- select with range
- multiple cursor
2024-11-14 22:21:14 +08:00
Myriad-Dreamin
a2eb405430
feat: goto field definition of concrete values (#822) 2024-11-14 22:20:59 +08:00
Myriad-Dreamin
f18ed7d1b2
fix: query underlying file type when listing packages (#821) 2024-11-14 21:22:36 +08:00
Myriad-Dreamin
c6047f8712
fix: bad usage of /package/symbol (#820) 2024-11-14 21:22:16 +08:00
Myriad-Dreamin
4581d10703
feat: evict analysis caches before exact min revision (#819) 2024-11-14 21:22:05 +08:00
Myriad-Dreamin
b844240212
dev: clean up log to print (#818) 2024-11-14 21:21:47 +08:00
Myriad-Dreamin
dd2a22a67d
dev: use more safe retainer for gc (#817) 2024-11-14 21:21:27 +08:00
Myriad-Dreamin
bbcca41909
dev: add time limit to lsp replay command (#816) 2024-11-14 21:21:17 +08:00
Myriad-Dreamin
1c08256e9c
fix: describe dictionary object by correct name (#815) 2024-11-14 21:21:08 +08:00
Myriad-Dreamin
808da99092
feat: improve style of hover param docs (#813)
* feat: improve style of hover param docs

* feat: give value example in parameter docs
2024-11-14 20:49:14 +08:00
Myriad-Dreamin
c128f633d4
feat: merge func and variable docs parser (#812)
* feat: merge func and variable docs parser

* test: update snapshot
2024-11-14 20:35:21 +08:00
Myriad-Dreamin
7ab125bbc2
fix: ensure expr and type enum are not too big (#811) 2024-11-14 11:47:34 +08:00
Myriad-Dreamin
3469e215eb
dev: refactor semantic_tokens crate (#809)
* dev: move semantic_tokens crate

* dev: remove bad comment
2024-11-14 02:39:26 +08:00
Myriad-Dreamin
fc3099a27c
feat: lock and snapshot {analysis,token} caches on main thread (#806)
* refactor: hide lock in `query_snapshot`

* refactor: hide lock in `query_snapshot`

* test: update snapshot

* dev: update comments

* dev: update snapshot
2024-11-14 01:40:27 +08:00
Myriad-Dreamin
61f2273e2e
dev: convert diagnostics without analysis snapshot (#805) 2024-11-13 23:51:48 +08:00
Myriad-Dreamin
cadc70ceec
dev: use fixtures/playground if name is not provided (#804) 2024-11-13 23:51:39 +08:00
Myriad-Dreamin
41868aa0f4
fix: strip out the line containing the return type (#803) 2024-11-13 23:51:29 +08:00
Myriad-Dreamin
58b8015386
dev: refactor semantic token apis (#802) 2024-11-13 23:51:20 +08:00
Myriad-Dreamin
41e8e1105f
fix: bad type representation of rest parameters (#801) 2024-11-13 23:22:40 +08:00
Myriad-Dreamin
8a5d687da6
fix: bad rule to check function identifiers by syntax (#800) 2024-11-13 18:20:11 +08:00
Myriad-Dreamin
5616a3fb34
feat: slightly improve expression describer (#798)
* dev: simplify type union

* dev: split repr crate

* feat: slightly improve expression describer

* dev: update snapshot

* dev: change repr if there is no name
2024-11-12 17:53:00 +08:00
Yifan Song
0babb8b451
fix: wrong word count when empty line exists (#795) 2024-11-12 14:11:16 +08:00
Myriad-Dreamin
bdb127109f
dev(ci): upload log even if CI is failing (#787) 2024-11-09 22:07:48 +08:00
Myriad-Dreamin
d8886b2065
feat: render error as docs instead of causing failures (#786) 2024-11-09 21:53:55 +08:00
Myriad-Dreamin
22621a966c
feat: consistently enrich colon after show selectors (#785) 2024-11-09 21:26:42 +08:00
max397574
a4bcd802ec
Update MAINTAINERS.typ 2024-11-09 11:25:32 +01:00
Myriad-Dreamin
bbee391995
feat: claim list of maintainers (#781)
* feat: claim list of maintainers

* docs: update readme

* fix: maintain list
2024-11-09 11:59:36 +08:00
Myriad-Dreamin
adbf05d366
fix: rename export_again to is_external (#777) 2024-11-08 16:16:01 +08:00
Myriad-Dreamin
662ae488be
test: add more completion tests (#776)
* dev: add more tests

* test: add show/set completion tests

* test: test completion about arguments of builtin functions
2024-11-08 16:15:45 +08:00
Myriad-Dreamin
411f29fd53
feat: recover support to goto definition of fields (#775)
* feat: goto field definition with type checking

* dev: minor changes

* dev: update snapshot
2024-11-08 16:15:31 +08:00
Myriad-Dreamin
3da56a4dd2
fix: range error when converting huge base64 strings (#774) 2024-11-08 15:55:57 +08:00
Myriad-Dreamin
d75fd7e74e
feat: render examples in docs (#772)
* feat: render examples in docs

* fix: create `hover-images` on `startHover`

* dev: update snapshot
2024-11-08 15:55:47 +08:00
Myriad-Dreamin
d02fa18617
dev: implement Ord for Decl (#773)
* dev: change order to compare

* dev: implement `Ord` for `Decl`
2024-11-08 15:46:28 +08:00
Myriad-Dreamin
a402d6d4ae
docs: add documentation about docstring (#771)
* docs: add documentation about docstring

* docs: minor revision
2024-11-07 16:18:56 +08:00
Myriad-Dreamin
c035f42676
feat: strictly match module-level comments (#770)
* feat: strictly match module-level comments

* dev: update snapshot
2024-11-07 16:18:44 +08:00
Wenzhuo Liu
7dfa0fb498
chore: bump typstyle to v0.12.1 (#764) 2024-11-04 15:27:59 +08:00
Myriad-Dreamin
c830048b61
chore: upload test snapshot for debugging (#760) 2024-11-02 14:52:34 +08:00
Myriad-Dreamin
f1f77065d7
dev: collect func.with type information for signature help (#759)
* feat: static analysis on `func.with` bindings

* test: update snapshot
2024-11-02 14:52:25 +08:00
Myriad-Dreamin
67367b03bf
dev: hash imports of expr info (#756) 2024-10-31 23:27:59 +08:00
Myriad-Dreamin
8f3566366e
refactor: refactor hover, analysis/global, and docs crates (#755)
* dev: refactor hover.rs

* refactor refactor AnalysisContext

* refactor: refactor docs crate
2024-10-31 10:07:31 +08:00
Myriad-Dreamin
1c1bc19caf
dev: more consistent way to get docs of decls (#752)
* dev: more consistent way to get docs of decls

* test: update snapshot
2024-10-30 22:29:07 +08:00
Myriad-Dreamin
8129c6741e
feat: provide docs when hovering on module refs (#751)
* feat: hover for module-level docs

* test: update snapshot

* test: update snapshot
2024-10-30 17:07:47 +08:00
Myriad-Dreamin
ac97c34d0f
feat: improve signature formatting in docs (#750)
* feat: improve signature formatting in docs

* test: update snapshot

* fix: package docs formatting
2024-10-30 15:17:08 +08:00
Myriad-Dreamin
b97907cde6
docs: update neovim's setup section (#749) 2024-10-29 22:56:05 +08:00
Myriad-Dreamin
493f8a8695
feat: don't trigger trivial completion when the trigger char is an ascii punctuation (#748) 2024-10-29 22:32:12 +08:00
Myriad-Dreamin
e8f5f6185a
fix: match identifier like nodes for completion (#747)
* fix: match identifier like nodes for completion

* test: update snapshot
2024-10-29 22:09:55 +08:00
Myriad-Dreamin
9385b95c81
fix: bitmap and svg glyphs are not rendered correctly (#745) 2024-10-29 16:38:21 +08:00
Myriad-Dreamin
9c87fe2fb4
feat: client-side control to whether issue completion callback (#744)
* feat: client-side control to whether issue completion callback

* fix: bad changes
2024-10-29 13:00:57 +08:00
summerBreeze630
5dd1226cdc
dev: complete symbol classification in handwriting recognizer (#705)
* dev: complete symbol classification in handwriting recognizer

* dev: update symbol category

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-10-29 11:19:48 +08:00
Myriad-Dreamin
c798d3037e
feat: show performance statistics in summary page (#743) 2024-10-29 11:16:59 +08:00
Myriad-Dreamin
15785f1deb
feat: add check package command (#742)
* g

* feat: add check package command
2024-10-29 11:16:40 +08:00
Julien THILLARD
c4c9a704ce
feat: add preview icon when clicking outside the document (#734)
* Always show preview icon

* Drop editor when closed, default on activeEditor
2024-10-29 11:16:24 +08:00
Myriad-Dreamin
8ca953dbed
feat: identify identifier kind for semantic highlighting (#741)
* feat: identify identifier kind for semantic highlighting

* test: update snapshot
2024-10-29 10:52:41 +08:00
Myriad-Dreamin
1d49e110e2
dev: cache expression information correctly (#736)
* dev: cache expression information correctly

* rev
2024-10-27 20:20:59 +08:00
Myriad-Dreamin
2c38695b6f
docs: maintain readme and command docs (#733)
* docs: maintain readme and command docs

* docs: update inline images

* test: update snapshot

* test: update baseline

* test: update baseline
2024-10-26 22:47:12 +08:00
Myriad-Dreamin
81ebc8a635
feat: implement expression checker (#714)
* feat: implements expression checker

* dev: resolve information

* dev: delete def_use

* stage

* stage

* stage

* stage concurrent

* stage concurrent

* dev: better concurrency

* dev: final constant evaluation improvement

* dev: change reference site

* dev: handle comments

* dev: remove indirect import structure

* dev: adjust linked_def impl

* dev: finalize goto definition impl

* dev: replace all old import and def_use analyses with expr analysis

* dev: update expr_of snapshots

* dev: split def/expr, refactor definition

* dev: more consistent definition solver

* dev: rename definition crate

* dev: references work again

* dev: resolve root decl

* dev: resolve root decl

* dev: resolve global definitions

* dev: resolve tokens with world

* feat: render semantic tokens with expression information

* dev: loop detection

* dev: recover type checking

* dev: recover more type checking

* dev: refactor analysis context

* fix: process case of spread left

* dev: label inference

* dev: recover more signature checking

* dev: recover more ident reference checking

* dev: pass all tests

* Revert "dev: dirty changes"

This reverts commit 9ae2dacd0c96851e088feea76c61c184a1cf9722.

* test: update snapshot

* fix: bad cached signatures

* fix: slash problem
2024-10-25 23:52:11 +08:00
Myriad-Dreamin
136b162360
dev: fix bugs in bold/italic syntax highlighting (#732) 2024-10-24 23:34:06 +08:00
Myriad-Dreamin
79ada570b7
dev: fix bidirectional jump feature if there is a page fill (#728) 2024-10-23 00:04:11 +08:00
Tan, Long
5d89acfd3a
docs: add coc.nvim config example (#727)
* docs: add coc.nvim config example

* docs: update readme

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-10-22 23:13:57 +08:00
Myriad-Dreamin
ace46062a1
feat: disable unicode pair autocompletion (#726) 2024-10-22 23:02:52 +08:00
Myriad-Dreamin
464b83dcf8
dev: remove outdated typst.tmLanguage.json (#725) 2024-10-22 22:26:23 +08:00
Myriad-Dreamin
b1efa88161
feat: improve syntax highlighting (#724)
* dev: simplify if statement handling

* dev: parse blocks in if/for/while more consistently

* feat: improve context expression parsing

* feat: improve context expression parsing

* feat: improve parameter clause parsing
2024-10-22 21:41:20 +08:00
Myriad-Dreamin
7a54bc1030
feat: {en,de}code base-64 strings with Text{De,En}coder (#719) 2024-10-21 13:23:08 +08:00
Myriad-Dreamin
4437b3bffb
build: bump version to 0.12.0 (#712)
* build: bump version to 0.12.0

* build: fix git versions

* docs: update changelog

* fix: description in changelog

* fix: wrong category
2024-10-20 00:52:15 +08:00
Myriad-Dreamin
7ed731b0e5
build: bump node version to 22 in gh_pages (#711) 2024-10-19 23:06:12 +08:00
Myriad-Dreamin
ff535a1924
fix: bump version to 0.12.0-rc1 (real) (#710)
* test: update snapshot

* fix: actually bump to 0.12.0-rc1
2024-10-19 23:03:10 +08:00
Myriad-Dreamin
66fff06dfe
build: bump tinymist to 0.12.0-rc1 (#708)
* feat: support nightly typst (#600)

* feat: support for custom certificate configuration (#592)

* feat: add certificate option

* refactor: move SystemCompilerFeat into tinymist-world

* feat: move HttpRegistry as HttpsRegistry into tinymist-world

* feat: add reading pem file

* feat: update LspUniverseBuilder::build

* feat: fill missing argument of LspUniverseBuilder::build

* chore: update lock file for additional dependencies

* chore:  refine comment for certification

* refactor: simplify by new constructor

* refactor: sort arguments for threaded_http

* refactor: split https.rs from lib.rs in tinymist-world

* feat: provide package view and local documentation (#596)

* feat: move featured components

* feat: provide package view and local documentation

* stage

* fix: compile error by merged commits

* fix: ignore system fonts correctly (#597)

* feat: adapt nightly typst

chore: use mainline typst

fix: `leaf_at` second parameter

fix: build `Engine`

fix: `interpret_mode_at` converage

feat: use my typst

fix: use `typst::trace` to trace

fix: frameitem

fix: new kinds

fix: new scope

fix: lazyhash

fix: result

fix: new SyntaxKinds

fix: utils, lazyhash

chore: remove useless imports

fix: sink

feat: frameitem

fix: export svg with page

fix: deref span

styl:

deps

fix: lazyhash

deps: use my typstyle

fix: enable contenthint with feature

fix: leaf_at side

fix: compile.output

deps

fix: warnings

deps: use new branch name

fix: fix merge error

ci: update ci branch

test: accept new test snap

fix: fix compile

deps: update typst

fix: fix compilation for latest tinymist

fix: fix tests

fix: fix tests

* chore: clean useless imports

---------

Co-authored-by: ricOC3 <100465762+ricOC3@users.noreply.github.com>
Co-authored-by: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com>

* fix: compile warnings and errors

* fix: add round_2 back

* fix: pdf options

* build: bump version to 0.11.33

build: bump version to 0.11.31 (#652)

build: lock git branches

build: bump version to 0.11.23-rc1

dev: update cargo.toml

deps: update typst, typst.ts, typstyle to tagged version (#624)

build: bump version to 0.11.29 (#628)

dev: nightly-0.11.31 (#649)

* deps: update typst

* test: fix snapshot

fix: dependencies

dev: nightly 0.11.33 (#655)

* deps: update typst, typst.ts, typstyle

* test: fix test hash

* fix: compile error

* fix: errors

* build: bump typst to 0.12.0

* dev: final bumps

* build: bump version to 0.11.34-rc1

* build: update cargo.lock

* test: update snapshot

---------

Co-authored-by: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com>
Co-authored-by: ricOC3 <100465762+ricOC3@users.noreply.github.com>
2024-10-19 18:32:37 +08:00
Myriad-Dreamin
d9d10df7a4
feat: provide parameter docs in hover tips (#702)
* feat: supports parameter docs

* dev: update snapshot
2024-10-17 19:21:33 +08:00
Myriad-Dreamin
e57cf36f9b
feat: render hover docs with converted result (#701)
* feat: render hover docs with converted result

* dev: update snapshot
2024-10-17 19:18:36 +08:00
Myriad-Dreamin
e35b9f9c73
feat: handle func.with stack during signature analysis (#699)
* fix: some cases of docs checking

* feat: check signature with binding stack

* feat: handle with stack

* dev: update snapshot

* dev: update snapshot
2024-10-17 18:57:17 +08:00
Myriad-Dreamin
39f343d536
feat: combine signature solving (#696)
* feat: combine signature solving

* dev: update snapshot

* dev: update snapshot
2024-10-17 18:45:52 +08:00
Myriad-Dreamin
6d62bffdeb
feat: type induction on builtin values (#694) 2024-10-17 01:02:00 +08:00
Myriad-Dreamin
0a008c8cc5
fix: bad directories not found (#695) 2024-10-17 00:59:07 +08:00
Myriad-Dreamin
de130dcc2c
refactor: reduce source cache and mutability (#693)
* dev: reduce source cache and mutability

* dev: update common imports
2024-10-16 23:17:52 +08:00
Myriad-Dreamin
4d23b57785
dev: caching static function signature analysis (#692) 2024-10-16 22:34:45 +08:00
Myriad-Dreamin
02bbdbf8d9
feat: incorporated with static function signature analysis (#688)
* feat: finished function signature analysis

* dev: update snapshot

* dev: broken snapshot
2024-10-16 15:53:43 +08:00
Myriad-Dreamin
a3f100e7cb
refactor: change PrimarySignature structure to merge type checking info (#687)
* dev: support spread left params

* dev: stage merge

* dev: remove ParamSpecShort

* chore: remove useless code

* dev: merge all things back

* fix: testing

* fix: testing

* remove: useless method
2024-10-16 14:35:24 +08:00
Myriad-Dreamin
1f5be314a7
dev: shrink size of tag types (#686)
* dev: shrink size of tag types

* update: testing
2024-10-16 14:32:17 +08:00
Myriad-Dreamin
b9da92175e
dev: merge signature docs and rest docs (#685)
* dev: deduplicate code

* dev: merge signature docs and rest docs

* dev: change struct of the `DocString`

* dev: improve structure of SymbolDocs
2024-10-16 11:16:16 +08:00
Myriad-Dreamin
d121e8279d
refactor: split tinymist-query/docs crate (#684)
* dev: split docs code

* dev: rename a bit

* dev: refactor a bit
2024-10-15 22:58:27 +08:00
Myriad-Dreamin
957b58687e
feat: merge hover and docs function formatter (#683)
* feat: merge hover and docs function formatter

* dev: clean up a bit

* test: update snapshot
2024-10-15 21:31:13 +08:00
Myriad-Dreamin
190b7dfd45
feat: make star import tooltip more human readable (#682) 2024-10-15 21:26:45 +08:00
Myriad-Dreamin
c17e0c787e
feat: check variable type annotations in docstring (#681)
* feat: check variable type annotations in docstring

* dev: rollback playground changes

* dev: refactor a bit
2024-10-15 21:04:35 +08:00
Myriad-Dreamin
4aeb3747bc
feat: cache docstring building (Part. 2) (#680)
* feat: cache docstring building (Part. 2)

* dev: fix import

* dev: change some variable names
2024-10-15 18:50:43 +08:00
Myriad-Dreamin
3ed401740e
feat: read and check type annotations in docstring (Part. 1) (#679)
* feat: read and check type annotations in docstring

* fix: remove test.snap in playground

* chore: refactor and remove some dirty changes
2024-10-15 14:52:50 +08:00
Mads Hougesen
c8e11e92f1
docs: fix typos in readme (#662)
* docs: fix typos in readme

* dev: update introduction.typ

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-10-14 23:03:01 +08:00
Myriad-Dreamin
f2cb8805b4
fix: broken test_sig_call (#675) 2024-10-14 14:04:34 +08:00
Myriad-Dreamin
242a9253c6
dev: refactor analysis structure (#674) 2024-10-14 14:04:24 +08:00
Myriad-Dreamin
6124ac2837
chore: use PackageSpec::to_string instead of homemade format (#673) 2024-10-14 14:04:14 +08:00
Myriad-Dreamin
7bc30bf2fa
test: init completion package tests (#672) 2024-10-14 13:15:27 +08:00
Myriad-Dreamin
28f2645c40
feat: call with default bindings (#671) 2024-10-14 13:06:11 +08:00
Myriad-Dreamin
e9ec60d2b5
feat: introduce type context trait TyCtx (#670)
* feat: introduce `TyCtx`

* core: simplify import

* feat: implement local bind apis

* build: update cargo.lock

* dev: rename `LocalTyCtx` back to `TyCtxMut`
2024-10-14 12:31:07 +08:00
Myriad-Dreamin
5898c60de1
feat: elementary tuple method checker (#669)
* feat: elementary tuple method checker

* dev: remove println!
2024-10-14 11:34:03 +08:00
Myriad-Dreamin
191c943936
feat: elementary select checker (#668)
* feat: elementary select checker

* dev: remove println!
2024-10-13 15:14:24 +08:00
Myriad-Dreamin
cc29728fc9
feat: implements ord for Ty (#667)
* feat: implements partial ord for `Ty`

* feat: implements ord for `Ty`

* test: update snapshot
2024-10-13 14:37:03 +08:00
Myriad-Dreamin
0e41ea33b2
build: bump version to 0.11.32 (#666) 2024-10-13 13:49:30 +08:00
Myriad-Dreamin
0bdaadbacd
fix: publish script with tests (#665)
* fix: publish script

* fix: publish script with tests

* dev: print env

* fix: guess reason

* fix: guess reason
2024-10-12 11:01:58 +08:00
Myriad-Dreamin
ae08ce8723
feat: send trace data via http instead of lsp stdio (#660) 2024-10-11 15:27:23 +08:00
Myriad-Dreamin
69aef36184
feat: cache dirs::data_dir and dirs::cache_dir (#659)
* feat: create query packageDocs command to profile type checker

* feat: cache `dirs::data_dir` and `dirs::cache_dir`
2024-10-11 12:33:15 +08:00
Myriad-Dreamin
406b6bcb34
feat: identify static path references in documents (#658)
* feat: identify static path references in documents

* test: update snapshot

* test: update snapshot
2024-10-11 12:16:37 +08:00
Myriad-Dreamin
f5520691fa
build: bump node version to 22 (#654) 2024-10-10 11:39:48 +08:00
Myriad-Dreamin
471b2fd349 fix: publish script (#653) 2024-10-10 11:11:00 +08:00
Myriad-Dreamin
654a5d1aa5 feat: create new pull request rule (#650)
* feat: create new pull request rule

* fix: cargo.toml

* fix: package meta
2024-10-10 11:11:00 +08:00
Myriad-Dreamin
7b0fb6036d
feat: issue import changes request during willRenameFiles (#648)
* feat: issue import changes request during `willRenameFiles`

* test: update snapshot

* fix: snapshot
2024-10-09 14:53:19 +08:00
Myriad-Dreamin
c9846b1d0d
dev: use DETACHED_ENTRY if no entry is provided (#647)
* dev: use `DETACHED_ENTRY` if no entry is provided

* fix: compile error
2024-10-09 14:39:24 +08:00
Myriad-Dreamin
2334593ec4
feat: automatically add indent on entering in the empty block math (#646) 2024-10-09 14:22:36 +08:00
Myriad-Dreamin
5ae003efcd
feat: rename modules by path (#645)
* dev: update new changes

* feat: rename modules

* dev: skip abs test
2024-10-09 14:22:23 +08:00
Myriad-Dreamin
df5dafbf75
feat: go to definition of module members (#644)
* feat: go to definition of module members

* dev: rename a bit

* ovo
2024-10-09 12:17:51 +08:00
Myriad-Dreamin
3aa8f1233d
fix: check existence of requestIdleCallback before uses (#643) 2024-10-07 14:18:45 +08:00
Myriad-Dreamin
24751130a5
feat: parse for clause correctly (#642)
* fix: unchanged snapshots

* feat: parse for clause correctly
2024-10-07 13:13:42 +08:00
Myriad-Dreamin
fbefcb3a78
feat: record and use span where the label is attached (#641)
* test: add test to pass

* dev: refactor a bit

* dev: refactor a bit

* feat: record span where the label is attached
2024-10-07 12:57:00 +08:00
Myriad-Dreamin
b0f5398412
fix: pass to_multiline_tokens2 checking by copilot (#639)
* test: generate and pass sema_tokens sanity checking by copilot

* test: pass sema_tokens sanity checking

* dev: update snapshot
2024-10-07 11:58:48 +08:00
Myriad-Dreamin
d4492e0436
feat: add configuration to open exported file by system default app (#636)
* feat: add configuration to open exported file by system default application

* dev: update description

* fix: config key
2024-10-06 23:22:04 +08:00
Myriad-Dreamin
d6fae74773
feat: support drag and drop of files into the typst editor (#635)
* feat: support drag and drop of files into the typst editor

* feat: add configuration gate
2024-10-06 22:57:54 +08:00
Myriad-Dreamin
be9bf5ec66
dev: improve code quality of sync-lsp (#632) 2024-10-06 22:04:35 +08:00
Myriad-Dreamin
80c4bc8491
fix: warning no edition set (#633)
- defaulting to the 2015 edition while the latest is 2021
2024-10-06 22:04:20 +08:00
Myriad-Dreamin
8eaa65499b
fix: failed version checking when cross compiling (#634) 2024-10-06 22:03:19 +08:00
Myriad-Dreamin
578928135f
fix: the version in package.json is not bumped (#631)
* fix: the version is not bumped

* dev: add version checking for publish
2024-10-06 20:31:51 +08:00
Myriad-Dreamin
485adc7761
build: bump version to 0.11.28 (#627)
* docs: update changelog

* build: bump version to 0.11.28
2024-10-05 15:02:18 +08:00
Myriad-Dreamin
43796a3dce
fix: allow user keeping garbage directories in the package directory (#622) 2024-10-02 21:05:28 +08:00
Myriad-Dreamin
3e58f97866
fix: compile warnings and errors (#619) 2024-09-30 23:57:39 +08:00
Myriad-Dreamin
58ff9ab846
feat: print version information when starting lsp server (#614) 2024-09-28 16:39:45 +08:00
Myriad-Dreamin
f3ccb4a186
build: bump version to 0.11.22 (#611)
* build: bump version to 0.11.22

* fix: bugs in package view

* feat: check release version for nightly releases
2024-09-28 07:38:25 +08:00
Myriad-Dreamin
114955194f
build: bump version to 0.11.22-rc1 (#607)
* docs: update changelog

* docs: update changelog

* build: bump version to 0.11.22-rc1

* fix: reqwest dep
2024-09-20 15:42:50 +08:00
Myriad-Dreamin
3d886a021b
feat: improve theme settings for raw blocks (#606) 2024-09-20 14:12:53 +08:00
Derived Cat
67bc986e01
feat: show first occurrence locations for used fonts (#598)
* feat: show first occurrence locations for used fonts

add source typst file path

clean up

rename variables

* Fix a logic error in `work_text`

Corrected a logic flaw that caused incorrect results of `uses`

* add span_offset

* add `first_occur_column`

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-09-20 14:11:48 +08:00
Myriad-Dreamin
dc6a4482c1
fix: ignore invalid tokens in typst's syntax tree (#605) 2024-09-20 13:59:15 +08:00
Myriad-Dreamin
fcde0efb22
fix: deduplicate value completion correctly (#604) 2024-09-20 13:14:07 +08:00
Myriad-Dreamin
6ce6bb8018
fix: refine label types to remove hacking citation filter (#603)
* test: check types

* test: confirm bug

* fix: refine label types

* dev: update snapshot

* dev: update snapshot
2024-09-20 12:30:36 +08:00
Myriad-Dreamin
58fea291ad
fix: ignore system fonts correctly (#597) 2024-09-12 21:46:35 +08:00
Myriad-Dreamin
78f3893185
feat: provide package view and local documentation (#596)
* feat: move featured components

* feat: provide package view and local documentation

* stage

* fix: compile error by merged commits
2024-09-12 21:17:07 +08:00
ricOC3
b06447ffe2
feat: support for custom certificate configuration (#592)
* feat: add certificate option

* refactor: move SystemCompilerFeat into tinymist-world

* feat: move HttpRegistry as HttpsRegistry into tinymist-world

* feat: add reading pem file

* feat: update LspUniverseBuilder::build

* feat: fill missing argument of LspUniverseBuilder::build

* chore: update lock file for additional dependencies

* chore:  refine comment for certification

* refactor: simplify by new constructor

* refactor: sort arguments for threaded_http

* refactor: split https.rs from lib.rs in tinymist-world
2024-09-12 09:02:54 +08:00
ParaN3xus
ce107efc7e
refactor: add compatibility for typst_syntax::LinkedNode.leaf_at (#582)
* refactor: add compatibility for `typst_syntax::LinkedNode.leaf_at`

* feat: `LinkedNodeExt` trait with `leaf_at_compat`
2024-09-08 22:10:01 +08:00
Myriad-Dreamin
ffa12bc2c9
fix: create function scopes for nest symbols (#589)
* dev: nest symbols into of functions

* dev: update snapshot
2024-09-07 09:30:54 +08:00
Myriad-Dreamin
50fadf453f
fix: process overlapping cases in line folding only mode (3ab4fa62) (#588)
* fix: process overlapping cases in line folding only mode (3ab4fa62)

* fix: snapshot
2024-09-07 08:12:09 +08:00
Myriad-Dreamin
3ab4fa625f dev: process overlapping cases in line folding only mode 2024-09-06 23:34:55 +08:00
TANIGUCHI Masaya
a92d477d88
feat: add gitpod layer (#575)
* feat: add gitpod.ts

* Not -> not
2024-09-06 20:05:22 +08:00
Myriad-Dreamin
67f148ce44
feat: listen data plane socket and serve frontend html on same address (#577)
* g1

* g2

* g3

* g4

* dev: clean up

* dev: remove deps

* dev: extract recv function

* move serve function

* hide generics

* recover fut change

* remove a useless function

* rename message back

* remove dyn frontend_html

* remove duplicated types

* remove wrong comment

* reduce glue codes

* remove dirty code

* feat: maintain compatibility

* dev: human name
2024-09-06 15:33:40 +08:00
Tim Voßhenrich
5b1d5ce331
feat: add shell completions script for Fig and Nushell (#578) 2024-09-06 07:18:33 +08:00
Myriad-Dreamin
b8d933615d
feat: add label view (#570)
* feat: add label view

* fix: typo

* fix: snapshot

* chore: final tune
2024-08-27 19:31:57 +08:00
Myriad-Dreamin
a7951b3832
build: bump shiroa to 0.2.0-nightly4 (#574) 2024-08-27 19:31:41 +08:00
ParaN3xus
0fa1bab9d0
feat: add compatibility for Typst's util (stable) and utils (nightly) (#573) 2024-08-27 18:38:03 +08:00
Myriad-Dreamin
9f9c710906
fix: deadlock when iterating dependencies (#568) 2024-08-27 14:49:58 +08:00
Myriad-Dreamin
c6da5590ca
fix: symbols doesn't show if pattern is not provided (#569) 2024-08-27 12:19:57 +08:00
Myriad-Dreamin
666e95c540
feat: remove excessive word in title of symbol view (#567) 2024-08-27 09:15:48 +08:00
Myriad-Dreamin
1f9a42c2e8
build: bump version to 0.11.20 (#566) 2024-08-26 23:58:06 +08:00
Myriad-Dreamin
233a04af9f
feat: display all imported definitions for wildcard imports (#565) 2024-08-26 22:45:54 +08:00
OrangeX4
0438808fe8
feat: local package manager (#458)
* feat: import local packages

* feat: create and open local packages

* dev: unwrap nested block

* dev: data directory as resource

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-08-26 22:43:08 +08:00
Myriad-Dreamin
4ffe52399f docs: update changelog 2024-08-26 22:35:15 +08:00
Myriad-Dreamin
0c2d06969c
build: bump version to 0.11.20-rc1 (#563)
* docs: update changelog

* build: bump version to 0.11.20-rc1
2024-08-26 21:58:16 +08:00
Myriad-Dreamin
5396c270c1
fix: invalid merged command options (#564) 2024-08-26 21:54:55 +08:00
Myriad-Dreamin
a53b9d92d7
docs: add notes to stateful pin commands (#562) 2024-08-26 21:41:09 +08:00
Myriad-Dreamin
b2b9715218
docs: add root path hints for neovim users (#561)
* docs: add root path hints for neovim users

* fix: configuration generation
2024-08-26 21:28:42 +08:00
Myriad-Dreamin
f21e5bbd27
docs: add document preview feature documentations for non-vscode clients (#560)
* docs: add document preview feature documentations for non-vscode clients

* chore: add suggestion
2024-08-26 21:06:59 +08:00
Myriad-Dreamin
ccaf83e2ec
fix: parse quotes near the atomic hash expression (#559) 2024-08-26 10:56:49 +08:00
Myriad-Dreamin
cfa04bdd1b
feat: improve numeric literal parsers (#558) 2024-08-26 10:55:34 +08:00
Myriad-Dreamin
1b9255e04e
fix: parse dot issue 492 again (#557) 2024-08-26 10:42:39 +08:00
Myriad-Dreamin
fbd22d2601
build: bump typst.ts to v0.5.0-rc7 (#554)
* dev: sync typ_server code

* build: bump typst.ts to v0.5.0-rc7
2024-08-25 17:43:54 +08:00
mgt
b67cec2918 chore: bump typstyle to v0.11.32 2024-08-19 23:20:59 +08:00
Myriad-Dreamin
093f2af6dc
feat: support include expressions in typlite (#547) 2024-08-19 09:36:36 +08:00
Myriad-Dreamin
41e83b38e2
dev: merge {typlite,typst-preview,tinymist} world and compile argument parsers (#546)
* dev: merge lite world and lsp world

* dev: merge {typlite,typst-preview,tinymist} compile arg parsers
2024-08-19 09:12:01 +08:00
Myriad-Dreamin
78a8d4a579
dev: add links to emacs guide (#545) 2024-08-19 09:11:43 +08:00
Myriad-Dreamin
66be9ec533
dev: improve title of the contextual 'Copy as ANSI Code' action (#544) 2024-08-19 09:11:25 +08:00
Myriad-Dreamin
ba26c673b5
feat: remove useless tinymist.preview.showInActivityBar (#543) 2024-08-19 09:11:10 +08:00
Meow King
9609d137c1
docs: add installation and configuration instruction for Emacs (#538)
* doc: add installation and configuration instruction for Emacs

* docs: refinement

* docs: help newbies a bit

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-08-19 01:23:44 +08:00
Yifan Song
63ade4f893
remove feature texmath (#535) 2024-08-15 21:51:24 +08:00
Myriad-Dreamin
68911d91cb
dev: perform simple rate limit on heavy dynamic analysis (#532)
* dev: perform simple rate limit on heavy dynamic analysis

* chore: wording

* dev: remove a todo
2024-08-15 13:04:27 +08:00
Yifan Song
1295c8754a
feat: find references for Ref and Label (#527)
* add test for `goto_definition` with label reference

* simplify test for `goto_definition` with reference

* abstract compile doc for test

* add snap for goto_definition label reference

* basic goto_reference with simple test

* basic find_reference for Ref

* fix: a bug in linked def

* Remove unwanted compile directive compile: true

* simply compile and get depended files fail for corss_file_ref_label

* update ref reference but still fail to get source from path

* fix: reuse find definition effort and handle undefined references for labels

* dev: update test case

* fix: label reference analysis

* fix: rust analyzer doing bad

* dev: update snapshot

* dev: lift common pattern

* fix: unstable snapshot

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-08-14 09:21:44 +08:00
Yifan Song
0fce237d57
test: add test for goto_definition for label (#510)
* add test for `goto_definition` with label reference

* simplify test for `goto_definition` with reference

* abstract compile doc for test

* add snap for goto_definition label reference
2024-08-12 17:08:34 +08:00
Myriad-Dreamin
6b8380ade7
feat: export text in range as ansi highlighted code (#526)
* feat: export text in range as ansi highlighted code

* dev: update snapshot
2024-08-12 11:25:55 +08:00
Yifan Song
190b09d4b5
feat: generate shell completion (#525)
* basic clap_complete for shell

* dev: remove an unwrap and split a command function

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-08-12 11:15:37 +08:00
Myriad-Dreamin
606486b9fd build: bump version to 0.11.19 2024-08-11 13:30:18 +08:00
Myriad-Dreamin
18c201d9c1 docs: update changelog 2024-08-11 13:28:42 +08:00
Myriad-Dreamin
a95b07de27 fix: nested colorization 2024-08-11 11:24:50 +08:00
Myriad-Dreamin
61f8b25c94 docs: rearrange and chore fixes 2024-08-11 11:14:28 +08:00
Myriad-Dreamin
1d71ad4ae8 chore: run link-docs 2024-08-11 10:38:29 +08:00
Myriad-Dreamin
3cbf75c369
build: bump version to 0.11.19-rc1 (#524)
* build: update changelog

* build: bump msrv

* build: bump version to 0.11.19-rc1
2024-08-10 21:11:13 +08:00
Myriad-Dreamin
3a6ace59a7
fix: bad configuration initialization (#523) 2024-08-10 20:58:23 +08:00
Myriad-Dreamin
555da7e5a5
feat: identify more context for bracket colorization (#522) 2024-08-10 20:43:18 +08:00
Myriad-Dreamin
99f9d6ccb7
fix: bad configuration document (#521) 2024-08-10 20:43:08 +08:00
Myriad-Dreamin
f8472e9a3e
fix: allow underline in url link (#520) 2024-08-10 20:42:59 +08:00
Myriad-Dreamin
bbeca48e2e
feat: link sublime text support (#519) 2024-08-10 20:42:50 +08:00
Myriad-Dreamin
5381914951
fix: broken vscode package configuration (#518) 2024-08-10 20:22:54 +08:00
Myriad-Dreamin
04cdcd3ac2
feat: show target of label and con tent of metadata when hovering (#517) 2024-08-10 20:22:42 +08:00
mgt
98570a00f0 chore: bump typstyle v0.11.31 2024-08-09 10:44:23 +08:00
nerix
ee50b24ce4
fix: use plural for 0 items (#507) 2024-08-07 18:33:25 +08:00
Myriad-Dreamin
97100bc7e1
feat: inject typst{,-code} syntaxes into markdown syntax highlighting (#504) 2024-08-06 15:21:47 +08:00
Myriad-Dreamin
67515c163b
refactor: extension entry (#503)
* dev: refactor command code

* refactor: onEnter and server probing

* refactor: extension activate

* refactor: split config

* refactor: dedent on enter handler

* dev: inline expression

* dev: make clear condition checking

* dev: simplify export command patterns
2024-08-06 14:13:56 +08:00
Myriad-Dreamin
810a4d766f
dev: reformat code (#502) 2024-08-06 11:02:25 +08:00
Myriad-Dreamin
ad553c0741
refactor: export tasks (#501)
* refactor: export tasks

* dev: clean code
2024-08-06 10:21:04 +08:00
Myriad-Dreamin
7da938f46c
fix: two bugs in tasks feature (#499) 2024-08-06 02:11:53 +08:00
Myriad-Dreamin
c4c3d6f3fa
feat: convert editor READMEs to docs.typ (#498) 2024-08-05 23:32:18 +08:00
Myriad-Dreamin
11f9965c48
fix: parse dot operation on atomic expression correctly (#497) 2024-08-05 19:47:55 +08:00
Myriad-Dreamin
fb0a300bc2
build: bump version to 0.11.18 (#494)
* build: bump version to 0.11.18

* build: update cargo.lock
2024-08-05 03:27:38 +08:00
Myriad-Dreamin
1bfeead39d
docs: update documentation about export (#493) 2024-08-05 03:17:53 +08:00
Myriad-Dreamin
a3095c2d5a
build: bump version to 0.11.18-rc1 (#491) 2024-08-05 02:40:07 +08:00
Myriad-Dreamin
85c459d4c8
feat: support vscode tasks for exporting query and pdfpc (#490)
* feat: support vscode tasks for exporting query and pdfpc

* test: update snapshot
2024-08-05 02:14:03 +08:00
Myriad-Dreamin
56e20b2590
feat: support vscode tasks for exporting html, md, and txt (#489)
* feat: support vscode tasks for exporting html, md, and txt

* chore: styling

* docs: update

* test: update snapshot
2024-08-05 01:00:25 +08:00
Myriad-Dreamin
140299f0ce
feat: support vscode tasks for exporting pdf, svg, and png (#488)
* feat: support vscode tasks for exporting pdf, svg, and png

* fix: parse errors

* dev: update fill, gap arguments

* fix: merged props
2024-08-04 23:41:52 +08:00
Zike Xu
60f3200088
fix: apply label instead of bib title name in at completion (#485)
* fix: apply label instead of bib title name in `at` completion

* test: snapshot testing for #483

* test: add more label-related snapshot testings

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-08-04 23:33:02 +08:00
Myriad-Dreamin
859fb468e2
dev: a false positive of clippy (#487) 2024-08-04 22:24:09 +08:00
Myriad-Dreamin
05f1645ccd
dev: reformat code (#461) 2024-08-04 17:11:51 +08:00
Myriad-Dreamin
0134de41c1
fix: retrieve environments even if typstExtraArgs is unspecified (#482) 2024-08-02 10:13:17 +08:00
Myriad-Dreamin
04de6a2806
fix: allow hyphenate in url link (#481) 2024-07-30 18:47:57 +08:00
Myriad-Dreamin
d2689a120e
docs: add documentation about installing nightly prebuilts (#480) 2024-07-30 18:47:45 +08:00
Myriad-Dreamin
acd22b71a5
feat: convert introduction.typ to README.md (#479)
* dev: supports some functions for README

* feat: convert introduction.typ to README.md
2024-07-30 17:12:20 +08:00
Myriad-Dreamin
bc3bd9f762
feat: add error framework and parse sys arguments for typlite (#478)
* feat: parse sys arguments for typlite

* feat: add error framework to typlite

* dev: allow output to stdout

* fix: error in docs
2024-07-30 16:49:04 +08:00
Myriad-Dreamin
6ef09724dd
fix: scroll command doesn't process task correctly (#477) 2024-07-29 23:34:53 +08:00
Myriad-Dreamin
1726596a49
feat: remove typst-preview.showLog and add tinymist.showLog (#476) 2024-07-29 23:34:40 +08:00
Myriad-Dreamin
abcdadda50
fix: generate configuration more correctly (#473) 2024-07-28 18:11:47 +08:00
Myriad-Dreamin
0c9d6623b4
build: cherry pick concurrent id error (#472)
* dev: commit reference changes

* build: cherry pick concurrent id error
2024-07-28 18:06:43 +08:00
雪域冰龍
a6c81c80b0
feat(invert-colors): add normal-image option (#464)
* feat(invert-colors): add normal-image option

* fix: type bug

* dev: simplify and refine implementation

* build: lock version

* fix: comment

* chore: add warnings about unknown strategy

* dev: reformat package.json

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-07-28 17:49:02 +08:00
Myriad-Dreamin
08b9c10aa1
docs: improve and add contribution guide for syntaxes (#471)
* dev: reformat metadata of raw languages

* docs: improve and add contribution guide for syntaxes
2024-07-27 23:04:52 +08:00
Myriad-Dreamin
4162b6c65f
build: update cargo.lock (#470) 2024-07-27 18:40:55 +08:00
Myriad-Dreamin
651d7f7148
build: bump version to 0.11.17 (#469)
* docs: update readme

* fix: disable syntax highlighting issue

* gg

* fix: fenced code

* build: bump version to 0.11.17

* fix: indented fenced code
2024-07-27 13:34:27 +08:00
Myriad-Dreamin
56b47fb01d
build: bump version to 0.11.17-rc1 (#468)
* docs: update changelog

* build: bump version to 0.11.17-rc1

* docs: update changelog

* docs: update changelog

* docs: update changelog

* docs: add a tip to help first contributors.

* build: update cargo.lock
2024-07-27 12:02:30 +08:00
Myriad-Dreamin
f97c6c1222
dev: reduce clone of frontend html (#467) 2024-07-27 11:22:10 +08:00
Myriad-Dreamin
9978d8f4eb
docs: update documentation about completion (#466) 2024-07-27 11:21:48 +08:00
Chad Skeeters
4ead324c7e
fix: modify static host to send Content-Type: text/html (#465) 2024-07-27 10:34:39 +08:00
Myriad-Dreamin
daad0b331c
feat: add showPdf icon to navigation bar (#462)
* feat: add `showPdf` icon to navigation bar

* wording
2024-07-26 14:47:17 +08:00
Myriad-Dreamin
22aea0e075
dev: intern vscode-variable package (#460)
* dev: intern vscode-variable package

* dev: add vitest

* dev: add tests

* fix: a bug

* dev: less global state

* dev: less bug-prone construction
2024-07-26 12:47:26 +08:00
Myriad-Dreamin
96d5ba0c00
test: increase the difficulty of diagnostic testing (#457) 2024-07-25 20:04:03 +08:00
Myriad-Dreamin
d9767a63f6
fix: process lagged compile reason (#456) 2024-07-25 12:09:17 +08:00
Zike Xu
7b8b3938a2
feat: support querying label with paper name in bib items (#365)
* feat: support querying label with paper name in bib items

* dev: distinguish ref and bib title

* dev: distinguish ref and bib title 2

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
2024-07-25 10:14:31 +08:00
Myriad-Dreamin
ff72962334
feat(typlite): add equation support (#454)
* feat(typlite): add equation support

* feat(typlite): minimize snapshot

* dev(typlite): eliminate unnecessary spacing

* dev: redact totally

* fix: snapshot
2024-07-24 13:41:54 +08:00
Myriad-Dreamin
ab3c642038
feat(typlite): add image support (#453) 2024-07-24 02:11:21 +08:00
Myriad-Dreamin
379359a19f
dev: add link support of typlite (#452)
* dev: extend ast to work

* dev: support link

* dev: reimplement it

* dev: add nest testing

* dev: rearrange code

* dev: rearrange code
2024-07-23 20:40:55 +08:00
Myriad-Dreamin
f8c4218534
feat: introduce typlite's cli (#451)
* feat: introduce typlite's cli

* build: specify default-bin

* fix

* fix: default bin again

* dev: ignore typlite's lock
2024-07-23 19:48:14 +08:00
Myriad-Dreamin
81a95816b6
feat: syntax highlighting for raw blocks (fence ticks <= 6) (#450)
* feat: syntax highlighting for raw blocks (fence ticks <= 6)

* dev: remove unused comments
2024-07-22 19:20:25 +08:00
Myriad-Dreamin
c5222661b1
dev: fix errors after upgrading tsc and update resolution (#449) 2024-07-22 18:45:59 +08:00
Myriad-Dreamin
1bbf800643
test: add rename testing (#448) 2024-07-22 14:29:53 +08:00
Myriad-Dreamin
ede592796d
chore: change compile command to trace-lsp (#447) 2024-07-22 14:28:57 +08:00
upsidedowncake
5b7794a587
fix: provide an error message when no path is provided (#445)
Co-authored-by: Ale <alecake@ale.pet>
2024-07-22 13:22:06 +08:00
Myriad-Dreamin
d6d69b28bf
build: bump version to 0.11.16 (#444)
* build: update changelog and readme

* build: bump version to 0.11.16
2024-07-20 23:33:04 +08:00
Myriad-Dreamin
e704c44707
build: bump version to 0.11.16-rc1 (#443) 2024-07-20 22:50:35 +08:00
Myriad-Dreamin
31d22e3285
fix: extract completion labels in tests reliably (#442)
* fix: extract completion labels in tests reliably

* dev: add test helper
2024-07-20 22:46:11 +08:00
Myriad-Dreamin
7aca6a657f
test: add editor-side e2e testing (#441)
* test: first runnable editor e2e

* test: first smoke testing

* fix: a bug found by editor e2e

* test: add completion e2e testing

* test: add diagnostics and focus e2e testing

* feat: test extension in ci

* dev: remove one useless dependency

* dev: setup x server for testing

* dev: recover stable test

* test: add multiple preview e2e testing
2024-07-20 18:52:15 +08:00
Myriad-Dreamin
39a3bd8634
feat: allow multiple-tasked preview (#427)
* feat: implement it

* fix: faster doc propagation, but may still have bugs
2024-07-20 11:36:58 +08:00
Myriad-Dreamin
624a533833
docs: add hints about configuring rootless document (#440) 2024-07-20 06:58:42 +08:00
Myriad-Dreamin
103e0f3b3e
feat: support creation-timestamp configuration for exporting PDF (#439)
* feat: support creation-timestamp configuration for exporting PDF

* fix: respect config
2024-07-20 06:58:27 +08:00
Myriad-Dreamin
25c449c2b2
feat: provide sys.inputs.x-preview (#438)
* feat: provide `sys.inputs.x-preview`

* feat: improve a bit
2024-07-20 06:19:16 +08:00
Myriad-Dreamin
61d6578fb7
dev: rename the status read events (#436) 2024-07-19 13:41:42 +08:00
Myriad-Dreamin
bb9ba23b3e
dev: increase revision for compile request (#435) 2024-07-19 13:29:46 +08:00
Myriad-Dreamin
755979f2bb
dev: make cache evicting shared (#434) 2024-07-19 13:29:34 +08:00
Myriad-Dreamin
a1b7550d2d
refactor: simplify compile actor (#433) 2024-07-19 13:28:03 +08:00
Myriad-Dreamin
4538e5f042
feat: make compilation not block most snapshot requests (#432) 2024-07-19 12:15:18 +08:00
Myriad-Dreamin
aeb0ad0694
fix: error tolerated on client changing source state (#429) 2024-07-19 12:15:02 +08:00
A_A
65875adbc3
fix: description for exportPdf setting (#431) 2024-07-19 08:34:10 +08:00
Myriad-Dreamin
77837d062a
fix: don't change entry if pinning (#430) 2024-07-19 02:52:57 +08:00
Myriad-Dreamin
1d011155cf
refactor: rearrange preview entry for future improvement (#426)
* dev: refactor preview entry for future improvement

* dev: move watcher ahead

* dev: move host ahead
2024-07-18 13:53:18 +08:00
Myriad-Dreamin
8413c66c51
fix: wrong checked prefix on completing strings (#422) 2024-07-17 15:34:33 +08:00
Myriad-Dreamin
134bd063be
fix: remove dirty preview command changes and add dev kit (#421) 2024-07-17 05:00:17 +08:00
Myriad-Dreamin
74fc066602
feat: show views only if tinymist extension is activated (#420) 2024-07-17 04:24:52 +08:00
Myriad-Dreamin
b8de9f9553
build: bump version to 0.11.15 (#418)
* build: update changelog

* build: bump version to v0.11.15

* build: update cargo lock
2024-07-15 11:05:23 +08:00
Wenzhuo Liu
077feae5fd
deps: bump typstyle to v0.11.30 (#416) 2024-07-14 22:12:17 +08:00
Myriad-Dreamin
0c0e77ab24
fix: wrong serialization of task_id v.s. taskId (#417) 2024-07-14 22:12:03 +08:00
Myriad-Dreamin
a223bb37a5 fix: cargo.lock 2024-07-14 20:50:02 +08:00
Myriad-Dreamin
28899d801f build: bump version to v0.11.15-rc3 2024-07-14 20:43:20 +08:00
Myriad-Dreamin
76d87e5ec6 build: update snapshot 2024-07-14 19:26:14 +08:00
Myriad-Dreamin
696dc20c87 build: bump version to v0.11.15-rc2 2024-07-14 19:22:23 +08:00
Myriad-Dreamin
d4a24ea993 build: update changelog 2024-07-14 19:21:03 +08:00
Myriad-Dreamin
764376de1d
fix: buggy compile fence (#415) 2024-07-14 19:00:52 +08:00
Myriad-Dreamin
ee2d97eba4
fix: annoying often detached views (#414) 2024-07-14 19:00:26 +08:00
Myriad-Dreamin
0d84553390
fix: broken content preview (#413)
* fix: broken outline

* fix: render mode
2024-07-14 19:00:13 +08:00
Myriad-Dreamin
27a0aa9e2b
feat: use requestIdleCallback to wait for updating canvas pages when editor is in idle (#412)
* dev: use local frontend files

* very lazy
2024-07-14 17:52:55 +08:00
Myriad-Dreamin
6a142dca01
dev: refactor tasks (#411)
* dev: improve export task

* aba aba

* dev: less indent

* dev: reorder

* dev: reduce some clone

* dev: improve format task

* fix: documentation links

* dev: doesn't rely on hash entry state
2024-07-14 17:40:01 +08:00
mgt
69c50fef4a deps: bump typstyle to v0.11.29 2024-07-14 15:15:58 +08:00
Myriad-Dreamin
46f6342a50
dev: reformat code (#369) 2024-07-14 15:15:30 +08:00
Myriad-Dreamin
dd25091ae9
feat: allow deferred snapshot event processing (#408) 2024-07-12 16:13:26 +08:00
Myriad-Dreamin
50ffb75b50
feat: don't change entry on language query (#406) 2024-07-12 14:40:34 +08:00
Myriad-Dreamin
72e7a1e0fa
dev: diagnostics from primary instance is not special anymore (#405) 2024-07-12 14:40:22 +08:00
Myriad-Dreamin
70ffc3ac73
dev: check revision during publishing diag and counting words (#404)
* dev: check revision during publish

* dev: print word count revision
2024-07-12 12:50:56 +08:00
Myriad-Dreamin
4f5c962852
fix: duplicated notify status entry in configurations (#403) 2024-07-12 12:36:23 +08:00
Myriad-Dreamin
e983a338d4
fix: data race in FutureFolder (#402) 2024-07-12 12:36:03 +08:00
Myriad-Dreamin
adff5a8a96
dev: reduce dependencies a bit (#400)
* dev: disable default feature of typstyle

* dev: add release launch

* dev: remove threads and await tree

* dev: remove await-tree
2024-07-11 15:35:08 +08:00
Myriad-Dreamin
4acc39b237
build: rearrange dependencies (#399) 2024-07-11 11:03:55 +08:00
Myriad-Dreamin
1b769a4ddd
feat: add typlite for typst's doc comments (#398) 2024-07-11 09:45:51 +08:00
Myriad-Dreamin
96c8e08b50
feat: render example code in typst docs as typst syntax (#397)
* feat: render example code in typst docs as typst syntax

* fix: snapshot
2024-07-11 09:03:08 +08:00
Myriad-Dreamin
653789c1e6
fix: cyclic loop detection in cross-module def-use relation checking (#396) 2024-07-10 12:01:22 +08:00
Myriad-Dreamin
1e424eca8a
fix: scroll source correctly when no text editor is active (#395) 2024-07-10 10:13:16 +08:00
Myriad-Dreamin
1d1f4bf6e5
dev: reduce three marco uses (#393) 2024-07-09 13:25:25 +08:00
Myriad-Dreamin
1662d58cb8
dev: delete preview_stub (#394) 2024-07-09 13:25:15 +08:00
Myriad-Dreamin
b13643ebf7
dev: merge compile opts and args (#392) 2024-07-09 12:40:14 +08:00
Myriad-Dreamin
7cf100ec96
dev: remove threaded_receive uses (#391) 2024-07-09 12:37:33 +08:00
Myriad-Dreamin
30a446086e
docs: document tinymist crate (#390)
* docs: document tinymist crate

* fix: description about export mode
2024-07-09 11:56:02 +08:00
Myriad-Dreamin
6a8a9f6eab
dev: remove knowledge about force drop (#389) 2024-07-09 11:07:15 +08:00
Myriad-Dreamin
80d0114264
fix: trace task is not stopping correctly (#388) 2024-07-09 09:50:35 +08:00
Myriad-Dreamin
5979c98bc4
fix: on changed condition (#387) 2024-07-09 09:34:28 +08:00
Myriad-Dreamin
7bcd4c65e3
dev: rewrite format/user_action actors as tasks (#386)
* dev: rewrite format/user_action actors as tasks

* dev: clean some dirty code
2024-07-09 08:55:49 +08:00
Myriad-Dreamin
675ac1b351
fix: some corner cases of serving preview (#385) 2024-07-09 08:43:40 +08:00
Myriad-Dreamin
692b87eeb8
dev: introduce task concept and rewrite export actor as export task (#383)
* dev: introduce task concept and rewrite export actor as export task

* dev: delete useless code

* fix: export mode
2024-07-08 19:18:52 +08:00
Myriad-Dreamin
4b1f8cd80c
fix: broken preview feature flag (#381) 2024-07-08 14:12:30 +08:00
Myriad-Dreamin
d95041deb2
dev: remove server module (#380) 2024-07-08 12:49:51 +08:00
Myriad-Dreamin
83eef2f168
refactor: merge compile and language state (#379)
* refactor: remove dedicate servers

* refactor: merge compile state and language state

* refactor: initialize oneshot lsp by `super_init`

* refactor: remove compile_init

* dev: remove unused trait
2024-07-08 12:29:23 +08:00
Myriad-Dreamin
ad79b29fd2
dev: move preview actor (#378) 2024-07-08 12:11:12 +08:00
Myriad-Dreamin
8852109b10 fix: patch dependency 2024-07-07 15:29:58 +08:00
Myriad-Dreamin
be75ab3d2c
build: bump version to 0.11.14 (#377)
* docs: update changelog

* build: bump version to 0.11.14

* docs: update changelog

* build: bump version to 0.11.14

* chore: wording
2024-07-07 15:25:03 +08:00
Wenzhuo Liu
8cb41afc63
docs: add deprecation notice in readme (#375) 2024-07-07 13:51:54 +08:00
Wenzhuo Liu
8a8419b609
build: add vscode launch script for typst-preview (#374)
* build: add vscode launch script for typst-preview

* chore: update lockfile
2024-07-07 13:51:40 +08:00
Myriad-Dreamin
bd08e15d96
fix: github pages action (#376) 2024-07-07 13:50:06 +08:00
Myriad-Dreamin
1714103316
feat: persist webview preview through vscode restarts (#373)
* fix: bugs

* feat: persist webview preview through vscode restarts

* make sure code works without VSCODE_STATE

* Apply suggestions from code review

* Use base64 to solve security stuff

* fix: wrong patch

* fix: formatting

* fix: bugs

* fix: stupid bug

* fix: get compat configuration correctly

---------

Co-authored-by: Noam Zaks <imnoamzaks@gmail.com>
2024-07-07 13:43:04 +08:00
Myriad-Dreamin
1b57bec161
feat: full compatible with typst-preview extension (#371) 2024-07-07 11:26:50 +08:00
Myriad-Dreamin
db314c2ea9
docs: write some developer guides (#372) 2024-07-07 11:26:35 +08:00
Myriad-Dreamin
cbe6d3ec71
fix: two errors during refactoring (#370) 2024-07-06 14:48:49 +08:00
Myriad-Dreamin
a8d470222f
feat: support single-task preview commands (#368)
* refactor: adjust compat code

* refactor: extension side code

* dev: setup preview state

* refactor: lsp side code

* dev: first successful preview

* dev: respect compile reason

* dev: update snapshot

* dev: log a bit

* fix: refresh style

* dev: properly start and stop

* dev: throw error correctly

* dev: update deprecation note

* dev: remove preview cli input/font arguments

* build: don't ignore frontend file

* dev: polyfill non-text editions

* dev: clean some code

* dev: clean some code

* dev: eliminate preview html in tinymist extension

* dev: eliminate CompilationHandleImpl and CompileServer

* dev: stop browser preview correctly

* dev: update configuration
2024-07-06 13:27:17 +08:00
Myriad-Dreamin
39158070d7
fix: lsp should respond errors at tail (#367) 2024-07-04 00:51:44 +08:00
Myriad-Dreamin
d5456c05b0
dev: add cast method to lsp client (#366) 2024-07-03 23:53:51 +08:00
Myriad-Dreamin
1a5b146d36
refactor: combine typst-preview and tinymist extension code (#364)
* dev: move preview methods to compile handler

* dev: move preview code

* refactor: combine typst-preview and tinymist extension code

* fix: indent
2024-07-03 23:25:18 +08:00
Myriad-Dreamin
c51bc163c4 fix: vsce again 2024-07-02 21:00:33 +08:00
Myriad-Dreamin
194e8adeb0 fix: vsce 2024-07-02 16:07:06 +08:00
Myriad-Dreamin
4c949e8816
feat: fully concurrent lsp (#363)
* fix: dep hash

* dev: exp concurrent hash

* feat: fully concurrent lsp

* dev: disable concurrent compilation
2024-07-02 14:01:42 +08:00
Myriad-Dreamin
023513e085
build: bump version to 0.11.13 (#362)
* build: update changelog

* build: bump version to 0.11.13
2024-07-02 12:36:45 +08:00
Myriad-Dreamin
bc98d13eeb
fix: check main before compilation (#361) 2024-07-02 11:08:35 +08:00
Myriad-Dreamin
23a31df815
build: optimize release profile (#359)
* build: keep rust's default profiles untouched

* build: optimize release profile
2024-07-02 10:27:41 +08:00
Myriad-Dreamin
849f7a894d
feat: move sync-lsp crate (#358)
* feat: move sync-lsp crate

* fix: doc tests
2024-07-02 10:27:00 +08:00
Myriad-Dreamin
9aa7a22bd7
feat(ci): upgrade macos runner (#360) 2024-07-02 03:40:46 +08:00
Myriad-Dreamin
230b36de4b
fix: diagnostics is gone (#354) 2024-06-28 21:54:52 +08:00
Myriad-Dreamin
02437eb8af dev: update release script 2024-06-28 10:48:16 +08:00
Myriad-Dreamin
54b0207fe1
build: serve crate docs (#353)
* build: crate docs

* docs: update table of contents
2024-06-28 10:03:26 +08:00
Myriad-Dreamin
7f1de87765
build: bump version to 0.11.12 (#352)
* build: bump dependencies

* docs: update changelog

* build: bump version to 0.11.12

* chore: stupid patch
2024-06-28 09:08:09 +08:00
Myriad-Dreamin
ce8baa80b2
fix: completion in string context a bit (#351)
* fix: completion in string context a bit

* fix: side effect snapshot
2024-06-27 18:30:34 +08:00
Myriad-Dreamin
6967dc5a22
fix: bad early return in param_completions (#350)
* fix: bad early return in param_completions

* dev: update snapshot

* dev: filter result
2024-06-27 16:31:50 +08:00
Myriad-Dreamin
0a1c625397
fix: avoid duplicated method completion (#349) 2024-06-27 16:00:08 +08:00
Myriad-Dreamin
a3724bc87f
feat: remove cast completion (#348)
* feat: remove cast completion

* fix: update snapshot
2024-06-27 15:42:40 +08:00
Myriad-Dreamin
00ec24e18f
dev: terminate expression before math blocks (#347)
* docs: minor updates

* dev: terminate expression before math blocks
2024-06-26 18:14:04 +08:00
Myriad-Dreamin
7faf7973ef
feat: disable bracket colorization in markup mode (#346)
* docs: minor updates

* feat: disable bracket colorization in markup mode
2024-06-26 18:13:55 +08:00
Myriad-Dreamin
eccfe42d1a
docs: minor updates (#345) 2024-06-26 16:40:21 +08:00
Myriad-Dreamin
39d6c0affe
docs: add base documentation (#344) 2024-06-26 16:33:33 +08:00
Myriad-Dreamin
c7d0ebd3bd
feat: replace harness with sync_lsp (#343)
* feat: replace harness with sync_lsp

* dev: defer getting notification handlers

* fix: snapshot

* dev: add notes
2024-06-26 14:41:13 +08:00
Myriad-Dreamin
6fcad1c1c7
feat: prepare for parallelizing lsp requests (#342)
* feat: migrate steal_sync to snapshot_sync

* feat: correctly make world/analysis snapshot

* very rayon

* dev: recover async lsp request

* gg

* dev: pin

* fix: make server stable

* dev: disable concurrent server by default

* dev: very sync
2024-06-26 10:37:57 +08:00
Myriad-Dreamin
5e4e1e9877
refactor: pick state changes (#338)
* dev: make clippy happy

* refactor: pick state changes

---------

Co-authored-by: QuarticCat <QuarticCat@pm.me>
2024-06-23 12:31:03 +08:00
Myriad-Dreamin
7d65829ed7
refactor: combine typst-preview and tinymist compiler (#337)
* refactor: combine typst-preview and tinymist compiler

* dev: update link

* fix: bad changes

* dev: sync snapshot compiler
2024-06-22 15:06:42 +08:00
Myriad-Dreamin
b265dd49d6
refactor: combine typst-preview and tinymist binary (#332)
* refactor: combine typst-preview and tinymist binary

* dev: externalize assets

* dev: improve deps

* dev: bad deps
2024-06-21 19:23:31 +08:00
Myriad-Dreamin
82a9b3b8c3 build: publish tinymist-assets 2024-06-18 13:39:50 +08:00
Myriad-Dreamin
bb9f30fcdf
feat: move typst-preview to tinymist (#323)
* merge preview crates

Co-authored-by: mgt <mgt@oi-wiki.org>
Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
Co-authored-by: slanterns <slanterns.w@gmail.com>
Co-authored-by: Bubbleioa <1342130847@QQ.com>
Co-authored-by: 7mile <i@7li.moe>
Co-authored-by: 7sDream <7822577+7sDream@users.noreply.github.com>
Co-authored-by: Aldric.li <31800073+Parsifa1@users.noreply.github.com>
Co-authored-by: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com>
Co-authored-by: AsukaMinato <i@asukaminato.eu.org>
Co-authored-by: Banson <xzcxzcyy@126.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Marlon Regenhardt <marlon.r@hotmail.de>
Co-authored-by: OrangeX4 <34951714+OrangeX4@users.noreply.github.com>
Co-authored-by: Severi Salminen <severi.salminen@iki.fi>
Co-authored-by: Wisha W <49518157+wishawa@users.noreply.github.com>
Co-authored-by: werifu <wohu1363195380@outlook.com>

* chore: minimize images

* feat: move typst-preview to tinymist

* build: merge npm dependencies

* build: merge npm dependencies 2

* build: use assets TYPST_PREVIEW_HTML

* build(ci): bundle typst-preview package

* dev: add convenient script for building

* build: update yarn.lock

---------

Co-authored-by: mgt <mgt@oi-wiki.org>
Co-authored-by: slanterns <slanterns.w@gmail.com>
Co-authored-by: Bubbleioa <1342130847@QQ.com>
Co-authored-by: 7mile <i@7li.moe>
Co-authored-by: 7sDream <7822577+7sDream@users.noreply.github.com>
Co-authored-by: Aldric.li <31800073+Parsifa1@users.noreply.github.com>
Co-authored-by: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com>
Co-authored-by: AsukaMinato <i@asukaminato.eu.org>
Co-authored-by: Banson <xzcxzcyy@126.com>
Co-authored-by: Kian-Meng Ang <kianmeng.ang@gmail.com>
Co-authored-by: Marlon Regenhardt <marlon.r@hotmail.de>
Co-authored-by: OrangeX4 <34951714+OrangeX4@users.noreply.github.com>
Co-authored-by: Severi Salminen <severi.salminen@iki.fi>
Co-authored-by: Wisha W <49518157+wishawa@users.noreply.github.com>
Co-authored-by: werifu <wohu1363195380@outlook.com>
2024-06-17 17:22:45 +08:00
7sDream
8784a07b2b
feat: add font list export panel in summary tool (#322)
* feat(vscode/summary): add font list export pannel

* feat: json/csv format,  export to file and state persistence
2024-06-17 17:17:11 +08:00
Myriad-Dreamin
1c653d5fd2
build: bump version to 0.11.11 (#331)
* docs: update changelog

* build: bump version to 0.11.11

* fix: wording
2024-06-17 13:36:40 +08:00
Wenzhuo Liu
a08ba75a49
chore: bump typstyle to v0.11.26 (#326) 2024-06-17 12:57:37 +08:00
Myriad-Dreamin
340410fe63
fix: accumulate export events correctly (#330)
* fix: accumulate export events correctly

* dev: rename a variable

* dev: improve readability

* dev: loose export condition
2024-06-17 12:57:22 +08:00
Myriad-Dreamin
a1bd1c6698
dev: accurate warn on out-of-bound conversion (#329) 2024-06-17 11:06:10 +08:00
Myriad-Dreamin
95a68d2559
feat: implements experimental/onEnter (#328)
* feat: implements `experimental/onEnter`

* docs: update readme

* dev: update snapshot

* dev: allow configuration
2024-06-16 17:33:46 +08:00
Myriad-Dreamin
8d753d8c56
fix: handle the conversion of offset at the EOF (#325)
* fix: handle the conversion of offset at the EOF

* fix: clippy error

* fix: snapshot
2024-06-15 03:37:39 +08:00
QuarticCat
27fa1beb26
refactor: simplify pin_entry (#320)
* refactor: simplify pin_entry

* fix: update self.pinning
2024-05-31 14:52:32 +08:00
Lars Wrenger
257a6bcb86
feat: generate names for destructuring closure params (#319) 2024-05-31 12:24:08 +08:00
QuarticCat
10b0fd7ea3
refactor: combine CompileClient and CompileClientActor (#318)
* refactor: combine CompileClient and CompileClientActor

* refactor: improve comment
2024-05-30 21:09:35 +08:00
Myriad-Dreamin
82e75f362a
feat: highlights all break points for that loop context (#317)
* feat: highlights all break points for that loop or block context

* docs: update readme

* dev: remove a debug logging

* QAQ
2024-05-26 17:44:32 +08:00
Myriad-Dreamin
eb12ef0671
build: bump version to 0.11.10 (#316)
* docs: update changelog

* build: bump version to 0.11.10

* docs: update changelog.md
2024-05-26 11:50:15 +08:00
Wenzhuo Liu
de610aa28b
chore: bump typstyle to v0.11.23 (#315)
* chore: bump typstyle to v0.11.22

* bump to v0.11.23
2024-05-26 11:14:04 +08:00
Myriad-Dreamin
9d4700aee3
dev: transparentize the typst icon's background (#313) 2024-05-23 20:03:01 +08:00
Myriad-Dreamin
933352b0ea
feat: make more consistent font configuration (#312)
* feat: more consistent font configuration

* dev: improve systemFonts config

* dev: remove system font argument to pass
2024-05-23 18:10:44 +08:00
Myriad-Dreamin
0e853363dd
feat: complete CSL paths (#310)
* feat: complete csl paths

* dev: update snapshot
2024-05-23 17:49:26 +08:00
Myriad-Dreamin
247c6d5848
feat: check and move the exactly single punctuation after the math equation to refactor (#306) 2024-05-19 16:17:58 +08:00
Myriad-Dreamin
49c665de66
build: bump version to 0.11.9 (#304)
* build: add changelog

* build: bump version to 0.11.9
2024-05-18 13:08:44 +08:00
Wenzhuo Liu
8a577d5be5
chore: bump to typstyle v0.11.21 (#303) 2024-05-18 12:47:23 +08:00
Myriad-Dreamin
8f5725f51a
feat: complete both open and closed labels (#302)
* feat: complete both open and closed labels

* QAQ
2024-05-18 12:36:42 +08:00
Myriad-Dreamin
071d9072e1
build: bump typst to 0.11.1 (#301) 2024-05-18 12:17:24 +08:00
Myriad-Dreamin
71591b1f08
dev: remove some debug logging (#300) 2024-05-18 12:12:40 +08:00
Myriad-Dreamin
937f6f042f
fix: search newline character in utf-8 bytes sequence (#299) 2024-05-18 12:12:06 +08:00
Myriad-Dreamin
caaeb8efe8
fix: errors on debugging frontend (#297) 2024-05-17 17:07:45 +08:00
Myriad-Dreamin
7336c61453
dev: simplify a bit (#296) 2024-05-16 11:59:23 +08:00
Myriad-Dreamin
9835ffe6ab
docs: add documents to type system (#295)
* docs: simplify a bit

* docs: add documents to type system code

* docs: update

* refactor: rename
2024-05-16 11:52:41 +08:00
Myriad-Dreamin
c182c5fadc
chore: move typst-specific types (#294)
* chore: move typst-specific types

* QAQ
2024-05-16 00:30:32 +08:00
Myriad-Dreamin
d995ded9b2
feat: implement naive substitution (β-reduction) (#292)
* feat: implement naive substitution (β-reduction)

* fix: order

* dev: harder tests
2024-05-15 18:42:06 +08:00
Myriad-Dreamin
c8977f0052
dev: don't complete literal themselves (#291) 2024-05-15 14:54:56 +08:00
Myriad-Dreamin
cfd94b9416
dev: get check target without skip trivia node in non-code context (#289)
* x

* dev: get check target without skip trivia node in non-code context

* dev: add matcher testing

* dev: narrow down target matching

* dev: update snapshot
2024-05-14 21:26:29 +08:00
Myriad-Dreamin
bf64d3f004
fix: match labels in signature help correctly (#288)
* fix: match labels in signature help correctly

* QAQ
2024-05-14 20:58:54 +08:00
Myriad-Dreamin
235f2e49ae
fix: filter unsettable params when making a set rule (#287) 2024-05-14 20:08:39 +08:00
Myriad-Dreamin
3cd86a06a7
fix: correctly determine is_set for checking targets (#286) 2024-05-14 19:29:22 +08:00
Myriad-Dreamin
8cbd32c724
fix: make snapshot stable (#283)
* fix: make snapshot stable

* >_<
2024-05-14 18:38:02 +08:00
Myriad-Dreamin
04dd06313a
fix: completion path with ctx.leaf (#282) 2024-05-13 21:41:12 +08:00
Myriad-Dreamin
c90a766fdc
fix: wrong order of def-and-use names (#281) 2024-05-13 21:30:13 +08:00
Myriad-Dreamin
66e6aff2b4
dev: don't use bug prone ever_be (#280) 2024-05-13 21:29:59 +08:00
Myriad-Dreamin
f66d50c51f
dev: remove some interned uses (#279) 2024-05-13 21:04:10 +08:00
Myriad-Dreamin
6b9bd73d8a
build: uses types declaration in detypify (#277) 2024-05-12 17:00:35 +08:00
Myriad-Dreamin
43946b9bd3
docs: a first draft on overview document (#276)
* docs: finish command system overview

* docs: a first draft on overview document

* dev: revise a bit
2024-05-12 17:00:27 +08:00
Myriad-Dreamin
99aed49f8d
build: install detypify service from npm (#275)
* dev: install detypify service

* build: remove manual detypify assets downloading

* build: add types declaration for detypify
2024-05-12 01:06:54 +08:00
Myriad-Dreamin
0f08a4d2b0
docs: initialize overview (#274) 2024-05-12 00:52:58 +08:00
Myriad-Dreamin
6a438e79c4
fix: properly stops call expressions (#273) 2024-05-12 00:32:53 +08:00
Myriad-Dreamin
fff227f3ae
dev: interning types (#271)
* refactor: a bit

* fix: named completion

* dev: replace complete_literal by complete_type

* dev: remove unused code

* dev: basic interner

* dev: basic types

* dev: type operations

* dev: migrate all type definitions

* dev: check syntax and builtin types

* dev: make TypeSimplifier simply work

* dev: make TypeDescriber simply work

* dev: make TypeChecker simply work

* dev: recover type check

* fix: context check

* fix: use after free in seen fields

* fix: typed with

* fix: record type on field

* dev: check type of constructors and element containing

* dev: show sig by type

* fix: mixed context checking

* QAQ

* >_<

* dev: fix documents
2024-05-11 21:12:49 +08:00
Myriad-Dreamin
d9df64bca7
feat: make compile-based symbol resolver (#269)
* feat: use new symbol resolver

* feat: render emojis in symbol view
2024-05-09 12:33:19 +08:00
Myriad-Dreamin
95db52b068
docs: link to typst.zed for zed users (#268) 2024-05-09 12:32:29 +08:00
Myriad-Dreamin
e2b7bc4b56
refactor: introduce uri_for_id and deref_syntax_at (#267)
* dev: add documentation

* refactor: introduce uri_for_id and deref_syntax_at
2024-05-09 12:32:20 +08:00
Myriad-Dreamin
6d669461f9
dev: slice a syntax string prefix (#266) 2024-05-09 12:32:11 +08:00
Myriad-Dreamin
01f72c3d75
dev: simplify a bit (#265)
* fix: clippy

* dev: simplify a bit
2024-05-09 12:12:49 +08:00
Myriad-Dreamin
869960a89c
dev: {re,}move conversions of completion structs (#264)
* dev: {re,}move conversions

* dev: update dependencies
2024-05-09 12:04:42 +08:00
QuarticCat
94a0a1b23a
refactor: clean code & fix suffix computation & combine export actors (#263)
* dev: use bail! macro

* dev: remove redundant arg structures as we have inlay hints

* dev: unify actor namings

* dev: unify actor namings (cont)

* fix: suffix computation

* dev: add EditorActor::new

* dev: unify index file flavors

* dev: combine export actors

* dev: small tweaks

* dev: mimic try blocks

* dev: accumulate export requests

* dev: remove unnecessary Option

* dev: unify serde renames

* dev: remove unnecessary Option

* dev: small tweaks
2024-05-09 08:57:44 +08:00
Myriad-Dreamin
d05c5012ff
feat: implicitly focus entry on no focus request sent (#262)
* feat: implicitly focus entry on no focus command sent

* dev: garden
2024-05-08 22:16:56 +08:00
Myriad-Dreamin
ca5d8f61cc
build: upgrade rust and set MSRV to 1.75 (#261) 2024-05-08 20:48:35 +08:00
Myriad-Dreamin
398f2afb04
feat: simple code actions to manipulate equations (#258) 2024-05-07 20:21:01 +08:00
Myriad-Dreamin
f0442b7269
build: bump version to 0.11.8 (#256)
* dev: update changelog

* build: bump version to 0.11.8
2024-05-07 19:38:38 +08:00
Myriad-Dreamin
7e59b9dbcb
dev: identify let context completely (#255) 2024-05-07 19:26:31 +08:00
Myriad-Dreamin
806fb9bdfc
dev: improve open document tooltip (#254) 2024-05-07 19:26:21 +08:00
Myriad-Dreamin
1f9719a420
dev: weaken inference from outer use (#250)
* dev: weaken inference from outer use

* >_<
2024-05-07 19:21:13 +08:00
Myriad-Dreamin
ca5b87efba
dev: restore lparen and comma trigger characters (#253)
* dev: restore lparen and comma trigger characters

* QAQ
2024-05-07 19:18:23 +08:00
Myriad-Dreamin
5c83fb56ab
dev: improve literal completion matching (#252) 2024-05-07 19:13:29 +08:00
Myriad-Dreamin
bbded48a1b
dev: insert commas in arg context for completing before identifiers (#251) 2024-05-07 19:03:25 +08:00
Myriad-Dreamin
c640d53396
dev: improve join type (#249)
* dev: improve join type

* dev: update snapshot
2024-05-07 18:30:14 +08:00
Myriad-Dreamin
4fae99d767
fix: simplify all substructure (#248) 2024-05-07 15:27:05 +08:00
Myriad-Dreamin
73a5742c09
fix: instantiate variable before applying variable function (#247) 2024-05-07 13:44:50 +08:00
Myriad-Dreamin
b0c71a0961
fix: infinite loop in simplifying recursive functions (#246)
* fix: infinite loop in simplifying recursive functions

* dev: update snapshot
2024-05-07 13:39:04 +08:00
Myriad-Dreamin
25ae4afcbb
fix: wording in changelog (#245) 2024-05-07 13:38:52 +08:00
Myriad-Dreamin
f167ad1524
build: bump version to 0.11.7 (#244)
* dev: update changelog

* build: bump version to 0.11.7
2024-05-06 00:06:31 +08:00
Wenzhuo Liu
c406d5bab1
chore: bump to typstyle v0.11.17 (#223) 2024-05-05 23:40:39 +08:00
Myriad-Dreamin
d8c3a97f24
feat: trigger parameter hints instead of suggest on pos args (#243)
* dev: disable aggressive positional arguments completion

* feat: trigger parameter hints instead of suggest on pos args

* dev: update snapshot
2024-05-05 23:40:29 +08:00
Myriad-Dreamin
64c8be64d3
feat: improve icons (#242) 2024-05-05 23:30:27 +08:00
Myriad-Dreamin
3490a3244c
feat: reimplement signature help (#241)
* feat: reimplement signature help

* dev: export doc tooltip

* dev: update snapshot
2024-05-05 23:30:19 +08:00
Myriad-Dreamin
b8143e7090
feat: provide code action to rewrite headings (#240)
* feat: provide code action to rewrite headings

* dev: update snapshot
2024-05-05 23:25:03 +08:00
Myriad-Dreamin
6ad9258740
feat: handle/add link in the hover documentation (#239)
* feat: handle/add link in the hover documentation

* dev: update snapshot

* dev: update snapshot

* dev: update snapshot
2024-05-05 21:32:09 +08:00
Myriad-Dreamin
68bcc2b571
feat: provide label details by type, symbol, and labels (#237)
* feat: label details by type

* fix: symbol's details and label details

* dev: update snapshot

* fix: make signature stable
2024-05-05 20:19:29 +08:00
Myriad-Dreamin
3b93643091
feat: add template for feature request (#238) 2024-05-05 20:01:01 +08:00
Myriad-Dreamin
bf8a505135
feat: check surrounding syntax for elements/selectors (#236)
* feat: check surrounding syntax for elements/selectors

* dev: update snapshot

* dev: update snapshot
2024-05-05 19:36:30 +08:00
Myriad-Dreamin
d774304574
feat: find definition of label references (#235)
* feat: find definition of label references

* dev: move dependencies declaration

* dev: remove serde_spanned
2024-05-05 18:53:18 +08:00
Myriad-Dreamin
c133d81d36
dev: correctly handle module import completion (#234) 2024-05-05 17:59:26 +08:00
Myriad-Dreamin
abb89ed3e8
feat: dynamic analysis on import from dynamic expressions (#233)
* feat: dynamic analysis on import from dynamic expressions

* dev: adds more fixture
2024-05-05 17:39:56 +08:00
Myriad-Dreamin
46f524de57
feat: type check across modules (#232) 2024-05-05 17:19:56 +08:00
Myriad-Dreamin
0b566f83de
feat: improve and prefer to use post type check (#231)
* dev: rename literal_type_check to post_type_check

* feat: post check signature

* feat: post check array/dict elements

* feat: post check positional arguments

* fix: signature of func with/where

* fix: kind of items

* dev: remove cross-module fixture

* fix: kind of completions
2024-05-04 20:56:40 +08:00
Myriad-Dreamin
27f992bd87
docs: add roadmap (#229) 2024-05-04 14:17:26 +08:00
Myriad-Dreamin
10fad2ecde
dev: run completion snapshots with filtering (#230) 2024-05-04 14:17:13 +08:00
Myriad-Dreamin
97043b9789
feat: lsp label descriptions for labels (#228) 2024-05-04 13:59:07 +08:00
Myriad-Dreamin
0a76b4b18a
feat: graphic label descriptions for symbols (#227) 2024-05-04 13:58:59 +08:00
Myriad-Dreamin
f87659f2e3
dev: improve doc about slice_at (#226) 2024-05-04 13:58:51 +08:00
Myriad-Dreamin
c544283bbf
feat: disable inlay hints (#225) 2024-05-04 13:56:34 +08:00
Myriad-Dreamin
1814f42165
fix: symbol view issues (#224) 2024-05-04 13:56:25 +08:00
Wenzhuo Liu
60fa22c4df
feat: conditionally open activity icon when lang id is typst (#222) 2024-05-04 13:22:15 +08:00
Myriad-Dreamin
9767e33bdd
fix: install curl for downloading assets again (#221) 2024-04-27 11:02:06 +08:00
Myriad-Dreamin
c1583f065d
fix: install curl for downloading assets (#220) 2024-04-27 10:59:52 +08:00
Myriad-Dreamin
5fdf3353b7
build: bump version to 0.11.6 (#219)
* dev: add help and acknowledgement about symbol view

* dev: add changelog for  0.11.6

* build: bump version to 0.11.6
2024-04-27 10:49:18 +08:00
Myriad-Dreamin
bbc6e3e4e9
feat: complete symbol view (#218)
* dev: make detypify work

* dev: add symbol view

* fix: some bugs in symbol picker

* dev: make names correct

* dev: add help panel in symbol picker

* feat: paste the sym directly into the source position

* dev: tuning the detail

* dev: remove debug logging

* dev: recover mock

* docs: improve accessibility

* dev: change symbol picker to symbol view

* dev: download detypify assets

* dev: fix download script
2024-04-27 09:58:58 +08:00
Myriad-Dreamin
5ad5294fca
feat: support code context queries (#217)
* feat: support code context queries

* dev: improve switch

* dev: update snapshot
2024-04-27 09:29:20 +08:00
Myriad-Dreamin
65cbd3d658
dev: add position_encoding todo (#216) 2024-04-27 09:19:53 +08:00
Myriad-Dreamin
8293f9e2cc
fix: remove debugging (#215) 2024-04-27 09:19:24 +08:00
Myriad-Dreamin
09c5882c97
docs: add packaging status (#214) 2024-04-25 18:38:09 +08:00
Myriad-Dreamin
f3a63ebd96
dev: optimize state transition of focusing file and status bar (#212) 2024-04-25 17:03:28 +08:00
QuarticCat
b5164d844e
refactor: clean code of actors (#213)
* dev: simplify cluster.rs

* dev: simplify render.rs

* dev: simplify EditorActor::publish

* dev: simplify typ_client.rs

* dev: simplify typ_server.rs

* dev: remove handle param from steal_async as callers can get it by themselves
2024-04-25 17:03:14 +08:00
Myriad-Dreamin
73c64470fd
dev: make the main thread (lsp) out of tokio runtime (#211) 2024-04-24 10:25:09 +08:00
Myriad-Dreamin
4227f864a2
feat: add more auto closing pairs, surrounding pairs, and characters that could make auto closing before (#209)
* dev: add more characters that could make auto closing before

* dev: add more auto closing pairs and surrounding pairs

* dev: remove a debugging log

* dev: add a comment
2024-04-21 10:53:55 +08:00
Myriad-Dreamin
786814b09c
build: bump version to 0.11.5 (#207)
* build: update changelog

* build: bump version to 0.11.5
2024-04-20 19:33:47 +08:00
Myriad-Dreamin
e54d74812e
feat: append rest code completion result after param completed (#208)
* feat: append rest code completion result after param completed

* dev: update snapshot
2024-04-20 16:04:18 +08:00
Wenzhuo Liu
f79a83e616
chore: bump to typstyle v0.11.14 (#200) 2024-04-20 15:28:20 +08:00
Myriad-Dreamin
9c9e4977b1
feat: complete functions with where/with snippets (#206)
* dev: complete function with where/with snippets

* dev: update snapshot
2024-04-20 15:27:57 +08:00
Myriad-Dreamin
c33f14e761
fix: wrong check of param completion position at comma (#205) 2024-04-20 15:26:31 +08:00
Myriad-Dreamin
b52ad52760
feat: completion on func.where and func.with (#204) 2024-04-20 15:17:47 +08:00
Myriad-Dreamin
b35d897919
feat: complete function parameters on signatures inferred by type checking (#203)
* dev: check upper bound types in assigning positions

* dev: check template signatures

* feat: completion with type sigatures

* dev: document a bit

* dev: save todo work on auto completion on user functions

* dev: fix document target

* dev: remove playground snaps

* dev: fix ident target

* dev: update snapshot
2024-04-20 15:03:46 +08:00
Myriad-Dreamin
4ec4305fd5
dev: check variadic/content arguments correctly (#202) 2024-04-20 12:49:44 +08:00
Myriad-Dreamin
fa0899b7cf
feat: complete array/tuple literals (#201)
* dev: introduce type checking on arrays/tuples

* dev: complete array literals

* dev: complete columns/ros/gutter/column-gutter/row-gutter/size/dash array types

* chore: reduce two todos
2024-04-20 11:47:53 +08:00
Myriad-Dreamin
f6f2454d37
feat: complete text.lang/region (#199) 2024-04-19 16:12:40 +08:00
Myriad-Dreamin
0982686258
fix: identify string literals in math mode (#196) 2024-04-18 11:33:49 +08:00
Myriad-Dreamin
3393b998aa
fix: a dot or colon in ref ident cannot follow space or EOF (#195) 2024-04-18 11:33:22 +08:00
Myriad-Dreamin
879d95a74b
dev: introduce type checking on if and block join (#193)
* dev: clean some todo

* dev: remove FlowBinaryRepr

* dev: simple if and type join
2024-04-16 14:13:37 +08:00
Myriad-Dreamin
a09c068d1d
dev: prefer less uses of analzer_expr during definition analysis (#192)
* dev: prefer less uses of `analzer_expr` during definition analysis

* dev: improve pipeline of resolving syntactic definition
2024-04-16 14:03:01 +08:00
Myriad-Dreamin
68ce4701c6
build: bump version to 0.11.4 (#191)
* build: update changelog

* build: bump version to 0.11.4

* docs: update readme

* docs: update wording
2024-04-15 01:34:38 +08:00
Myriad-Dreamin
878a414646
feat: infer types on set rules (#189) 2024-04-15 00:47:03 +08:00
Myriad-Dreamin
f98470a0f5
fix: slicing at an offset that is not char boundary (#188) 2024-04-15 00:46:10 +08:00
Wenzhuo Liu
882dd6ad27
chore: bump typstyle to v0.11.12 (#181) 2024-04-15 00:18:21 +08:00
Myriad-Dreamin
987a7da867
feat: complete arguments enhanced by type inference (#186)
* auto complete code in param position

* dev: initial path completion in params

* fix: compile error

* remove two todo

* dev: improve get_deref_target

* check string during completion

* feat: complete path arguments

* feat: identify hash before function follows a content parameter

* dev: complete text.size, text.dir, stack.dir, stroke dict

* dev: add record type

* dev: complete stroke dict

* fix: correct kind of langauge of code tooltip

* dev: add colon trigger character

* dev: let type selection complete

* dev: complete inset/outset/margin/radius dictionary types

* dev: complete raw theme/syntaxes, bib path types

* dev: complete all files at the same time

* dev: update snapshot
2024-04-15 00:17:54 +08:00
Myriad-Dreamin
76de22b676
dev: rename trace feature to profile feature (#185)
* dev: rename trace feature to profile feature

* dev: update snapshot
2024-04-12 09:49:44 +08:00
Myriad-Dreamin
4b1057efaf
fix: better grammar on incomplete heading (#187) 2024-04-12 09:49:36 +08:00
Myriad-Dreamin
6e3af65749
dev: remove unused StableHash (#184) 2024-04-12 08:31:15 +08:00
Myriad-Dreamin
71ad5aaaed
dev: introduce basic type checker (#183)
* dev: draft type checker v1

* dev: use check_in_mode

* dev: refactor entries

* dev: change name

* update test

* dev: clean up playground

* dev: clean tests

* dev: update snapshot

* fix: bad refactor

* dev: update snapshot
2024-04-11 23:28:32 +08:00
Myriad-Dreamin
0c4a898c97
dev: introduce call static analysis (#182)
* dev: start write signature v2

* dev: introduce signature with bindings

* fix: print value instead document in type repr

* dev: use new signature analyzer for calls

* dev: weaken analysis requirement

* dev: invalidate signature cache on source update
2024-04-11 21:07:09 +08:00
Myriad-Dreamin
c22f70b49e
dev: refactor def and use cache for improving definition (#179)
* chore: add a notes to do.

* dev: cache def and use information

* dev: move signature cache to analysis level

* dev: refactor a bit for improving definition

* dev: more appropriate definition discover

* fix: clippy error
2024-04-11 20:45:02 +08:00
QuarticCat
ebed95cbcd
fix: improve release profile & fix typos (#177)
* dev: split a gh-release profile to accelerate development

* fix: many typos

* fix: miri warnings

* fix: update fixtures
2024-04-10 11:34:18 +08:00
Myriad-Dreamin
e7acb31a54
fix: set entry state on changing entry (#180) 2024-04-09 16:36:30 +08:00
Myriad-Dreamin
59ca5bdabc
chore: fix test scripts and update test documents (#178)
* chore: fix test scripts and update test documents

* docs: redirect developer who want to build and test to the contributing guide

* dev: change wording
2024-04-09 12:37:01 +08:00
Myriad-Dreamin
da70c0d31c
build: bump version to 0.11.3 (#172)
* build: update readme and changelog for update

* build: bump version to 0.11.3

* dev: remove a dirty console log

* dev: update changelog
2024-04-06 19:46:41 +08:00
Myriad-Dreamin
6c8074852f
revert: "dev: evict cache more frequently"
This reverts commit 454127e354.
2024-04-06 16:20:27 +08:00
Myriad-Dreamin
4afe4b30d9
feat: add basic color providers (#171)
* feat: provide document color api

* feat: provide color presentation api.

* dev: update snapshot

* dev: update snapshot
2024-04-06 14:10:48 +08:00
Myriad-Dreamin
8a3fdbc642
feat: add common print width configuration for formatters (#170)
* dev: typstfmt use width configuration

* feat: add common print width configuration for formatters
2024-04-06 13:54:26 +08:00
Myriad-Dreamin
76c88c43d1
fix: collect warning diagnostics correctly (#169) 2024-04-06 13:46:02 +08:00
Myriad-Dreamin
8378d06ab6
dev: collect server's font paths information (#168) 2024-04-06 13:45:52 +08:00
Myriad-Dreamin
61851f1300
dev: correctly parse label and reference markup (#167) 2024-04-06 13:44:48 +08:00
Wenzhuo Liu
3cc078e501
chore: bump to typstyle v0.11.11 (#163) 2024-04-06 13:32:38 +08:00
Myriad-Dreamin
7613712137
feat: support tracing execution in current document (#166)
* feat: support tracing execution in current document

* dev: improve frontend appearence

* fix: word grammar

* dev: update snapshot
2024-04-06 13:32:11 +08:00
Myriad-Dreamin
f60d78a3ca
dev: clear analysis cache (#165)
* dev: clear analysis cache

* dev: remove an extra clear
2024-04-06 09:24:42 +08:00
Myriad-Dreamin
c2f2b214a2
feat: initialize telescope mode previewing (#164)
* feat: initialize telescope mode previewing

* dev: add notes

* dev: configure and disable hovering periscope

* dev: update snapshot
2024-04-05 17:22:56 +08:00
Myriad-Dreamin
703c8b4c1d
dev: collect server information for summary (#162)
* dev: collect server information for summary

* dev: humanize font variant to show

* fix: let focus state correct
2024-04-05 13:18:36 +08:00
Myriad-Dreamin
6722b2501f
feat: add status bar to showing words count, also for compiling status (#158)
* feat: add status bar to showing words count, also for compilng status

* dev: add configuration for compile status

* fix: let focus state correct

* dev: improve hint
2024-04-05 13:16:24 +08:00
Myriad-Dreamin
454127e354
dev: evict cache more frequently (#161) 2024-04-05 13:13:14 +08:00
Myriad-Dreamin
84f7e27654
build: bump typstyle to 0.11.10 (#160) 2024-04-05 13:12:47 +08:00
Myriad-Dreamin
c0878fc627
build: bump typst.ts to 0.5.0-rc3 (#159) 2024-04-05 13:12:38 +08:00
Myriad-Dreamin
2ba806359a
dev: join array of hover contents by divider for neovim clients (#157)
* dev: join array of hover contents by divider for neovim client

* dev: update snapshots
2024-04-05 12:37:27 +08:00
Myriad-Dreamin
1c5c6bd929
feat: go to definition of include paths (#156) 2024-04-04 11:11:23 +08:00
Myriad-Dreamin
36eea552ac
feat: initialize symbol picker (#155)
* feat: initialize symbol picker

* dev: update snapshot

* dev: remove mock
2024-04-04 10:33:25 +08:00
Myriad-Dreamin
3945c59be1
dev: reduce information to show in summary page (#154) 2024-04-04 09:49:54 +08:00
Myriad-Dreamin
d256ff0556
dev: recover module completion (#151)
* dev: recover module completion

* dev: update snapshot
2024-04-04 09:38:47 +08:00
Myriad-Dreamin
bd610b2323
feat: auto complete parameters after completing a function (#150)
* feat: auto complete parameters after completing a function

* dev: update snapshot

* dev: update completion snapshot
2024-04-02 18:50:02 +08:00
Myriad-Dreamin
d71dd38b98
feat: complete parameter values on user functions (#149)
* feat: complete parameter values on user functions

* dev: separate type/value repr in parameter analysis
2024-04-02 17:52:15 +08:00
Myriad-Dreamin
d708bdfe2d
feat: complete parameters on user functions (#148)
* fix: skip tabs that have no uris for reopening pdf

* dev: lift call analysis

* feat: complete parameters on user functions
2024-04-02 17:12:20 +08:00
Myriad-Dreamin
631f6e288c
fix: skip tabs that have no uris for reopening pdf (#147) 2024-04-01 13:23:41 +08:00
Myriad-Dreamin
de5df05b67
fix: complete parameters in scope (#146) 2024-04-01 10:40:05 +08:00
Myriad-Dreamin
b43dfcf11e
fix: correctly shadow items for completion (#145) 2024-04-01 10:36:47 +08:00
Myriad-Dreamin
d6e58ea961
fix: perform correct dynamic analysis on imports (#143)
* dev: perform correct dynamic analysis on imports

* dev: review e2e snapshot
2024-04-01 10:35:48 +08:00
Myriad-Dreamin
c420b10540
dev: analyze lexical hierarchy on for loops (#142) 2024-04-01 10:27:31 +08:00
Myriad-Dreamin
00e32a1db0
dev: early exit on simple syntax nodes (#141) 2024-04-01 10:27:23 +08:00
Myriad-Dreamin
7e453872b1
dev: init summary page (#137)
* feat: add summary frontend

* dev: init summary page

* build: update cargo.lock

* feat: init diagnostics frontend

* build: update snapshot hash
2024-04-01 10:16:26 +08:00
Myriad-Dreamin
2e39afde78
fix: better grammar on incomplete AST (#140)
* dev: error tolerance on editing let/show statements

* dev: error tolerance on editing if/show statements

* dev: error tolerance on editing while/for statements

* dev: error tolerance on editing if/while/for statements

* dev: better token for and or not
2024-04-01 01:51:42 +08:00
Myriad-Dreamin
38c54a70da
build: bump typstyle to 0.11.8 (#139) 2024-04-01 01:18:43 +08:00
Myriad-Dreamin
b635f06619
build: bump version to 0.11.2 (#136)
* docs: update documents

* fix: correct order of building binaries

* build: bump version to 0.11.2

* docs: redirect changelog

* docs: update document tips

* docs: update insert template in place tips

* build: bump typstyle version to 0.11.7
2024-03-30 23:02:43 +08:00
Myriad-Dreamin
f7fd47d62c
dev: don't do complete on definition itself (#135)
* dev: don't do completion on definition itself.

* dev: update snapshot hash
2024-03-30 21:09:06 +08:00
Myriad-Dreamin
36536bbc6b
feat: support import path completion (#134)
* feat: path completion

* fix: package snippet order

* dev: update snapshot hash

* fix: completion
2024-03-30 20:44:27 +08:00
Myriad-Dreamin
90ef2e6f72
dev: improve punctuation and keyword token kinds (#133)
* dev: improve punctuation and keyword token kinds

* dev: improve punctuation and keyword token kinds
2024-03-30 20:04:34 +08:00
Myriad-Dreamin
edbb7bc1af
fix: empty url sent from neovim (#130)
* fix: empty url sent from neovim

* dev: move e2e build script

* dev: make stronger name for empty urls

* fix: work around empty url

* fix: convert empty link on unix system
2024-03-30 20:04:03 +08:00
Myriad-Dreamin
b76e80bad3
fix: dedent documentation correctly (#132) 2024-03-30 19:04:07 +08:00
Myriad-Dreamin
c32e6e3097
fix: documentation issues (#131) 2024-03-30 18:51:30 +08:00
Myriad-Dreamin
edd21deaca
feat: support entry configuration (#122) 2024-03-30 18:51:17 +08:00
Myriad-Dreamin
4e318e023f
fix: correct identifier/keyword boundaries (#128) 2024-03-30 17:14:58 +08:00
Myriad-Dreamin
21a872bbe8
fix: wrong completion kind (#127)
* fix: wrong completion kind

* dev: add completion requests back to e2e testing
2024-03-30 17:14:50 +08:00
Myriad-Dreamin
2c13d7efdd
feat: minimal diff algorithm for source formatting (#123)
* feat: minimal diff algorithm for source formatting

* fix: typo
2024-03-29 19:46:30 +08:00
Myriad-Dreamin
0eae40dec6
dev: intern completion code (#124)
* dev: intern completion code

* dev: change completion kind of symbols to FIELD

* fix: accept hash

* fix: reduce redundant information
2024-03-29 19:46:10 +08:00
Myriad-Dreamin
858c100146
fix: expose pin/unpin commands for vscode (#121) 2024-03-29 15:27:11 +08:00
Myriad-Dreamin
529b422189
feat: support untitled url scheme for unsaved documents (#120) 2024-03-29 15:26:46 +08:00
Myriad-Dreamin
d53bd80d14
dev: ensure to run a single compiler instance (#119)
* build: remoe tinymist deps on tests

* dev: ensure unique running compiler

* docs: update some comments
2024-03-29 14:36:02 +08:00
Myriad-Dreamin
b364160fdd
build: bump typstyle to 0.11.5 (#118) 2024-03-29 14:35:51 +08:00
Myriad-Dreamin
3a0e8e3d26
fix: converts out of bounds offsets again (#115)
* fix: converts out of bounds offsets again

* fix: wrong length calculation

* dev: accept hash
2024-03-29 02:20:12 +08:00
Myriad-Dreamin
5f27135419
feat: add an e2e smoke testing (#114)
* feat: e2e smoke testing

* feat: redact value

* dev: don't compile in tests

* dev: use correct path to binary
2024-03-28 21:34:56 +08:00
Myriad-Dreamin
d4dda9e06f
feat: support formatters (#113)
* feat: supports formatter

* feat: supports dynamic configuration and typstfmt

* fix: test
2024-03-28 16:28:00 +08:00
Myriad-Dreamin
0114bf4a3b
feat: allow tracing typst programs in subprocess (#112)
* feat: add compiler mode

* feat: implement compiler mode

* dev: imtroduce typst timings
2024-03-27 22:51:51 +08:00
Myriad-Dreamin
b84aaec294
fix: passed correct arguments to editor tools (#111) 2024-03-27 22:50:50 +08:00
Myriad-Dreamin
3380bfdb7d
dev: make a lsp function for testing (#70)
* dev: make a lsp function for testing

* dev: split modes futhermore
2024-03-27 13:56:32 +08:00
Myriad-Dreamin
e4148ef51e fix: testing workflow again... 2024-03-27 11:12:33 +08:00
Myriad-Dreamin
c0ac418e87 fix: bundle tm languages 2024-03-27 10:55:16 +08:00
Myriad-Dreamin
2daec9cc9c fix: testing workflow 2024-03-27 10:47:26 +08:00
Myriad-Dreamin
bf739d8367
build: bump version to 0.11.1 (#106)
* build: bump version to 0.11.1

* build: add changelog for v0.11.1

* fix: wrong changelog

* docs: update readme

* docs: update changelog
2024-03-27 10:30:50 +08:00
Myriad-Dreamin
d908648582
docs: mention how to work with multiple-file projects (#108)
* docs: mention how to work with multiple-file projects

* fix: words

* dev: update helix solution
2024-03-27 10:20:23 +08:00
Myriad-Dreamin
2ae86922a4
fix: keyword boundary (#109) 2024-03-27 10:19:50 +08:00
Myriad-Dreamin
3344eebe3f
feat: correctly parse and show hover doc (#105)
* feat: seperate content on hover tips

* dev: half hover

* fix: ensure extracting docs correctly
2024-03-27 10:19:34 +08:00
Myriad-Dreamin
de2504b15f
feat: add minimal helix support (#107) 2024-03-26 12:55:08 +08:00
Myriad-Dreamin
4d21026661
dev: more accurate deref target (#104) 2024-03-26 11:40:20 +08:00
Myriad-Dreamin
876827d39b
dev: recover sys.inputs configuration (#103) 2024-03-26 11:40:12 +08:00
Myriad-Dreamin
63d332f8d9
refactor: make state query functions closer (#102) 2024-03-26 11:40:05 +08:00
Myriad-Dreamin
413c2e8deb
feat: add svg and png export (#101) 2024-03-26 11:25:46 +08:00
Myriad-Dreamin
e649ad308f
refactor: tidy up compiler server/client actors (#100)
* refactor: split construct/preview code

* refactor: clean server-client actors

* fix: infinite loop

* fix: compile error
2024-03-26 11:15:32 +08:00
Myriad-Dreamin
90484cb8e6
build: add categories meta for vscode extension (#99) 2024-03-26 11:05:08 +08:00
Myriad-Dreamin
1cd6e03529
feat: add tracing frontend (#98) 2024-03-26 10:54:47 +08:00
Myriad-Dreamin
8f91615839
fix: wrong default value for system fonts (#97) 2024-03-26 10:54:35 +08:00
Myriad-Dreamin
37982a6870
fix: error tolerance on external paths (#96) 2024-03-26 10:54:26 +08:00
Myriad-Dreamin
76b4e91046
feat: allow running server with loading font once and on rootless files (#94)
* dev: change system config

* docs: update config doc

* dev: clean up tightly coupled world

* dev: load font once

* docs: add more comments to tinymist-query

* dev: merge compiler layers

* feat: allow run lsp on rootless files

* build: bump ts

* fix: workspace dep

* build: bump preview

* dev: correctly check inactive state

* fix: weird cargo default features
2024-03-26 10:33:56 +08:00
Myriad-Dreamin
f0a9c3e880
dev: use positive system font config (#93)
* dev: change system config

* docs: update config doc
2024-03-24 10:16:29 +08:00
Myriad-Dreamin
b6dd6671c3
fix: convert EOF position correctly (#92) 2024-03-23 18:59:19 +08:00
Myriad-Dreamin
9b09d6458e
feat: integrate neovim support (#91)
* feat: integrate neovim support

* dev: restre default settings in plugin file

* fix: description

* docs: better link

* chore: fix

* chore: mason install

* fix: link
2024-03-23 18:46:31 +08:00
Myriad-Dreamin
a0c434477c
refactor: remove listeners (#90) 2024-03-23 12:56:30 +08:00
Myriad-Dreamin
67a05a97c8
dev: remove InitializeParamsExt (#89) 2024-03-23 10:46:24 +08:00
Myriad-Dreamin
4139491019
chore: improve issue report templates and integration (#88)
* build: change order of rust cache

* build: link pr title

* build: update issue template
2024-03-23 10:09:23 +08:00
Myriad-Dreamin
81ed159e90
dev: test libraries in CI (#69)
* fix: canonicalize line feed for testing

* dev: test libraries in CI

* build: remove wrapper
2024-03-23 09:16:32 +08:00
Myriad-Dreamin
0cdbeaa38b
build: remove rust cache (#87) 2024-03-23 08:42:21 +08:00
Myriad-Dreamin
e62001530f
build: remove preview hacks (#86) 2024-03-23 07:37:38 +08:00
Myriad-Dreamin
2e7c7732dc
feat: mark correct expression boundary on all testing files from typst/typst (#85)
* fix: comment and set rules

* fix: losen for rules

* fix: chore field, escape

* fix: hash termination

* dev: handle math mode

* fix: terminate expressions on right braces

* dev: match spread operator

* dev: remove complex check on if

* dev: add two bugs

* dev: fix if/while conditions

* fix: terminate expressions on right braces 2
2024-03-23 01:19:43 +08:00
Myriad-Dreamin
10c3e0134a
feat: disable bracket colorizing according to textmate scopes (#81)
* feat: disable bracket colorizing according to textmate scopes

* feat: use typc as highlighting language
2024-03-22 21:23:26 +08:00
Myriad-Dreamin
14ef2e78e2
feat: provide more robust syntax highlight for expressions in markup context (#80)
* dev: robust if syntax

* dev: robust for syntax

* dev: if/for with content blocks

* dev: robust while syntax

* dev: lift identifier matchers

* dev: update test case

* dev: robust call syntax

* dev: robust arrow func syntax

* dev: robust set syntax

* dev: robust show syntax

* dev: robust let syntax

* dev: robust string literal syntax

* dev: robust include syntax

* dev: robust import syntax

* dev: expression continuation

* dev: error tolerance

* dev: robust inline/blocky raw syntax

* dev: chore fixes

* dev: fix call and raw

* dev: fix some markup

* dev: refactor many markup patterns

* dev: final touches

* dev: remove unused dep
2024-03-21 17:52:51 +08:00
Myriad-Dreamin
5c70b310de
build: disable lto (#84) 2024-03-21 14:06:40 +08:00
Myriad-Dreamin
bc9e2aa1e1
feat: parse comments for hover tooltip (#78) 2024-03-21 03:05:16 +08:00
Myriad-Dreamin
13e3562424
build: bump version to 0.11.1-rc2 (#79) 2024-03-20 18:25:15 +08:00
Myriad-Dreamin
a3948df5da
feat: init syntax library for function hover tip (#77)
* dev: introduce upstream tooltip

* feat: basic function definition

* feat: init syntax library

* abandon

* build: run syntax building

* fix: let expression

* fix: markup in code

* fix: raw code
2024-03-20 12:18:57 +08:00
Myriad-Dreamin
14fc4819f1
feat: hover tooltip on functions (#76)
* dev: introduce upstream tooltip

* feat: basic function definition
2024-03-20 00:02:11 +08:00
Myriad-Dreamin
b780a2a885
fix: typo (#75) 2024-03-19 03:20:16 +08:00
Myriad-Dreamin
7e94c7d47c
feat: provides correct semantic highlighting (#71)
* dev: initialize highlight test

* dev: add more cases

* fix: overlapping token

* fix: multiple lines token
2024-03-19 01:20:22 +08:00
Myriad-Dreamin
fb503ede1a
feat: use ts and preview crates (#73) 2024-03-18 23:01:07 +08:00
Myriad-Dreamin
cc1f418423
dev: reduce a bundle of ts usage in query crate (#72) 2024-03-18 23:00:27 +08:00
Myriad-Dreamin
c6509325a8
fix: steal the latest compiled document for lsp functions (#68) 2024-03-18 17:36:58 +08:00
Myriad-Dreamin
2fe992e933
dev: convert all syntax-level request and check main state before requesting (#67) 2024-03-18 17:36:43 +08:00
Myriad-Dreamin
5d123221db
fix: two bugs during initializing template (#65)
* fix: show packages only if it is favorited

* fix: vscode dark theme detection
2024-03-18 12:00:16 +08:00
Myriad-Dreamin
342c8969dc
feat: provide dhat instrumenting feature for heap usage analysis (#64)
* fix: get missing header in mirrorred input.

* feat: provide dhat instrumenting feature for heap analysis.
2024-03-18 02:29:00 +08:00
Myriad-Dreamin
cfca8b1dba
build: bump version to 0.11.0 (#63) 2024-03-17 19:52:01 +08:00
Myriad-Dreamin
d937153888
feat: init template in place (#62) 2024-03-17 16:59:21 +08:00
Myriad-Dreamin
512d33b734
feat: add favorite function in template gallery (#61) 2024-03-17 16:56:54 +08:00
Myriad-Dreamin
e0c2c575bf
fix: editor-tools files are not bundled (#60) 2024-03-17 15:38:27 +08:00
Myriad-Dreamin
3c37ce174a
build: bump version to 0.10.3 (#54)
* build: bump typst to v0.11.0

* build: bump dependencies

* build: update readme and changelog

* build: bump version to 0.10.3

* fix: use a different branch for building

* build: set correct rev to typst-preview

* fix: in perfects
2024-03-17 00:57:36 +08:00
Myriad-Dreamin
d8cc783c14
feat: supports vscode variables in configurations and (#53)
+ more testing and validation
2024-03-16 23:12:40 +08:00
Myriad-Dreamin
c27bf6a3c4
feat: add template gallery as template picker (#52)
* feat: add template gallery as template picker

* fix: ci install deps and add regular build checking

* fix: ci regular build checking again

* fix: stupid matrix
2024-03-16 22:23:09 +08:00
Myriad-Dreamin
9b7b4d7f56
dev: change position of inlay hint params (#51)
* dev: change position of inlay hint params

* dev: update test snapshot
2024-03-16 16:53:54 +08:00
Myriad-Dreamin
c92149fa3e
feat: add init template command (#50)
* feat: add init template command

* dev: remove bad patch
2024-03-16 13:21:29 +08:00
Myriad-Dreamin
f4fd0fc276
feat: leave typst-preview as optional dependencies (#49)
* feat: leave typst-preview as optional dependencies

* build: configure cargo.toml correctly
2024-03-16 11:09:04 +08:00
Myriad-Dreamin
222681ca97
feat: disable inlay hints on one line content blocks (#48) 2024-03-16 10:22:10 +08:00
Myriad-Dreamin
d5c7bcdd18
feat: support syntax analysis on packages (#47)
* feat: support syntax analysis on packages

* dev: add more tests
2024-03-16 10:21:59 +08:00
Myriad-Dreamin
f683426753
feat: allow fuzzy selection to deref targets (#46) 2024-03-16 04:22:54 +08:00
Myriad-Dreamin
be244840b2
feat: support rest code lens (#45) 2024-03-16 04:21:10 +08:00
Myriad-Dreamin
2d2857e6f3
docs: refactor and documenting analyzer code (#44)
* dev: refactor and documenting analyzer code

* dev: documenting some lsp api
2024-03-16 02:54:56 +08:00
Myriad-Dreamin
da7028f59c
dev: reimplements definition analysis (#43)
* dev: reimplements definition based on def use analysis

* dev: reimplements lsp apis based on new definition api

* fix: most cases of references

* fix: scope of params
2024-03-15 22:05:53 +08:00
Myriad-Dreamin
5fa4f8f94f
feat: support query of cross-module references (#42)
* feat: support cross-module references by wild-card import

* feat: support cross-module references by ident import

* feat: support cross-module references by alias import

* docs: update readme

* dev: remove two debug printing
2024-03-15 15:43:42 +08:00
Myriad-Dreamin
fe25933d0e
dev: implements module dependencies analysis (#41) 2024-03-15 14:33:14 +08:00
Myriad-Dreamin
c88e37ffba
dev: create tests module (#40) 2024-03-15 14:03:23 +08:00
Myriad-Dreamin
4aa60c5acb
dev: unfocus document on changed to other files (#39) 2024-03-15 14:03:07 +08:00
Myriad-Dreamin
61be2f78e4
feat: implement inlay hint configuration (#37)
* fix: unstable order of reference results

* feat: inlay hint configuration

* dev: test inlay hint on `lr`
2024-03-15 00:37:57 +08:00
Myriad-Dreamin
dbd1726d08
feat: support goto/find references inside of modules (#34)
* feat: support goto declaration inside of modules

* fix: change goto declarations provider to references provider

* fix: redact uri in references response
2024-03-14 20:38:30 +08:00
Myriad-Dreamin
9d344570b4
dev: borrow the document state inside of compiler (#33) 2024-03-14 20:37:14 +08:00
Myriad-Dreamin
c7825c3174
feat: deferred root resolution (#32)
* dev: create state module

* dev: rearrange roots code

* refactor: reduce deferred values

* feat: deferred root resolution

* dev: resolve root before waiting
2024-03-14 18:57:10 +08:00
Myriad-Dreamin
8ca5807801
feat: add capability to settle down a compiler actor (#31)
* feat: add capability to settle down a compiler actor

* dev: update rev
2024-03-14 02:01:21 +08:00
Myriad-Dreamin
51c30f4f66
feat: upgrade compiler for autocompleting package (#30)
* feat: upgrade compiler for autocompleting package

* fix: rev not found
2024-03-13 17:43:39 +08:00
Myriad-Dreamin
f7860bd4b7
feat: add def use analysis for external items (#26)
* feat: add def use analysis for external items

* fix: recursive import wildcard
2024-03-13 15:05:52 +08:00
Myriad-Dreamin
1f5f38895d
feat: add def use analysis for module items (#25)
* feat: analyze lexical hierarchy for import items

* feat: add def use analysis for module items
2024-03-13 12:05:28 +08:00
Myriad-Dreamin
32d74194c0
dev: move snaps (#20)
* dev: move snaps

* build: update cargo.lock
2024-03-12 14:10:24 +08:00
Myriad-Dreamin
1a05e4274c
feat: add def use analysis inside of module (#19)
* dev: add snapshot map

* feat: add def use analysis inside of module
2024-03-12 14:09:48 +08:00
Myriad-Dreamin
ee131ac68a
feat: analyze lexical hierarchy for def-use relations (#17) 2024-03-12 12:24:53 +08:00
Myriad-Dreamin
f8194c76b0
docs: add changelog for 0.10.2 (#18)
* docs: add changelog for 0.10.2

* Update Cargo.toml

* Update package.json
2024-03-12 03:48:15 +08:00
Myriad-Dreamin
3fe61971b5
feat: support more ast nodes to folding (#11) 2024-03-11 23:47:13 +08:00
Myriad-Dreamin
47a9b88c90
feat: add tests for inlay hints (#8) 2024-03-11 20:54:19 +08:00
Myriad-Dreamin
9823dfa4f5
Merge pull request #7 from Myriad-Dreamin/shutdown-sender
feat: correctly drop sender after the server shutting down
2024-03-11 19:57:10 +08:00
Myriad-Dreamin
746afddd89
Merge pull request #6 from Myriad-Dreamin/new-context-keyword
feat: add the new context keyword
2024-03-11 19:36:20 +08:00
Myriad-Dreamin
92b1789b11 feat: correctly drop sender after the server shutting down 2024-03-11 19:35:16 +08:00
Myriad-Dreamin
50a4f1b5d4 feat: add the new context keyword 2024-03-11 16:05:04 +08:00
Myriad-Dreamin
c2dedcdbd7
Merge pull request #3 from Myriad-Dreamin/implicit-complete
dev: use implicit autocomplete
2024-03-11 15:59:43 +08:00
Myriad-Dreamin
8bfbe7706e dev: use implicit autocomplete 2024-03-11 15:58:07 +08:00
2437 changed files with 179125 additions and 13545 deletions

10
.dockerignore Normal file
View file

@ -0,0 +1,10 @@
# Ignored for `Dockerfile` build tinymist cli
target
node_modules
editors
tools
refs
local
syntaxes
docs
contrib

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
.zed/settings.json linguist-language=json5

View file

@ -1,59 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior (Library test):
1. Declare a rust test 'fn test_xxx() { ... }' or typescript test 'it_should(function () { ... })'
2. Execute test function
3. See error
Or (Shell code):
1. Attach necessary resources to execute shell code
2. Put down some shell code 'cargo run --bin typst-ts-cli -- ...'
3. Execute shell code
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Package/Software version:**
VSCode version(Help -> About):
```plain
Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.12-x64v4-xanmod1
```
tinymist extension version: `v0.7.3`
**Logs:**
tinymist server log(Output Panel -> tinymist):
```plain
```
tinymist client log(Help -> Toggle Developer Tools -> Console):
```plain
```
**Additional context**
Add any other context about the problem here.

92
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,92 @@
name: Bug report
description: File a bug/issue
labels: ["bug", "need-to-investigate"]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: dropdown
attributes:
label: Platform
description: Which platform are you on?
options:
- x64 Windows (win32-x64, Most Common)
- x64 Linux (linux-x64, Most Common)
- Apple Silicon macOS (darwin-arm64, Most Common)
- ARM64 Windows (win32-arm64)
- ARM64 Linux (linux-arm64)
- ARMv7 Linux (linux-armhf)
- Intel macOS (darwin-x64)
- x64 Alpine Linux (alpine-x64)
- ARM64 Alpine Linux (alpine-arm64)
- Browser (web)
- Other Platforms (universal)
validations:
required: true
- type: dropdown
attributes:
label: Editor
description: Which editor are you using?
options:
- VS Cod(e,ium)
- Neovim
- Emacs
- Sublime Text
- Helix
- Zed
- CLI (Command Line Interface)
- Other
validations:
required: true
- type: textarea
attributes:
label: Editor Version
description: |
For example, in VSCode, get the version in (Help -> About)
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Server Logs
description: |
For example, in Neovim, the log is oftenly stored in the `~/.local/state/nvim/lsp`.
For example, in VSCode, get the logs in (Output Panel -> Tinymist).
We may close a bug report if there is no full logs. Please don't truncate it for us, attach it as a file if it's too long.
value: |
```log
Paste your logs here
```
validations:
required: true
- type: textarea
attributes:
label: Browser Logs
description: |
For example, in VSCode, get the logs in (Help -> Toggle Developer Tools -> Console).
If you open preview in browser, the console log in the browser is also helpful.
We may close a bug report if there is no full logs. Please don't truncate it for us, attach it as a file if it's too long.
value: |
```log
Paste your logs here
```
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: |
Links? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false

View file

@ -0,0 +1,26 @@
name: Feature request
description: Create a feature request
labels: ["enhancement", "need-to-investigate"]
body:
- type: textarea
attributes:
label: Motivation
description: |
A brief use case, scenario, or other argument used in support of this *feature*.
validations:
required: false
- type: textarea
attributes:
label: Description
description: |
A clear and concise description of this *feature*.
validations:
required: false
- type: textarea
attributes:
label: More Examples/Questions
description: |
- Using examples to profile how you imagine the *feature* should be
- Raising questions to highlight the uncertain design for the *feature*.
validations:
required: false

337
.github/copilot-instructions-l10n.md vendored Normal file
View file

@ -0,0 +1,337 @@
# Localization Instructions for Claude/Copilot
This document provides comprehensive guidance for adding, updating, and maintaining localization (l10n) in the Tinymist project.
## Overview
Tinymist's localization system supports multiple languages across two main components:
- **Rust backend** (`crates/`): Language server functionality
- **VSCode extension** (`editors/vscode/`): Editor integration
The localization process has two main phases:
1. **Marking and Extracting Messages**: Adding localization calls in code and extracting them
2. **Translating Messages**: Adding translations to locale files
## Phase 1: Marking and Extracting Messages
### Rust Backend (`crates/`)
#### Adding Localized Messages
Use the `tinymist_l10n::t!` macro with a key and default English message:
```rust
// Simple message
let message = tinymist_l10n::t!("error.file-not-found", "File not found");
// Message with parameters
let message = tinymist_l10n::t!(
"error.invalid-config",
"Invalid configuration: {key}",
key = config_key
);
```
**Note**: Use the full `tinymist_l10n::t!` path - no need to import the macro separately.
#### Key Naming Convention
Use hierarchical dot-separated keys:
- `component.category.specific-action`
- Examples:
- `tinymist-query.code-action.exportPdf`
- `tinymist.config.badServerConfig`
- `tinymist-project.validate-error.root-path-not-absolute`
### TypeScript/VSCode Extension (`editors/vscode/`)
#### Adding Localized Messages
Use the `l10nMsg` function imported from `../l10n`:
```typescript
import { l10nMsg } from "../l10n";
// Simple message
const message = l10nMsg("Export as PDF");
// Message with parameters
const message = l10nMsg("Processing {count} files", { count: fileCount });
```
#### Import Pattern
Always import `l10nMsg` from the relative path to `l10n.ts`:
```typescript
import { l10nMsg } from "../l10n"; // Adjust path as needed
```
### Extracting Messages
After adding localized messages to code, extract them using:
```bash
yarn build:l10n
```
This command:
1. Scans Rust and TypeScript files for localization calls
2. Extracts messages to TOML files in `locales/`:
- `locales/tinymist-rt.toml` (Rust messages)
- `locales/tinymist-vscode-rt.toml` (TypeScript messages)
3. Updates existing translations while preserving manual edits
#### When to Run Extraction
- **Required**: After adding new localized messages to code
- **Not needed**: When only editing translations in `locales/` files
## Phase 2: Translating Messages
### Locale File Format
Locale files use TOML format designed for easy modification by LLMs:
```toml
# The translations are partially generated by copilot
[key.name]
en = "English message"
zh = "Chinese translation"
zh-TW = "Traditional Chinese translation"
fr = "French translation"
```
### Available Locale Files
- `locales/tinymist-vscode.toml` - VSCode extension UI (manual translations)
- `locales/tinymist-vscode-rt.toml` - VSCode extension runtime (auto-extracted)
- `locales/tinymist-rt.toml` - Rust backend runtime (auto-extracted)
### Adding Translations
#### Example: Adding a French Translation
```toml
[extension.tinymist.command.tinymist.exportCurrentPdf]
en = "Export the Opened File as PDF"
zh = "将当前打开的文件导出为 PDF"
fr = "Exporter le fichier ouvert en PDF" # Add this line
```
#### Example: Adding Support for a New Language
```toml
[extension.tinymist.command.tinymist.restartServer]
en = "Restart server"
zh = "重启服务器"
es = "Reiniciar servidor" # New Spanish translation
de = "Server neu starten" # New German translation
```
### Translation Guidelines
1. **Preserve Parameters**: Keep parameter placeholders like `{key}`, `{count}`, `{value}`
2. **Maintain Formatting**: Preserve newlines and special characters
3. **Context Awareness**: Consider the UI context where the message appears
4. **Consistency**: Use consistent terminology across related messages
### Language Codes
Use standard language codes:
- `en` - English (required, default)
- `zh` - Simplified Chinese
- `zh-TW` - Traditional Chinese
- `fr` - French
- `de` - German
- `es` - Spanish
- `ja` - Japanese
- `ru` - Russian
## Examples
### Example 1: Adding a New Error Message (Rust)
1. **Add to Rust code**:
```rust
return Err(tinymist_l10n::t!(
"compilation.invalid-syntax",
"Invalid syntax at line {line}",
line = line_number
).into());
```
2. **Extract messages**:
```bash
yarn build:l10n
```
3. **Add translations** in `locales/tinymist-rt.toml`:
```toml
[compilation.invalid-syntax]
en = "Invalid syntax at line {line}"
zh = "第 {line} 行语法错误"
fr = "Syntaxe invalide à la ligne {line}"
```
### Example 2: Adding a New UI Label (TypeScript)
1. **Add to TypeScript code**:
```typescript
const exportButton = vscode.window.createQuickPick();
exportButton.title = l10nMsg("Select Export Format");
```
2. **Extract messages**:
```bash
yarn build:l10n
```
3. **Add translations** in `locales/tinymist-vscode-rt.toml`:
```toml
["Select Export Format"]
en = "Select Export Format"
zh = "选择导出格式"
fr = "Sélectionner le format d'exportation"
```
### Example 3: Complex Message with Multiple Parameters
```rust
let message = tinymist_l10n::t!(
"preview.compilation-stats",
"Compiled {pages} pages in {duration}ms",
pages = page_count,
duration = compile_time
);
```
Corresponding translation:
```toml
[preview.compilation-stats]
en = "Compiled {pages} pages in {duration}ms"
zh = "在 {duration} 毫秒内编译了 {pages} 页"
fr = "Compilé {pages} pages en {duration}ms"
```
## Best Practices
### When to Localize
**DO localize:**
- User-facing error messages
- UI labels and buttons
- Status messages
- Command descriptions
- Configuration descriptions
**DON'T localize:**
- Log messages for developers
- Debug output
- Technical error codes
- File paths or URLs
- Code identifiers
### Message Design
1. **Keep messages concise** but informative
2. **Use parameters** for dynamic content instead of string concatenation
3. **Design for translation** - avoid culture-specific references
4. **Group related messages** using consistent key prefixes
### Key Naming
```rust
// Good: Hierarchical, descriptive
tinymist_l10n::t!("export.pdf.success", "PDF exported successfully")
tinymist_l10n::t!("export.pdf.error.permission", "Permission denied for PDF export")
// Bad: Flat, unclear
tinymist_l10n::t!("msg1", "PDF exported successfully")
tinymist_l10n::t!("err", "Permission denied")
```
## Troubleshooting
### Common Issues
1. **Build errors after adding localization**:
- Ensure proper import of `tinymist_l10n` or `l10nMsg`
- Check for typos in macro/function calls
- Run `yarn build:l10n` to extract new messages
2. **Missing translations**:
- Verify the key exists in the appropriate locale file
- Check if extraction was run after adding the message
- Ensure locale file syntax is valid TOML
3. **Parameter substitution not working**:
- Verify parameter names match between code and translation
- Check for missing or extra parameters in translations
### Testing Localization
1. **Test message extraction**:
```bash
yarn build:l10n
```
2. **Verify locale files** contain your new messages
3. **Test in different languages** by changing VSCode language settings
## File Structure Reference
```
locales/
├── README.md # Documentation
├── tinymist-vscode.toml # Manual VSCode translations
├── tinymist-vscode-rt.toml # Auto-extracted VSCode messages
└── tinymist-rt.toml # Auto-extracted Rust messages
crates/
├── tinymist-l10n/ # Localization library
└── */src/**/*.rs # Rust source files (use tinymist_l10n::t!)
editors/vscode/
├── src/l10n.ts # TypeScript l10n helper
└── src/**/*.ts # TypeScript source files (use l10nMsg)
scripts/
└── build-l10n.mjs # Message extraction script
```
## Advanced Usage
### Conditional Messages
```rust
let message = if is_error {
tinymist_l10n::t!("status.error", "Error occurred")
} else {
tinymist_l10n::t!("status.success", "Operation completed")
};
```
### Pluralization
Handle plurals with parameters:
```rust
let message = tinymist_l10n::t!(
"files.count",
"{count} file(s) processed",
count = file_count
);
```
Translation:
```toml
[files.count]
en = "{count} file(s) processed"
zh = "已处理 {count} 个文件"
fr = "{count} fichier(s) traité(s)"
```
Remember to run `yarn build:l10n` after adding any new localized messages to code, and only edit translation files manually for languages other than English.

128
.github/copilot-instructions.md vendored Normal file
View file

@ -0,0 +1,128 @@
This is a Rust+JavaScript repository. It builds:
- A Rust binary serves language features:
- `lsp`: Runs language server
- `dap`: Runs debug adapter
- `preview`: Runs preview server
- The JavaScript VS Code extension.
- The lua plugin for Neovim.
It is primarily responsible for providing integrated typst language service to various editors like VS Code, Neovim, Emacs, and Zed. Please follow these guidelines when contributing:
## Specialized Instructions
- **Localization**: See [copilot-instructions-l10n.md](./copilot-instructions-l10n.md) for comprehensive guidance on adding, updating, and maintaining localization in the project.
## Code Standards
### Keep Good PR Title
Determine a good PR prefix **only** by the PR description before work. Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/
Available types:
- dev
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
### Required Before Each Commit
- Run `yarn fmt` to format Rust/JavaScript files
- This will run formatters on all necessary files to maintain consistent style
### Development Flow
- Build Server: `cargo build`
- Build VS Code Extension: `cd editors/vscode && yarn build`
- Full CI check: `cargo clippy --workspace --all-targets`
- Test Server: `cargo test --workspace -- --skip=e2e`
Note that, in the envoironment where network is not available (copilot or nix actions), we should also skip following tests:
```
completion::tests::test_pkgs
docs::package::tests::cetz
docs::package::tests::fletcher
docs::package::tests::tidy
docs::package::tests::touying
```
## Repository Structure
- `crates/`: rust crates for the server and related functionality
- `editors/vscode/`: VS Code extension code
- `editors/neovim/`: Lua plugin for Neovim (canonical implementation - see [CONTRIBUTING.md](editors/neovim/CONTRIBUTING.md) and [Specification.md](editors/neovim/Specification.md))
- `tools/editor-tools`: utility GUI tools for typst
- `tools/typst-preview-frontend`: Preview GUI for typst
- `docs/`: documentation for the project
- `locales/`: localization files for the entire project
- `tests/`: integration tests for the server and editors
- `syntaxes/`: textmate syntax definitions for typst
## Key Guidelines
1. Follow Rust and JavaScript best practices and idiomatic patterns
2. Maintain existing code structure and organization
4. Write unit tests for new functionality. Use snapshot-based unit tests when possible.
5. Document public APIs and complex logic in code comments
## Editor Integration Guidelines
### Neovim Canonical Implementation
The Neovim plugin in `editors/neovim/` serves as the **canonical implementation** of a Tinymist editor language client. When working on editor integrations:
- **Reference Implementation**: Use the Neovim plugin as the reference for LSP client patterns, configuration handling, and event subscription mechanisms
- **Test Suite**: Refer to `editors/neovim/spec/` for comprehensive test coverage examples
- **Documentation**: See [editors/neovim/Specification.md](editors/neovim/Specification.md) for complete API and functionality documentation
- **Development Workflow**: Use `./bootstrap.sh editor` for interactive testing and `./bootstrap.sh test` for automated validation
- **Contributing**: Follow patterns established in [editors/neovim/CONTRIBUTING.md](editors/neovim/CONTRIBUTING.md)
## Development Guidelines
### `tools/editor-tools`
The frontend-side and backend-side can be developed independently. For example, a data object passed from backend to frontend can be coded as `van.state<T>` as follows:
- Intermediate arguments:
```ts
const documentMetricsData = `:[[preview:DocumentMetrics]]:`;
const docMetrics = van.state<DocumentMetrics>(
documentMetricsData.startsWith(":") ? DOC_MOCK : JSON.parse(base64Decode(documentMetricsData)),
);
```
- Server-pushing arguments (e.g. `programTrace` in `tools/editor-tools/src/vscode.ts`):
```ts
export const programTrace = van.state<TraceReport | undefined>(undefined /* init value */);
export function setupVscodeChannel() {
if (vscodeAPI?.postMessage) {
// Handle messages sent from the extension to the webview
window.addEventListener("message", (event: any) => {
switch (event.data.type) {
case "traceData": {
programTrace.val = event.data.data;
break;
}
// other cases
}
});
}
}
```
- Tool request arguments (e.g. `requestSaveFontsExportConfigure` in `tools/editor-tools/src/vscode.ts`):
```ts
export function requestSaveFontsExportConfigure(data: fontsExportConfigure) {
if (vscodeAPI?.postMessage) {
vscodeAPI.postMessage({ type: "saveFontsExportConfigure", data });
}
}
```
`DOC_MOCK` is a mock data object for the frontend to display so that the frontend can be developed directly with `yarn dev`.

70
.github/workflows/announce.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: tinymist::announce
on:
workflow_call:
inputs:
tag:
description: Release Tag
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: Release Tag
required: true
type: string
permissions:
"contents": "write"
env:
isNightly: ${{ ((!((!contains(inputs.tag, 'rc') && (endsWith(inputs.tag, '0') || endsWith(inputs.tag, '2') || endsWith(inputs.tag, '4') || endsWith(inputs.tag, '6') || endsWith(inputs.tag, '8')))))) }}
jobs:
build:
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/cargo-dist/releases/download/v0.28.6-tinymist.3/cargo-dist-installer.sh | sh"
- name: Install parse changelog
uses: taiki-e/install-action@parse-changelog
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install deps
run: yarn install
- id: announce
name: "Generate announcement"
run: |
yarn draft-release ${{ inputs.tag }}
echo "draft-release ran successfully"
- name: "Upload announcement changelog"
uses: actions/upload-artifact@v4
with:
name: announcement-changelog.md
path: target/announcement-changelog.md
- name: "Upload announcement"
uses: actions/upload-artifact@v4
with:
name: announcement-dist.md
path: target/announcement-dist.md
- name: "Upload announcement"
uses: actions/upload-artifact@v4
with:
name: announcement.gen.md
path: target/announcement.gen.md
- name: Create GitHub Release
env:
PRERELEASE_FLAG: "${{ (fromJson(env.isNightly) && '--prerelease') || '' }}"
ANNOUNCEMENT_TITLE: "${{ steps.announce.outputs.tag }}"
RELEASE_COMMIT: "${{ github.sha }}"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Creating release for ${{ steps.announce.outputs.tag }} with PRERELEASE_FLAG=$PRERELEASE_FLAG (isNightly=$isNightly)"
gh release create "${{ steps.announce.outputs.tag }}" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file target/announcement.gen.md --draft=true

151
.github/workflows/auto-tag.yml vendored Normal file
View file

@ -0,0 +1,151 @@
name: tinymist::auto_tag
on:
push:
branches:
- main
jobs:
auto-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_TOKEN }}
fetch-depth: 0
- name: Get merged PR info
id: get-pr
run: |
COMMIT_SHA="${{ github.sha }}"
PR_NUMBER=$(gh pr list --state merged --limit 50 --json number,mergeCommit \
--jq ".[] | select(.mergeCommit.oid == \"$COMMIT_SHA\") | .number")
if [ -n "$PR_NUMBER" ]; then
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
echo "Found merged PR: #$PR_NUMBER"
else
echo "pr_number=" >> $GITHUB_OUTPUT
echo "No merged PR found for this commit"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check for tag directive in merged PR
if: steps.get-pr.outputs.pr_number != ''
id: check-tag
uses: actions/github-script@v7
with:
script: |
const prNumber = '${{ steps.get-pr.outputs.pr_number }}';
if (!prNumber) {
console.log('No PR number found');
core.setOutput('tag_found', 'false');
return;
}
try {
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: parseInt(prNumber)
});
const prBody = pr.body || '';
console.log('PR Body:', prBody);
const tagRegex = /^\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/m;
const match = prBody.match(tagRegex);
if (match) {
const tagVersion = match[1];
console.log('Found tag directive:', tagVersion);
core.setOutput('tag_found', 'true');
core.setOutput('tag_version', tagVersion);
} else {
console.log('No tag directive found in merged PR');
core.setOutput('tag_found', 'false');
}
} catch (error) {
console.error('Error fetching PR:', error);
core.setOutput('tag_found', 'false');
}
- name: Check if tag already exists
if: steps.check-tag.outputs.tag_found == 'true'
id: check-existing-tag
run: |
TAG="${{ steps.check-tag.outputs.tag_version }}"
if git tag -l | grep -q "^$TAG$"; then
echo "tag_exists=true" >> $GITHUB_OUTPUT
echo "Tag $TAG already exists"
else
echo "tag_exists=false" >> $GITHUB_OUTPUT
echo "Tag $TAG does not exist, safe to create"
fi
- name: Create tag
if: steps.check-tag.outputs.tag_found == 'true' && steps.check-existing-tag.outputs.tag_exists == 'false'
run: |
TAG="${{ steps.check-tag.outputs.tag_version }}"
PR_NUMBER="${{ steps.get-pr.outputs.pr_number }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "Auto-created tag $TAG from PR #$PR_NUMBER"
git push origin "$TAG"
echo "Created and pushed tag: $TAG"
- name: Comment on merged PR
if: steps.check-tag.outputs.tag_found == 'true' && steps.check-existing-tag.outputs.tag_exists == 'false'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tagVersion = '${{ steps.check-tag.outputs.tag_version }}';
const prNumber = '${{ steps.get-pr.outputs.pr_number }}';
const comment = `**Tag Created Successfully**
Tag \`${tagVersion}\` has been automatically created and pushed to the repository following the merge of this PR.
You can view the tag here: https://github.com/${{ github.repository }}/releases/tag/${tagVersion}`;
github.rest.issues.createComment({
issue_number: parseInt(prNumber),
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
- name: Handle tag creation error
if: steps.check-tag.outputs.tag_found == 'true' && steps.check-existing-tag.outputs.tag_exists == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tagVersion = '${{ steps.check-tag.outputs.tag_version }}';
const prNumber = '${{ steps.get-pr.outputs.pr_number }}';
const actionUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`;
const comment = `**Tag Creation Failed**
Could not create tag \`${tagVersion}\`.
Please refer to [this action run](${actionUrl}) for more information.`;
github.rest.issues.createComment({
issue_number: parseInt(prNumber),
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

96
.github/workflows/build-vsc-assets.yml vendored Normal file
View file

@ -0,0 +1,96 @@
name: tinymist::build::vsc_assets
on:
workflow_call:
env:
target: x86_64-unknown-linux-gnu
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install deps
run: yarn install
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Download tinymist binary artifact
uses: actions/download-artifact@v4
with:
name: artifacts-build-local-${{ env.target }}
path: prebuilts
- name: Unzip tinymist binary artifact (Windows)
run: 7z x -y -oprebuilts prebuilts/tinymist-${{ env.target }}.zip
if: contains(env.target, 'windows')
- name: Unzip tinymist binary artifact (Linux)
run: |
tar -xvf prebuilts/tinymist-${{ env.target }}.tar.gz -C prebuilts
mv prebuilts/tinymist-${{ env.target }}/tinymist prebuilts/tinymist
if: ${{ !contains(env.target, 'windows') }}
- name: Download font assets
# use fonts in stable releases
run: |
mkdir -p assets/fonts/
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.2/font-assets.tar.gz | tar -xvz -C assets/fonts
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.0/charter-font-assets.tar.gz | tar -xvz -C assets/fonts
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.5/source-han-serif-font-assets.tar.gz | tar -xvz -C assets/fonts
- name: Download & install shiroa
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.3.1-rc3/shiroa-installer.sh | sh
- name: Build Book
run: |
shiroa build --font-path ./assets/typst-fonts/ --font-path ./assets/fonts/ --path-to-root /tinymist/ -w . docs/tinymist --mode=static-html
- name: Build PDF Documentation
run: |
prebuilts/tinymist compile --font-path assets/fonts --root . docs/tinymist/ebook.typ tinymist-docs.pdf
# todo: this is a bug
- name: Install PDF Documentation
run: |
mkdir -p editors/vscode/out/ contrib/html/editors/vscode/out/
cp tinymist-docs.pdf editors/vscode/out/tinymist-docs.pdf
cp tinymist-docs.pdf contrib/html/editors/vscode/out/tinymist-docs.pdf
- name: Upload PDF Documentation
uses: actions/upload-artifact@v4
with:
name: tinymist-docs.pdf
path: tinymist-docs.pdf
if-no-files-found: error
- name: Build typst-preview vscode extension
run: |
yarn
yarn run compile
working-directory: ./contrib/typst-preview/editors/vscode
- name: Build tinymist vscode extension
run: |
yarn
yarn run compile
working-directory: ./editors/vscode
- name: Pre-bundle tinymist vscode extension
uses: actions/upload-artifact@v4
with:
name: vscode-artifacts-tinymist
path: editors/vscode/out
- name: Pre-bundle tinymist vscode extension (L10n)
uses: actions/upload-artifact@v4
with:
name: vscode-artifacts-tinymist-l10n
path: |
editors/vscode/l10n/**/*
editors/vscode/package.nls.json
editors/vscode/package.nls.*.json
- name: Pre-bundle typst-preview vscode extension
uses: actions/upload-artifact@v4
with:
name: vscode-artifacts-typst-preview
path: contrib/typst-preview/editors/vscode/out

181
.github/workflows/build-vscode-main.yml vendored Normal file
View file

@ -0,0 +1,181 @@
name: tinymist::build::vscode::main
on:
workflow_call:
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
platform: win32
arch: x64
regular_build: 'true'
- os: windows-latest
rust-target: aarch64-pc-windows-msvc
platform: win32
arch: arm64
- os: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
platform: linux
arch: x64
regular_build: 'true'
- os: ubuntu-22.04
rust-target: aarch64-unknown-linux-gnu
platform: linux
arch: arm64
- os: ubuntu-22.04
rust-target: arm-unknown-linux-gnueabihf
platform: linux
arch: armhf
- os: macos-14
rust-target: x86_64-apple-darwin
platform: darwin
arch: x64
- os: macos-14
rust-target: aarch64-apple-darwin
platform: darwin
arch: arm64
regular_build: 'true'
name: build (${{ matrix.platform }}-${{ matrix.arch }})
runs-on: ${{ matrix.os }}
env:
target: ${{ matrix.platform }}-${{ matrix.arch }}
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8'))))) || (!startsWith(github.ref, 'refs/tags/') && matrix.regular_build == 'true')) }}
isTest: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' || matrix.rust-target == 'x86_64-pc-windows-msvc' }}
isUniversal: ${{ matrix.rust-target == 'x86_64-unknown-linux-gnu' }}
steps:
- name: "Print Env"
run: |
echo "Running on ${{ matrix.os }}"
echo "Target: ${{ env.target }}"
echo "Is Release: ${{ fromJson(env.isRelease) }}"
echo "Is Nightly: ${{ fromJson(env.isNightly) }}"
echo "Is Test: ${{ fromJson(env.isTest) }}"
echo "Is Universal (No Server): ${{ fromJson(env.isUniversal) }}"
- uses: actions/checkout@v4
with:
submodules: recursive
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Install deps
run: yarn install
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Download tinymist binary artifact
uses: actions/download-artifact@v4
with:
name: artifacts-build-local-${{ matrix.rust-target }}
path: prebuilts
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Unzip tinymist binary artifact (Windows)
run: 7z x -y -oprebuilts prebuilts/tinymist-${{ matrix.rust-target }}.zip
if: matrix.platform == 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Unzip tinymist binary artifact (Linux)
run: |
tar -xvf prebuilts/tinymist-${{ matrix.rust-target }}.tar.gz -C prebuilts
mv prebuilts/tinymist-${{ matrix.rust-target }}/tinymist prebuilts/tinymist
if: matrix.platform != 'win32' && (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Download VSC Assets
uses: actions/download-artifact@v4
with:
name: vscode-artifacts-tinymist
path: editors/vscode/out
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Download VSC Assets (L10n)
uses: actions/download-artifact@v4
with:
name: vscode-artifacts-tinymist-l10n
path: editors/vscode
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Download VSC Assets (Preview)
uses: actions/download-artifact@v4
with:
name: vscode-artifacts-typst-preview
path: contrib/typst-preview/editors/vscode/out
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Copy binary to output directory
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
run: |
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "editors/vscode/out/"
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "contrib/typst-preview/editors/vscode/out/"
cp "prebuilts/tinymist${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}" "tinymist-${{ env.target }}${{ ( matrix.platform == 'win32' ) && '.exe' || '' }}"
- name: Package typst-preview extension
if: fromJson(env.isRelease)
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix
working-directory: ./contrib/typst-preview/editors/vscode
- name: Package tinymist extension
if: fromJson(env.isRelease)
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
working-directory: ./editors/vscode
- name: Package typst-preview extension (Nightly)
if: fromJson(env.isNightly)
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix --pre-release
working-directory: ./contrib/typst-preview/editors/vscode
- name: Package tinymist extension (Nightly)
if: fromJson(env.isNightly)
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix --pre-release
working-directory: ./editors/vscode
- name: Upload binary artifact
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}
path: tinymist-${{ env.target }}${{ fromJSON('["", ".exe"]')[matrix.platform == 'win32'] }}
- name: Upload typst-preview VSIX artifact
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
uses: actions/upload-artifact@v4
with:
name: typst-preview-${{ env.target }}.vsix
path: contrib/typst-preview/editors/vscode/typst-preview-${{ env.target }}.vsix
- name: Upload VSIX artifact
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.vsix
path: editors/vscode/tinymist-${{ env.target }}.vsix
- name: Test tinymist extension
uses: coactions/setup-xvfb@v1
with:
run: yarn test
working-directory: ./editors/vscode
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest)
- name: Upload Tinymist Testing log
if: ${{ always() && ((fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isTest))}}
uses: actions/upload-artifact@v4
with:
name: tinymist-lsp-tests.${{ env.target }}.log
path: editors/vscode/e2e-workspaces/simple-docs/tinymist-lsp.log
# The universal target doesn't bundle the binary. Users of that must install
# tinymist by themselves.
- name: Remove server binary
if: fromJson(env.isUniversal)
run: rm "editors/vscode/out/tinymist"
- name: Package extension (Universal)
if: fromJson(env.isRelease) && fromJson(env.isUniversal)
run: yarn run package -- -o tinymist-universal.vsix
working-directory: ./editors/vscode
- name: Package extension (Universal, Nightly)
if: fromJson(env.isNightly) && fromJson(env.isUniversal)
run: yarn run package -- -o tinymist-universal.vsix --pre-release
working-directory: ./editors/vscode
- name: Upload tinymist VSIX artifact (Universal)
if: (fromJson(env.isRelease) || fromJson(env.isNightly)) && fromJson(env.isUniversal)
uses: actions/upload-artifact@v4
with:
name: tinymist-universal.vsix
path: editors/vscode/tinymist-universal.vsix

View file

@ -0,0 +1,188 @@
name: tinymist::build::vscode::others
on:
workflow_call:
env:
RUSTFLAGS: '-Dwarnings'
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
jobs:
build_alpine:
name: build extension (alpine-${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
if: startsWith(github.ref, 'refs/tags/')
container:
image: rust:alpine
volumes:
- /usr/local/cargo/registry:/usr/local/cargo/registry
- /opt:/opt:rw,rshared
- /opt:/__e/node20:ro,rshared
strategy:
matrix:
include:
- arch: x64
target: alpine-x64
RUST_TARGET: x86_64-unknown-linux-musl
runner: ubuntu-24.04
- arch: arm64
target: alpine-arm64
RUST_TARGET: aarch64-unknown-linux-musl
runner: ubuntu-24.04-arm
env:
target: ${{ matrix.target }}
RUST_TARGET: ${{ matrix.RUST_TARGET }}
RUSTFLAGS: "-Dwarnings -C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))))) }}
steps:
- name: Allow Linux musl containers on ARM64 runners
if: matrix.runner == 'ubuntu-24.04-arm'
run: |
sed -i "/^ID=/s/alpine/NotpineForGHA/" /etc/os-release
apk add nodejs --update-cache
mkdir /opt/bin
ln -s /usr/bin/node /opt/bin/node
- name: Install dependencies
# bash is required by setup-rust-toolchain
run: apk add --no-cache git clang lld musl-dev nodejs-current npm yarn binutils bash
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install deps
run: yarn install
- name: Build typst-preview vscode extension
run: yarn run compile
working-directory: ./contrib/typst-preview/editors/vscode
- name: Build tinymist vscode extension
run: yarn run compile
working-directory: ./editors/vscode
- name: Build tinymist binary
run: |
cargo build --profile=gh-release --bin tinymist --target $RUST_TARGET
- name: Split debug symbols
run: |
cd target/$RUST_TARGET/gh-release
objcopy --compress-debug-sections --only-keep-debug "tinymist" "tinymist-${{ env.target }}.debug"
objcopy --strip-debug --add-gnu-debuglink="tinymist-${{ env.target }}.debug" "tinymist"
- name: Upload split debug symbols
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.debug
path: target/${{ env.RUST_TARGET }}/gh-release/tinymist-${{ env.target }}.debug
- name: Copy binary to output directory
run: |
mkdir -p editors/vscode/out
cp "target/${{ env.RUST_TARGET }}/gh-release/tinymist" "editors/vscode/out/"
cp "target/${{ env.RUST_TARGET }}/gh-release/tinymist" "contrib/typst-preview/editors/vscode/out/"
cp "target/${{ env.RUST_TARGET }}/gh-release/tinymist" "tinymist-${{ env.target }}"
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}
path: tinymist-${{ env.target }}
- name: Download PDF Documentation
uses: actions/download-artifact@v4
with:
name: tinymist-docs.pdf
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Install PDF Documentation
run: |
mkdir -p editors/vscode/out/
cp tinymist-docs.pdf editors/vscode/out/tinymist-docs.pdf
if: (fromJson(env.isRelease) || fromJson(env.isNightly))
- name: Package typst-preview extension
if: fromJson(env.isRelease)
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix
working-directory: ./contrib/typst-preview/editors/vscode
- name: Package extension
if: fromJson(env.isRelease)
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
working-directory: ./editors/vscode
- name: Package typst-preview extension (Nightly)
if: fromJson(env.isNightly)
run: yarn run package -- --target ${{ env.target }} -o typst-preview-${{ env.target }}.vsix --pre-release
working-directory: ./contrib/typst-preview/editors/vscode
- name: Package extension (Nightly)
if: fromJson(env.isNightly)
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix --pre-release
working-directory: ./editors/vscode
- name: Upload typst-preview VSIX artifact
uses: actions/upload-artifact@v4
with:
name: typst-preview-${{ env.target }}.vsix
path: contrib/typst-preview/editors/vscode/typst-preview-${{ env.target }}.vsix
- name: Upload tinymist VSIX artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.vsix
path: editors/vscode/tinymist-${{ env.target }}.vsix
build_web:
name: build extension (web)
runs-on: ubuntu-latest
env:
target: web
RUST_TARGET: wasm32-unknown-unknown
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))))) }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: "v0.13.1"
- name: Install deps
run: yarn install
- name: Build tinymist library
run: yarn build:web
working-directory: .
- name: Pack tinymist npm library
run: |
npm pack > package-name
mv $(cat package-name) tinymist-${{ env.target }}.tar.gz
working-directory: ./crates/tinymist
- name: Upload tinymist npm library
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}-npm
path: crates/tinymist/tinymist-${{ env.target }}.tar.gz
- name: Download PDF Documentation
uses: actions/download-artifact@v4
with:
name: tinymist-docs.pdf
- name: Install PDF Documentation
run: |
mkdir -p editors/vscode/out/
cp tinymist-docs.pdf editors/vscode/out/tinymist-docs.pdf
- name: Package extension
if: '!fromJson(env.isNightly)'
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
working-directory: ./editors/vscode
- name: Package extension (Nightly)
if: fromJson(env.isNightly)
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix --pre-release
working-directory: ./editors/vscode
- name: Upload tinymist VSIX artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.vsix
path: editors/vscode/tinymist-${{ env.target }}.vsix

91
.github/workflows/build-vscode.yml vendored Normal file
View file

@ -0,0 +1,91 @@
name: tinymist::build::vscode
on:
workflow_call:
inputs:
plan:
description: 'A description of the plan input'
required: true # or false, depending on whether the input is mandatory
type: string # or other appropriate type like boolean, number, etc.
env:
RUSTFLAGS: '-Dwarnings'
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
jobs:
build-vsc-assets:
uses: ./.github/workflows/build-vsc-assets.yml
build-vscode-main:
needs: [build-vsc-assets]
uses: ./.github/workflows/build-vscode-main.yml
build-vscode-others:
needs: [build-vsc-assets]
uses: ./.github/workflows/build-vscode-others.yml
release:
needs: [build-vscode-main, build-vscode-others] # , announce
runs-on: ubuntu-latest
if: success() && startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/download-artifact@v4
with:
path: artifacts
pattern: '{tinymist,typst-preview}-*'
- name: Display structure of downloaded files
run: ls -R artifacts
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "artifacts/*/*"
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
publish:
needs: [build-vscode-main, build-vscode-others] # , announce
runs-on: ubuntu-latest
env:
isRelease: ${{ (startsWith(github.ref, 'refs/tags/') && (!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))) }}
isNightly: ${{ ((startsWith(github.ref, 'refs/tags/') && !((!contains(github.ref, 'rc') && (endsWith(github.ref, '0') || endsWith(github.ref, '2') || endsWith(github.ref, '4') || endsWith(github.ref, '6') || endsWith(github.ref, '8')))))) }}
if: success() && startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'rc')
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/download-artifact@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install deps
run: yarn install
- name: Deploy to VS Code Marketplace
if: fromJson(env.isRelease)
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
- name: Deploy to OpenVSX
if: fromJson(env.isRelease)
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate
env:
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
- name: Deploy to VS Code Marketplace (Nightly)
if: fromJson(env.isNightly)
run: npx @vscode/vsce publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
- name: Deploy to OpenVSX (Nightly)
if: fromJson(env.isNightly)
run: npx ovsx publish --packagePath $(find . -type f -iname 'tinymist-*.vsix') --skip-duplicate --pre-release
env:
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}

67
.github/workflows/ci-check-e2e.yml vendored Normal file
View file

@ -0,0 +1,67 @@
name: tinymist::check-e2e
on:
workflow_call:
inputs:
plan:
description: 'A description of the plan input'
required: true # or false, depending on whether the input is mandatory
type: string # or other appropriate type like boolean, number, etc.
env:
RUSTFLAGS: '-Dwarnings'
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
jobs:
checks-e2e:
strategy:
matrix:
include:
- os: windows-2022
rust-target: x86_64-pc-windows-msvc
platform: win32
arch: x64
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
platform: win32
arch: x64
- os: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
platform: linux
arch: x64
- os: ubuntu-latest
rust-target: x86_64-unknown-linux-gnu
platform: linux
arch: x64
- os: macos-latest
rust-target: aarch64-apple-darwin
platform: darwin
arch: arm64
name: E2E Tests (${{ matrix.platform }}-${{ matrix.arch }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Download tinymist binary artifact
uses: actions/download-artifact@v4
with:
name: artifacts-build-local-${{ matrix.rust-target }}
path: editors/vscode/out
- name: Unzip tinymist binary artifact (Windows)
run: 7z x -y -oeditors/vscode/out editors/vscode/out/tinymist-${{ matrix.rust-target }}.zip
if: matrix.platform == 'win32'
- name: Unzip tinymist binary artifact (Linux)
run: |
tar -xvf editors/vscode/out/tinymist-${{ matrix.rust-target }}.tar.gz -C editors/vscode/out
mv editors/vscode/out/tinymist-${{ matrix.rust-target }}/tinymist editors/vscode/out/tinymist
if: matrix.platform != 'win32'
- name: Test GLIBC
run: node ./scripts/test-glibc.mjs editors/vscode/out/tinymist
if: matrix.platform != 'win32'
- name: Test Tinymist (E2E)
run: cargo test -p tests -- e2e
- name: Upload Tinymist E2E Test Snapshot
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-snapshot-${{ matrix.rust-target }}-${{ matrix.os }}
path: target/e2e

138
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,138 @@
name: tinymist::ci
on:
push:
branches:
- main
- nightly
tags:
- "*"
pull_request:
types: [opened, synchronize]
branches:
- main
- nightly
workflow_dispatch:
env:
RUSTFLAGS: '-Dwarnings'
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
jobs:
pre_build:
permissions:
actions: write
contents: read
name: Duplicate Actions Detection
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: "true"
checks-linux:
name: Check Clippy, Formatting, Completion, Documentation, and Tests (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: typst-community/setup-typst@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install deps
run: yarn install
- name: Check and build assets
run: |
yarn build:preview
yarn build:l10n
- run: cargo clippy --workspace --all-targets
- run: scripts/feature-testing.sh
- run: cargo fmt --check --all
- run: cargo doc --workspace --no-deps
- run: yarn build:typlite
- run: node ./scripts/link-docs.mjs --check
- name: Generate completions
run: |
mkdir -p completions/{zsh,bash,fish/vendor_completions.d,elvish/lib,nushell/vendor/autoload,powershell}/
cargo run --bin tinymist -- completion zsh > completions/zsh/_tinymist
cargo run --bin tinymist -- completion bash > completions/bash/tinymist
cargo run --bin tinymist -- completion fish > completions/fish/vendor_completions.d/tinymist.fish
cargo run --bin tinymist -- completion elvish > completions/elvish/lib/tinymist.elv
cargo run --bin tinymist -- completion nushell > completions/nushell/vendor/autoload/tinymist.nu
cargo run --bin tinymist -- completion powershell > completions/powershell/tinymist.ps1
tar -czvf tinymist-completions.tar.gz completions
- name: upload completions
uses: actions/upload-artifact@v4
with:
name: tinymist-completion-scripts
path: tinymist-completions.tar.gz
- name: Test tinymist
run: cargo test --workspace -- --skip=e2e
- name: Test Lockfile (Prepare)
run: ./scripts/test-lock.sh
- name: Test Lockfile (Check)
run: cargo test --package tinymist --lib -- route::tests --show-output --ignored
checks-windows:
name: Check Minimum Rust version and Tests (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.89.0 # check-min-version
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Install deps
run: yarn install
- name: Check Rust Version
run: yarn check-msrv
- name: Check and build assets
run: |
yarn build:preview
yarn build:l10n
- run: cargo check --workspace
- name: Test tinymist
run: cargo test --workspace -- --skip=e2e
prepare-build:
runs-on: "ubuntu-latest"
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
- id: tag # get the tag from package.json
run:
echo "tag=v$(jq -r '.version' editors/vscode/package.json)" >> $GITHUB_OUTPUT
- name: Show tag
run: echo "Tag is ${{ steps.tag.outputs.tag }}"
announce:
needs: [prepare-build]
permissions:
contents: write
uses: ./.github/workflows/announce.yml
if: ${{ startsWith(github.ref, 'refs/tags/') }}
secrets: inherit
with:
tag: ${{ needs.prepare-build.outputs.tag }}
build:
needs: [prepare-build] # , announce
permissions:
contents: write
uses: ./.github/workflows/release.yml
secrets: inherit
with:
tag: ${{ (startsWith(github.ref, 'refs/tags/') && needs.prepare-build.outputs.tag) || '' }}
targets: ${{ (!startsWith(github.ref, 'refs/tags/') && 'aarch64-apple-darwin,x86_64-pc-windows-msvc,x86_64-unknown-linux-gnu') || 'all' }}

62
.github/workflows/detect-pr-tag.yml vendored Normal file
View file

@ -0,0 +1,62 @@
name: tinymist::detect_pr_tag
on:
pull_request:
types: [opened, edited]
branches:
- main
jobs:
detect-tag:
runs-on: ubuntu-latest
steps:
- name: Check tag in PR body
id: check-tag
uses: actions/github-script@v7
with:
script: |
const prBody = context.payload.pull_request.body || '';
console.log('PR Body:', prBody);
const tagRegex = /^\+tag\s+(v\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+)?)/m;
const match = prBody.match(tagRegex);
if (match) {
const tagVersion = match[1];
console.log('Found tag:', tagVersion);
core.setOutput('tag_found', 'true');
core.setOutput('tag_version', tagVersion);
} else {
console.log('No tag found in PR description');
core.setOutput('tag_found', 'false');
}
- name: Comment on PR
if: steps.check-tag.outputs.tag_found == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const tagVersion = '${{ steps.check-tag.outputs.tag_version }}';
const comment = `**Tag Detection Notice**
This PR contains a tag directive: \`+tag ${tagVersion}\`
If this PR is merged, it will automatically create tag \`${tagVersion}\` on the main branch.
Please ensure before merging:
- [ ] **Cargo.toml & Cargo.lock**: No \`git\` dependencies with \`branch\`, use \`tag\` or \`rev\` dependencies instead
- [ ] **Publish tokens**: Both \`VSCODE_MARKETPLACE_TOKEN\` and \`OPENVSX_ACCESS_TOKEN\` are valid and not expired
- [ ] **Version updates**: All version numbers in \`Cargo.toml\`, \`package.json\` and other files have been updated consistently
- [ ] **Changelog**: \`editors/vscode/CHANGELOG.md\` has been updated with correct format
- [ ] **tinymist-assets**: If needed, the crate has been published and version updated in \`Cargo.toml\`
`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

79
.github/workflows/gh-pages.yml vendored Normal file
View file

@ -0,0 +1,79 @@
name: tinymist::gh_pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
pages: write
id-token: write
contents: read
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
build-gh-pages:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- run: git submodule update --init --recursive
- name: Make directories
run: |
if [ ! -d "${XDG_DATA_HOME:-$HOME/.local/share}" ]; then
echo "Creating data directory: ${XDG_DATA_HOME:-$HOME/.local/share}"
mkdir -p ${XDG_DATA_HOME:-$HOME/.local/share}
else
echo "Data directory already exists: ${XDG_DATA_HOME:-$HOME/.local/share}"
fi
if [ ! -d "${XDG_CACHE_HOME:-$HOME/.cache}" ]; then
echo "Creating cache directory: ${XDG_CACHE_HOME:-$HOME/.cache}"
mkdir -p ${XDG_CACHE_HOME:-$HOME/.cache}
else
echo "Cache directory already exists: ${XDG_CACHE_HOME:-$HOME/.cache}"
fi
- name: Download font assets
# use fonts in stable releases
run: |
mkdir -p assets/fonts/
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.2/font-assets.tar.gz | tar -xvz -C assets/fonts
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.0/charter-font-assets.tar.gz | tar -xvz -C assets/fonts
curl -L https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.1.5/source-han-serif-font-assets.tar.gz | tar -xvz -C assets/fonts
- name: Download & install shiroa
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.3.1-rc3/shiroa-installer.sh | sh
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install deps
run: yarn install
- name: Build Preview Html
run: |
yarn build:preview
- name: Build Book
run: |
shiroa build --font-path ./assets/typst-fonts/ --font-path ./assets/fonts/ --path-to-root /tinymist/ -w . docs/tinymist --mode=static-html
- name: Build Cargo Docs
run: |
cargo doc --workspace --no-deps
cp -r target/doc dist/tinymist/rs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload `/github-pages` sub directory
path: './dist/tinymist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

59
.github/workflows/lint-pr-title.yml vendored Normal file
View file

@ -0,0 +1,59 @@
name: tinymist::lint_pr_title
on:
pull_request:
types: [opened, edited, synchronize]
permissions:
pull-requests: write
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (newline-delimited).
# Default: https://github.com/commitizen/conventional-commit-types
# extraType: dev: internal development
types: |
dev
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
ignoreLabels: |
bot
ignore-semantic-pull-request
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true

View file

@ -0,0 +1,42 @@
name: tinymist::assets::publish
on:
workflow_dispatch:
env:
RUSTFLAGS: '-Dwarnings'
jobs:
publish-crates:
name: build
runs-on: ubuntu-22.04
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'yarn'
- name: Install llvm
run: |
sudo apt-get update
sudo apt-get install llvm
- name: Install deps
run: yarn install
- name: Check and build assets
run: |
yarn build:preview
yarn build:l10n
- name: Publish crates
run: |
cargo publish --allow-dirty --no-verify -p tinymist-assets || true
- name: Verifies crate health (Optional)
run: |
cargo publish --allow-dirty --dry-run -p tinymist-assets

72
.github/workflows/release-crates.yml vendored Normal file
View file

@ -0,0 +1,72 @@
name: tinymist::crates::publish
on:
push:
tags:
- "*"
workflow_dispatch:
env:
RUSTFLAGS: '-Dwarnings'
jobs:
publish-crates:
name: build
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# https://github.com/dtolnay/rust-toolchain/issues/133
# https://github.com/rust-lang/rustup/issues/3635
# Only needed if your action will run two or more rust
# commands concurrently, otherwise rustup will lazily
# install your rust-toolchain.toml when needed:
- name: 'Install from rust-toolchain.toml'
run: rustup show
- name: Install llvm
run: |
sudo apt-get update
sudo apt-get install llvm
- name: Publish crates
run: |
cargo publish --no-verify -p typst-shim || true
cargo publish --no-verify -p tinymist-derive || true
cargo publish --no-verify -p tinymist-l10n || true
cargo publish --no-verify -p tinymist-std || true
cargo publish --no-verify -p sync-ls || true
cargo publish --no-verify -p tinymist-package || true
cargo publish --no-verify -p tinymist-vfs || true
cargo publish --no-verify -p tinymist-world || true
cargo publish --no-verify -p tinymist-analysis || true
cargo publish --no-verify -p tinymist-task || true
cargo publish --no-verify -p tinymist-project || true
cargo publish --no-verify -p typlite || true
cargo publish --no-verify -p crityp || true
cargo publish --no-verify -p tinymist-debug || true
cargo publish --no-verify -p tinymist-lint || true
cargo publish --no-verify -p tinymist-query || true
cargo publish --no-verify -p tinymist-render || true
cargo publish --no-verify -p tinymist-preview || true
cargo publish --no-verify -p tinymist || true
cargo publish --no-verify -p tinymist-cli || true
- name: Verifies crate health (Optional)
run: |
cargo publish --dry-run -p typst-shim
cargo publish --dry-run -p tinymist-derive
cargo publish --dry-run -p tinymist-l10n
cargo publish --dry-run -p tinymist-std
cargo publish --dry-run -p sync-ls
cargo publish --dry-run -p tinymist-vfs
cargo publish --dry-run -p tinymist-package
cargo publish --dry-run -p tinymist-world
cargo publish --dry-run -p tinymist-task --features no-content-hint
cargo publish --dry-run -p tinymist-project --features no-content-hint
cargo publish --dry-run -p typlite
cargo publish --dry-run -p crityp
# needs patched typst
# cargo publish --dry-run -p tinymist-analysis

350
.github/workflows/release-nightly.yml vendored Normal file
View file

@ -0,0 +1,350 @@
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
- cron: '0 23 * * *'
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
default: 'nightly'
type: choice
options:
- nightly
- canary
jobs:
check-and-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: nightly
token: ${{ secrets.REPO_TOKEN }}
fetch-depth: 0
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- name: Install deps
run: yarn install
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Determine release type
id: release_type
run: |
if [[ "${{ github.event_name }}" == "schedule" ]]; then
if [[ "${{ github.event.schedule }}" == "0 0 * * *" ]]; then
echo "release_type=nightly" >> $GITHUB_ENV
else
echo "release_type=canary" >> $GITHUB_ENV
fi
else
echo "release_type=${{ github.event.inputs.release_type }}" >> $GITHUB_ENV
fi
- name: Check for updates
id: check_updates
run: |
echo "Checking for updates in dependency repositories..."
# Get current revs using script
eval "$(node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . get-current-revs)"
# Get latest revs
latest_typst_rev=$(curl -s "https://api.github.com/repos/ParaN3xus/typst/commits/nightly" | jq -r '.sha')
latest_typst_content_hint_rev=$(curl -s "https://api.github.com/repos/ParaN3xus/typst/commits/nightly-content-hint" | jq -r '.sha')
latest_reflexo_rev=$(curl -s "https://api.github.com/repos/ParaN3xus/typst.ts/commits/nightly" | jq -r '.sha')
latest_typstyle_rev=$(curl -s "https://api.github.com/repos/ParaN3xus/typstyle/commits/nightly" | jq -r '.sha')
latest_typst_ansi_hl_rev=$(curl -s "https://api.github.com/repos/ParaN3xus/typst-ansi-hl/commits/nightly" | jq -r '.sha')
echo "Current revs: typst=$current_typst_rev, typst.ts=$current_reflexo_rev, typstyle=$current_typstyle_rev, hl=$current_typst_ansi_hl_rev"
echo "Latest revs: typst=$latest_typst_rev, typst.ts=$latest_reflexo_rev, typstyle=$latest_typstyle_rev, hl=$latest_typst_ansi_hl_rev"
# Check for updates
need_update=false
if [[ "$current_typst_rev" != "$latest_typst_rev" ]] || [[ -z "$current_typst_rev" ]]; then
echo "Typst needs update"
need_update=true
fi
if [[ "$current_reflexo_rev" != "$latest_reflexo_rev" ]] || [[ -z "$current_reflexo_rev" ]]; then
echo "Typst.ts needs update"
need_update=true
fi
if [[ "$current_typstyle_rev" != "$latest_typstyle_rev" ]] || [[ -z "$current_typstyle_rev" ]]; then
echo "Typstyle needs update"
need_update=true
fi
if [[ "$current_typst_ansi_hl_rev" != "$latest_typst_ansi_hl_rev" ]] || [[ -z "$current_typst_ansi_hl_rev" ]]; then
echo "Typst-ansi-hl needs update"
need_update=true
fi
current_version=$(grep '^version = ' Cargo.toml | head -1 | cut -d'"' -f2)
echo "current_version=$current_version" >> $GITHUB_ENV
# Updates can only be performed when releasing an RC.
# When an RC has been released and there are no subsequent updates,
# this indicates that the RC release was successful. Only at this
# point will the nightly release be published.
need_release=false
if [ "$release_type" = "nightly" ]; then
if [ "$need_update" = "false" ] && echo "$current_version" | grep -q -- '-rc[0-9]\+$'; then
echo "RC version detected with no updates needed, nightly release condition met"
need_release=true
else
echo "Nightly release condition not met (requires stable RC version)"
fi
elif [ "$release_type" = "canary" ]; then
if [ "$need_update" = "true" ]; then
echo "Code updates detected, canary release condition met"
need_release=true
else
echo "No code updates, skipping canary release"
fi
fi
echo "Final decision: need_release=$need_release"
echo "need_release=$need_release" >> $GITHUB_OUTPUT
echo "latest_typst_rev=$latest_typst_rev" >> $GITHUB_ENV
echo "latest_typst_content_hint_rev=$latest_typst_content_hint_rev" >> $GITHUB_ENV
- name: Calculate new version
id: version
if: steps.check_updates.outputs.need_release == 'true'
run: |
echo "Current version: $current_version"
echo "Release type: $release_type"
new_version=$(node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . calculate-version "$current_version" "$release_type")
echo "New version: $new_version"
echo "new_version=$new_version" >> $GITHUB_ENV
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: steps.check_updates.outputs.need_release == 'true'
- name: Get typst information
id: typst_info
if: steps.check_updates.outputs.need_release == 'true'
run: |
# Clone typst repository
git clone --depth 50 --single-branch --branch nightly-content-hint \
--filter=blob:limit=1k https://github.com/ParaN3xus/typst.git /tmp/typst
cd /tmp/typst
git checkout nightly-content-hint
# Get version
typst_version=$(grep '^version = ' Cargo.toml | head -1 | cut -d'"' -f2)
typst_assets_rev=$(grep 'typst-assets.*git' Cargo.toml | grep 'rev = ' | cut -d'"' -f4)
echo "typst_version=$typst_version" >> $GITHUB_ENV
echo "typst_assets_rev=$typst_assets_rev" >> $GITHUB_ENV
# Get base commit
git remote add upstream https://github.com/typst/typst.git && git fetch upstream main --prune
typst_base_commit=$(git merge-base HEAD upstream/main 2>/dev/null)
typst_base_msg=$(git --no-pager log --format="%s" -1 $typst_base_commit)
echo "typst_base_commit=$typst_base_commit" >> $GITHUB_ENV
echo "typst_base_msg=$typst_base_msg" >> $GITHUB_ENV
- name: Update typst dependencies in tinymist
if: steps.check_updates.outputs.need_release == 'true'
run: |
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-typst-deps \
"$typst_version" \
"$typst_assets_rev"
revs_json=$(cat <<EOF
{
"typst": "${latest_typst_rev}"
}
EOF
)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-patch-revs "$revs_json"
- name: Bump world crates version
if: steps.check_updates.outputs.need_release == 'true'
run: |
# node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . bump-world-crates "$new_version"
cargo update
git add -A
git commit -m "build: bump world crates to $new_version" || true
git push origin nightly
world_commit=$(git rev-parse HEAD)
echo "world_commit=$world_commit" >> $GITHUB_ENV
- name: Update typst.ts
if: steps.check_updates.outputs.need_release == 'true'
run: |
# Clone typst.ts
git clone https://${{ secrets.NIGHTLY_REPO_TOKEN }}@github.com/ParaN3xus/typst.ts.git /tmp/typst.ts
cd /tmp/typst.ts
git checkout nightly
new_version="$new_version"
# node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-world-crates "$new_version"
# Update typst dependencies
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-typst-deps \
"$typst_version" \
"$typst_assets_rev"
# Update patches
revs_json=$(cat <<EOF
{
"tinymist": "${world_commit}",
"typst": "${latest_typst_content_hint_rev}"
}
EOF
)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-patch-revs "$revs_json"
cargo update
git add -A
git commit -m "build: update tinymist and typst" || true
git push origin nightly
reflexo_commit=$(git rev-parse HEAD)
echo "reflexo_commit=$reflexo_commit" >> $GITHUB_ENV
- name: Update typstyle
if: steps.check_updates.outputs.need_release == 'true'
run: |
# Clone typstyle
git clone https://${{ secrets.NIGHTLY_REPO_TOKEN }}@github.com/ParaN3xus/typstyle.git /tmp/typstyle
cd /tmp/typstyle
git checkout nightly
# node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-world-crates "$new_version"
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-typst-deps \
"$typst_version" \
"$typst_assets_rev"
# Update patches
revs_json=$(cat <<EOF
{
"tinymist": "${world_commit}",
"typst": "${latest_typst_rev}"
}
EOF
)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-patch-revs "$revs_json"
cargo update
git add -A
git commit -m "build: update tinymist to ${new_version}" || true
git push origin nightly
typstyle_commit=$(git rev-parse HEAD)
echo "typstyle_commit=$typstyle_commit" >> $GITHUB_ENV
- name: Update typst-ansi-hl
if: steps.check_updates.outputs.need_release == 'true'
run: |
# Clone typst-ansi-hl
git clone https://${{ secrets.NIGHTLY_REPO_TOKEN }}@github.com/ParaN3xus/typst-ansi-hl.git /tmp/typst-ansi-hl
cd /tmp/typst-ansi-hl
git checkout nightly
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-typst-deps \
"$typst_version" \
"$typst_assets_rev"
# Update patches
revs_json=$(cat <<EOF
{
"typst": "${latest_typst_rev}"
}
EOF
)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-patch-revs "$revs_json"
cargo update
git add -A
git commit -m "build: update typst-syntax" || true
git push origin nightly
hl_commit=$(git rev-parse HEAD)
echo "hl_commit=$hl_commit" >> $GITHUB_ENV
- name: Update tinymist patches and versions
if: steps.check_updates.outputs.need_release == 'true'
run: |
# Update patch revisions using script
revs_json=$(cat <<EOF
{
"reflexo": "${reflexo_commit}",
"typst-ansi-hl": "${hl_commit}",
"typstyle": "${typstyle_commit}"
}
EOF
)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-patch-revs "$revs_json"
# Update main version
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-main-version "$new_version"
- name: Update version files
if: steps.check_updates.outputs.need_release == 'true'
run: |
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . update-version-files "$new_version"
- name: Generate changelog
if: steps.check_updates.outputs.need_release == 'true'
run: |
tinymist_base_commit=$(git merge-base HEAD origin/main)
tinymist_base_msg=$(git --no-pager log --format="%s" -1 $tinymist_base_commit)
node $GITHUB_WORKSPACE/scripts/nightly-utils.mjs . generate-changelog \
"$new_version" \
"$tinymist_base_commit" \
"$tinymist_base_msg" \
"$latest_typst_rev" \
"$typst_base_commit" \
"$typst_base_msg"
- name: Final commit and tag
if: steps.check_updates.outputs.need_release == 'true'
run: |
new_version="$new_version"
cargo update
git add -A
git commit -m "build: bump version to ${new_version}"
bump_commit=$(git rev-parse HEAD)
git push origin nightly
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/git/refs \
-d "{\"ref\":\"refs/tags/v${new_version}\",\"sha\":\"${bump_commit}\"}"
echo "Successfully released tinymist ${new_version}!"
- name: No updates needed
if: steps.check_updates.outputs.need_release != 'true'
run: |
echo "No updates needed. All dependencies are up to date."

View file

@ -1,304 +1,341 @@
# stolen from https://github.com/nvarner/tinymist/blob/master/.github/workflows/release.yml
name: CI
on:
push:
branches:
- main
tags:
- "*"
pull_request:
types: [opened, synchronize]
branches:
- main
workflow_dispatch:
# This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
#
# Copyright 2022-2024, axodotdev
# Copyright 2025 Astral Software Inc.
# SPDX-License-Identifier: MIT or Apache-2.0
#
# CI that:
#
# * checks for a Git Tag that looks like a release
# * builds artifacts with dist (archives, installers, hashes)
# * uploads those artifacts to temporary workflow zip
# * on success, uploads the artifacts to a GitHub Release
#
# Note that a GitHub Release with this tag is assumed to exist as a draft
# with the appropriate title/body, and will be undrafted for you.
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
name: Release
permissions:
"contents": "write"
# This task will run whenever you workflow_dispatch with a tag that looks like a version
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
#
# If PACKAGE_NAME is specified, then the announcement will be for that
# package (erroring out if it doesn't have the given version or isn't dist-able).
#
# If PACKAGE_NAME isn't specified, then the announcement will be for all
# (dist-able) packages in the workspace with that version (this mode is
# intended for workspaces with only one dist-able package, or with all dist-able
# packages versioned/released in lockstep).
#
# If you push multiple tags at once, separate instances of this workflow will
# spin up, creating an independent announcement for each one. However, GitHub
# will hard limit this to 3 tags per commit, as it will assume more tags is a
# mistake.
#
# If there's a prerelease-style suffix to the version, then the release(s)
# will be marked as a prerelease.
on:
workflow_call:
inputs:
tag:
description: Release Tag
required: true
default: dry-run
type: string
targets:
description: Targets to build
required: true
default: all
type: string
workflow_dispatch:
inputs:
tag:
description: Release Tag
required: true
default: dry-run
type: string
targets:
description: Targets to build
required: true
default: all
type: string
jobs:
pre_build:
permissions:
actions: write
contents: read
name: Duplicate Actions Detection
runs-on: ubuntu-latest
# Run 'dist plan' (or host) to determine what tasks we need to do
plan:
runs-on: "ubuntu-22.04"
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
val: ${{ steps.plan.outputs.manifest }}
tag: ${{ (inputs.tag != 'dry-run' && inputs.tag) || '' }}
tag-flag: ${{ inputs.tag && inputs.tag != 'dry-run' && format('--tag={0}', inputs.tag) || '' }}
publishing: ${{ inputs.tag && inputs.tag != 'dry-run' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
- uses: actions/checkout@v4
with:
cancel_others: "true"
build:
persist-credentials: false
submodules: recursive
- name: Install dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Myriad-Dreamin/cargo-dist/releases/download/v0.28.6-tinymist.3/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/dist
# sure would be cool if github gave us proper conditionals...
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
# functionality based on whether this is a pull_request, and whether it's from a fork.
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
# but also really annoying to build CI around when it needs secrets to work right.)
- id: plan
run: |
dist ${{ (inputs.tag && inputs.tag != 'dry-run' && format('host --steps=create --tag={0}', inputs.tag)) || 'plan' }} --output-format=json > plan-dist-manifest.json
echo "dist ran successfully"
cat plan-dist-manifest.json
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
with:
name: artifacts-plan-dist-manifest
path: plan-dist-manifest.json
# Build and packages all the platform-specific things
build-local-artifacts:
name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
# Let the initial task tell us to not run (currently very blunt)
needs:
- plan
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || (fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') || (inputs.targets == 'all' || contains(inputs.targets, join(fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.targets, '')))) || inputs.tag == 'dry-run' }}
strategy:
matrix:
include:
- os: windows-latest
rust-target: x86_64-pc-windows-msvc
platform: win32
arch: x64
- os: windows-latest
rust-target: aarch64-pc-windows-msvc
platform: win32
arch: arm64
- os: ubuntu-20.04
rust-target: x86_64-unknown-linux-gnu
platform: linux
arch: x64
- os: ubuntu-20.04
rust-target: aarch64-unknown-linux-gnu
platform: linux
arch: arm64
- os: ubuntu-20.04
rust-target: arm-unknown-linux-gnueabihf
platform: linux
arch: armhf
- os: macos-11
rust-target: x86_64-apple-darwin
platform: darwin
arch: x64
- os: macos-11
rust-target: aarch64-apple-darwin
platform: darwin
arch: arm64
name: build (${{ matrix.platform }}-${{ matrix.arch }})
runs-on: ${{ matrix.os }}
fail-fast: false
# Target platforms/runners are computed by dist in create-release.
# Each member of the matrix has the following arguments:
#
# - runner: the github runner
# - dist-args: cli flags to pass to dist
# - install-dist: expression to run to install dist on the runner
#
# Typically there will be:
# - 1 "global" task that builds universal installers
# - N "local" tasks that build each platform's binaries and platform-specific installers
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container && matrix.container.image || null }}
env:
target: ${{ matrix.platform }}-${{ matrix.arch }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
steps:
- name: enable windows longpaths
run: |
git config --global core.longpaths true
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- uses: actions/checkout@v4
- name: Install Rust non-interactively if not already installed
if: ${{ matrix.container }}
run: |
if ! command -v cargo > /dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- uses: swatinem/rust-cache@v2
with:
repository: Enter-tainer/typst-preview
path: external/typst-preview
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install Node.js
uses: actions/setup-node@v4
key: ${{ join(matrix.targets, '-') }}
cache-provider: ${{ matrix.cache_provider }}
- name: Install dist
run: ${{ matrix.install_dist.run }}
# Get the dist-manifest
- name: Fetch local artifacts
uses: actions/download-artifact@v4
with:
node-version: 16
- name: Hack typst-preview
run: |
mv src/main.rs src/main.rsx
working-directory: ./external/typst-preview
- name: Build typst-dom
run: |
yarn
yarn build
working-directory: ./external/typst-preview/addons/typst-dom
- name: Build frontend
run: yarn
working-directory: ./external/typst-preview/addons/frontend
- name: Build typst-preview
run: |
yarn
yarn run compile
working-directory: ./external/typst-preview/addons/vscode
- name: Build vscode extension
run: |
yarn
yarn run compile
working-directory: ./editors/vscode
- name: rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust-target }}
- name: Install llvm
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install llvm
- name: Install AArch64 target toolchain
if: matrix.rust-target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install gcc-aarch64-linux-gnu
- name: Install ARM target toolchain
if: matrix.rust-target == 'arm-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build tinymist binary
shell: pwsh
run: |
cargo build --release -p tinymist --target ${{ matrix.rust-target }}
- name: Rename debug symbols for windows
if: matrix.platform == 'win32'
run: |
cd target/${{ matrix.rust-target }}/release
cp tinymist.pdb tinymist-${{ env.target }}.pdb
- name: Upload split debug symbols for windows
if: matrix.platform == 'win32'
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.pdb
path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.pdb
- name: Split debug symbols for linux
if: matrix.platform == 'linux'
run: |
cd target/${{ matrix.rust-target }}/release
llvm-objcopy --compress-debug-sections --only-keep-debug "tinymist" "tinymist-${{ env.target }}.debug"
llvm-objcopy --strip-debug --add-gnu-debuglink="tinymist-${{ env.target }}.debug" "tinymist"
- name: Upload split debug symbols for linux
if: matrix.platform == 'linux'
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.debug
path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.debug
compression-level: 0
- name: Collect debug symbols for mac
if: matrix.platform == 'darwin'
run: |
dsymutil -f "target/${{ matrix.rust-target }}/release/tinymist"
mv "target/${{ matrix.rust-target }}/release/tinymist.dwarf" "target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.dwarf"
- name: Upload split debug symbols for mac
if: matrix.platform == 'darwin'
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.dwarf
path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.dwarf
- name: Copy binary to output directory
shell: pwsh
run: |
cp "target/${{ matrix.rust-target }}/release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "editors/vscode/out/"
cp "target/${{ matrix.rust-target }}/release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "tinymist-${{ env.target }}$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )"
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}
path: tinymist-${{ env.target }}${{ fromJSON('["", ".exe"]')[matrix.platform == 'win32'] }}
- name: Package extension
shell: pwsh
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
working-directory: ./editors/vscode
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.vsix
path: editors/vscode/tinymist-${{ env.target }}.vsix
build_alpine:
name: build (x86_64-unknown-linux-musl)
runs-on: ubuntu-latest
container:
image: rust:alpine
volumes:
- /usr/local/cargo/registry:/usr/local/cargo/registry
env:
target: alpine-x64
RUST_TARGET: x86_64-unknown-linux-musl
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
steps:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- name: Install dependencies
run: apk add --no-cache git clang lld musl-dev nodejs npm yarn binutils
- name: Checkout repository
uses: actions/checkout@v4
run: |
${{ matrix.packages_install }}
- name: Build artifacts
run: |
# Actually do builds and make zips and whatnot
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
echo "dist ran successfully"
- id: cargo-dist
name: Post-build
# We force bash here just because github makes it really hard to get values up
# to "real" actions without writing to env-vars, and writing to env-vars has
# inconsistent syntax between shell and powershell.
shell: bash
run: |
# Parse out what we just built and upload it to scratch storage
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
submodules: recursive
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
path: |
${{ steps.cargo-dist.outputs.paths }}
${{ env.BUILD_MANIFEST_NAME }}
# Build and package all the platform-agnostic(ish) things
build-global-artifacts:
needs:
- plan
- build-local-artifacts
runs-on: "ubuntu-22.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
steps:
- uses: actions/checkout@v4
with:
repository: Enter-tainer/typst-preview
path: external/typst-preview
- name: Hack typst-preview
run: |
mv src/main.rs src/main.rsx
working-directory: ./external/typst-preview
- name: Build typst-dom
run: |
yarn
yarn build
working-directory: ./external/typst-preview/addons/typst-dom
- name: Build frontend
run: yarn
working-directory: ./external/typst-preview/addons/frontend
- name: Build typst-preview
run: |
yarn
yarn run compile
working-directory: ./external/typst-preview/addons/vscode
- name: Build vscode extension
run: |
yarn
yarn run compile
working-directory: ./editors/vscode
- name: Build tinymist binary
run: |
cargo build --release -p tinymist --target $RUST_TARGET
mkdir -p editors/vscode/out
- name: Split debug symbols
run: |
cd target/$RUST_TARGET/release
objcopy --compress-debug-sections --only-keep-debug "tinymist" "tinymist-${{ env.target }}.debug"
objcopy --strip-debug --add-gnu-debuglink="tinymist-${{ env.target }}.debug" "tinymist"
- name: Upload split debug symbols
uses: actions/upload-artifact@v4
persist-credentials: false
submodules: recursive
- name: Install cached dist
uses: actions/download-artifact@v4
with:
name: tinymist-${{ env.target }}.debug
path: target/${{ env.RUST_TARGET }}/release/tinymist-${{ env.target }}.debug
- name: Copy binary to output directory
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- id: cargo-dist
shell: bash
run: |
cp "target/${{ env.RUST_TARGET }}/release/tinymist" "editors/vscode/out/"
cp "target/${{ env.RUST_TARGET }}/release/tinymist" "tinymist-${{ env.target }}"
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}
path: tinymist-${{ env.target }}
- name: Package extension
run: yarn run package -- --target ${{ env.target }} -o tinymist-${{ env.target }}.vsix
working-directory: ./editors/vscode
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: tinymist-${{ env.target }}.vsix
path: editors/vscode/tinymist-${{ env.target }}.vsix
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
echo "dist ran successfully"
release:
runs-on: ubuntu-latest
needs: [build, build_alpine]
if: success() && startsWith(github.ref, 'refs/tags/')
# Parse out what we just built and upload it to scratch storage
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: artifacts-build-global
path: |
${{ steps.cargo-dist.outputs.paths }}
${{ env.BUILD_MANIFEST_NAME }}
custom-build-vscode:
needs:
- plan
- build-local-artifacts
uses: ./.github/workflows/build-vscode.yml
with:
plan: ${{ needs.plan.outputs.val }}
secrets: inherit
permissions:
contents: write
"contents": "write"
custom-ci-check-e2e:
needs:
- plan
- build-local-artifacts
uses: ./.github/workflows/ci-check-e2e.yml
with:
plan: ${{ needs.plan.outputs.val }}
secrets: inherit
# Determines if we should publish/announce
host:
needs:
- plan
- build-local-artifacts
- build-global-artifacts
- custom-build-vscode
- custom-ci-check-e2e
# Only run if we're "publishing", and only if local and global didn't fail (skipped is fine)
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.custom-build-vscode.result == 'skipped' || needs.custom-build-vscode.result == 'success') && (needs.custom-ci-check-e2e.result == 'skipped' || needs.custom-ci-check-e2e.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: "ubuntu-22.04"
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- uses: actions/download-artifact@v4
- name: Install cached dist
uses: actions/download-artifact@v4
with:
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
# Fetch artifacts from scratch-storage
- name: Fetch artifacts
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- id: host
shell: bash
run: |
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
with:
# Overwrite the previous copy
name: artifacts-dist-manifest
path: dist-manifest.json
# Create a GitHub Release while uploading all files to it
- name: "Download GitHub Artifacts"
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "artifacts/*/*"
allowUpdates: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
merge-multiple: true
- name: Cleanup
run: |
# Remove the granular manifests
rm -f artifacts/*-dist-manifest.json
- name: Create GitHub Release
env:
PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
RELEASE_COMMIT: "${{ github.sha }}"
run: |
# If we're editing a release in place, we need to upload things ahead of time
gh release upload "${{ needs.plan.outputs.tag }}" artifacts/*
publish:
runs-on: ubuntu-latest
needs: [build]
if: success() && startsWith(github.ref, 'refs/tags/')
gh release edit "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --draft=false
announce:
needs:
- plan
- host
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' }}
runs-on: "ubuntu-22.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/download-artifact@v4
- name: Deploy to VS Code Marketplace
run: npx vsce publish --packagePath $(find . -type f -iname '*.vsix')
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
- name: Deploy to OpenVSX
run: npx ovsx publish --packagePath $(find . -type f -iname '*.vsix')
env:
OVSX_PAT: ${{ secrets.OPENVSX_ACCESS_TOKEN }}
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive

11
.gitignore vendored
View file

@ -5,6 +5,11 @@ result*
.envrc
node_modules/
/local/
/editors/vscode/out/
/editors/lapce/out/
/external/typst-preview
editors/vscode/out/
editors/lapce/out/
/external/typst-preview
/dist
*.pdf
.vscode/*.code-workspace
refs/

View file

@ -1,10 +1,25 @@
.DS_Store
.git/**
.github/**
.vscode/**
assets/**
src/**
target/**
dist/**
icons/
node_modules/
editors/vscode/test-dist/
editors/vscode/out/
editors/vscode/.vscode-test/**
*.toml
*.txt
*.lock
*.md
.env
.env.*
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

13
.prettierrc.cjs Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
// same options as rust-analyzer, otherwise defaults from prettier
printWidth: 100,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: false,
quoteProps: "as-needed",
trailingComma: "all",
bracketSpacing: true,
arrowParens: "always",
singleAttributePerLine: false,
};

107
.vscode/launch.json vendored
View file

@ -15,7 +15,21 @@
"preLaunchTask": "VS Code Extension Prelaunch"
},
{
"name": "Run Extension [Jaeger]",
"name": "Run Extension [Web]",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentKind=web",
"--extensionDevelopmentPath=${workspaceFolder}/editors/vscode"
],
"outFiles": [
"${workspaceFolder}/editors/vscode/out/**/*.js"
],
"preLaunchTask": "VS Code Extension Prelaunch [Web]"
},
{
"name": "Run Extension [Release]",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
@ -25,7 +39,96 @@
"outFiles": [
"${workspaceFolder}/editors/vscode/out/**/*.js"
],
"preLaunchTask": "VS Code Extension Prelaunch [Jaeger]"
"preLaunchTask": "VS Code Extension Prelaunch [Release]"
},
{
"name": "Run Extension [Typst Preview]",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/contrib/typst-preview/editors/vscode"
],
"outFiles": [
"${workspaceFolder}/contrib/typst-preview/editors/vscode/out/**/*.js"
],
"preLaunchTask": "VS Code Extension Prelaunch Preview"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'tinymist'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=tinymist",
"--package=tinymist"
],
"filter": {
"name": "tinymist",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'tinymist-query'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=tinymist-query"
],
"filter": {
"name": "tinymist-query",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'tinymist-render'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=tinymist-render"
],
"filter": {
"name": "tinymist-render",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug integration test 'tinymist-e2e-tests'",
"cargo": {
"args": [
"test",
"--no-run",
"--test=tinymist-e2e-tests",
"--package=tests"
],
"filter": {
"name": "tinymist-e2e-tests",
"kind": "test"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

View file

@ -2,5 +2,8 @@
"eslint.format.enable": true,
"eslint.workingDirectories": [
"editors/vscode"
]
],
"tinymist.fontPaths": [
"assets/fonts"
],
}

137
.vscode/tasks.json vendored
View file

@ -3,10 +3,30 @@
"tasks": [
{
"label": "VS Code Extension Prelaunch",
"type": "npm",
"script": "prelaunch:vscode",
"group": "build",
},
{
"label": "VS Code Extension Prelaunch [Web]",
"type": "npm",
"script": "build:web",
"group": "build"
},
{
"label": "VS Code Extension Prelaunch Preview",
"dependsOn": [
"Compile Typst Preview Extension",
"Copy Debug LSP Binary to Typst Preview Extension"
],
"dependsOrder": "sequence",
},
{
"label": "VS Code Extension Prelaunch [Release]",
"dependsOn": [
"Compile VS Code Extension",
"Build Debug LSP Binary",
"Copy Debug LSP Binary to VS Code Extension"
"Build Release LSP Binary",
"Copy Release LSP Binary to VS Code Extension"
],
"dependsOrder": "sequence",
},
@ -16,7 +36,10 @@
"Compile VS Code Extension",
"Build Release LSP Binary",
"Copy Release LSP Binary to VS Code Extension",
"Generate VS Code Extension Bundle"
"Generate VS Code Extension Bundle",
"Compile Typst Preview Extension",
"Copy Release LSP Binary to Typst Preview Extension",
"Generate Typst Preview Extension Bundle"
],
"dependsOrder": "sequence",
},
@ -27,6 +50,13 @@
"path": "editors/vscode",
"group": "build",
},
{
"label": "Compile VS Code Extension [Web]",
"type": "npm",
"script": "compile:web",
"path": "editors/vscode",
"group": "build",
},
{
"label": "Generate VS Code Extension Bundle",
"type": "npm",
@ -35,50 +65,33 @@
"group": "build",
},
{
"label": "Build Debug LSP Binary",
"type": "cargo",
"command": "build",
"args": [ "--bin", "tinymist" ],
"problemMatcher": [
"$rustc"
],
"group": "build"
"label": "Compile Typst Preview Extension",
"type": "npm",
"script": "compile",
"path": "contrib/typst-preview/editors/vscode",
"group": "build",
},
{
"label": "Generate Typst Preview Extension Bundle",
"type": "npm",
"script": "package",
"path": "contrib/typst-preview/editors/vscode",
"group": "build",
},
{
"label": "Build Release LSP Binary",
"type": "cargo",
"command": "build",
"args": [ "--release", "--bin", "tinymist" ],
"args": [
"--release",
"--bin",
"tinymist"
],
"problemMatcher": [
"$rustc"
],
"group": "build"
},
{
"label": "Copy Debug LSP Binary to VS Code Extension",
"type": "shell",
"windows": {
"command": "cp",
"args": [
"${workspaceFolder}\\target\\debug\\tinymist.exe",
"${workspaceFolder}\\editors\\vscode\\out\\"
]
},
"linux": {
"command": "cp",
"args": [
"${workspaceFolder}/target/debug/tinymist",
"${workspaceFolder}/editors/vscode/out/"
]
},
"osx": {
"command": "cp",
"args": [
"${workspaceFolder}/target/debug/tinymist",
"${workspaceFolder}/editors/vscode/out/"
]
}
},
{
"label": "Copy Release LSP Binary to VS Code Extension",
"type": "shell",
@ -103,6 +116,56 @@
"${workspaceFolder}/editors/vscode/out/"
]
}
},
{
"label": "Copy Debug LSP Binary to Typst Preview Extension",
"type": "shell",
"windows": {
"command": "cp",
"args": [
"${workspaceFolder}\\target\\debug\\tinymist.exe",
"${workspaceFolder}\\contrib\\typst-preview\\editors\\vscode\\out\\"
]
},
"linux": {
"command": "cp",
"args": [
"${workspaceFolder}/target/debug/tinymist",
"${workspaceFolder}/contrib/typst-preview/editors/vscode/out/"
]
},
"osx": {
"command": "cp",
"args": [
"${workspaceFolder}/target/debug/tinymist",
"${workspaceFolder}/contrib/typst-preview/editors/vscode/out/"
]
}
},
{
"label": "Copy Release LSP Binary to Typst Preview Extension",
"type": "shell",
"windows": {
"command": "cp",
"args": [
"${workspaceFolder}\\target\\release\\tinymist.exe",
"${workspaceFolder}\\contrib\\typst-preview\\editors\\vscode\\out\\"
]
},
"linux": {
"command": "cp",
"args": [
"${workspaceFolder}/target/release/tinymist",
"${workspaceFolder}/contrib/typst-preview/editors/vscode/out/"
]
},
"osx": {
"command": "cp",
"args": [
"${workspaceFolder}/target/release/tinymist",
"${workspaceFolder}/contrib/typst-preview/editors/vscode/out/"
]
}
}
]
}

View file

@ -0,0 +1,37 @@
{
"$schema": "vscode://schemas/workspaceConfig",
"folders": [
{
"path": ".."
}
],
"settings": {
"tinymist.fontPaths": [
"assets/fonts"
],
"[javascript]":{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.format.enable": true,
"eslint.workingDirectories": [
"editors/vscode"
],
"rust-analyzer.check.command": "clippy",
"rust-analyzer.rustfmt.extraArgs": ["--config=wrap_comments=true"],
"files.watcherExclude": {
"**/target": true
},
},
"extensions": {
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"myriad-dreamin.tinymist",
]
},
}

22
.zed/settings.json Normal file
View file

@ -0,0 +1,22 @@
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"check": {
"command": "clippy"
}
}
},
"tinymist": {
"initialization_options": {
"exportPdf": "onSave",
"fontPaths": ["assets/fonts"],
"outputPath": "$root/target/typst/$dir/$name"
}
}
}
}

1
CHANGELOG.md Normal file
View file

@ -0,0 +1 @@
[CHANGELOG.md](./editors/vscode/CHANGELOG.md)

1255
CHANGELOG/CHANGELOG-2024.md Normal file

File diff suppressed because it is too large Load diff

4
CHANGELOG/README.md Normal file
View file

@ -0,0 +1,4 @@
# CHANGELOGs
- [CHANGELOG-2025.md](/editors/vscode/CHANGELOG.md)
- [CHANGELOG-2024.md](./CHANGELOG-2024.md)

2
CODEOWNERS Normal file
View file

@ -0,0 +1,2 @@
# Only Myriad-Dreamin and Enter-tainer can merge changes to this repository.
* @Myriad-Dreamin @Enter-tainer

22
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,22 @@
# Contributing
Thank you for your interest in contributing to tinymist! There are many ways to contribute and we appreciate all of them.
Before contributing, you can read the [Development Guide](./docs/dev-guide.md) to learn more about the project structure and how to build and run the project.
## Fixing a bug or improving a feature
Generally it's fine to just work on these kinds of things and put a pull-request out for it. If there is an issue accompanying it make sure to link it in the pull request description so it can be closed afterwards or linked for context.
If you want to find something to fix or work on keep a look out for the [`bug`](https://github.com/Myriad-Dreamin/tinymist/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and [`enhancement`](https://github.com/Myriad-Dreamin/tinymist/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)
labels. Among issues, the [`good first issue`](https://github.com/Myriad-Dreamin/tinymist/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label is a good place to start.
## Localization
Tinymist is localized in multiple languages. You can contribute to the localization of Tinymist by translating or correcting the locale files in the [locales](./locales) folder. This is also a good start of contributing to the project.
## Implementing a new feature
It's advised to first open an issue for any kind of new feature so the team can tell upfront whether the feature is desirable or not before any implementation work happens. We want to minimize the possibility of someone putting a lot of work into a feature that is then going to waste as we deem it out of scope (be it due to generally not fitting in with tinymist, or just not having the maintenance capacity). If there already is a feature issue open but it is not clear whether it is considered accepted feel free to just drop a comment and ask!

4996
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,73 +1,220 @@
[workspace.package]
description = "An integrated language service for Typst."
authors = ["Myriad-Dreamin <camiyoru@gmail.com>", "Nathan Varner"]
version = "0.10.1"
edition = "2021"
version = "0.14.6-rc1"
edition = "2024"
readme = "README.md"
license = "Apache-2.0"
homepage = "https://github.com/Myriad-Dreamin/tinymist"
repository = "https://github.com/Myriad-Dreamin/tinymist"
rust-version = "1.74"
# also change in ci.yml
rust-version = "1.89"
[workspace]
resolver = "2"
members = ["crates/*", "external/typst-preview"]
members = ["benches/*", "crates/*", "tests"]
[workspace.dependencies]
once_cell = "1"
# Basic Infra
anyhow = "1"
itertools = "0.13"
paste = "1.0"
cfg-if = "1.0"
strum = { version = "0.27.2", features = ["derive"] }
quote = "1"
syn = "2"
triomphe = { version = "0.1.10", default-features = false, features = ["std"] }
fxhash = "0.2.1"
ecow = "0.2.0"
comemo = "0.4"
ena = "0.14.2"
# Asynchoronous and Multi-threading
async-trait = "0.1.89"
futures = "0.3"
regex = "1.8.1"
itertools = "0.12.0"
lazy_static = "1.4.0"
env_logger = "0.11.1"
log = "0.4.17"
strum = { version = "0.25.0", features = ["derive"] }
async-trait = "0.1.73"
rayon = "1.11.0"
tokio = { version = "1.48.0", features = ["macros"] }
tokio-util = { version = "0.7.16", features = ["compat"] }
# System
battery = "0.7.8"
temp-env = "0.3.6"
open = { version = "5.3.2" }
parking_lot = "0.12.1"
thiserror = "1.0.44"
walkdir = "2"
chrono = { version = "0.4", default-features = false }
time = "0.3"
dirs = "6"
fontdb = { version = "0.23", default-features = false }
notify = "6"
path-clean = "1.0.1"
windows-sys = "0.61.2"
tempfile = "3.19.1"
same-file = "1.0.6"
libc = "0.2.155"
core-foundation = { version = "0.10.0", features = ["mac_os_10_7_support"] }
half = "=2.6.0"
typst = "0.10.0"
typst-ide = "0.10.0"
typst-pdf = "0.10.0"
typst-assets = { git = "https://github.com/typst/typst-assets", rev = "4d1211a" }
typst-ts-core = { version = "0.4.2-rc7" }
typst-ts-compiler = { version = "0.4.2-rc7" }
typst-preview = { path = "external/typst-preview" }
# Web
js-sys = "^0.3"
wasm-bindgen = "^0.2"
wasm-bindgen-futures = "^0.4"
wasm-bindgen-test = "0.3.45"
web-sys = "^0.3"
web-time = { version = "1.1.0" }
console_error_panic_hook = { version = "0.1.7" }
lsp-server = "0.7.3"
# Networking
hyper = { version = "1", features = ["full"] }
hyper-util = { version = "0.1.17", features = ["tokio"] }
hyper-tungstenite = "0.19.0"
reqwest = { version = "^0.12", default-features = false, features = [
"rustls-tls",
"blocking",
"multipart",
] }
http-body-util = "0.1.3"
# Algorithms
base64 = "0.22"
regex = "1.12.2"
# Cryptography and data processing
rustc-hash = { version = "2", features = ["std"] }
siphasher = "1"
fxhash = "0.2.1"
sha2 = "0.10.9"
nohash-hasher = "0.2.0"
fastrand = "2.3.0"
# Data Structures
bitvec = "1"
comemo = "0.5.0"
# We need to freeze the version of the crate, as the raw-api feature is considered unstable
dashmap = { version = "=5.5.3", features = ["raw-api"] }
ecow = "0.2.6"
ena = "0.14.3"
hashbrown = { version = "0.14", features = [
"inline-more",
], default-features = false }
indexmap = "2.12.0"
rpds = "1"
# Data/Text Format and Processing
biblatex = "0.11"
bytes = "1"
cmark-writer = { version = "0.9.0", features = [
"gfm",
], path = "crates/cmark-writer" }
docx-rs = { version = "0.4.18-rc19", git = "https://github.com/Myriad-Dreamin/docx-rs", default-features = false, rev = "db49a729f68dbdb9e8e91857fbb1c3d414209871" }
hayagriva = "0.9.1"
hex = "0.4.3"
flate2 = "1"
# typst can only support these formats.
image = { version = "0.25.5", default-features = false, features = [
"png",
"jpeg",
"gif",
] }
pathdiff = "0.2"
percent-encoding = "2"
rust_iso639 = "0.0.3"
rust_iso3166 = "0.1.4"
resvg = { version = "0.45" }
rkyv = "0.7.42"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_repr = "0.1"
serde_with = { version = "3.6", features = ["base64"] }
serde_yaml = "0.9"
serde-wasm-bindgen = "^0.6"
tar = "0.4"
toml = { version = "0.8", default-features = false, features = [
"parse",
"display",
] }
ttf-parser = "0.25.0"
unicode-script = "0.5"
unscanny = "0.1"
yaml-rust2 = "0.9"
# Logging
codespan-reporting = "0.11"
env_logger = "0.11.3"
log = "0.4"
# Typst
reflexo = { version = "=0.7.0-rc2", default-features = false, features = [
"flat-vector",
] }
reflexo-typst = { version = "=0.7.0-rc2", default-features = false }
reflexo-vec2svg = { version = "=0.7.0-rc2" }
typst = "0.14.2"
typst-html = "0.14.2"
typst-library = "0.14.2"
typst-macros = "0.14.2"
typst-timing = "0.14.2"
typst-svg = "0.14.2"
typst-render = "0.14.2"
typst-pdf = "0.14.2"
typst-syntax = "0.14.2"
typst-eval = "0.14.2"
typst-assets = "0.14.2"
typstfmt = { version = "0", git = "https://github.com/Myriad-Dreamin/typstfmt", tag = "v0.13.1" }
typst-ansi-hl = "0.4.0"
typstyle-core = { version = "=0.14.0", default-features = false }
# LSP
crossbeam-channel = "0.5.15"
lsp-types = { version = "=0.95.0", features = ["proposed"] }
crossbeam-channel = "0.5.8"
dapts = "0.0.6"
clap = { version = "4.4", features = ["derive", "env", "unicode", "wrap_help"] }
clap_builder = { version = "4", features = ["string"] }
clap_complete = "4.4"
clap_complete_fig = "4.4"
clap_mangen = { version = "0.2.15" }
vergen = { version = "8.2.5", features = [
# CLI
clap = { version = "4.5", features = ["derive", "env", "unicode"] }
clap_builder = { version = "4.5", features = ["string"] }
clap_complete = "4.5"
clap_complete_fig = "4.5"
clap_complete_nushell = "4.5.3"
clap_mangen = { version = "0.2.22" }
vergen = { version = "8.3.1", features = [
"build",
"cargo",
"git",
"gitcl",
"rustc",
] }
tokio = { version = "1.34.0", features = [
"macros",
"rt-multi-thread",
"io-std",
] }
tokio-util = "0.7.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
divan = "0.1.7"
insta = { vesrion = "1.34", features = ["glob"] }
# Testing
dhat = "0.3.3"
divan = "0.1.21"
insta = { version = "1.43", features = ["glob", "filters"] }
insta-cmd = "0.6.0"
# Our Own Crates
tinymist-assets = { version = "=0.14.6-rc1" }
tinymist-derive = { path = "./crates/tinymist-derive/", version = "0.14.6-rc2" }
tinymist-l10n = { path = "./crates/tinymist-l10n/", version = "0.14.6-rc2" }
tinymist-package = { path = "./crates/tinymist-package/", version = "0.14.6-rc2" }
tinymist-std = { path = "./crates/tinymist-std/", version = "0.14.6-rc2", default-features = false }
tinymist-vfs = { path = "./crates/tinymist-vfs/", version = "0.14.6-rc2", default-features = false }
tinymist-world = { path = "./crates/tinymist-world/", version = "0.14.6-rc2", default-features = false }
tinymist-project = { path = "./crates/tinymist-project/", version = "0.14.6-rc2" }
tinymist-task = { path = "./crates/tinymist-task/", version = "0.14.6-rc2" }
typst-shim = { path = "./crates/typst-shim", version = "0.14.6-rc2" }
tinymist-tests = { path = "./crates/tinymist-tests/" }
sync-ls = { path = "./crates/sync-lsp", version = "0.14.6-rc1" }
tinymist = { path = "./crates/tinymist/", version = "0.14.6-rc1", default-features = false }
tinymist-analysis = { path = "./crates/tinymist-analysis/", version = "0.14.6-rc1" }
tinymist-cli = { path = "./crates/tinymist-cli/", version = "0.14.6-rc1" }
tinymist-debug = { path = "./crates/tinymist-debug/", version = "0.14.6-rc1" }
tinymist-lint = { path = "./crates/tinymist-lint/", version = "0.14.6-rc1" }
tinymist-query = { path = "./crates/tinymist-query/", version = "0.14.6-rc1" }
tinymist-render = { path = "./crates/tinymist-render/", version = "0.14.6-rc1" }
tinymist-preview = { path = "./crates/typst-preview", version = "0.14.6-rc1" }
typlite = { path = "./crates/typlite", version = "0.14.6-rc1", default-features = false }
[profile.dev.package.insta]
opt-level = 3
@ -76,33 +223,115 @@ opt-level = 3
opt-level = 3
[profile.release]
lto = true # Enable link-time optimization
debug = true
opt-level = 3 # Optimize for speed
# lto = true # Enable link-time optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations
panic = 'abort' # Abort on panic
panic = "abort" # Abort on panic
[profile.gh-release]
inherits = "release"
debug = true
# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
[workspace.lints.rustdoc]
broken_intra_doc_links = "warn"
[workspace.lints.rust]
missing_docs = "warn"
# missing_crate_level_docs = "warn"
unexpected_cfgs = { level = "allow", check-cfg = [
'cfg(wasm_bindgen_unstable_test_coverage)',
'cfg(noop)',
'cfg(used_linker)',
] }
[workspace.lints.clippy]
uninlined_format_args = "warn"
# missing_errors_doc = "warn"
# missing_panics_doc = "warn"
# missing_docs_in_private_items = "warn"
missing_safety_doc = "warn"
undocumented_unsafe_blocks = "warn"
[patch.crates-io]
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
typst-ide = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "tinymist-v0.11.0" }
[workspace.metadata.typos.default]
locale = "en-us"
[workspace.metadata.typos.default.extend-words]
labelled = "labelled"
onces = "onces"
withs = "withs"
[workspace.metadata.typos.files]
ignore-hidden = false
extend-exclude = ["/.git", "fixtures"]
[patch.crates-io]
# This patch is used to bundle a locally built frontend (HTML) of `typst-preview`.
# The shortcoming is that you cannot install tinymist from git source then, i.e. `cargo install --git ..`, with this patch.
# However, it is not suggested to install it in that way. The suggested ways are:
# - Installation: https://github.com/Myriad-Dreamin/tinymist?tab=readme-ov-file#installation
# - Installing pre-built artifacts from GitHub : https://github.com/Myriad-Dreamin/tinymist?tab=readme-ov-file#installing-regularnightly-prebuilds-from-github
# tinymist-assets = { path = "./crates/tinymist-assets/" }
# These patches use a different version of `typst`, which only exports some private functions and information for code analysis.
#
# A regular build MUST use `tag` or `rev` to specify the version of the patched crate to ensure stability.
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-macros = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-library = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-html = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-timing = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-svg = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-render = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-pdf = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
typst-eval = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist/v0.14.6-rc2" }
# typst-ansi-hl = { git = "https://github.com/ParaN3xus/typst-ansi-hl.git", branch = "nightly" }
# typstyle-core = { git = "https://github.com/ParaN3xus/typstyle/", rev = "34869bfa9db089c5196be5fac2a5e9d752904ca2" }
# These patches use local `typst` for development.
# typst = { path = "../typst/crates/typst" }
# typst-ide = { path = "../typst/crates/typst-ide" }
# typst-timing = { path = "../typst/crates/typst-timing" }
# typst-svg = { path = "../typst/crates/typst-svg" }
# typst-pdf = { path = "../typst/crates/typst-pdf" }
# typst-render = { path = "../typst/crates/typst-render" }
# typst-syntax = { path = "../typst/crates/typst-syntax" }
typst-ts-svg-exporter = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "58c2c6b07831cffb8915776c45058754c505033b", package = "typst-ts-svg-exporter" }
typst-ts-core = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "58c2c6b07831cffb8915776c45058754c505033b", package = "typst-ts-core" }
typst-ts-compiler = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "58c2c6b07831cffb8915776c45058754c505033b", package = "typst-ts-compiler" }
# These patches use local `typstyle-core` for development.
# typstyle-core = { path = "../typstyle/crates/typstyle-core" }
# These patches use a different version of `reflexo`.
#
# A regular build MUST use `tag` or `rev` to specify the version of the patched crate to ensure stability.
reflexo = { git = "https://github.com/Myriad-Dreamin/typst.ts/", rev = "c078ddf869d9438b36e1cacb65100e4514780dc1" }
reflexo-typst = { git = "https://github.com/Myriad-Dreamin/typst.ts/", rev = "c078ddf869d9438b36e1cacb65100e4514780dc1" }
reflexo-vec2svg = { git = "https://github.com/Myriad-Dreamin/typst.ts/", rev = "c078ddf869d9438b36e1cacb65100e4514780dc1" }
# These patches use local `reflexo` for development.
# reflexo = { path = "../typst.ts/crates/reflexo/" }
# reflexo-typst = { path = "../typst.ts/crates/reflexo-typst/" }
# reflexo-vec2svg = { path = "../typst.ts/crates/conversion/vec2svg/" }
typst-shim = { path = "crates/typst-shim" }
tinymist-analysis = { path = "crates/tinymist-analysis" }
tinymist-std = { path = "crates/tinymist-std" }
tinymist-vfs = { path = "crates/tinymist-vfs" }
tinymist-world = { path = "crates/tinymist-world" }
tinymist-project = { path = "crates/tinymist-project" }
tinymist-task = { path = "crates/tinymist-task" }
# If reflexo use the tinymist from git, you should use the following patch.
# [patch."https://github.com/ParaN3xus/tinymist.git"]
# typst-shim = { path = "crates/typst-shim" }
# tinymist-analysis = { path = "crates/tinymist-analysis" }
# tinymist-std = { path = "crates/tinymist-std" }
# tinymist-vfs = { path = "crates/tinymist-vfs" }
# tinymist-world = { path = "crates/tinymist-world" }
# tinymist-project = { path = "crates/tinymist-project" }
# tinymist-task = { path = "crates/tinymist-task" }

48
Dockerfile Normal file
View file

@ -0,0 +1,48 @@
# ```shell
# docker build -t myriaddreamin/tinymist:latest .
# ```
#
# ## References
#
# https://stackoverflow.com/questions/58473606/cache-rust-dependencies-with-docker-build
# https://stackoverflow.com/a/64528456
# https://depot.dev/blog/rust-dockerfile-best-practices
ARG RUST_VERSION=1.89.0
FROM rust:${RUST_VERSION}-bookworm AS base
RUN apt-get install -y git
RUN cargo install sccache --version ^0.7
RUN cargo install cargo-chef --version ^0.1
ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
# to download the toolchain
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
rustup update
FROM base as planner
WORKDIR app
# We only pay the installation cost once,
# it will be cached from the second build onwards
RUN cargo install cargo-chef
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo +${RUST_VERSION} chef prepare --recipe-path recipe.json
FROM base as builder
WORKDIR app
RUN cargo install cargo-chef
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo +${RUST_VERSION} chef cook --release --recipe-path recipe.json
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo +${RUST_VERSION} build --bin tinymist --release
FROM debian:12
WORKDIR /app/
COPY --from=builder /app/target/release/tinymist /usr/local/bin
ENTRYPOINT ["/usr/local/bin/tinymist"]

View file

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023 Myriad Dreamin, Nathan Varner
Copyright 2023-2025 Myriad Dreamin, Nathan Varner
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

56
MAINTAINERS.md Normal file
View file

@ -0,0 +1,56 @@
<!-- This file is generated by scripts/link-docs.mjs. Do not edit manually. -->
# Tinymist Maintainers
Tinymist [ˈtaɪni mɪst] is an integrated language service for [Typst](https://typst.app/) [taɪpst].
This page is generated from [./MAINTAINERS.typ](./MAINTAINERS.typ) and renders information of [maintainers](#maintainers) and [features.](#features)
## Maintainers
- [**Myriad-Dreamin**](https://github.com/Myriad-Dreamin)
- Email: camiyoru@gmail.com
- Maintains: *[Editor Integration](#editor-integration)*, *[Language Service](#language-service)*, *[Document Previewing](#document-previewing)*, *[VS Code Client-Side Support](#vs-code-client-side-support)*, and *[Nightly Releases](#nightly-releases)*
- [**Enter-tainer**](https://github.com/Enter-tainer)
- Email: mgt@oi-wiki.org
- Maintains: *[Editor Integration](#editor-integration)*, *[Language Service](#language-service)*, *[Document Previewing](#document-previewing)*, and *[VS Code Client-Side Support](#vs-code-client-side-support)*
- [**ParaN3xus**](https://github.com/ParaN3xus)
- Email: paran3xus007@gmail.com
- Maintains: *[Nightly Releases](#nightly-releases)*
- [**Max397**](https://github.com/max397574)
- Email: undefined
- Maintains: *[Editor Integration](#editor-integration)*
- [**Ericoolen**](https://github.com/Eric-Song-Nop)
- Email: EricYFSong@gmail.com
- Maintains: *[Language Service](#language-service)*
- [**Caleb Maclennan**](https://github.com/alerque)
- Email: caleb@alerque.com
- Maintains: *[Editor Integration](#editor-integration)*
- [**SylvanFranklin**](https://github.com/SylvanFranklin)
- Email: sylvanfranklin@icloud.com
- Maintains: *[Editor Integration](#editor-integration)*, and *[Document Previewing](#document-previewing)*
## Features
### Editor Integration
Integrate tinymist server with popular editors like VS Code, Neovim, etc.
- Scope: [`crates/tinymist/`](./crates/tinymist/), [`editors/`](./editors/)
### Language Service
Perform code analysis and provide language support for Typst.
- Scope: [`crates/tinymist/`](./crates/tinymist/), [`crates/tinymist-analysis/`](./crates/tinymist-analysis/), [`crates/tinymist-query/`](./crates/tinymist-query/)
### Document Previewing
Provide instant preview of the document being edited.
- Scope: [`crates/tinymist/`](./crates/tinymist/), [`crates/typst-preview/`](./crates/typst-preview/), [`contrib/typst-preview/`](./contrib/typst-preview/), [`tools/typst-dom/`](./tools/typst-dom/), [`tools/typst-preview-frontend/`](./tools/typst-preview-frontend/)
### VS Code Client-Side Support
Enrich the VS Code features with the client-side extension.
- Scope: [`crates/tinymist/`](./crates/tinymist/), [`editors/vscode/`](./editors/vscode/), [`tools/editor-tools/`](./tools/editor-tools/)
### Nightly Releases
Build and Publish nightly releases of tinymist. The nightly releases are built upon the main branches of both tinymist and typst.
- Scope: [`crates/tinymist/`](./crates/tinymist/), [`crates/typst-shim/`](./crates/typst-shim/)

99
MAINTAINERS.typ Normal file
View file

@ -0,0 +1,99 @@
#import "typ/templates/maintainer.typ": *
#show: main
#let editor-integration = [Editor Integration]
#let language-service = [Language Service]
#let document-previewing = [Document Previewing]
#let vs-code-client-side-support = [VS Code Client-Side Support]
#let nightly-releases = [Nightly Releases]
== Maintainers
#maintainers[
- Myriad-Dreamin
- #github("Myriad-Dreamin")
- #email("camiyoru@gmail.com")
- #maintains[
- #editor-integration
- #language-service
- #document-previewing
- #vs-code-client-side-support
- #nightly-releases
]
- Enter-tainer
- #github("Enter-tainer")
- #email("mgt@oi-wiki.org")
- #maintains[
- #editor-integration
- #language-service
- #document-previewing
- #vs-code-client-side-support
]
- ParaN3xus
- #github("ParaN3xus")
- #email("paran3xus007@gmail.com")
- #maintains[
- #nightly-releases
]
- Max397
- #github("max397574")
- #maintains[
- #editor-integration
]
- Ericoolen
- #github("Eric-Song-Nop")
- #email("EricYFSong@gmail.com")
- #maintains[
- #language-service
]
- Caleb Maclennan
- #github("alerque")
- #email("caleb@alerque.com")
- #maintains[
- #editor-integration
]
- SylvanFranklin
- #github("SylvanFranklin")
- #email("sylvanfranklin@icloud.com")
- #maintains[
- #editor-integration
- #document-previewing
]
]
== Features
#features[
- #editor-integration
- #scope("crates/tinymist/", "editors/")
- #description[
Integrate tinymist server with popular editors like VS Code, Neovim, etc.
]
- #language-service
- #scope("crates/tinymist/", "crates/tinymist-analysis/", "crates/tinymist-query/")
- #description[
Perform code analysis and provide language support for Typst.
]
- #document-previewing
- #scope(
"crates/tinymist/",
"crates/typst-preview/",
"contrib/typst-preview/",
"tools/typst-dom/",
"tools/typst-preview-frontend/",
)
- #description[
Provide instant preview of the document being edited.
]
- #vs-code-client-side-support
- #scope("crates/tinymist/", "editors/vscode/", "tools/editor-tools/")
- #description[
Enrich the VS Code features with the client-side extension.
]
- #nightly-releases
- #scope("crates/tinymist/", "crates/typst-shim/")
- #description[
Build and Publish nightly releases of tinymist. The nightly releases are built upon the main branches of both tinymist and typst.
]
]

211
README.md
View file

@ -1,49 +1,228 @@
<!-- This file is generated by scripts/link-docs.mjs. Do not edit manually. -->
# Tinymist
Tinymist [ˈtaɪni mɪst] is an integrated language service for [Typst](https://typst.app/) [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese.
[<img src="https://img.shields.io/github/license/Myriad-Dreamin/tinymist" alt="GitHub license" />](https://github.com/Myriad-Dreamin/tinymist/blob/main/LICENSE)[<img src="https://github.com/Myriad-Dreamin/tinymist/actions/workflows/ci.yml/badge.svg?event=push" alt="Actions status" />](https://github.com/Myriad-Dreamin/tinymist/actions/workflows/ci.yml)[<img src="https://img.shields.io/badge/view-documentation-blue" alt="Documentation" />](https://myriad-dreamin.github.io/tinymist/)[<img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki" />](https://deepwiki.com/Myriad-Dreamin/tinymist)
Tinymist \[ˈtaɪni mɪst\] is an integrated language service for [Typst](https://typst.app/) \[taɪpst\]. You can also call it <ruby>
<rt>
wēi
</rt>
</ruby><ruby>
<rt>
ǎi
</rt>
</ruby> in Chinese.
It contains:
- an analyzing library for Typst, see [tinymist-query](./crates/tinymist-query/).
- a CLI for Typst, see [tinymist](./crates/tinymist/).
- which provides a language server for Typst.
- a VSCode extension for Typst, see [Tinymist VSCode Extension](./editors/vscode/).
- an analyzing library for Typst, see [tinymist-query](/crates/tinymist-query/).
- a CLI for Typst, see [tinymist](/crates/tinymist/).
- which provides a language server for Typst, see [Language Features](https://myriad-dreamin.github.io/tinymist/feature/language.html).
- which provides a preview server for Typst, see [Preview Feature](https://myriad-dreamin.github.io/tinymist/feature/preview.html).
- 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".
- The “semantic highlighting” is supplementary to [“syntax highlighting”](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide).
- [Code actions](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#provide-code-actions)
- Also known as “quick fixes” or “refactorings”.
- [Formatting (Reformatting)](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#format-source-code-in-an-editor)
- Provide the user with support for formatting whole documents, using [typstfmt](https://github.com/astrale-sharp/typstfmt) or [typstyle](https://github.com/Enter-tainer/typstyle).
- [Document highlight](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#highlight-all-occurrences-of-a-symbol-in-a-document)
- Highlight all break points in a loop context.
- (Todo) Highlight all exit points in a function context.
- (Todo) Highlight all captures in a closure context.
- (Todo) Highlight all occurrences of a symbol in a document.
- [Document links](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentLink)
- Renders path or link references in the document, such as `image("path.png")` or `bibliography(style: "path.csl")`.
- [Document symbols](https://code.visualstudio.com/docs/getstarted/userinterface#_outline-view)
- Also known as "document outline" or "table of contents" **in Typst**.
- 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 definitions](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".
- Right-click on a symbol and select “Go to Definition”.
- Or ctrl+click on a symbol.
- [References](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#find-all-references-to-a-symbol)
- Right-click on a symbol and select “Go to References” or “Find References”.
- Or ctrl+click on a symbol.
<!-- - [Goto declarations](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".
- Also known as “hovering tooltip”.
- Render docs according to [tidy](https://github.com/Mc-Zen/tidy) style.
- [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.
- [Color Provider](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#show-color-decorators)
- View all inlay colorful label for color literals in your document.
- Change the color literals value by a color picker or its code presentation.
- [Code Lens](https://code.visualstudio.com/blogs/2017/02/12/code-lens-roundup)
- Should give contextual buttons along with code. For example, a button for exporting your document to various formats at the start of the document.
- [Rename symbols](https://code.visualstudio.com/api/language-extensions/programmatic-language-features#rename-symbols)
- [Rename symbols and embedded paths](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)
- [Code Action](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-code-actions)
- Increasing/Decreasing heading levels.
- Turn equation into “inline”, “block” or “multiple-line block” styles.
- [experimental/onEnter](https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#on-enter)
- <kbd>
Enter
</kbd> inside triple-slash comments automatically inserts `///`
- <kbd>
Enter
</kbd> in the middle or after a trailing space in `//` inserts `//`
- <kbd>
Enter
</kbd> inside `//!` doc comments automatically inserts `//!`
- <kbd>
Enter
</kbd> inside equation markups automatically inserts indents.
Extra features:
- Compiles to PDF on save (configurable to as-you-type, or other options)
- Compiles to PDF on save (configurable to as-you-type, or other options). Check [Docs: Exporting Documents](https://myriad-dreamin.github.io/tinymist/feature/export.html).
- Also compiles to SVG, PNG, HTML, Markdown, Text, and other formats by commands, vscode tasks, or code lenses.
- Provides test, benchmark, coverage collecting on documents and modules. Check [Docs: Testing Features](https://myriad-dreamin.github.io/tinymist/feature/testing.html).
- Provides builtin linting. Check [Docs: Linting Features](https://myriad-dreamin.github.io/tinymist/feature/linting.html).
- Provides a status bar item to show the current documents compilation status and words count.
- [Editor tools](/tools/editor-tools/):
- View a list of templates in template gallery. (`tinymist.showTemplateGallery`)
- Click a button in template gallery to initialize a new project with a template. (`tinymist.initTemplate` and `tinymist.initTemplateInPlace`)
- Trace execution in current document (`tinymist.profileCurrentFile`).
## Versioning and Release Cycle
Tinymists versions follow the [Semantic Versioning](https://semver.org/) scheme, in format of `MAJOR.MINOR.PATCH`. Besides, tinymist follows special rules for the version number:
- If a version is suffixed with `-rcN` (<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/images/introduction/frame_0.svg" /><img src="assets/images/introduction/frame_1.svg" alt="typst-frame" />
</picture>), e.g. `0.11.0-rc1` and `0.12.1-rc1`, it means this version is a release candidate. It is used to test publish script and E2E functionalities. These versions will not be published to the marketplace.
- If the `PATCH` number is odd, e.g. `0.11.1` and `0.12.3`, it means this version is a nightly release. The nightly release will use both [tinymist](https://github.com/Myriad-Dreamin/tinymist/tree/main) and [typst](https://github.com/typst/typst/tree/main) at **main branch**. They will be published as prerelease version to the marketplace. Note that in nightly releases, we change `#sys.version` to the next minor release to help develop documents with nightly features. For example, in tinymist nightly v0.12.1 or v0.12.3, the `#sys.version` is changed to `version(0, 13, 0)`.
- Otherwise, if the `PATCH` number is even, e.g. `0.11.0` and `0.12.2`, it means this version is a regular release. The regular release will always use the recent stable version of tinymist and typst.
The release cycle is as follows:
- If there is a typst version update, a new major or minor version will be released intermediately. This means tinymist will always align the minor version with typst.
- If there is at least a bug or feature added this week, a new patch version will be released.
## Installation
Follow the instructions to enable tinymist in your favorite editor.
+ [VSCode](./editors/vscode/README.md)
- [VS Cod(e,ium)](https://myriad-dreamin.github.io/tinymist/frontend/vscode.html)
- [Neovim](https://myriad-dreamin.github.io/tinymist/frontend/neovim.html)
- [Emacs](https://myriad-dreamin.github.io/tinymist/frontend/emacs.html)
- [Sublime Text](https://myriad-dreamin.github.io/tinymist/frontend/sublime-text.html)
- [Helix](https://myriad-dreamin.github.io/tinymist/frontend/helix.html)
- [Zed](https://myriad-dreamin.github.io/tinymist/frontend/zed.html)
## Installing Regular/Nightly Prebuilds from GitHub
Note: if you are not knowing what is a regular/nightly release, please dont follow this section.
Besides published releases specific for each editors, you can also download the latest regular/nightly prebuilts from GitHub and install them manually.
- Regular prebuilts can be found in [GitHub Releases](https://github.com/Myriad-Dreamin/tinymist/releases).
- Nightly prebuilts can be found in [GitHub Actions](https://github.com/Myriad-Dreamin/tinymist/actions).
- (Suggested) Use the [tinymist-nightly-installer](https://github.com/hongjr03/tinymist-nightly-installer) to install the nightly prebuilts automatically.
- Unix (Bash):
```bash
curl -sSL https://github.com/hongjr03/tinymist-nightly-installer/releases/latest/download/run.sh | bash
```
- Windows (PowerShell):
```bash
iwr https://github.com/hongjr03/tinymist-nightly-installer/releases/latest/download/run.ps1 -UseBasicParsing | iex
```
- The prebuilts for other revisions can also be found manually. For example, if you are seeking a nightly release for the featured [PR: build: bump version to 0.11.17-rc1](https://github.com/Myriad-Dreamin/tinymist/pull/468), you could click and go to the [action page](https://github.com/Myriad-Dreamin/tinymist/actions/runs/10120639466) run for the related commits and download the artifacts.
To install extension file (the file with `.vsix` extension) manually, please <kbd>
Ctrl+Shift+X
</kbd> in the editor window and drop the downloaded vsix file into the opened extensions view.
## Documentation
See [Online Documentation](https://myriad-dreamin.github.io/tinymist/).
## Packaging
Stable Channel:
<a href="https://repology.org/project/tinymist/versions" target="_blank" rel="noopener noreferrer">
<img src="https://repology.org/badge/vertical-allrepos/tinymist.svg" alt="Packaging status" style="max-width: 100%; height: auto;" />
</a>
Nightly Channel:
<a href="https://repology.org/project/tinymist-nightly/versions" target="_blank" rel="noopener noreferrer">
<img src="https://repology.org/badge/vertical-allrepos/tinymist-nightly.svg" alt="Packaging status" style="max-width: 100%; height: auto;" />
</a>
## Roadmap
### Short Terms
To encourage contributions, we create many [Pull Requests](https://github.com/Myriad-Dreamin/tinymist/pulls) in draft to navigate short-term plans. They give you a hint of what or where to start in this large repository.
### Long Terms
We are planning to implement the following features in typst v0.14.0 or spare time in weekend:
- Type checking: complete the type checker.
- Periscope renderer: It is disabled since vscode reject to render SVGs containing foreignObjects.
- Inlay hint: It is disabled _by default_ because of performance issues.
- Find references of dictionary fields and named function arguments.
- Improve symbol views appearance.
- Improve package view.
- Navigate to symbols by clicking on the symbol name in the view.
- Automatically locate the symbol item in the view when viewing local documentation.
- Remember the recently invoked package commands, e.g. “Open Docs of @preview/cetz:0.3.1”, “Open directory of @preview/touying:0.5.3”.
- Improve label view.
- Group labels.
- Search labels.
- Keep (persist) group preferences.
- Improve Typst Preview.
- Pin drop-down: Set the file to preview in the drop-down for clients that doesnt support passing arguments to the preview command.
- Render in web worker (another thread) to reduce overhead on the electrons main thread.
- Spell checking: There is already a branch but no suitable (default) spell checking library is found.
- [typos](https://github.com/crate-ci/typos) is great for typst. [harper](https://github.com/Automattic/harper) looks promise.
If you are interested by any above features, please feel free to send Issues to discuss or PRs to implement to [GitHub.](https://github.com/Myriad-Dreamin/tinymist)
## Contributing
Please read the [CONTRIBUTING.md](CONTRIBUTING.md) file for contribution guidelines.
## Sponsoring
Tinymist thrives on community love and remains proudly independent. While we dont accept direct project funding, we warmly welcome support for our maintainers personal efforts. Please go to [Maintainers Page](/MAINTAINERS.md) and [Contributors Page](https://github.com/Myriad-Dreamin/tinymist/graphs/contributors) and find their personal pages for more information. It is also welcomed to directly ask questions about sponsoring on the [GitHub Issues](https://github.com/Myriad-Dreamin/tinymist/issues/new).
## Acknowledgements
- Partially code is inherited from [typst-lsp](https://github.com/nvarner/typst-lsp)
- The [integrating](/editors/vscode#symbol-view) **offline** handwritten-stroke recognizer is powered by [Detypify](https://detypify.quarticcat.com/).
- The [integrating](/editors/vscode#preview-command) preview service is powered by [typst-preview](https://github.com/Enter-tainer/typst-preview).
- The [integrating](/editors/vscode#managing-local-packages) local package management functions are adopted from [vscode-typst-sync](https://github.com/OrangeX4/vscode-typst-sync).

4
_typos.toml Normal file
View file

@ -0,0 +1,4 @@
files.extend-exclude = [
"locales/**/*",
"editors/vscode/e2e-workspaces/ieee-paper/ieee-tex.typ",
]

1
assets/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
fonts

View file

@ -0,0 +1,30 @@
<svg class="typst-doc" viewBox="0 0 28.796833333333332 7.171500000000001" width="28.796833333333332pt" height="7.171500000000001pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:h5="http://www.w3.org/1999/xhtml">
<g>
<g transform="translate(0 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#gE8D41A7B821A6DA6449385730041271C" x="0" fill="#f0f6fc" fill-rule="nonzero"/>
</g>
</g>
<g transform="translate(12.461166666666667 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#g4026F2AE0915FEFF1AFA11899F67637E" x="0" fill="#f0f6fc" fill-rule="nonzero"/>
</g>
</g>
<g transform="translate(23.546833333333332 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#g5C0D1D2E151935F3439EF1D4CB39DF87" x="0" fill="#f0f6fc" fill-rule="nonzero"/>
</g>
</g>
</g>
<defs id="glyph">
<symbol id="gE8D41A7B821A6DA6449385730041271C" overflow="visible">
<path d="M 9.072 7.1714997 C 8.872499 7.1714997 8.221499 7.14 8.022 7.14 C 7.8224998 7.14 7.161 7.1714997 6.9614997 7.1714997 C 6.804 7.1714997 6.7304997 7.0875 6.7304997 6.9195 C 6.7304997 6.825 6.804 6.7725 6.9614997 6.762 C 7.4024997 6.762 7.6229997 6.6254997 7.6229997 6.3525 C 7.6229997 6.2894998 7.6124997 6.216 7.6019998 6.1425 L 6.468 1.6485 L 4.2105 6.9509997 C 4.1265 7.1505 4.1054997 7.1714997 3.843 7.1714997 L 2.4465 7.1714997 C 2.1945 7.1714997 2.1 7.1505 2.1 6.9195 C 2.1 6.8145 2.2154999 6.762 2.4359999 6.762 C 2.8769999 6.762 3.0974998 6.7515 3.108 6.72 L 1.7114999 1.155 C 1.617 0.74549997 1.3755 0.5145 0.9975 0.44099998 C 0.7245 0.4095 0.4095 0.4515 0.4095 0.1575 C 0.4095 0.0525 0.4725 0 0.588 0 C 0.777 0 1.428 0.0315 1.6274999 0.0315 C 1.827 0.0315 2.499 0 2.6985 0 C 2.856 0 2.9294999 0.084 2.9294999 0.252 C 2.9294999 0.3465 2.8455 0.399 2.6775 0.4095 C 2.247 0.42 2.037 0.5565 2.037 0.819 C 2.037 0.8715 2.0475 0.945 2.0685 1.05 L 3.4229999 6.4154997 L 6.048 0.22049999 C 6.111 0.0735 6.1949997 0 6.2894998 0 C 6.384 0 6.447 0.084 6.489 0.252 L 7.9484997 6.027 C 8.085 6.5625 8.379 6.7515 9.03 6.762 C 9.177 6.7725 9.2505 6.8564997 9.2505 7.0245 C 9.219 7.119 9.2085 7.1714997 9.072 7.1714997 Z "/>
</symbol>
<symbol id="g4026F2AE0915FEFF1AFA11899F67637E" overflow="visible">
<path d="M 7.203 2.3834999 C 7.308 2.4359999 7.3605 2.5095 7.3605 2.625 C 7.3605 2.7405 7.308 2.814 7.203 2.8665 L 1.176 5.7225 C 1.1445 5.733 1.1025 5.7434998 1.0605 5.7434998 C 0.8925 5.7434998 0.8085 5.6595 0.8085 5.481 C 0.8085 5.3865 0.861 5.3129997 0.9555 5.271 L 6.5625 2.625 L 0.9555 -0.021 C 0.861 -0.063 0.8085 -0.1365 0.8085 -0.23099999 C 0.8085 -0.4095 0.8925 -0.4935 1.0605 -0.4935 C 1.1025 -0.4935 1.1445 -0.48299998 1.176 -0.4725 Z "/>
</symbol>
<symbol id="g5C0D1D2E151935F3439EF1D4CB39DF87" overflow="visible">
<path d="M 2.6145 -0.23099999 C 4.095 -0.23099999 4.83 0.96599996 4.83 3.36 C 4.83 4.9665 4.494 6.0375 3.8325 6.5625 C 3.465 6.8459997 3.0555 6.993 2.625 6.993 C 1.1445 6.993 0.4095 5.7855 0.4095 3.36 C 0.4095 1.428 0.92399997 -0.23099999 2.6145 -0.23099999 Z M 3.7905 5.502 C 3.8639998 5.1345 3.8955 4.4625 3.8955 3.486 C 3.8955 2.52 3.8535 1.806 3.78 1.344 C 3.6434999 0.504 3.2549999 0.084 2.6145 0.084 C 2.373 0.084 2.1315 0.1785 1.911 0.357 C 1.6274999 0.5985 1.4595 1.092 1.386 1.8479999 C 1.3544999 2.1104999 1.344 2.6564999 1.344 3.486 C 1.344 4.3995 1.3755 5.04 1.428 5.3865 C 1.5225 5.9639997 1.7114999 6.3315 2.0055 6.489 C 2.2365 6.615 2.4359999 6.678 2.6145 6.678 C 3.297 6.678 3.675 6.1215 3.7905 5.502 Z "/>
</symbol>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -0,0 +1,30 @@
<svg class="typst-doc" viewBox="0 0 28.796833333333332 7.171500000000001" width="28.796833333333332pt" height="7.171500000000001pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:h5="http://www.w3.org/1999/xhtml">
<g>
<g transform="translate(0 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#gE8D41A7B821A6DA6449385730041271C" x="0" fill="#262625" fill-rule="nonzero"/>
</g>
</g>
<g transform="translate(12.461166666666667 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#g4026F2AE0915FEFF1AFA11899F67637E" x="0" fill="#262625" fill-rule="nonzero"/>
</g>
</g>
<g transform="translate(23.546833333333332 7.171500000000001)">
<g class="typst-text" transform="scale(1, -1)">
<use xlink:href="#g5C0D1D2E151935F3439EF1D4CB39DF87" x="0" fill="#262625" fill-rule="nonzero"/>
</g>
</g>
</g>
<defs id="glyph">
<symbol id="gE8D41A7B821A6DA6449385730041271C" overflow="visible">
<path d="M 9.072 7.1714997 C 8.872499 7.1714997 8.221499 7.14 8.022 7.14 C 7.8224998 7.14 7.161 7.1714997 6.9614997 7.1714997 C 6.804 7.1714997 6.7304997 7.0875 6.7304997 6.9195 C 6.7304997 6.825 6.804 6.7725 6.9614997 6.762 C 7.4024997 6.762 7.6229997 6.6254997 7.6229997 6.3525 C 7.6229997 6.2894998 7.6124997 6.216 7.6019998 6.1425 L 6.468 1.6485 L 4.2105 6.9509997 C 4.1265 7.1505 4.1054997 7.1714997 3.843 7.1714997 L 2.4465 7.1714997 C 2.1945 7.1714997 2.1 7.1505 2.1 6.9195 C 2.1 6.8145 2.2154999 6.762 2.4359999 6.762 C 2.8769999 6.762 3.0974998 6.7515 3.108 6.72 L 1.7114999 1.155 C 1.617 0.74549997 1.3755 0.5145 0.9975 0.44099998 C 0.7245 0.4095 0.4095 0.4515 0.4095 0.1575 C 0.4095 0.0525 0.4725 0 0.588 0 C 0.777 0 1.428 0.0315 1.6274999 0.0315 C 1.827 0.0315 2.499 0 2.6985 0 C 2.856 0 2.9294999 0.084 2.9294999 0.252 C 2.9294999 0.3465 2.8455 0.399 2.6775 0.4095 C 2.247 0.42 2.037 0.5565 2.037 0.819 C 2.037 0.8715 2.0475 0.945 2.0685 1.05 L 3.4229999 6.4154997 L 6.048 0.22049999 C 6.111 0.0735 6.1949997 0 6.2894998 0 C 6.384 0 6.447 0.084 6.489 0.252 L 7.9484997 6.027 C 8.085 6.5625 8.379 6.7515 9.03 6.762 C 9.177 6.7725 9.2505 6.8564997 9.2505 7.0245 C 9.219 7.119 9.2085 7.1714997 9.072 7.1714997 Z "/>
</symbol>
<symbol id="g4026F2AE0915FEFF1AFA11899F67637E" overflow="visible">
<path d="M 7.203 2.3834999 C 7.308 2.4359999 7.3605 2.5095 7.3605 2.625 C 7.3605 2.7405 7.308 2.814 7.203 2.8665 L 1.176 5.7225 C 1.1445 5.733 1.1025 5.7434998 1.0605 5.7434998 C 0.8925 5.7434998 0.8085 5.6595 0.8085 5.481 C 0.8085 5.3865 0.861 5.3129997 0.9555 5.271 L 6.5625 2.625 L 0.9555 -0.021 C 0.861 -0.063 0.8085 -0.1365 0.8085 -0.23099999 C 0.8085 -0.4095 0.8925 -0.4935 1.0605 -0.4935 C 1.1025 -0.4935 1.1445 -0.48299998 1.176 -0.4725 Z "/>
</symbol>
<symbol id="g5C0D1D2E151935F3439EF1D4CB39DF87" overflow="visible">
<path d="M 2.6145 -0.23099999 C 4.095 -0.23099999 4.83 0.96599996 4.83 3.36 C 4.83 4.9665 4.494 6.0375 3.8325 6.5625 C 3.465 6.8459997 3.0555 6.993 2.625 6.993 C 1.1445 6.993 0.4095 5.7855 0.4095 3.36 C 0.4095 1.428 0.92399997 -0.23099999 2.6145 -0.23099999 Z M 3.7905 5.502 C 3.8639998 5.1345 3.8955 4.4625 3.8955 3.486 C 3.8955 2.52 3.8535 1.806 3.78 1.344 C 3.6434999 0.504 3.2549999 0.084 2.6145 0.084 C 2.373 0.084 2.1315 0.1785 1.911 0.357 C 1.6274999 0.5985 1.4595 1.092 1.386 1.8479999 C 1.3544999 2.1104999 1.344 2.6564999 1.344 3.486 C 1.344 4.3995 1.3755 5.04 1.428 5.3865 C 1.5225 5.9639997 1.7114999 6.3315 2.0055 6.489 C 2.2365 6.615 2.4359999 6.678 2.6145 6.678 C 3.297 6.678 3.675 6.1215 3.7905 5.502 Z "/>
</symbol>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -0,0 +1,21 @@
[package]
name = "tinymist-bench-font-load"
description = "Font loading bench for tinymist."
authors.workspace = true
version.workspace = true
license.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true
[dependencies]
divan.workspace = true
tinymist.workspace = true
[[bench]]
name = "tinymist-bench-font-load"
path = "src/load.rs"
harness = false
[features]
the-thesis = []

View file

@ -0,0 +1,39 @@
use std::sync::Arc;
use tinymist::{Config, project::LspUniverseBuilder};
fn main() {
// initialize global variables
// Run registered benchmarks.
divan::main();
}
// Checks font loading performance of embedded fonts
#[divan::bench]
fn load_embedded() {
let _embedded_fonts = Arc::new(LspUniverseBuilder::only_embedded_fonts().unwrap());
}
// Checks font loading performance of system fonts
#[divan::bench]
fn load_system() {
let config = Config::default();
let _fonts = config.fonts();
}
/*
Without Parallelization
Timer precision: 17 ns
tinymist_bench_font_load fastest slowest median mean samples iters
load_embedded 1.167 ms 1.697 ms 1.176 ms 1.188 ms 100 100
load_system 111.8 ms 123 ms 113.6 ms 114.3 ms 100 100
With Parallelization
Timer precision: 17 ns
tinymist_bench_font_load fastest slowest median mean samples iters
load_embedded 130.8 µs 1.164 ms 157 µs 170.3 µs 100 100
load_system 14.44 ms 18.22 ms 15.37 ms 15.54 ms 100 100
*/

39
biome.json Normal file
View file

@ -0,0 +1,39 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.5/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"bracketSpacing": true,
"quoteStyle": "double",
"semicolons": "always",
"trailingCommas": "all"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

View file

@ -0,0 +1,6 @@
tinymist-*.vsix
*.log
test-dist
.vscode-test
coverage
out/

View file

@ -0,0 +1,12 @@
**
!out/tinymist-docs.pdf
!out/extension.js
!out/extension.web.js
!out/server.js
!package.json
!package-lock.json
!icons/**
!syntaxes/**
!README.md
!LICENSE
!CHANGELOG.md

View file

@ -0,0 +1,11 @@
# Change Log
All notable changes to the "tinymist-html-ext" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
The changelog lines unspecified with authors are all written by the @Myriad-Dreamin.
## v0.13.0 - [2025-02-22]
Initial release of the extension.

View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023-2025 Myriad Dreamin, Nathan Varner
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View file

@ -0,0 +1,16 @@
import { build } from "esbuild";
import * as fs from "fs";
if (!fs.existsSync("./out/extension.web.js")) {
fs.mkdirSync("./out", { recursive: true });
fs.writeFileSync("./out/extension.web.js", "");
}
build({
entryPoints: ["./src/extension.mts", "./src/server.mts"],
bundle: true,
outdir: "./out",
external: ["vscode"],
format: "cjs",
platform: "node",
}).catch(() => process.exit(1));

View file

@ -0,0 +1,29 @@
import { build } from "esbuild";
import { polyfillNode } from "esbuild-plugin-polyfill-node";
import * as fs from "fs";
if (!fs.existsSync("./out/extension.js")) {
fs.mkdirSync("./out", { recursive: true });
fs.writeFileSync("./out/extension.js", "");
}
build({
entryPoints: ["./src/extension.web.ts"],
bundle: true,
outfile: "./out/extension.web.js",
external: ["vscode"],
format: "cjs",
target: ["es2020", "chrome61", "edge18", "firefox60"],
// Node.js global to browser globalThis
define: {
global: "globalThis",
},
plugins: [
polyfillNode({
polyfills: {
crypto: "empty",
},
// Options (optional)
}),
],
}).catch(() => process.exit(1));

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,80 @@
{
"name": "tinymist-vscode-html",
"version": "0.14.6-rc1",
"description": "Extending Typst with HTML features",
"keywords": [
"html",
"typst",
"language-server"
],
"categories": [
"Programming Languages"
],
"repository": {
"type": "git",
"url": "https://github.com/Myriad-Dreamin/tinymist.git"
},
"displayName": "Tinymist Typst HTML",
"author": "Myriad-Dreamin",
"contributors": [
"Myriad-Dreamin"
],
"publisher": "myriad-dreamin",
"license": "Apache-2.0",
"engines": {
"vscode": "^1.97.0"
},
"activationEvents": [
"onLanguage:typst"
],
"main": "./out/extension.js",
"browser": "./out/extension.web.js",
"icon": "./icons/ti-white.png",
"contributes": {
"commands": [
{
"command": "tinymist.showHtmlExtensionLog",
"title": "Show Log of the HTML extension",
"description": "Show log of the tinymist HTML extension",
"category": "Typst",
"icon": "$(list-flat)"
}
]
},
"scripts": {
"build-web-base": "node esbuild.web.mjs",
"build-system-base": "node esbuild.system.mjs",
"build-base": "yarn run build-web-base && yarn run build-system-base",
"compile-shared": "node scripts/check-version.mjs && node scripts/postinstall.cjs",
"compile:web": "yarn run build-web-base -- --minify && yarn run compile-shared",
"compile:system": "yarn run build-system-base -- --minify && yarn run compile-shared",
"package": "npx @vscode/vsce package --yarn",
"compile": "yarn run compile:system",
"watch": "yarn run build-system-base -- --sourcemap --watch",
"check": "tsc --noEmit",
"format-check": "prettier --check .",
"format": "prettier --write .",
"test": "rimraf test-dist/ && tsc -p tsconfig.test.json && node test-dist/test/runTests.js"
},
"dependencies": {
"css": "^3.0.0",
"esbuild-plugin-polyfill-node": "^0.3.0",
"lodash.flow": "^3.5.0",
"vscode-languageclient": "^9.0.0",
"vscode-languageserver": "^9.0.0",
"xxhashjs": "^0.2.2"
},
"devDependencies": {
"@types/chai": "^5.0.1",
"@types/css": "^0.0.38",
"@types/mocha": "^10.0.1",
"@types/node": "^22.13.4",
"@types/vscode": "^1.97.0",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.22.0",
"chai": "^5.1.1",
"mocha": "^10.2.0",
"ovsx": "^0.8.3",
"vscode-html-languageservice": "^5.3.1"
}
}

View file

@ -0,0 +1,15 @@
import { readFileSync } from "fs";
function check() {
const cargoToml = readFileSync("../../../../Cargo.toml", "utf8");
const cargoVersion = cargoToml.match(/version = "(.*?)"/)[1];
const pkgVersion = JSON.parse(readFileSync("package.json", "utf8")).version;
if (cargoVersion !== pkgVersion) {
throw new Error(
`Version mismatch: ${cargoVersion} (in Cargo.toml) !== ${pkgVersion} (in package.json)`,
);
}
}
check();

View file

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2023 Anders Ellenshøj Andersen <andersa@atlab.dk>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,35 @@
let XXH = require("xxhashjs").h32;
export function flatten<T>(nestedArray: T[][]): T[] {
if (nestedArray.length === 0) {
throw new RangeError("Can't flatten an empty array.");
} else {
return nestedArray.reduce((a, b) => a.concat(b));
}
}
export function distinct<T>(items: T[] | Thenable<T[]>): Thenable<T[]> {
return Promise.resolve(items).then((items) => Array.from(new Set(items)));
}
export function distinctByXXHash<T>(items: T[] | Thenable<T[]>): Thenable<T[]> {
const initialValue = {
distinctItems: <T[]>[],
hashSet: new Set(),
};
const accumulatorPromise = Promise.resolve(items).then((items) =>
items.reduce((acc, item) => {
const hash = XXH(item, 0x1337).toNumber();
if (!acc.hashSet.has(hash)) {
acc.distinctItems.push(item);
acc.hashSet.add(hash);
}
return acc;
}, initialValue),
);
return accumulatorPromise.then((accumulator) => accumulator.distinctItems);
}

View file

@ -0,0 +1,34 @@
import { workspace, window } from "vscode";
// @ts-ignore
import flow from "lodash.flow";
import uriFilesReader from "./uriFilesReader";
import { distinct, distinctByXXHash } from "./arrayUtils";
import { parseCssTexts, getCSSRules, getCSSSelectors, getCSSClasses } from "./cssUtils";
const styleSheetsReader = flow(uriFilesReader, distinctByXXHash, parseCssTexts);
const distinctCSSClassesExtractor = flow(getCSSRules, getCSSSelectors, getCSSClasses, distinct);
export default function (): Thenable<string[]> {
const startTime = process.hrtime();
return styleSheetsReader(
workspace.findFiles("**/*.css", ""),
workspace.getConfiguration("files").get("encoding", "utf8"),
).then((parseResult: any) => {
return distinctCSSClassesExtractor(parseResult.styleSheets).then((distinctCssClasses: any) => {
const elapsedTime = process.hrtime(startTime);
console.log(`Elapsed time: ${elapsedTime[0]} s ${Math.trunc(elapsedTime[1] / 1e6)} ms`);
console.log(`Files processed: ${parseResult.styleSheets.length}`);
console.log(`Skipped due to parse errors: ${parseResult.unparsable.length}`);
console.log(`CSS classes discovered: ${distinctCssClasses.length}`);
window.setStatusBarMessage(
`HTML Class Suggestions processed ${parseResult.styleSheets.length} distinct css files and discovered ${distinctCssClasses.length} css classes.`,
10000,
);
return distinctCssClasses;
});
});
}

View file

@ -0,0 +1,39 @@
"use strict";
import * as vscode from "vscode";
import aggregator from "./cssAggregator";
export class CssCompletionItemProvider {
public completionItems?: PromiseLike<vscode.CompletionItem[]>;
constructor() {
this.refreshCompletionItems();
}
// public provideCompletionItems(
// document: vscode.TextDocument,
// position: vscode.Position,
// token: vscode.CancellationToken,
// ): Thenable<vscode.CompletionItem[]> {
// if (canTriggerCompletion(document, position)) {
// return this.completionItems as PromiseLike<vscode.CompletionItem[]>;
// } else {
// return Promise.reject<vscode.CompletionItem[]>("Not inside html class attribute.");
// }
// }
public refreshCompletionItems() {
this.completionItems = aggregator().then((cssClasses) => {
const completionItems = cssClasses.map((cssClass) => {
const completionItem = new vscode.CompletionItem(cssClass);
completionItem.detail = `Insert ${cssClass}`;
completionItem.insertText = cssClass;
completionItem.kind = vscode.CompletionItemKind.Value;
// make sure our completion item group are first
completionItem.preselect = true;
return completionItem;
});
return completionItems;
});
}
}

View file

@ -0,0 +1,105 @@
import { parse, Stylesheet, Rule, Media } from "css";
import { flatten } from "./arrayUtils";
export interface CSSTextsParseResult {
styleSheets: Stylesheet[];
unparsable: string[];
}
export function parseCssTexts(
cssTexts: string[] | Thenable<string[]>,
): Thenable<CSSTextsParseResult> {
const initialValue = {
styleSheets: <Stylesheet[]>[],
unparsable: <string[]>[],
};
return Promise.resolve(cssTexts).then((cssTexts) =>
cssTexts.reduce((acc, cssText) => {
try {
acc.styleSheets.push(parse(cssText));
} catch (error) {
acc.unparsable.push(cssText);
}
return acc;
}, initialValue),
);
}
export function getCSSRules(styleSheets: Stylesheet[] | Thenable<Stylesheet[]>): Thenable<Rule[]> {
return Promise.resolve(styleSheets).then((styleSheets) =>
styleSheets.reduce((acc, styleSheet) => {
return acc.concat(findRootRules(styleSheet), findMediaRules(styleSheet));
}, [] as Rule[]),
);
}
export function getCSSSelectors(rules: Rule[] | Thenable<Rule[]>): Thenable<string[]> {
return Promise.resolve(rules).then((rules) => {
if (rules.length > 0) {
return flatten(rules.map((rule) => rule.selectors!)).filter(
(value) => value && value.length > 0,
);
} else {
return [];
}
});
}
export function getCSSClasses(selectors: string[] | Thenable<string[]>): Thenable<string[]> {
return Promise.resolve(selectors).then((selectors) =>
selectors.reduce((acc, selector) => {
const className = findClassName(selector);
if (className && className.length > 0) {
acc.push(sanitizeClassName(className));
}
return acc;
}, [] as string[]),
);
}
export function findRootRules(cssAST: Stylesheet): Rule[] {
// @ts-ignore
return cssAST.stylesheet!.rules.filter((node) => (<Rule>node).type === "rule");
}
export function findMediaRules(cssAST: Stylesheet): Rule[] {
let mediaNodes = <Rule[]>cssAST.stylesheet!.rules.filter((node) => {
// @ts-ignore
return (<Rule>node).type === "media";
});
if (mediaNodes.length > 0) {
// @ts-ignore
return flatten(mediaNodes.map((node) => (<Media>node).rules!));
} else {
return [];
}
}
export function findClassName(selector: string): string {
let classNameStartIndex = selector.lastIndexOf(".");
if (classNameStartIndex >= 0) {
let classText = selector.substr(classNameStartIndex + 1);
// Search for one of ' ', '[', ':' or '>', that isn't escaped with a backslash
let classNameEndIndex = classText.search(/[^\\][\s\[:>]/);
if (classNameEndIndex >= 0) {
return classText.substr(0, classNameEndIndex + 1);
} else {
return classText;
}
} else {
return "";
}
}
export function sanitizeClassName(className: string): string {
return className.replace(/\\[!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}~]/g, (substr, ...args) => {
if (args.length === 2) {
return substr.slice(1);
} else {
return substr;
}
});
}

View file

@ -0,0 +1,23 @@
import * as path from 'path';
import { runTests } from '@vscode/test-electron';
async function main() {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
// The path to test runner
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './suite/index');
// Download VS Code, unzip it and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests', err);
process.exit(1);
}
}
main();

View file

@ -0,0 +1,38 @@
import { findClassName, sanitizeClassName } from '../../cssUtils';
import * as assert from 'assert';
suite('Test cssUtils', () => {
suite('#findClassName', () => {
test('finds \'container\' in \'.container\'', () => {
assert.equal(findClassName('.container'), 'container');
});
test('finds \'bg-warning\' in \'a.bg-warning:hover\'', () => {
assert.equal(findClassName('a.bg-warning:hover'), 'bg-warning');
});
test('finds \'u-1\\/2\' in \'.u-1\\/2\'', () => {
assert.equal(findClassName('.u-1\\/2'), 'u-1\\/2');
});
test('finds \'ratio-16\\:9\' in \'.ratio-16\\:9\'', () => {
assert.equal(findClassName('.ratio-16\\:9'), 'ratio-16\\:9');
});
test('finds \'margin\\@palm\' in \'.margin\\@palm\'', () => {
assert.equal(findClassName('.margin\\@palm'), 'margin\\@palm');
});
});
suite('#sanitizeClassName', () => {
test('sanitizes \'u-1\\/2\' to \'u-1/2\'', () =>{
assert.equal(sanitizeClassName('u-1\\/2'), 'u-1/2');
});
test('sanitizes \'ratio-16\\:9\' to \'ratio-16:9\'', () =>{
assert.equal(sanitizeClassName('ratio-16\\:9'), 'ratio-16:9');
});
test('sanitizes \'margin\\@palm\' to \'margin@palm\'', () =>{
assert.equal(sanitizeClassName('margin\\@palm'), 'margin@palm');
});
test('sanitizes \'foo-1\\/2\\@bar\' to \'foo-1/2@bar\'', () =>{
assert.equal(sanitizeClassName('foo-1\\/2\\@bar'), 'foo-1/2@bar');
});
});
});

View file

@ -0,0 +1,38 @@
import * as path from "path";
import * as Mocha from "mocha";
import * as glob from "glob";
export function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: "tdd",
color: true,
});
const testsRoot = path.resolve(__dirname, "..");
return new Promise((c, e) => {
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
console.error(err);
e(err);
}
});
});
}

View file

@ -0,0 +1,14 @@
import uriFilesReader from "../../uriFilesReader";
import * as assert from "assert";
import { Uri } from "vscode";
suite("Test uriFilesReader", () => {
test("Can't load http protocol", () => {
const httpsUri = Uri.parse("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css");
return uriFilesReader([httpsUri], "utf8").then((data: any) => {
assert(false, "Expected promise to be rejected.");
},(err: any) => {
assert(err.code === "ENOENT");
});
});
});

View file

@ -0,0 +1,16 @@
import { Uri } from "vscode";
import { readFile } from "fs";
export default (uris: Uri[]|Thenable<Uri[]>, encoding: BufferEncoding): Thenable<string[]> => {
return Promise.resolve(uris).then(uris => {
return Promise.all(uris.map(uri => new Promise<string>((resolve, reject) => {
readFile(uri.fsPath, encoding, (err, data) => {
if (err) {
reject(err);
} else {
resolve(data.toString());
}
});
})));
});
};

View file

@ -0,0 +1,224 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
interface EmbeddedRegion {
languageId: string | undefined;
start: number;
end: number;
attributeValue?: boolean;
}
enum TokenKind {
Unknown,
Colon,
String,
Identifier,
}
class BackScanner {
currentToken: TokenKind = TokenKind.Unknown;
tokenContent: string = "";
constructor(
private documentText: string,
private offset: number,
) {
this.scanBack();
}
getCurrentToken() {
return this.currentToken;
}
scanBack() {
let i = this.offset;
this.currentToken = TokenKind.Unknown;
while (i >= 0) {
const ch = this.documentText[i];
i--;
// console.log("scanBack", ch, this.currentToken, this.tokenContent);
if (this.currentToken === TokenKind.Unknown) {
if (ch === ":") {
this.currentToken = TokenKind.Colon;
this.tokenContent = ch;
break;
} else if (ch === '"') {
this.currentToken = TokenKind.String;
this.tokenContent = ch;
} else if (/[a-zA-Z0-9\-]/.test(ch)) {
this.currentToken = TokenKind.Identifier;
this.tokenContent = ch;
} else if (/\s/.test(ch)) {
// ignore
} else {
break;
}
} else if (this.currentToken === TokenKind.String) {
this.tokenContent = ch + this.tokenContent;
if (ch === '"') {
break;
}
} else if (this.currentToken === TokenKind.Identifier) {
if (/[a-zA-Z0-9\-]/.test(ch)) {
this.tokenContent = ch + this.tokenContent;
} else {
break;
}
}
}
this.offset = i;
}
}
export function isInsideClassAttribute(documentText: string, offset: number) {
console.log("isInsideClassAttribute", offset);
// string start
let start = offset - 1;
while (start >= 0) {
if (documentText[start] === '"') {
let shashCount = 0;
while (start > 0) {
if (documentText[start - 1] === "\\") {
shashCount++;
start--;
} else {
break;
}
}
if (shashCount % 2 === 0) {
break;
}
start--;
} else {
start--;
}
}
if (start >= 0 && documentText[start] === '"') {
start -= 1;
// find class attribute
const reverseScanner = new BackScanner(documentText, start);
if (reverseScanner.getCurrentToken() !== TokenKind.Colon) {
return false;
}
reverseScanner.scanBack();
if (reverseScanner.getCurrentToken() === TokenKind.Identifier) {
console.log("found class attribute", reverseScanner.tokenContent);
return reverseScanner.tokenContent === "class";
}
if (reverseScanner.getCurrentToken() === TokenKind.String) {
console.log("found class attribute", reverseScanner.tokenContent);
return reverseScanner.tokenContent === '"class"';
}
}
return false;
}
export function parseRawBlockRegion(
documentText: string,
offset: number,
): EmbeddedRegion | undefined {
let start = offset - 1;
while (start >= 0) {
if (documentText[start] === "`") {
start -= 2;
if (start < 0 || documentText.slice(start, start + 3) !== "```") {
break;
}
let languageOffset = start + 3;
let backtickStart = start;
while (backtickStart > 0 && documentText[backtickStart - 1] === "`") {
backtickStart -= 1;
}
let numOfBackticks = languageOffset - backtickStart;
let languageStart = languageOffset;
while (languageOffset < offset) {
if (/\s/.test(documentText[languageOffset])) {
break;
}
languageOffset++;
}
let languageId = documentText.slice(languageStart, languageOffset);
console.log("numOfBackticks", numOfBackticks, languageOffset, languageId);
let rawOffset = languageOffset;
let rawEnd = languageOffset;
let accumulatedBacktick = 0;
while (rawEnd < documentText.length) {
const isBacktick = documentText[rawEnd] === "`";
rawEnd++;
if (isBacktick) {
accumulatedBacktick++;
} else {
if (accumulatedBacktick >= numOfBackticks) {
break;
}
accumulatedBacktick = 0;
}
}
if (accumulatedBacktick > rawEnd) {
return;
}
rawEnd -= accumulatedBacktick;
const rawContent = documentText.slice(rawOffset, rawEnd);
console.log("raw content", languageId, rawOffset, rawEnd, rawContent);
// return [languageId, rawOffset, rawEnd];
return {
languageId,
start: rawOffset,
end: rawEnd,
};
}
start--;
}
return;
}
/**
* Extract embedded regions from a document
*
* @param documentText The content of the document
* @param regions The regions to embed
* @param langId The language id to extract
* @returns The content of the document with the regions embedded
*/
export function getVirtualContent(
documentText: string,
regions: EmbeddedRegion[],
langId: string,
): string {
// Keeps space.
let content = documentText
.split("\n")
.map((line) => {
return " ".repeat(line.length);
})
.join("\n");
regions.forEach((r) => {
if (r.languageId === langId) {
content =
content.slice(0, r.start) + documentText.slice(r.start, r.end) + content.slice(r.end);
}
});
return content;
}

View file

@ -0,0 +1,142 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as path from "path";
import * as vscode from "vscode";
import { commands, CompletionList, ExtensionContext, Uri } from "vscode";
import {
type LanguageClientOptions,
type ServerOptions,
LanguageClient,
TransportKind,
} from "vscode-languageclient/node";
import { getVirtualContent, isInsideClassAttribute, parseRawBlockRegion } from "./embeddedSupport";
import { cssActivate } from "./features/css";
let client: LanguageClient;
export function activate(context: ExtensionContext) {
const tinymistExtension = vscode.extensions.getExtension("myriad-dreamin.tinymist");
if (!tinymistExtension) {
void vscode.window.showWarningMessage(
"Tinymist HTML:\n\nTinymist LSP feature is required. Please install Tinymist Typst Extension (myriad-dreamin.tinymist).",
);
}
const provider = cssActivate(context);
// The server is implemented in node
const serverModule = context.asAbsolutePath(path.join("out", "server.js"));
// If the extension is launched in debug mode then the debug server options are used
// Otherwise the run options are used
const serverOptions: ServerOptions = {
run: { module: serverModule, transport: TransportKind.ipc },
debug: {
module: serverModule,
transport: TransportKind.ipc,
},
};
const virtualDocumentContents = new Map<string, string>();
const removeSuffix = (uri: string) => uri.replace(/\.(html|css)$/, "");
vscode.workspace.registerTextDocumentContentProvider("embedded-content", {
provideTextDocumentContent: (uri) => {
const originalUri = removeSuffix(uri.path.slice(1));
const decodedUri = decodeURIComponent(originalUri);
console.log("provideTextDocumentContent gg", uri.path, originalUri, decodedUri);
return virtualDocumentContents.get(decodedUri);
},
});
const clientOptions: LanguageClientOptions = {
documentSelector: [{ scheme: "file", language: "typst" }],
middleware: {
provideCompletionItem: async (document, position, context, token, next) => {
const res = await vscode.commands.executeCommand<
[{ mode: "math" | "markup" | "code" | "comment" | "string" | "raw" }]
>("tinymist.interactCodeContext", {
textDocument: {
uri: document.uri.toString(),
},
query: [
{
kind: "modeAt",
position: {
line: position.line,
character: position.character,
},
},
],
});
const inString = res[0]?.mode === "string";
const inRaw = res[0]?.mode === "raw";
// If completes the content of a `class` attribute, completes classes found in the css
// files.
if (inString && isInsideClassAttribute(document.getText(), document.offsetAt(position))) {
return provider.completionItems;
}
if (!inRaw) {
return await next(document, position, context, token);
}
// If not in `<style>`, do not perform request forwarding
const virtualContent = parseRawBlockRegion(document.getText(), document.offsetAt(position));
if (!virtualContent) {
return await next(document, position, context, token);
}
const langId = virtualContent.languageId;
if (langId !== "html" && langId !== "css") {
return await next(document, position, context, token);
}
const originalUri = document.uri.toString(true);
virtualDocumentContents.set(
originalUri,
getVirtualContent(document.getText(), [virtualContent], langId!),
);
const vdocUriString = `embedded-content://${langId}/${encodeURIComponent(originalUri)}.${langId}`;
const vdocUri = Uri.parse(vdocUriString);
return await commands.executeCommand<CompletionList>(
"vscode.executeCompletionItemProvider",
vdocUri,
position,
context.triggerCharacter,
);
},
},
};
// Create the language client and start the client.
client = new LanguageClient(
"TinymistTypstHTMLExtension",
"Tinymist Typst HTML Extension",
serverOptions,
clientOptions,
);
context.subscriptions.push(
vscode.commands.registerCommand("tinymist-html-ext.showLog", () => {
client.outputChannel?.show();
}),
);
// Start the client. This will also launch the server
client.start();
}
export function deactivate(): Thenable<void> | undefined {
if (!client) {
return undefined;
}
return client.stop();
}

View file

@ -0,0 +1,16 @@
import * as vscode from "vscode";
import { CssCompletionItemProvider } from "../css/cssCompletionItemProvider";
export function cssActivate(context: vscode.ExtensionContext) {
let provider = new CssCompletionItemProvider();
context.subscriptions.push(
vscode.workspace.onDidSaveTextDocument((e) => {
if (e.languageId === "css") {
provider.refreshCompletionItems();
}
}),
);
return provider;
}

View file

@ -0,0 +1,62 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { getLanguageService } from "vscode-html-languageservice/lib/esm/htmlLanguageService";
import {
createConnection,
InitializeParams,
ProposedFeatures,
TextDocuments,
TextDocumentSyncKind,
} from "vscode-languageserver/node";
import { TextDocument } from "vscode-languageserver-textdocument";
// Create a connection for the server. The connection uses Node's IPC as a transport.
// Also include all preview / proposed LSP features.
const connection = createConnection(ProposedFeatures.all);
// Create a simple text document manager. The text document manager
// supports full document sync only
const documents = new TextDocuments(TextDocument);
const htmlLanguageService = getLanguageService();
connection.onInitialize((_params: InitializeParams) => {
console.log("initialize server");
return {
capabilities: {
textDocumentSync: TextDocumentSyncKind.Full,
// Tell the client that the server supports code completion
completionProvider: {
triggerCharacters: [
..."abcdefghijklmnopqrstuvwxyz".split(""),
..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),
],
resolveProvider: false,
},
},
};
});
connection.onCompletion(async (textDocumentPosition, _token) => {
console.log(
"provideCompletionItem server",
textDocumentPosition.textDocument.uri,
textDocumentPosition.position,
);
const document = documents.get(textDocumentPosition.textDocument.uri);
if (!document) {
return null;
}
return htmlLanguageService.doComplete(
document,
textDocumentPosition.position,
htmlLanguageService.parseHTMLDocument(document),
);
});
documents.listen(connection);
connection.listen();

View file

@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"types": ["mocha", "chai", "node"],
"target": "es2020",
"lib": ["es2020"],
"outDir": "out",
"rootDir": "src",
"sourceMap": true,
"strict": true
},
"include": ["src", "scripts"],
"exclude": ["node_modules/*", "../../node_modules/*"]
}

View file

@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "test-dist"
},
"include": ["src/test"],
"exclude": ["node_modules"]
}

120
contrib/nix/dev/flake.nix Normal file
View file

@ -0,0 +1,120 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-manifest = {
url = "https://static.rust-lang.org/dist/channel-rust-1.88.0.toml";
flake = false;
};
};
outputs = inputs @ { self, flake-parts, nixpkgs, fenix, rust-manifest, }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = {config, lib, pkgs, system, ...}:
let
rust-toolchain = (fenix.packages.${system}.fromManifestFile rust-manifest).defaultToolchain;
tinymist = (pkgs.makeRustPlatform {
cargo = rust-toolchain;
rustc = rust-toolchain;
}).buildRustPackage (finalAttrs: {
pname = "tinymist";
# Please update the corresponding vscode extension when updating
# this derivation.
version = "0.14.6-rc1";
src = pkgs.lib.cleanSource ../../..;
useFetchCargoVendor = true;
cargoHash = "sha256-IyGYBbb8ilK+8fsFAm1N2A0Cw0qrbTqG20TgQs+1yaA=";
nativeBuildInputs = [
pkgs.installShellFiles
pkgs.pkg-config
];
checkFlags = [
"--skip=e2e"
# Require internet access
"--skip=docs::package::tests::cetz"
"--skip=docs::package::tests::fletcher"
"--skip=docs::package::tests::tidy"
"--skip=docs::package::tests::touying"
# Tests are flaky for unclear reasons since the 0.12.3 release
# Reported upstream: https://github.com/Myriad-Dreamin/tinymist/issues/868
"--skip=analysis::expr_tests::scope"
"--skip=analysis::post_type_check_tests::test"
"--skip=analysis::type_check_tests::test"
"--skip=completion::tests::test_pkgs"
"--skip=folding_range::tests::test"
"--skip=goto_definition::tests::test"
"--skip=hover::tests::test"
"--skip=inlay_hint::tests::smart"
"--skip=prepare_rename::tests::prepare"
"--skip=references::tests::test"
"--skip=rename::tests::test"
"--skip=semantic_tokens_full::tests::test"
];
postInstall = lib.optionalString (pkgs.stdenv.hostPlatform.emulatorAvailable pkgs.buildPackages) (
let
emulator = pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages;
in
''
installShellCompletion --cmd tinymist \
--bash <(${emulator} $out/bin/tinymist completion bash) \
--fish <(${emulator} $out/bin/tinymist completion fish) \
--zsh <(${emulator} $out/bin/tinymist completion zsh)
''
);
nativeInstallCheckInputs = [
pkgs.versionCheckHook
];
versionCheckProgramArg = "-V";
doInstallCheck = true;
meta = {
description = "Tinymist is an integrated language service for Typst";
homepage = "https://github.com/Myriad-Dreamin/tinymist";
changelog = "https://github.com/Myriad-Dreamin/tinymist/blob/v${finalAttrs.version}/editors/vscode/CHANGELOG.md";
license = lib.licenses.asl20;
mainProgram = "tinymist";
maintainers = with lib.maintainers; [
GaetanLepage
lampros
];
};
});
in {
# export the project devshell as the default devshell
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
rust-analyzer
nodejs_24
(yarn.override { nodejs = nodejs_24; })
];
shellHook = ''
echo "Docs: docs/tinymist/nix.typ."
'';
};
# Developing neovim integration requires a fresh tinymist binary
devShells.neovim = pkgs.mkShell {
buildInputs = [
tinymist
];
shellHook = ''
echo "Docs: docs/tinymist/nix.typ."
'';
};
};
};
}

View file

@ -0,0 +1,23 @@
# https://wiki.nixos.org/wiki/Flakes
{
description = "A flake configuration to use tinymist CLI from unstable nixpkgs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = with pkgs; [
tinymist
];
shellHook = ''
echo "Got tinymist from nixpkgs unstable channel"
'';
};
};
}

View file

@ -0,0 +1,5 @@
out
dist
node_modules
.vscode-test/
*.vsix

View file

@ -0,0 +1,11 @@
node_modules
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts

View file

@ -0,0 +1 @@
--ignore-engines true

View file

@ -0,0 +1,368 @@
# Change Log
Mirroring from [Tinymist Changelog](https://github.com/Myriad-Dreamin/tinymist/blob/main/editors/vscode/CHANGELOG.md)
## v0.11.14 - [2024-07-07]
## Compiler
This bug is introduced by [Preparing for parallelizing lsp requests](https://github.com/Myriad-Dreamin/tinymist/pull/342).
* (Fix) Lsp should respond errors at tail in https://github.com/Myriad-Dreamin/tinymist/pull/367
### Commands/Tools
* Supported single-task preview commands in https://github.com/Myriad-Dreamin/tinymist/pull/364, https://github.com/Myriad-Dreamin/tinymist/pull/368, https://github.com/Myriad-Dreamin/tinymist/pull/370, and https://github.com/Myriad-Dreamin/tinymist/pull/371
* Typst Preview extension is already integrated into Tinymist. It . Please disable Typst Preview extension to avoid conflicts.
* Otherwise, you should disable the tinymist's embedded preview feature by `"tinymist.preview": "disable"` in your settings.json.
### Preview
* Persisting webview preview through vscode restarts by @Myriad-Dreamin and @noamzaks in https://github.com/Myriad-Dreamin/tinymist/pull/373
**Full Changelog**: https://github.com/Myriad-Dreamin/tinymist/compare/v0.11.13...v0.11.14
# Change Log (v0.1.0 - v0.11.7)
All notable changes to the "typst-preview" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## v0.11.7 - [2024-06-09]
Thanks @7sDream for this release!
- Add supports for setting `sys.inputs` in configuration
- Add support for ignoring system fonts.
## v0.11.6 - [2024-05-19]
- Add extension icon designed by Zoknatwrd and QuarticCat🔮
## v0.11.5 - [2024-05-19]
- Bump to typst v0.11.1
- Show activity bar icon only when current file is a typst file
## v0.11.4 - [2024-04-09]
- Fix version in nix build
- Fix desync in firefox
## v0.11.3 - [2024-03-25]
- Bump to typst.ts 0.5.0-rc1
## v0.11.2 - [2024-03-21]
- Fix:
- #254 Zoom regression in 0.10.8 is now fixed
- #270 Wrong webview panel location when using 2-row layout
- Fix preview button being slow when using tinymist
## v0.11.1 - [2024-03-18]
- Fix:
- remove windows-ia32. It is not supported by vscode anymore.
## v0.11.0 - [2024-03-18]
- Features:
- Upgrade to typst v0.11.0
- typst-preview is available on crate.io now. You can install it by running `cargo install typst-preview`. You can also use it as a library in your project by adding `typst-preview` to your `Cargo.toml`.
## v0.10.10 - [2024-03-13]
- Features:
- Upgrade to typst v0.11.0-rc1(master, 48820fe69b8061bd949847afc343bf160d05c924)
- Bug fixes:
- Fix gradient color being rendered incorrectly
## v0.10.9 - [2024-03-10]
- Features:
- Upgrade to typst v0.11.0-rc1
- Bug fixes:
- May fix a bug when typst preview cannot launch on some windows machines
- Fix jumping view while zooming
- Fix cannot use relative path in `typst-preview.fontPaths`
## ~~v0.11.0-rc1 - [2024-03-10]~~
- Features:
- Upgrade to typst v0.11.0-rc1
- Bug fixes:
- May fix a bug when typst preview cannot launch on some windows machines
- Fix jumping view while zooming
- Fix cannot use relative path in `typst-preview.fontPaths`
## v0.10.8 - [2024-02-19]
- Features:
- Add favicon when opening the preview in browser (#239)
- Add drag to scroll. You can now drag the preview panel to scroll.
- Bug fixes:
- fix sensitive scale on touchpad (#244)
- The vscode extension will check the server version before starting.
- Misc:
- Add async tracing and add a new command `typst-preview.showAwaitTree` to pop a message and copy the async tree to clipboard. This is useful for debugging.
- Add split debug symbol for the server.
-
## v0.10.7 - [2024-01-25]
- Features:
- Jump to source is more accurate now.
- Add a config to invert color in preview panel. See `typst-preview.invertColors`.
- Allow config scroll sync mode. See `typst-preview.scrollSync`
- (Experimental) Improve cursor indicator.
## v0.10.6 - [2024-01-17]
- Bug fixes:
- fix a bug which cause the preview panel no longer updates as you type
## v0.10.5 - [2024-01-14]
- Bug fixes:
- fix a bug that fails to incrementally rendering pages with transformed content
- fix #141: glyph data desync problem, corrupting state of webview typically after your editor hibernating and coming back.
- Features:
- performance is now improved even further. We now use a more efficient way to render the document.
## v0.10.4 - [2024-01-05]
- Bug fixes:
- Fix open in browser. It's broken in v0.10.3.
- Features:
- Improve incremental rendering performance.
## v0.10.3 - [2024-01-01]
- Bug fixes:
- Thanks to new rendering technique, scrolling in no longer laggy on long document.
- Features:
- We now automatically declare the previewing file as entrypoint when `typst-preview.pinPreviewFile` is set to `true`. This is like the eye icon in webapp. This should improve diagnostic messages for typst lsp. You can enable this by setting `typst-preview.pinPreviewFile` to `true`.
## v0.10.2 - [2023-12-18]
- Bug fixes:
- fix scrollbar hiding
## v0.10.1 - [2023-12-17]
- Features:
- Improve thumbnail side panel and outline. Now it is clickable and you can jump to the corresponding page.
- Bug fixes:
- Improve performance for outline generation.
## v0.10.0 - [2023-12-05]
- Features:
- Bump to typst v0.10.0
## v0.9.2 - [2023-11-23]
- Features:
- You can now enable a preview panel in the sidebar. See `typst-preview.showInActivityBar`.
- A new keybinding is added. You can trigger preview by using `Ctrl`/`Cmd` + `k` `v` now.
- Bug fix:
- Scroll to cursor on 2-column documents is now improved.
## v0.9.1 - [2023-11-17]
- Features:
- #160: Slides mode is available now! You can enable use `typst-preview.preview-slide` command.
- Allow adjust the status bar item
- Bug fixes:
- Previously the `Compiling` status is never sent to the status bar item. This is now fixed.
- #183 #128 Various rendering fix.
## v0.9.0 - [2023-10-31]
- Features:
- Update to typst v0.9.0
- Add a status indicator in status bar. When compile fails, it becomes red. Clicking on it will show the error message.
- Bug fixes:
- #143 Scrolling is not that laggy now
- #159 Fix a clip path bug
## v0.8.3 - [2023-10-28]
- Bug fixes:
- #152 Do not pop up error message when the preview window is closed
- #156 Fix shaking scrollbar/border
- #161 #151 Should not panic when the file is not exist
- Features:
- #157 Add a rough indicator for the current cursor position in the preview panel. You may enable this in configuration.
## v0.8.2 - [2023-10-20]
- Features:
- #142 The scroll position of the preview panel is now preserved when you switch between tabs.
- #133 We now provide a button to show log when the server crashes. This should make debugging easier. You may also use the command `typst-preview.showLog` to show the log.
- #129 A `--version` flag is now provided in the cli
- Bug fixes:
- #137 Previously preview page might go blank when saving the file
- #130 Previously you cannot watch a file in `/tmp`
- #118 Previously the preview page might flash when you save the file
## v0.8.1 - [2023-09-24]
- Bug fixes:
- #121: Disable darkreader for preview panel. This should fix the problem where the preview panel is invisible when darkreader is installed in the browser.
- #123: Fix a VDOM bug which may cause color/clip-path desync.
- #124: Fix a race condition which may cause the webview process messages out of order, resulting in blank screen.
- #125: Resizing the preview panel is not that laggy now.
- Features:
- #120: We now show page breaks and center pages horizontally. By default we will choose the `vscode-sideBar-background` color as the page break color. If it is not distinguishable from white, we will use rgb(82, 86, 89) instead.
## v0.8.0 - [2023-09-17]
- Upgrade to typst v0.8.0
- Fix #111: Previously stroke related attributes are not rendered correctly. This is now fixed.
- Fix #105: The compiler will panic randomly. This is now fixed.
- Upstream bug fixes: <https://github.com/Myriad-Dreamin/typst.ts/releases/tag/v0.4.0-rc3>
## v0.7.5 - [2023-09-01]
- Fix #107: now VSCode variables like `${workspaceFolder}` can be used in `typst-preview.fontPaths`.
- Fix cannot open multiple preview tabs at the same time.
## v0.7.4 - [2023-08-29]
- Typst Preview Book is now available at <https://enter-tainer.github.io/typst-preview/> ! You can find the documentation of Typst Preview there.
- Improved standalone usage: Use `typst-preview` without VSCode now becomes easier. All you need is `typst-preview --partial-rendering cool-doc.typ`. Take a look at <https://enter-tainer.github.io/typst-preview/standalone.html>
- Upgrade to typst.ts 0.4.0-rc2. This fixes a subtle incremental parsing bug.
- Partial rendering is now enabled by default. This should improve performance on long document. You can disable it by setting `typst-preview.partialRendering` to `false`.
## v0.7.3 - [2023-08-20]
- Bugfix: fix a subtle rendering issue, [typst.ts#306](https://github.com/Myriad-Dreamin/typst.ts/pull/306).
## v0.7.2 - [2023-08-20]
- Bug fixes:
- #79: We now put typst compiler and renderer in a dedicate thread. Therefore we should get more stable performance.
- #78: Currently only the latest compile/render request is processed. This should fix the problem where the preview request will queue up when you type too fast and the doc takes a lot of time to compile.
- #81: We now use a more robust way to detect the whether to kill stale server process. This should fix the problem where the when preview tab will become blank when it becomes inactive for a while.
- #87: Add enum description for `typst-preview.scrollSync`. Previously the description is missing.
## v0.7.1 - [2023-08-16]
- Bug fixes:
- fix #41. It is now possible to use Typst Preview in VSCode Remote.
- fix #82. You can have preview button even when typst-lsp is not installed.
- Misc: We downgrade the ci image for Linux to Ubuntu 20.04. This should fix the problem where the extension cannot be installed on some old Linux distros.
## v0.7.0 - [2023-08-09]
- Upgrade to typst v0.7.0
- Bug fixes
- #77 #75: Previously arm64 devices will see a blank preview. This is now fixed.
- #74: Previously when you open a file without opening in folder, the preview will not work. This is now fixed.
## v0.6.4 - [2023-08-06]
- Rename to Typst Preview.
- Add page level partial rendering. This should improve performance on long document. This is an experimental feature and is disabled by default. You can enable it by setting `typst-preview.partialRendering` to `true`.
- The binary `typst-preview` now can be used as a standalone typst server. You can use it to preview your document in browser. For example: `typst-preview ./assets/demo/main.typ --open-in-browser --partial-rendering`
- Fix #70: now you can launch many preview instances at the same time.
## v0.6.3 - [2023-07-29]
- Fix #13, #63: Now ctrl+wheel zoom should zoom the content to the cursor position. And when the cursor is not within the document, the zoom sill works.
## v0.6.2 - [2023-07-25]
- Fix #60 and #24. Now we watch dirty files in memory therefore no shadow file is needed. Due to the removal of disk read/write, this should also improve performance and latency.
- Preview on type is now enabled by default for new users. Existing users will not be affected.
## v0.6.1 - [2023-07-14]
- Fix empty file preview. Previously, if you start with an empty file and type something, the preview will not be updated. This is now fixed.
## v0.6.0 - [2023-07-06]
- Upgrade to typst v0.6.0
- Bug fixes:
- #48: Webview cannot load frontend resources when VSCode is installed by scoop
- #46: Preview to source jump not working after inserting new text in the source file
- #52: Bug fix about VDOM operation
- Enhancement
- #54: Only scroll the preview panel when the event is triggered by mouse
## v0.5.1 - [2023-06-30]
- Performance improvement(#14): We now use typst.ts. We utilize a [virtual DOM](https://en.wikipedia.org/wiki/Virtual_DOM) approach to diff and render the document. This is a **significant enhancement** of previewing document in `onType` mode in terms of resource savings and response time for changes.
- Cross jump between code and preview (#36): We implement SyncTeX-like feature for typst-preview. You can now click on the preview panel to jump to the corresponding code location, and vice versa. This feature is still experimental and may not work well in some cases. Please report any issues you encounter.
- Sync preview position with cursor: We now automatically scroll the preview panel to the corresponding position of the cursor. This feature is controlled by `typst-preview.scrollSync`
- Open preview in separate window(#39): You can type `typst-preview.browser` in command palette to open the preview page in a separate browser.
- Links in preview panel: You can now click on links in the preview panel to open them in browser. The cross reference links are also clickable.
- Text selection in preview panel: You can now select text in the preview panel.
## v0.5.0 - [2023-06-10]
- Upgrade to typst v0.5.0
## v0.4.1 - [2023-06-07]
- Makes the WebSocket connection retry itself when it is closed, with a delay of 1 second.
## v0.4.0 - [2023-06-07]
- Upgrade to typst v0.4.0
## v0.3.3 - [2023-05-11]
- Fix nix-ld compatibility by inheriting env vars(#33)
## v0.3.1 - [2023-05-04]
- Publish to OpenVSX
- allow configuring font paths
## v0.3.0 - [2023-04-26]
- Upgrade typst to v0.3.0
- Fix panic when pages are removed
## v0.2.4 - [2023-04-21]
- Automatically choose a free port to listen. This should fix the problem where you can't preview multiple files at the same time.
- Server will exit right after client disconnects, preventing resource leak.
## v0.2.3 - [2023-04-20]
- Performance Improvement: only update pages when they are visible. This should improve performance when you have a lot of pages.
## v0.2.2 - [2023-04-16]
- Fix server process not killed on exit(maybe)
- Add config for OnSave/OnType
- Add output channel for logging
## v0.2.1 - [2023-04-16]
- Bundle typst-ws within vsix. You no longer need to install typst-ws
## v0.1.7 - [2023-04-10]
- Preview on type
- Add config entry for `typst-ws` path
## v0.1.6 - [2023-04-09]
Add preview button
## v0.1.0 - [2023-04-09]
Initial release

View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 mgt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,55 @@
# [DEPRECATION NOTICE] Typst preview extension has been integrated into [tinymist](https://github.com/Myriad-Dreamin/tinymist)
We recommend all users migrate to tinymist for the following benefits:
- More centralized resource management
- Reduced redundancy and lower resource usage
- Easier updates and maintenance
This repository will no longer be updated in future. All development will move to tinymist. Thank you for your support and understanding!
- We still maintain the typst-preview extension for a while in a best effort way.
- The lazy people can continue using their setting, as all old things are still working.
- This respect people who love minimal env, like a treesitter plugin plus preview.
- Tinymist will ensure compatibility to typst-preview as much as possible.
- for vscode users: uninstall the preview extension and install the tinymist extension.
- for standalone cli users: `typst-preview -> tinymist preview`
# [Typst Preview VSCode](https://github.com/Enter-tainer/typst-preview)
Preview your Typst files in vscode instantly!
## Features
- Low latency preview: preview your document instantly on type. The incremental rendering technique makes the preview latency as low as possible.
- Open in browser: open the preview in browser, so you put it in another monitor. https://github.com/typst/typst/issues/1344
- Cross jump between code and preview: We implement SyncTeX-like feature for typst-preview. You can now click on the preview panel to jump to the corresponding code location, and vice versa.
Install this extension from [marketplace](https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview), open command palette (Ctrl+Shift+P), and type `>Typst Preview:`.
You can also use the shortcut (Ctrl+K V).
![demo](demo.png)
For more information, please visit documentation at [Typst Preview Book](https://enter-tainer.github.io/typst-preview/).
## Extension Settings
See https://enter-tainer.github.io/typst-preview/config.html
## Bug report
To achieve high performance instant preview, we use a **different rendering backend** from official typst. We are making our best effort to keep the rendering result consistent with official typst. We have set up comprehensive tests to ensure the consistency of the rendering result. But we cannot guarantee that the rendering result is the same in all cases. There can be unknown corner cases that we haven't covered.
**Therefore, if you encounter any rendering issue, please report it to this repo other than official typst repo.**
## Known Issues
See [issues](https://github.com/Enter-tainer/typst-preview/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) on GitHub.
## Legal
This project is not affiliated with, created by, or endorsed by Typst the brand.
## Change Log
See [CHANGELOG.md](CHANGELOG.md)

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View file

@ -0,0 +1,282 @@
{
"name": "typst-preview",
"displayName": "Typst Preview",
"description": "preview your typst document in instant",
"publisher": "mgt19937",
"license": "MIT",
"icon": "./preview-logo.png",
"repository": {
"type": "git",
"url": "https://github.com/Enter-tainer/typst-preview"
},
"version": "0.11.14",
"engines": {
"vscode": "^1.97.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onLanguage:typst"
],
"main": "./out/extension.js",
"contributes": {
"icons": {
"typst-guy": {
"description": "typst guy",
"default": {
"fontPath": "./preview.woff",
"fontCharacter": "A"
}
}
},
"languages": [
{
"id": "typst",
"extensions": [
".typ"
]
}
],
"commands": [
{
"command": "typst-preview.preview",
"title": "Typst Preview: Preview current file",
"description": "Launch typst-preview server",
"icon": "$(open-preview)",
"when": "resourceLangId == typst && editorTextFocus"
},
{
"command": "typst-preview.browser",
"title": "Typst Preview: Preview current file in browser",
"description": "Launch typst-preview server and open the preview in your browser",
"icon": "$(open-preview)",
"when": "resourceLangId == typst && editorTextFocus"
},
{
"command": "typst-preview.preview-slide",
"title": "Typst Preview: Preview current file in slide mode",
"description": "Launch typst-preview server in slide mode",
"icon": "$(open-preview)",
"when": "resourceLangId == typst && editorTextFocus"
},
{
"command": "typst-preview.browser-slide",
"title": "Typst Preview: Preview current file in browser and slide mode",
"description": "Launch typst-preview server in slide mode and open the preview in your browser",
"icon": "$(open-preview)",
"when": "resourceLangId == typst && editorTextFocus"
},
{
"command": "typst-preview.sync",
"title": "Typst Preview: Sync preview with current cursor",
"description": "Scroll preview to current cursor position",
"icon": "$(sync)",
"when": "resourceLangId == typst && editorTextFocus"
},
{
"command": "typst-preview.showLog",
"title": "Typst Preview: Show Log",
"description": "Show typst-preview log",
"icon": "$(list-flat)",
"when": "resourceLangId == typst"
},
{
"command": "typst-preview.noteOutline",
"title": "Note: Jumping to source location of the outline item doesn't work well if its body doesn't have source location, e.g.\n```\n#let my-heading(h) = heading(h) // will jump to here\n#my-heading(\"Title\") // will not jump to here\n```.\nHence, you may want to use `my-heading[Title]` instead to gain better experience of outline jumping.",
"description": "...",
"icon": "$(extensions-info-message)"
}
],
"menus": {
"editor/title": [
{
"command": "typst-preview.preview",
"when": "resourceLangId == typst && editorTextFocus",
"group": "navigation"
}
],
"view/title": [
{
"command": "typst-preview.noteOutline",
"when": "view == typst-preview.outline",
"group": "navigation"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "typst-preview-activitybar",
"title": "Typst Preview",
"icon": "./icons/activity-bar.svg"
}
]
},
"views": {
"typst-preview-activitybar": [
{
"id": "typst-preview.content-preview",
"type": "webview",
"name": "Content",
"when": "config.typst-preview.showInActivityBar && resourceLangId == typst"
},
{
"id": "typst-preview.outline",
"name": "Outline",
"when": "config.typst-preview.showInActivityBar && resourceLangId == typst"
}
]
},
"configuration": {
"title": "Typst Preview",
"properties": {
"typst-preview.executable": {
"type": "string",
"default": "",
"description": "Path to typst-preview executable. If not set, the extension will use bundled typst-preview. If bundled binary is not found, it will use typst-preview installed in PATH"
},
"typst-preview.sysInputs": {
"type": "object",
"items": {
"type": "string"
},
"default": {},
"description": "key-value pairs visible through `sys.inputs`, corresponds to `--input` argument of typst cli"
},
"typst-preview.systemFonts": {
"type": "boolean",
"default": true,
"description": "Whether to load system fonts. If disabled, only fonts in `typst-preview.fontPaths` is loaded"
},
"typst-preview.fontPaths": {
"type": "array",
"items": {
"type": "string",
"title": "Font path",
"description": "Absolute path to a directory or file containing font assets."
},
"default": [],
"description": "List of *additional* paths to font assets used by typst-preview."
},
"typst-preview.refresh": {
"title": "Refresh preview",
"description": "Refresh preview when the document is saved or when the document is changed",
"type": "string",
"enum": [
"onSave",
"onType"
],
"default": "onType",
"enumDescriptions": [
"Refresh preview on save",
"Refresh preview on type"
]
},
"typst-preview.scrollSync": {
"description": "Configure scroll sync mode.",
"type": "string",
"enum": [
"never",
"onSelectionChangeByMouse",
"onSelectionChange"
],
"default": "onSelectionChangeByMouse",
"enumDescriptions": [
"Disable automatic scroll sync",
"Scroll preview to current cursor position when selection changes by mouse",
"Scroll preview to current cursor position when selection changes by mouse or keyboard (any source)"
]
},
"typst-preview.partialRendering": {
"description": "Only render visible part of the document. This can improve performance but still being experimental.",
"type": "boolean",
"default": true
},
"typst-preview.invertColors": {
"description": "Invert colors of the preview (useful for dark themes without cost). Please note you could see the origin colors when you hover elements in the preview.",
"type": "string",
"enum": [
"never",
"auto",
"always"
],
"default": "never",
"enumDescriptions": [
"Disable color inversion of the preview",
"Invert colors smartly by detecting dark/light themes in browser environment or by `typst query` your document",
"Always invert colors of the preview"
]
},
"typst-preview.cursorIndicator": {
"description": "(Experimental) Show typst cursor indicator in preview.",
"type": "boolean",
"default": false
},
"typst-preview.showInActivityBar": {
"description": "(Experimental) Show a preview panel in activity bar.",
"type": "boolean",
"default": false
},
"typst-preview.statusBarIndicator": {
"description": "Style of status bar indicator for typst-preview.",
"type": "string",
"enum": [
"full",
"compact"
],
"default": "compact",
"enumDescriptions": [
"Show full status bar indicator (ICON Compile Success)",
"Show compact status bar indicator (ICON)"
]
},
"typst-preview.pinPreviewFile": {
"description": "Declare current previewing file as entrypoint for typst-lsp. This will make typst-lsp to use this file as entrypoint instead of the file opened in vscode. This can improve diagnostics messages and auto completion but still being experimental.",
"type": "boolean",
"default": false
}
}
},
"keybindings": [
{
"command": "typst-preview.preview",
"key": "ctrl+k v",
"mac": "cmd+k v",
"when": "editorLangId == typst"
}
]
},
"scripts": {
"build:frontend": "cd ../../../../ && yarn build:preview && cd contrib/typst-preview/editors/vscode && yarn install:frontend",
"install:frontend": "rimraf ./out/frontend/ && cpr ../../../../tools/typst-preview-frontend/dist/ ./out/frontend/",
"build-base": "esbuild ../../../../editors/vscode/src/extension.preview.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node --target=node16",
"vscode:prepublish": "yarn run build-base -- --minify && yarn run build:frontend",
"compile": "yarn run build-base -- --sourcemap && yarn run build:frontend",
"build": "yarn run compile",
"watch": "yarn run build-base -- --sourcemap --watch",
"pretest": "yarn run compile && yarn run lint",
"package": "vsce package --yarn",
"lint": "eslint src",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1",
"@types/node": "^22.13.4",
"@types/vscode": "^1.97.0",
"@types/ws": "^8.5.5",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.22.0",
"glob": "^8.1.0",
"mocha": "^10.2.0",
"typescript": "^5.2.2"
},
"dependencies": {
"cross-spawn": "^7.0.3",
"node-fetch": "^3.3.2",
"vscode-variables": "^0.1.3",
"ws": "^8.13.0"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View file

@ -0,0 +1,22 @@
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 600 600">
<filter xmlns="http://www.w3.org/2000/svg" id="a" width="100%" height="100%" x="0%" y="0%">
<feTurbulence xmlns="http://www.w3.org/2000/svg" baseFrequency=".005" type="fractalNoise"/>
</filter>
<path d="M0 0h600v600H0z" style="fill:#30a9b3;fill-rule:nonzero"/>
<path d="M0 0h600v600H0z" opacity=".5" style="filter:url(#a)"/>
<path d="M7.888 18.148c0 1.133.162 1.892.487 2.28.325.387.916.581 1.773.581.886 0 2.024-.447 3.412-1.341l.886 1.475c-2.599 2.175-4.741 3.263-6.425 3.263-1.684 0-3.014-.402-3.988-1.207-.975-.834-1.463-2.294-1.463-4.38V7.107H.355L0 5.453l2.57-.804V2.458L7.888 0v4.917l5.229-.402-.488 2.905-4.741-.179v10.907Z" style="fill:#fff;fill-rule:nonzero" transform="translate(200 122) scale(14.1524)"/>
<circle cx="240" cy="247" r="101" style="fill:#30a9b3" transform="translate(-7 9)"/>
<g transform="translate(163 144) scale(16.7338)">
<clipPath id="b">
<circle cx="4.183" cy="6.693" r="6.036"/>
</clipPath>
<g clip-path="url(#b)">
<path d="M7.888 18.148c0 1.133.162 1.892.487 2.28.325.387.916.581 1.773.581.886 0 2.024-.447 3.412-1.341l.886 1.475c-2.599 2.175-4.741 3.263-6.425 3.263-1.684 0-3.014-.402-3.988-1.207-.975-.834-1.463-2.294-1.463-4.38V7.107H.355L0 5.453l2.57-.804V2.458L7.888 0v4.917l5.229-.402-.488 2.905-4.741-.179v10.907Z" style="fill:#fff;fill-rule:nonzero"/>
</g>
</g>
<path d="M352.734 406.179a8.004 8.004 0 0 1-5.668-2.348l-72.685-72.685a8.019 8.019 0 0 1 0-11.337 8.018 8.018 0 0 1 11.337 0l72.685 72.685a8.018 8.018 0 0 1-5.669 13.685" style="fill:#7b7979;fill-rule:nonzero" transform="translate(30)"/>
<path d="m429.598 441.015-59.858-59.858a23.91 23.91 0 0 0-17.006-7.045 23.91 23.91 0 0 0-17.006 7.045c-9.377 9.376-9.377 24.635 0 34.011l59.858 59.858a23.91 23.91 0 0 0 17.006 7.045 23.905 23.905 0 0 0 17.006-7.044c9.377-9.377 9.377-24.636 0-34.012" style="fill:#a7a6a6;fill-rule:nonzero" transform="translate(30)"/>
<path d="M330.327 389.472c-3.325 8.611-1.534 18.76 5.402 25.696l59.858 59.858a23.91 23.91 0 0 0 17.006 7.045c3.026 0 5.958-.574 8.696-1.635l-90.962-90.964Z" style="fill:#918f90;fill-rule:nonzero" transform="translate(30)"/>
<path d="M203.089 129.336c70.433 0 127.732 57.301 127.732 127.733s-57.3 127.732-127.732 127.732S75.356 327.502 75.356 257.069c0-70.433 57.301-127.733 127.733-127.733Zm0 34.205c-51.572 0-93.528 41.956-93.528 93.528s41.957 93.528 93.528 93.528c51.571 0 93.528-41.956 93.528-93.528s-41.956-93.528-93.528-93.528Z" style="fill:#ff8c78" transform="translate(30)"/>
<path d="M203.089 149.645c59.234 0 107.424 48.19 107.424 107.424 0 59.234-48.19 107.424-107.424 107.424-59.234 0-107.424-48.19-107.424-107.424 0-59.234 48.19-107.424 107.424-107.424Zm0 13.896c-51.572 0-93.528 41.956-93.528 93.528s41.957 93.528 93.528 93.528c51.571 0 93.528-41.956 93.528-93.528s-41.956-93.528-93.528-93.528Z" style="fill:#df7a6e" transform="translate(30)"/>
</svg>

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

View file

@ -0,0 +1,2 @@
interface Window {}
declare const acquireVsCodeApi: any;

View file

@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2020",
"outDir": "out",
"lib": ["ES2020", "DOM"],
"sourceMap": true,
"rootDir": "../../../../editors/vscode",
"skipLibCheck": true,
"types": ["./src/global.d.ts"],
"resolveJsonModule": true
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"files": ["../../../../editors/vscode/src/extension.preview.ts"],
"include": ["../../../../editors/vscode/src/**/*.ts"]
}

View file

@ -0,0 +1,19 @@
[package]
name = "cmark-writer-macros"
version = "0.9.0"
edition = "2021"
authors = ["Hong Jiarong"]
description = "Proc-macro implementations for cmark-writer"
license = "MIT"
[lib]
proc-macro = true
[dependencies]
syn = { version = "2.0", features = ["full", "extra-traits"] }
quote = "1.0"
proc-macro2 = "1.0"
[dev-dependencies]
cmark-writer = { path = "../cmark-writer" }
ecow = "0.2.6"

View file

@ -0,0 +1,9 @@
MIT License
Copyright 2025 Hong Jiarong
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,387 @@
extern crate proc_macro;
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use syn::{
parse::Parse, parse::ParseStream, parse_macro_input, DeriveInput, Ident, LitBool, LitStr, Token,
};
/// Parse custom_node attribute parameters
struct CustomNodeArgs {
is_block: Option<bool>,
html_impl: Option<bool>,
}
impl Parse for CustomNodeArgs {
fn parse(input: ParseStream) -> syn::Result<Self> {
let mut is_block = None;
let mut html_impl = None;
if input.is_empty() {
return Ok(CustomNodeArgs {
is_block,
html_impl,
});
}
loop {
if input.is_empty() {
break;
}
let ident: Ident = input.parse()?;
if ident == "block" {
let _: Token![=] = input.parse()?;
let value: LitBool = input.parse()?;
is_block = Some(value.value);
} else if ident == "html_impl" {
let _: Token![=] = input.parse()?;
let value: LitBool = input.parse()?;
html_impl = Some(value.value);
} else {
return Err(syn::Error::new_spanned(
ident,
"Unknown attribute parameter",
));
}
// Handle optional comma separator
if input.peek(Token![,]) {
let _: Token![,] = input.parse()?;
}
}
Ok(CustomNodeArgs {
is_block,
html_impl,
})
}
}
#[derive(Default)]
struct StructureErrorArgs {
format: Option<LitStr>,
}
impl Parse for StructureErrorArgs {
fn parse(input: ParseStream) -> syn::Result<Self> {
let mut format = None;
while !input.is_empty() {
let ident: Ident = input.parse()?;
if ident == "format" {
let _: Token![=] = input.parse()?;
let value: LitStr = input.parse()?;
format = Some(value);
} else {
return Err(syn::Error::new_spanned(
ident,
"Unknown attribute parameter",
));
}
if input.peek(Token![,]) {
let _: Token![,] = input.parse()?;
} else {
break;
}
}
Ok(Self { format })
}
}
/// Custom node attribute macro for implementing the CustomNode trait
///
/// This macro automatically implements the CustomNode trait. Users can specify
/// whether the node is a block element using the `block` parameter and whether
/// it implements HTML rendering with the `html_impl` parameter.
///
/// # Example
///
/// ```rust
/// use cmark_writer::writer::{BlockWriterProxy, HtmlWriteResult, HtmlWriter, InlineWriterProxy};
/// use cmark_writer::{custom_node, WriteResult};
/// use ecow::EcoString;
///
/// // Specified as an inline element with both CommonMark and HTML implementations
/// #[derive(Debug, Clone, PartialEq)]
/// #[custom_node(block=false, html_impl=true)]
/// struct HighlightNode {
/// content: EcoString,
/// color: EcoString,
/// }
///
/// impl HighlightNode {
/// // Required for CommonMark rendering
/// fn write_custom(&self, writer: &mut InlineWriterProxy) -> WriteResult<()> {
/// writer.write_str("<span style=\"background-color: ")?;
/// writer.write_str(&self.color)?;
/// writer.write_str("\">")?;
/// writer.write_str(&self.content)?;
/// writer.write_str("</span>")?;
/// Ok(())
/// }
///
/// // Optional HTML rendering implementation
/// fn write_html_custom(&self, writer: &mut HtmlWriter) -> HtmlWriteResult<()> {
/// writer.start_tag("span")?;
/// writer.attribute("style", &format!("background-color: {}", self.color))?;
/// writer.finish_tag()?;
/// writer.text(&self.content)?;
/// writer.end_tag("span")?;
/// Ok(())
/// }
/// }
///
/// // Only CommonMark implementation, default HTML implementation
/// #[derive(Debug, Clone, PartialEq)]
/// #[custom_node(block=true)]
/// struct AlertNode {
/// content: EcoString,
/// }
///
/// impl AlertNode {
/// fn write_custom(&self, writer: &mut BlockWriterProxy) -> WriteResult<()> {
/// writer.write_str("<div class=\"alert\">")?;
/// writer.write_str(&self.content)?;
/// writer.write_str("</div>")?;
/// Ok(())
/// }
/// }
/// ```
#[proc_macro_attribute]
pub fn custom_node(attr: TokenStream, item: TokenStream) -> TokenStream {
let args = syn::parse_macro_input!(attr as CustomNodeArgs);
let input = parse_macro_input!(item as DeriveInput);
let name = &input.ident;
// Configure is_block implementation
let is_block_impl = if let Some(is_block) = args.is_block {
quote! {
fn is_block(&self) -> bool {
#is_block
}
}
} else {
quote! {
fn is_block(&self) -> bool {
self.is_block_custom()
}
}
};
let is_block = args.is_block.unwrap_or(false);
// Configure html_write implementation
let html_write_impl = if args.html_impl.unwrap_or(false) {
// When html_impl=true, expect user to implement write_html_custom method
quote! {
fn html_write(
&self,
writer: &mut ::cmark_writer::writer::HtmlWriter,
) -> ::cmark_writer::writer::HtmlWriteResult<()> {
self.write_html_custom(writer)
}
}
} else {
// When html_impl is not set or false, use default implementation
quote! {
fn html_write(
&self,
writer: &mut ::cmark_writer::writer::HtmlWriter,
) -> ::cmark_writer::writer::HtmlWriteResult<()> {
writer.write_trusted_html(&format!(
"<!-- HTML rendering not implemented for Custom Node: {} -->",
self.type_name()
))?;
Ok(())
}
}
};
let write_block_impl = if is_block {
quote! {
fn write_block(
&self,
writer: &mut ::cmark_writer::writer::BlockWriterProxy,
) -> ::cmark_writer::error::WriteResult<()> {
self.write_custom(writer)
}
}
} else {
quote! {}
};
let write_inline_impl = if !is_block {
quote! {
fn write_inline(
&self,
writer: &mut ::cmark_writer::writer::InlineWriterProxy,
) -> ::cmark_writer::error::WriteResult<()> {
self.write_custom(writer)
}
}
} else {
quote! {}
};
let expanded = quote! {
#input
impl ::cmark_writer::ast::CustomNode for #name {
#write_block_impl
#write_inline_impl
#html_write_impl
fn clone_box(&self) -> Box<dyn ::cmark_writer::ast::CustomNode> {
Box::new(self.clone())
}
fn eq_box(&self, other: &dyn ::cmark_writer::ast::CustomNode) -> bool {
if let Some(other) = other.as_any().downcast_ref::<Self>() {
self == other
} else {
false
}
}
#is_block_impl
fn as_any(&self) -> &dyn std::any::Any {
self
}
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
self
}
}
impl #name {
pub fn matches(node: &dyn ::cmark_writer::ast::CustomNode) -> bool {
node.type_name() == std::any::type_name::<#name>() ||
node.as_any().downcast_ref::<#name>().is_some()
}
pub fn extract(node: Box<dyn ::cmark_writer::ast::CustomNode>) -> Option<#name> {
node.as_any().downcast_ref::<#name>().map(|n| n.clone())
}
}
};
TokenStream::from(expanded)
}
/// Custom error attribute macro, replaces the struct form errors in the original define_custom_errors! macro
///
/// # Example
///
/// ```rust
/// use cmark_writer::structure_error;
///
/// #[structure_error(format = "Table column mismatch: {}")]
/// struct TableColumnMismatchError(pub &'static str);
/// ```
#[proc_macro_attribute]
pub fn structure_error(attr: TokenStream, item: TokenStream) -> TokenStream {
let args = if attr.is_empty() {
StructureErrorArgs::default()
} else {
parse_macro_input!(attr as StructureErrorArgs)
};
let input = parse_macro_input!(item as DeriveInput);
let name = &input.ident;
// Parse format attribute
let format_lit = args
.format
.unwrap_or_else(|| LitStr::new("{}", Span::call_site()));
let expanded = quote! {
#input
impl #name {
pub fn new(message: &'static str) -> Self {
Self(message)
}
pub fn into_error(self) -> ::cmark_writer::error::WriteError {
let mut error_factory = ::cmark_writer::error::StructureError::new(#format_lit);
let arg = self.0.to_string();
error_factory = error_factory.arg(arg);
<::cmark_writer::error::StructureError as ::cmark_writer::error::CustomErrorFactory>::create_error(&error_factory)
}
}
impl From<#name> for ::cmark_writer::error::WriteError {
fn from(factory: #name) -> Self {
factory.into_error()
}
}
impl ::cmark_writer::error::CustomErrorFactory for #name {
fn create_error(&self) -> ::cmark_writer::error::WriteError {
let mut error_factory = ::cmark_writer::error::StructureError::new(#format_lit);
let arg = self.0.to_string();
error_factory = error_factory.arg(arg);
<::cmark_writer::error::StructureError as ::cmark_writer::error::CustomErrorFactory>::create_error(&error_factory)
}
}
};
TokenStream::from(expanded)
}
/// Custom coded error attribute macro, replaces the coded form errors in the original define_custom_errors! macro
///
/// # Example
///
/// ```rust
/// use cmark_writer::coded_error;
///
/// #[coded_error]
/// struct MarkdownSyntaxError(pub String, pub String);
/// ```
#[proc_macro_attribute]
pub fn coded_error(_attr: TokenStream, item: TokenStream) -> TokenStream {
let input = parse_macro_input!(item as DeriveInput);
let name = &input.ident;
let expanded = quote! {
#input
impl #name {
pub fn new(message: &str, code: &str) -> Self {
Self(message.to_string(), code.to_string())
}
pub fn into_error(self) -> ::cmark_writer::error::WriteError {
let coded_error = ::cmark_writer::error::CodedError::new(self.0, self.1);
<::cmark_writer::error::CodedError as ::cmark_writer::error::CustomErrorFactory>::create_error(&coded_error)
}
}
impl From<#name> for ::cmark_writer::error::WriteError {
fn from(factory: #name) -> Self {
factory.into_error()
}
}
impl ::cmark_writer::error::CustomErrorFactory for #name {
fn create_error(&self) -> ::cmark_writer::error::WriteError {
let coded_error = ::cmark_writer::error::CodedError::new(self.0.clone(), self.1.clone());
<::cmark_writer::error::CodedError as ::cmark_writer::error::CustomErrorFactory>::create_error(&coded_error)
}
}
};
TokenStream::from(expanded)
}

View file

@ -0,0 +1,24 @@
[package]
name = "cmark-writer"
version = "0.9.0"
edition = "2021"
description = "A CommonMark writer implementation in Rust for serializing AST nodes to CommonMark format"
license = "MIT"
authors = ["Hong Jiarong"]
repository = "https://github.com/hongjr03/cmark-writer"
keywords = ["markdown", "commonmark", "writer", "serializer"]
categories = ["text-processing"]
readme = "README.md"
[dependencies]
cmark-writer-macros = { path = "../cmark-writer-macros", version = "0.9.0" }
ecow = "0.2.5"
env_logger = "0.11.8"
html-escape = "0.2.13"
log = "0.4.27"
[features]
default = []
# GitHub Flavored Markdown support including tables with alignment, strikethrough,
# task lists, and autolinks without angle brackets
gfm = []

View file

@ -0,0 +1,9 @@
MIT License
Copyright 2025 Hong Jiarong
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,164 @@
# cmark-writer
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
A CommonMark writer implementation in Rust.
## Basic Usage
```rust
use cmark_writer::ast::{Node, ListItem};
use cmark_writer::writer::CommonMarkWriter;
// Create a document
let document = Node::Document(vec![
Node::heading(1, vec![Node::Text("Hello CommonMark".into())]),
Node::Paragraph(vec![
Node::Text("This is a simple ".into()),
Node::Strong(vec![Node::Text("example".into())]),
Node::Text(".".into()),
]),
]);
// Render to CommonMark
let mut writer = CommonMarkWriter::new();
writer.write(&document).expect("Failed to write document");
let markdown = writer.into_string();
println!("{}", markdown);
```
## Custom Options
```rust
use cmark_writer::options::WriterOptionsBuilder;
use cmark_writer::writer::CommonMarkWriter;
// Use builder pattern for custom options
let options = WriterOptionsBuilder::new()
.strict(true)
.hard_break_spaces(false)
.indent_spaces(2)
.build();
let mut writer = CommonMarkWriter::with_options(options);
```
## Table Support
```rust
use cmark_writer::ast::{Node, tables::TableBuilder};
// Create tables with the builder pattern
let table = TableBuilder::new()
.headers(vec![
Node::Text("Name".into()),
Node::Text("Age".into())
])
.add_row(vec![
Node::Text("John".into()),
Node::Text("30".into()),
])
.add_row(vec![
Node::Text("Alice".into()),
Node::Text("25".into()),
])
.build();
```
## GitHub Flavored Markdown (GFM)
Enable GFM features by adding to your `Cargo.toml`:
```toml
[dependencies]
cmark-writer = { version = "0.8.0", features = ["gfm"] }
```
GFM Support:
- Tables with column alignment
- Strikethrough text
- Task lists
- Extended autolinks
- HTML element filtering
## HTML Writing
The library provides dedicated HTML writing capabilities through the `HtmlWriter` class:
```rust
use cmark_writer::{HtmlWriter, HtmlWriterOptions, Node};
// Create HTML writer with custom options
let options = HtmlWriterOptions {
strict: true,
code_block_language_class_prefix: Some("language-".into()),
#[cfg(feature = "gfm")]
enable_gfm: true,
#[cfg(feature = "gfm")]
gfm_disallowed_html_tags: vec!["script".into()],
};
let mut writer = HtmlWriter::with_options(options);
// Write some nodes
let paragraph = Node::Paragraph(vec![Node::Text("Hello HTML".into())]);
writer.write_node(&paragraph).unwrap();
// Get resulting HTML
let html = writer.into_string().unwrap();
assert_eq!(html, "<p>Hello HTML</p>\n");
```
## Custom Nodes
```rust
use cmark_writer::{HtmlWriteResult, HtmlWriter, Node, WriteResult};
use cmark_writer::writer::InlineWriterProxy;
use cmark_writer::custom_node;
use ecow::EcoString;
#[derive(Debug, Clone, PartialEq)]
#[custom_node(block=false, html_impl=true)]
struct HighlightNode {
content: EcoString,
color: EcoString,
}
impl HighlightNode {
// Implementation for CommonMark output
fn write_custom(&self, writer: &mut InlineWriterProxy) -> WriteResult<()> {
writer.write_str("<span style=\"background-color: ")?;
writer.write_str(&self.color)?;
writer.write_str("\">")?;
writer.write_str(&self.content)?;
writer.write_str("</span>")?;
Ok(())
}
// Optional HTML-specific implementation
fn write_html_custom(&self, writer: &mut HtmlWriter) -> HtmlWriteResult<()> {
writer.start_tag("span")?;
writer.attribute("style", &format!("background-color: {}", self.color))?;
writer.finish_tag()?;
writer.text(&self.content)?;
writer.end_tag("span")?;
Ok(())
}
}
```
## Development
```bash
# Build
cargo build
# Run tests
cargo test
```
## License
This project is licensed under the MIT License - see the LICENSE file for details.

View file

@ -0,0 +1,135 @@
//! Custom node definitions for the CommonMark AST.
use crate::error::{WriteError, WriteResult};
use crate::writer::{BlockWriterProxy, HtmlWriteResult, HtmlWriter, InlineWriterProxy};
use std::any::Any;
/// Trait for implementing custom node behavior for the CommonMark AST.
///
/// This trait defines methods that all custom node types must implement.
/// Users can implement dedicated block or inline rendering methods for CommonMark output and
/// optionally override the `html_write` method for HTML output.
///
/// The recommended way to implement this trait is through the `custom_node` macro,
/// which provides a default implementation of most methods and requires users to
/// implement only the node-specific logic.
///
/// # Example
///
/// ```rust
/// use ecow::EcoString;
/// use cmark_writer_macros::custom_node;
/// use cmark_writer::error::WriteResult;
/// use cmark_writer::writer::{HtmlWriteResult, HtmlWriter, InlineWriterProxy};
///
/// // Define a custom node with support for both CommonMark and HTML output
/// #[derive(Debug, Clone, PartialEq)]
/// #[custom_node(block=false, html_impl=true)]
/// struct HighlightNode {
/// content: EcoString,
/// color: EcoString,
/// }
///
/// impl HighlightNode {
/// // Required for CommonMark output
/// fn write_custom(&self, writer: &mut InlineWriterProxy) -> WriteResult<()> {
/// writer.write_str("<span style=\"background-color: ")?;
/// writer.write_str(&self.color)?;
/// writer.write_str("\">")?;
/// writer.write_str(&self.content)?;
/// writer.write_str("</span>")?;
/// Ok(())
/// }
///
/// // Optional HTML-specific implementation
/// fn write_html_custom(&self, writer: &mut HtmlWriter) -> HtmlWriteResult<()> {
/// writer.start_tag("span")?;
/// writer.attribute("style", &format!("background-color: {}", self.color))?;
/// writer.finish_tag()?;
/// writer.text(&self.content)?;
/// writer.end_tag("span")?;
/// Ok(())
/// }
/// }
/// ```
pub trait CustomNode: std::fmt::Debug + Send + Sync {
/// Write the custom node as a block element using the restricted block writer proxy.
///
/// Block custom nodes should implement this method to emit valid block-level content.
fn write_block(&self, writer: &mut BlockWriterProxy) -> WriteResult<()> {
let _ = writer;
Err(WriteError::UnsupportedNodeType)
}
/// Write the custom node as an inline element using the restricted inline writer proxy.
///
/// Inline custom nodes should implement this method to emit valid inline content.
fn write_inline(&self, writer: &mut InlineWriterProxy) -> WriteResult<()> {
let _ = writer;
Err(WriteError::UnsupportedNodeType)
}
/// Writes the HTML representation of the custom node to the provided HTML writer.
///
/// By default, this writes an HTML comment indicating that HTML rendering is not implemented
/// for this custom node type. When using the `custom_node` macro with `html_impl=true`,
/// this method delegates to the user-defined `write_html_custom` method.
///
/// Users should either:
/// 1. Override this method directly, or
/// 2. Use the `custom_node` macro with `html_impl=true` and implement the `write_html_custom` method.
fn html_write(&self, writer: &mut HtmlWriter) -> HtmlWriteResult<()> {
writer.write_trusted_html(&format!(
"<!-- HTML rendering not implemented for Custom Node: {} -->",
self.type_name()
))?;
Ok(())
}
/// Clone the custom node
fn clone_box(&self) -> Box<dyn CustomNode>;
/// Check if two custom nodes are equal
fn eq_box(&self, other: &dyn CustomNode) -> bool;
/// Whether the custom node is a block element
fn is_block(&self) -> bool;
/// Convert to Any for type casting
fn as_any(&self) -> &dyn Any;
/// Convert to mutable Any for type casting
fn as_any_mut(&mut self) -> &mut dyn Any;
/// Get the type name of the custom node for pattern matching
fn type_name(&self) -> &'static str {
std::any::type_name::<Self>()
}
}
// NOTE: CustomNodeWriter trait is deprecated and will be removed in a future version.
// Custom nodes should now directly use the provided writer proxies instead.
/*
/// Trait for custom node writer implementation
pub trait CustomNodeWriter {
/// Write a string to the output
fn write_str(&mut self, s: &str) -> std::fmt::Result;
/// Write a character to the output
fn write_char(&mut self, c: char) -> std::fmt::Result;
}
*/
// Implement Clone for Box<dyn CustomNode>
impl Clone for Box<dyn CustomNode> {
fn clone(&self) -> Self {
self.clone_box()
}
}
// Implement PartialEq for Box<dyn CustomNode>
impl PartialEq for Box<dyn CustomNode> {
fn eq(&self, other: &Self) -> bool {
self.eq_box(&**other)
}
}

View file

@ -0,0 +1,78 @@
//! HTML element definitions and utilities for CommonMark AST.
//!
//! This module contains definitions for HTML elements and attributes in the AST,
//! along with utilities for safely handling HTML content.
use super::Node;
use ecow::EcoString;
/// HTML attribute
#[derive(Debug, Clone, PartialEq)]
pub struct HtmlAttribute {
/// Attribute name
pub name: EcoString,
/// Attribute value
pub value: EcoString,
}
/// HTML element
#[derive(Debug, Clone, PartialEq)]
pub struct HtmlElement {
/// HTML tag name
pub tag: EcoString,
/// HTML attributes
pub attributes: Vec<HtmlAttribute>,
/// Child nodes
pub children: Vec<Node>,
/// Whether this is a self-closing element
pub self_closing: bool,
}
impl HtmlElement {
/// Create a new HTML element
pub fn new(tag: &str) -> Self {
Self {
tag: tag.into(),
attributes: Vec::new(),
children: Vec::new(),
self_closing: false,
}
}
/// Add an attribute to the HTML element
pub fn with_attribute(mut self, name: &str, value: &str) -> Self {
self.attributes.push(HtmlAttribute {
name: name.into(),
value: value.into(),
});
self
}
/// Add multiple attributes to the HTML element
pub fn with_attributes(mut self, attrs: Vec<(&str, &str)>) -> Self {
for (name, value) in attrs {
self.attributes.push(HtmlAttribute {
name: name.into(),
value: value.into(),
});
}
self
}
/// Add child nodes to the HTML element
pub fn with_children(mut self, children: Vec<Node>) -> Self {
self.children = children;
self
}
/// Set whether the element is self-closing
pub fn self_closing(mut self, is_self_closing: bool) -> Self {
self.self_closing = is_self_closing;
self
}
/// Check if this element's tag matches any in the provided list (case-insensitive)
pub fn tag_matches_any(&self, tags: &[EcoString]) -> bool {
tags.iter().any(|tag| tag.eq_ignore_ascii_case(&self.tag))
}
}

View file

@ -0,0 +1,17 @@
//! Abstract Syntax Tree for CommonMark document structure.
//!
//! This module defines various node types for representing CommonMark documents,
//! including headings, paragraphs, lists, code blocks, etc.
mod custom;
mod html;
mod node;
pub mod tables;
pub use self::custom::CustomNode;
pub use self::html::{HtmlAttribute, HtmlElement};
pub use self::node::{CodeBlockType, HeadingType, ListItem, Node};
// Re-export GFM specific types when the GFM feature is enabled
#[cfg(feature = "gfm")]
pub use self::node::{TableAlignment, TaskListStatus};

View file

@ -0,0 +1,389 @@
//! Node definitions for the CommonMark AST.
use super::custom::CustomNode;
use super::html::HtmlElement;
use ecow::EcoString;
use std::boxed::Box;
/// Code block type according to CommonMark specification
#[derive(Debug, Clone, PartialEq, Default)]
pub enum CodeBlockType {
/// Indented code block - composed of one or more indented chunks, each preceded by four or more spaces
Indented,
/// Fenced code block - surrounded by backtick or tilde fences
#[default]
Fenced,
}
/// Heading type according to CommonMark specification
#[derive(Debug, Clone, PartialEq, Default)]
pub enum HeadingType {
/// ATX Type - Beginning with #
#[default]
Atx,
/// Setext Type - Underlined or overlined text
Setext,
}
/// Table column alignment options for GFM tables
#[cfg(feature = "gfm")]
#[derive(Debug, Clone, PartialEq, Default)]
pub enum TableAlignment {
/// Left alignment (default)
#[default]
Left,
/// Center alignment
Center,
/// Right alignment
Right,
/// No specific alignment specified
None,
}
/// Task list item status for GFM task lists
#[cfg(feature = "gfm")]
#[derive(Debug, Clone, PartialEq)]
pub enum TaskListStatus {
/// Checked/completed task
Checked,
/// Unchecked/incomplete task
Unchecked,
}
/// Main node type, representing an element in a CommonMark document
#[derive(Debug, Clone, PartialEq)]
pub enum Node {
/// Root document node, contains child nodes
Document(Vec<Node>),
// Leaf blocks
// Thematic breaks
/// Thematic break (horizontal rule)
ThematicBreak,
// ATX headings & Setext headings
/// Heading, contains level (1-6) and inline content
Heading {
/// Heading level, 1-6
level: u8,
/// Heading content, containing inline elements
content: Vec<Node>,
/// Heading type (ATX or Setext)
heading_type: HeadingType,
},
// Indented code blocks & Fenced code blocks
/// Code block, containing optional language identifier and content
CodeBlock {
/// Optional language identifier (None for indented code blocks, Some for fenced code blocks)
language: Option<EcoString>,
/// Code content
content: EcoString,
/// The type of code block (Indented or Fenced)
block_type: CodeBlockType,
},
// HTML blocks
/// HTML block
HtmlBlock(EcoString),
// Link reference definitions
/// Link reference definition
LinkReferenceDefinition {
/// Link label (used for reference)
label: EcoString,
/// Link destination URL
destination: EcoString,
/// Optional link title
title: Option<EcoString>,
},
// Paragraphs
/// Paragraph node, containing inline elements
Paragraph(Vec<Node>),
// Blank lines - typically handled during parsing, not represented in AST
// Container blocks
// Block quotes
/// Block quote, containing any block-level elements
BlockQuote(Vec<Node>),
// & List items and Lists
/// Ordered list, containing starting number and list items
OrderedList {
/// List starting number
start: u32,
/// List items
items: Vec<ListItem>,
},
/// Unordered list, containing list items
UnorderedList(Vec<ListItem>),
/// Table (extension to CommonMark)
Table {
/// Header cells
headers: Vec<Node>,
/// Column alignments for the table
#[cfg(feature = "gfm")]
alignments: Vec<TableAlignment>,
/// Table rows, each row containing multiple cells
rows: Vec<Vec<Node>>,
},
// Inlines
// Code spans
/// Inline code
InlineCode(EcoString),
// Emphasis and strong emphasis
/// Emphasis (italic)
Emphasis(Vec<Node>),
/// Strong emphasis (bold)
Strong(Vec<Node>),
/// Strikethrough (GFM extension)
Strikethrough(Vec<Node>),
// Links
/// Link
Link {
/// Link URL
url: EcoString,
/// Optional link title
title: Option<EcoString>,
/// Link text
content: Vec<Node>,
},
/// Reference link
ReferenceLink {
/// Link reference label
label: EcoString,
/// Link text content (optional, if empty it's a shortcut reference)
content: Vec<Node>,
},
// Images
/// Image
Image {
/// Image URL
url: EcoString,
/// Optional image title
title: Option<EcoString>,
/// Alternative text, containing inline elements
alt: Vec<Node>,
},
// Autolinks
/// Autolink (URI or email wrapped in < and >)
Autolink {
/// Link URL
url: EcoString,
/// Whether this is an email autolink
is_email: bool,
},
/// GFM Extended Autolink (without angle brackets, automatically detected)
ExtendedAutolink(EcoString),
// Raw HTML
/// HTML inline element
HtmlElement(HtmlElement),
// Hard line breaks
/// Hard break (two spaces followed by a line break, or backslash followed by a line break)
HardBreak,
// Soft line breaks
/// Soft break (single line break)
SoftBreak,
// Textual content
/// Plain text
Text(EcoString),
/// Custom node that allows users to implement their own writing behavior
Custom(Box<dyn CustomNode>),
}
impl Default for Node {
fn default() -> Self {
Node::Document(vec![])
}
}
/// List item type
#[derive(Debug, Clone, PartialEq)]
pub enum ListItem {
/// Unordered list item
Unordered {
/// List item content, containing one or more block-level elements
content: Vec<Node>,
},
/// Ordered list item
Ordered {
/// Optional item number for ordered lists, allowing manual numbering
number: Option<u32>,
/// List item content, containing one or more block-level elements
content: Vec<Node>,
},
/// Task list item (GFM extension)
#[cfg(feature = "gfm")]
Task {
/// Task completion status
status: TaskListStatus,
/// List item content, containing one or more block-level elements
content: Vec<Node>,
},
}
impl Node {
/// Check if a node is a block-level node
pub fn is_block(&self) -> bool {
match self {
Node::Custom(node) => node.is_block(),
_ => matches!(
self,
Node::Document(_)
// Leaf blocks
| Node::ThematicBreak
| Node::Heading { .. }
| Node::CodeBlock { .. }
| Node::HtmlBlock(_)
| Node::LinkReferenceDefinition { .. }
| Node::Paragraph(_)
// Container blocks
| Node::BlockQuote(_)
| Node::OrderedList { .. }
| Node::UnorderedList(_)
| Node::Table { .. }
),
}
}
/// Check if a node is an inline node
pub fn is_inline(&self) -> bool {
match self {
Node::Custom(node) => !node.is_block(),
_ => matches!(
self,
// Inlines
// Code spans
Node::InlineCode(_)
// Emphasis and strong emphasis
| Node::Emphasis(_)
| Node::Strong(_)
| Node::Strikethrough(_)
// Links
| Node::Link { .. }
| Node::ReferenceLink { .. }
// Images
| Node::Image { .. }
// Autolinks
| Node::Autolink { .. }
| Node::ExtendedAutolink(_)
// Raw HTML
| Node::HtmlElement(_)
// Hard line breaks
| Node::HardBreak
// Soft line breaks
| Node::SoftBreak
// Textual content
| Node::Text(_)
),
}
}
/// Create a heading node
///
/// # Arguments
/// * `level` - Heading level (1-6)
/// * `content` - Heading content
///
/// # Returns
/// A new heading node, default ATX type
pub fn heading(level: u8, content: Vec<Node>) -> Self {
Node::Heading {
level,
content,
heading_type: HeadingType::default(),
}
}
/// Create a code block node
///
/// # Arguments
/// * `language` - Optional language identifier
/// * `content` - Code content
///
/// # Returns
/// A new code block node, default Fenced type
pub fn code_block(language: Option<EcoString>, content: EcoString) -> Self {
Node::CodeBlock {
language,
content,
block_type: CodeBlockType::default(),
}
}
/// Create a strikethrough node
///
/// # Arguments
/// * `content` - Content to be struck through
///
/// # Returns
/// A new strikethrough node
pub fn strikethrough(content: Vec<Node>) -> Self {
Node::Strikethrough(content)
}
/// Create a task list item
///
/// # Arguments
/// * `status` - Task completion status
/// * `content` - Task content
///
/// # Returns
/// A new task list item
#[cfg(feature = "gfm")]
pub fn task_list_item(status: TaskListStatus, content: Vec<Node>) -> ListItem {
ListItem::Task { status, content }
}
/// Create a table with alignment
///
/// # Arguments
/// * `headers` - Table header cells
/// * `alignments` - Column alignments
/// * `rows` - Table rows
///
/// # Returns
/// A new table node with alignment information
#[cfg(feature = "gfm")]
pub fn table_with_alignment(
headers: Vec<Node>,
alignments: Vec<TableAlignment>,
rows: Vec<Vec<Node>>,
) -> Self {
Node::Table {
headers,
alignments,
rows,
}
}
/// Check if a custom node is of a specific type, and return a reference to that type
pub fn as_custom_type<T: CustomNode + 'static>(&self) -> Option<&T> {
if let Node::Custom(node) = self {
node.as_any().downcast_ref::<T>()
} else {
None
}
}
/// Check if a node is a custom node of a specific type
pub fn is_custom_type<T: CustomNode + 'static>(&self) -> bool {
self.as_custom_type::<T>().is_some()
}
}

Some files were not shown because too many files have changed in this diff Show more