Commit graph

555 commits

Author SHA1 Message Date
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
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
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
Myriad-Dreamin
7de64aefe5
fix: compile warnings (#1774) 2025-05-22 11:37:44 +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
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
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
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
d85bd7428a
refactor: remove unused code (#1728) 2025-05-01 17:58:15 +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
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
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
Luyan Zhou
2b3eb252f0
fix: built-in CSL styles are recognized as path link (#1704) 2025-04-25 13:42:02 +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
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
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
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
3d6c712565
feat: pass world to linter (#1650) 2025-04-14 21:37:29 +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
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
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
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
bceb93b944
fix: correct name_range impl (#1623) 2025-04-04 06:25:21 +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
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