Skip to content

Replace Default impls for AstNode with new placeholder method - #7897

Merged
laurmaedje merged 1 commit into
typst:mainfrom
isuffix:astnode-placeholder
Mar 4, 2026
Merged

laurmaedje merged 1 commit into
typst:mainfrom
isuffix:astnode-placeholder

Conversation

@isuffix

@isuffix isuffix commented Feb 19, 2026

Copy link
Copy Markdown
Collaborator

This adds a new placeholder method to the AstNode trait that formalizes the previously implicit guarantee that AST nodes would not panic if constructed incorrectly.

Comment thread crates/typst-eval/src/call.rs Resolved
@isuffix isuffix added the internals About internal changes to the codebase. label Feb 19, 2026
@isuffix
isuffix force-pushed the astnode-placeholder branch 3 times, most recently from 2fad3e9 to 48e1d86 Compare February 26, 2026 21:28
Comment thread crates/typst-syntax/src/ast.rs Resolved
Comment thread crates/typst-syntax/src/ast.rs Resolved
Comment thread crates/typst-syntax/src/ast.rs Resolved
@laurmaedje laurmaedje added waiting-on-author Pull request waits on author syntax About syntax, parsing, etc. labels Mar 2, 2026
@isuffix
isuffix force-pushed the astnode-placeholder branch 3 times, most recently from b55b0ae to a154893 Compare March 3, 2026 20:55
@isuffix

isuffix commented Mar 4, 2026 •

Copy link
Copy Markdown
Collaborator Author

I've rebased off main, updated the comments, and used unwrap_or_else wherever we construct a placeholder.
This is ready for review.

@isuffix
isuffix force-pushed the astnode-placeholder branch from a154893 to c6c72ab Compare March 4, 2026 04:29
@isuffix isuffix mentioned this pull request Mar 4, 2026
@laurmaedje laurmaedje added waiting-on-review This PR is waiting to be reviewed. and removed waiting-on-author Pull request waits on author labels Mar 4, 2026
@laurmaedje
laurmaedje added this pull request to the merge queue Mar 4, 2026
@laurmaedje

Copy link
Copy Markdown
Member

Thanks!

@laurmaedje laurmaedje removed the waiting-on-review This PR is waiting to be reviewed. label Mar 4, 2026
Merged via the queue into typst:main with commit 3239fcc Mar 4, 2026
8 checks passed
@isuffix
isuffix deleted the astnode-placeholder branch March 4, 2026 18:12
jassielof pushed a commit to jassielof/typst that referenced this pull request Apr 7, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 15, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 15, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 24, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request May 24, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request Jun 1, 2026
ParaN3xus added a commit to ParaN3xus/tinymist that referenced this pull request Jun 1, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin pushed a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 13, 2026
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the path-model group and keeps this slice focused on analyzer, query,
debug, lint, eval, and typlite API adaptation.

## Upstream Typst Changes

- [`typst/typst#7542`](typst/typst#7542) changes
function internals. Tinymist updates signature, definition, hover, and
rename paths that inspect function internals.
- [`typst/typst#7543`](typst/typst#7543) moves
call sites toward `to_element`-style element handling. Tinymist updates
field access, completion kind inference, and syntax type checking
accordingly.
- [`typst/typst#7808`](typst/typst#7808) changes
parameter metadata. Tinymist updates signature help, built-in type
metadata, scope completion, and type completion to the new parameter
representation.
- [`typst/typst#8215`](typst/typst#8215)
requests the standard library from `World` once upfront. Tinymist
updates tracked values, upstream helpers, global analysis, DAP request
evaluation, and eval engine construction to use the preloaded library
path.
- [`typst/typst#7865`](typst/typst#7865),
[`typst/typst#8116`](typst/typst#8116), and
`typst/typst@5326cd297` adjust math call, math field, and prime syntax.
Tinymist updates syntax matchers, coverage instrumentation, debugger
instrumentation, lint behavior, expression parsing, and query fixtures.
- [`typst/typst#7490`](typst/typst#7490) and
`typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates
document metrics and symbol glyph handling.
- `typst/typst@0f04fd176` changes diagnostic hints into spanned values.
Tinymist updates diagnostic hint rendering.
- [`typst/typst#7897`](typst/typst#7897)
introduces import item placeholders and related attach/text API changes.
Tinymist updates import completions and math text/attach matching.
- Typst 0.15 makes `typst::ROUTINES` private, adds the library argument
to `typst_eval::eval`, and protects engine introspection. Tinymist
updates `typst-shim` eval for both nightly and default feature builds.

## Tinymist Changes

- Ports analysis and query code to the updated function, element,
parameter, font, and math syntax APIs.
- Updates debug coverage and debugger instrumentation for the new math
call/field syntax shapes.
- Updates lint behavior so function-call and math-call handling stay
aligned.
- Updates DAP and `crityp` to the preloaded engine library path.
- Updates `typst-shim` eval and syntax compatibility modules so both
`nightly` and default feature builds compile against the current Typst
0.15 dependency set.
- Refreshes targeted query and typlite fixtures affected by these API
and syntax behavior changes.

---------

Co-authored-by: paran3xus <[email protected]>
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the path-model group and keeps this slice focused on analyzer, query,
debug, lint, eval, and typlite API adaptation.

- [`typst/typst#7542`](typst/typst#7542) changes
function internals. Tinymist updates signature, definition, hover, and
rename paths that inspect function internals.
- [`typst/typst#7543`](typst/typst#7543) moves
call sites toward `to_element`-style element handling. Tinymist updates
field access, completion kind inference, and syntax type checking
accordingly.
- [`typst/typst#7808`](typst/typst#7808) changes
parameter metadata. Tinymist updates signature help, built-in type
metadata, scope completion, and type completion to the new parameter
representation.
- [`typst/typst#8215`](typst/typst#8215)
requests the standard library from `World` once upfront. Tinymist
updates tracked values, upstream helpers, global analysis, DAP request
evaluation, and eval engine construction to use the preloaded library
path.
- [`typst/typst#7865`](typst/typst#7865),
[`typst/typst#8116`](typst/typst#8116), and
`typst/typst@5326cd297` adjust math call, math field, and prime syntax.
Tinymist updates syntax matchers, coverage instrumentation, debugger
instrumentation, lint behavior, expression parsing, and query fixtures.
- [`typst/typst#7490`](typst/typst#7490) and
`typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates
document metrics and symbol glyph handling.
- `typst/typst@0f04fd176` changes diagnostic hints into spanned values.
Tinymist updates diagnostic hint rendering.
- [`typst/typst#7897`](typst/typst#7897)
introduces import item placeholders and related attach/text API changes.
Tinymist updates import completions and math text/attach matching.
- Typst 0.15 makes `typst::ROUTINES` private, adds the library argument
to `typst_eval::eval`, and protects engine introspection. Tinymist
updates `typst-shim` eval for both nightly and default feature builds.

- Ports analysis and query code to the updated function, element,
parameter, font, and math syntax APIs.
- Updates debug coverage and debugger instrumentation for the new math
call/field syntax shapes.
- Updates lint behavior so function-call and math-call handling stay
aligned.
- Updates DAP and `crityp` to the preloaded engine library path.
- Updates `typst-shim` eval and syntax compatibility modules so both
`nightly` and default feature builds compile against the current Typst
0.15 dependency set.
- Refreshes targeted query and typlite fixtures affected by these API
and syntax behavior changes.

---------

Co-authored-by: paran3xus <[email protected]>
Myriad-Dreamin added a commit to Myriad-Dreamin/tinymist that referenced this pull request Jun 15, 2026
This PR is part of the Typst 0.15 nightly cleanup stack. It sits on top
of the path-model group and keeps this slice focused on analyzer, query,
debug, lint, eval, and typlite API adaptation.

- [`typst/typst#7542`](typst/typst#7542) changes
function internals. Tinymist updates signature, definition, hover, and
rename paths that inspect function internals.
- [`typst/typst#7543`](typst/typst#7543) moves
call sites toward `to_element`-style element handling. Tinymist updates
field access, completion kind inference, and syntax type checking
accordingly.
- [`typst/typst#7808`](typst/typst#7808) changes
parameter metadata. Tinymist updates signature help, built-in type
metadata, scope completion, and type completion to the new parameter
representation.
- [`typst/typst#8215`](typst/typst#8215)
requests the standard library from `World` once upfront. Tinymist
updates tracked values, upstream helpers, global analysis, DAP request
evaluation, and eval engine construction to use the preloaded library
path.
- [`typst/typst#7865`](typst/typst#7865),
[`typst/typst#8116`](typst/typst#8116), and
`typst/typst@5326cd297` adjust math call, math field, and prime syntax.
Tinymist updates syntax matchers, coverage instrumentation, debugger
instrumentation, lint behavior, expression parsing, and query fixtures.
- [`typst/typst#7490`](typst/typst#7490) and
`typst/typst@cfdd4238b` change font metadata APIs. Tinymist updates
document metrics and symbol glyph handling.
- `typst/typst@0f04fd176` changes diagnostic hints into spanned values.
Tinymist updates diagnostic hint rendering.
- [`typst/typst#7897`](typst/typst#7897)
introduces import item placeholders and related attach/text API changes.
Tinymist updates import completions and math text/attach matching.
- Typst 0.15 makes `typst::ROUTINES` private, adds the library argument
to `typst_eval::eval`, and protects engine introspection. Tinymist
updates `typst-shim` eval for both nightly and default feature builds.

- Ports analysis and query code to the updated function, element,
parameter, font, and math syntax APIs.
- Updates debug coverage and debugger instrumentation for the new math
call/field syntax shapes.
- Updates lint behavior so function-call and math-call handling stay
aligned.
- Updates DAP and `crityp` to the preloaded engine library path.
- Updates `typst-shim` eval and syntax compatibility modules so both
`nightly` and default feature builds compile against the current Typst
0.15 dependency set.
- Refreshes targeted query and typlite fixtures affected by these API
and syntax behavior changes.

---------

Co-authored-by: paran3xus <[email protected]>
Dikluwe pushed a commit to Dikluwe/typst-crystalline that referenced this pull request Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internals About internal changes to the codebase. syntax About syntax, parsing, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants