fix: bad route to reference pages (#1641)

* test: add tests

* fix: bad route
This commit is contained in:
Myriad-Dreamin 2025-04-09 05:08:47 +08:00 committed by GitHub
parent 5c6d9a5dee
commit fcb060280d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 445 additions and 13 deletions

View file

@ -0,0 +1 @@
$ /* ident after */ cases $

View file

@ -0,0 +1,9 @@
---
source: crates/tinymist-query/src/hover.rs
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
input_file: crates/tinymist-query/src/fixtures/hover/cases_doc.typ
---
{
"contents": "```typc\nlet cases(\n ..children: content,\n delim: array | none | str | symbol = (\"{\", \"}\"),\n gap: relative = 0% + 0.2em,\n reverse: bool = false,\n);\n```\n\n---\n\nA case distinction.\n\nContent across different branches can be aligned with the `&` symbol.\n\n# Example\n```typ\n$ f(x, y) := cases(\n 1 \"if\" (x dot y)/2 <= 0,\n 2 \"if\" x \"is even\",\n 3 \"if\" x in NN,\n 4 \"else\",\n) $\n```\n\n---\n\nA case distinction.\n\nContent across different branches can be aligned with the `&` symbol.\n\n# Example\n```typ\n$ f(x, y) := cases(\n 1 \"if\" (x dot y)/2 <= 0,\n 2 \"if\" x \"is even\",\n 3 \"if\" x in NN,\n 4 \"else\",\n) $\n```\n\n# Rest Parameters\n\n## children\n\n```typc\ntype: content\n```\n\nThe branches of the case distinction.\n\n# Named Parameters\n\n## delim\n\n```typc\ntype: array | none | str | symbol\n```\n\nThe delimiter to use.\n\nCan be a single character specifying the left delimiter, in which case\nthe right delimiter is inferred. Otherwise, can be an array containing a\nleft and a right delimiter.\n\n```typ\n#set math.cases(delim: \"[\")\n$ x = cases(1, 2) $\n```\n\n## gap (named)\n\n```typc\ntype: relative\n```\n\nThe gap between branches.\n\n```typ\n#set math.cases(gap: 1em)\n$ x = cases(1, 2) $\n```\n\n## reverse (named)\n\n```typc\ntype: bool\n```\n\nWhether the direction of cases should be reversed.\n\n```typ\n#set math.cases(reverse: true)\n$ cases(1, 2) = x $\n```\n\n---\n\n[Open docs](https://typst.app/docs/reference/math/cases/)",
"range": "0:20:0:25"
}