Skip to content

feat: upgrade fink to v0.4.0 with WAT/CPS sourcemap sync#21

Merged
kollhof merged 2 commits into
mainfrom
feat/deps-upgrade
Mar 28, 2026
Merged

feat: upgrade fink to v0.4.0 with WAT/CPS sourcemap sync#21
kollhof merged 2 commits into
mainfrom
feat/deps-upgrade

Conversation

@kollhof

@kollhof kollhof commented Mar 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrade fink crate from v0.3.0 to v0.4.0 — updated pipeline to use partial::apply → lower_module, replacing lower_expr and closure_lifting::lift_all
  • WAT panel: strip inline sourceMappingURL from displayed text and use it for source↔WAT cursor sync with tight s-expression span highlighting
  • Fix VLQ sourcemap decoder: 1-field stop-marker segments were silently dropping column deltas, causing CPS/WAT mapped positions to be off by up to 4 cols
  • Fix CPS panel: clear source→CPS highlight when clicking into CPS editor; fix tokenizer timing so highlights apply immediately on reparse

Test plan

  • Type foo = fn aa, bb:\n aa + bb in the source editor
  • CPS tab: clicking aa, bb, +, foo in source highlights the correct token in CPS
  • CPS tab: clicking in CPS highlights the correct token in source
  • WAT tab: clicking aa, bb, + in source highlights the correct (local.get $xx) span in WAT (not the whole line)
  • CPS highlight from source click is cleared when clicking anywhere in CPS editor
  • No red squiggly on import keyword

kollhof added 2 commits March 28, 2026 15:31
- Upgrade fink crate from v0.3.0 to v0.4.0:
  - Replace closure_lifting::lift_all with lifting::lift
  - Switch from lower_expr to lower_module (correct entry for module-level CPS)
  - Add partial::apply before scopes in all pipelines (required by v0.4.0)
  - Add scopes::analyse for ScopeResult required by lower_module
  - Add SynthIdent arm to node_kind_label, serialize_children, collect_tokens

- WAT panel: strip inline sourceMappingURL comment from displayed WAT text
  and parse it for source↔WAT cursor sync (highlight line on src cursor move)

- Fix VLQ sourcemap decoder: unmapped stop-marker segments (1-field VLQ)
  must still advance the column accumulator — skipping them caused col
  positions to be 4 units low (e.g. cpsCol 30/32 instead of 34/41)

- Fix CPS panel: clear source→CPS highlight decoration when clicking in CPS
  (was persisting after source-driven sync until next source cursor move)

- Fix CPS tokenizer timing: call tokenizer.update() before model.setValue()
  so Monaco's re-tokenize pass sees the new tokens immediately

- Add WAT syntax highlighting via hand-written Monarch tokenizer
WAT panel:
- Fix VLQ decoder: unmapped stop-marker segments (1-field) must advance
  the column accumulator even though they emit no mapping entry — fixes
  col positions being off when stop markers precede mapped segments
- Switch from whole-line to inline highlight decoration
- Use s-expression paren matching to tightly bound the highlight span,
  falling back to next mapped col then end-of-line

CPS panel:
- Same VLQ decoder fix (1-field segments advance col accumulator)
- Clear source→CPS highlight decoration when CPS cursor moves, so
  source-driven highlights don't persist after clicking into CPS
@github-actions

Copy link
Copy Markdown

This PR will release v1.14.0

@kollhof kollhof merged commit c84289f into main Mar 28, 2026
2 checks passed
@kollhof kollhof deleted the feat/deps-upgrade branch March 28, 2026 17:02
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.14.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant