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

This commit is contained in:
Myriad-Dreamin 2025-06-07 12:31:14 +08:00 committed by GitHub
parent 3d24320674
commit 7a30cbdc73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 214 deletions

View file

@ -125,111 +125,6 @@ the appearance and the position of each cell.
)
```
======
A table of items.
Tables are used to arrange content in cells. Cells can contain arbitrary
content, including multiple paragraphs and are specified in row-major order.
For a hands-on explanation of all the ways you can use and customize tables
in Typst, check out the [table guide](https://typst.app/docs/guides/table-guide/).
Because tables are just grids with different defaults for some cell
properties (notably `stroke` and `inset`), refer to the [grid
documentation](https://typst.app/docs/reference/layout/grid/) for more information on how to size the table tracks
and specify the cell appearance properties.
If you are unsure whether you should be using a table or a grid, consider
whether the content you are arranging semantically belongs together as a set
of related data points or similar or whether you are just want to enhance
your presentation by arranging unrelated content in a grid. In the former
case, a table is the right choice, while in the latter case, a grid is more
appropriate. Furthermore, Typst will annotate its output in the future such
that screenreaders will announce content in `table` as tabular while a
grid's content will be announced no different than multiple content blocks
in the document flow.
Note that, to override a particular cell's properties or apply show rules on
table cells, you can use the [`table.cell`](https://typst.app/docs/reference/model/table/#definitions-cell) element. See its
documentation for more information.
Although the `table` and the `grid` share most properties, set and show
rules on one of them do not affect the other.
To give a table a caption and make it [referenceable](https://typst.app/docs/reference/model/ref/), put it into a
[figure].
# Example
The example below demonstrates some of the most common table options.
```typ
#table(
columns: (1fr, auto, auto),
inset: 10pt,
align: horizon,
table.header(
[], [*Volume*], [*Parameters*],
),
image("cylinder.svg"),
$ pi h (D^2 - d^2) / 4 $,
[
$h$: height \
$D$: outer radius \
$d$: inner radius
],
image("tetrahedron.svg"),
$ sqrt(2) / 12 a^3 $,
[$a$: edge length]
)
```
Much like with grids, you can use [`table.cell`](https://typst.app/docs/reference/model/table/#definitions-cell) to customize
the appearance and the position of each cell.
```typ
>>> #set page(width: auto)
>>> #set text(font: "IBM Plex Sans")
>>> #let gray = rgb("#565565")
>>>
#set table(
stroke: none,
gutter: 0.2em,
fill: (x, y) =>
if x == 0 or y == 0 { gray },
inset: (right: 1.5em),
)
#show table.cell: it => {
if it.x == 0 or it.y == 0 {
set text(white)
strong(it)
} else if it.body == [] {
// Replace empty cells with 'N/A'
pad(..it.inset)[_N/A_]
} else {
it
}
}
#let a = table.cell(
fill: green.lighten(60%),
)[A]
#let b = table.cell(
fill: aqua.lighten(60%),
)[B]
#table(
columns: 4,
[], [Exam 1], [Exam 2], [Exam 3],
[John], [], a, [],
[Mary], [], a, a,
[Robert], b, a, b,
)
```
# Rest Parameters
## children

View file

@ -18,24 +18,6 @@ let cases(
======
A case distinction.
Content across different branches can be aligned with the `&` symbol.
# Example
```typ
$ f(x, y) := cases(
1 "if" (x dot y)/2 <= 0,
2 "if" x "is even",
3 "if" x in NN,
4 "else",
) $
```
======
A case distinction.
Content across different branches can be aligned with the `&` symbol.

View file

@ -16,24 +16,6 @@ let pagebreak(
======
A manual page break.
Must not be used inside any containers.
# Example
```typ
The next page contains
more details on compound theory.
#pagebreak()
== Compound Theory
In 1984, the first ...
```
======
A manual page break.
Must not be used inside any containers.

View file

@ -100,7 +100,7 @@ impl HoverWorker<'_> {
let source = self.source.clone();
let leaf = LinkedNode::new(source.root()).leaf_at_compat(self.cursor)?;
self.definition()
self.definition(&leaf)
.or_else(|| self.star(&leaf))
.or_else(|| self.link(&leaf))
}
@ -116,8 +116,7 @@ impl HoverWorker<'_> {
}
/// Definition analysis results
fn definition(&mut self) -> Option<()> {
let leaf = LinkedNode::new(self.source.root()).leaf_at_compat(self.cursor)?;
fn definition(&mut self, leaf: &LinkedNode) -> Option<()> {
let syntax = classify_syntax(leaf.clone(), self.cursor)?;
let def = self
.ctx