Skip to content

feat: go-to-definition + fix tab sync and unused-binding diagnostics#18

Merged
kollhof merged 2 commits into
mainfrom
feat/go-to-definition
Mar 24, 2026
Merged

feat: go-to-definition + fix tab sync and unused-binding diagnostics#18
kollhof merged 2 commits into
mainfrom
feat/go-to-definition

Conversation

@kollhof

@kollhof kollhof commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Go-to-definition: Register Monaco DefinitionProvider backed by the WASM get_definition() API. Supports F12 and Cmd/Ctrl+click. The ParsedDocument is kept alive across re-parses for cursor-time queries.
  • Fix tab sync decorations leaking: Tokens and AST panels no longer set editor decorations unconditionally on update() — sync is gated on the active tab. Switching to a sync tab triggers an initial sync.
  • Fix unused-binding diagnostics: Port is_ident and multi-expr module-level guards from vscode-fink, fixing spurious "unused binding '?'" warnings on anonymous functions.

Test plan

  • Open playground, write foo = 1 / foo 1 — F12 or Cmd+click on second foo jumps to binding
  • Switch to Output tab, edit code — no editor decorations appear
  • Switch to Tokens/AST tab — decorations sync to cursor immediately
  • Write foo = fn: fn a: a + 1 — no "unused binding '?'" warnings

kollhof added 2 commits March 24, 2026 14:43
Register Monaco DefinitionProvider backed by the WASM ParsedDocument's
get_definition() API. Supports F12 and Cmd/Ctrl+click. The ParsedDocument
is now kept alive across re-parses instead of being freed immediately.

Fix inactive tabs setting editor decorations: tokens-panel and ast-panel
update() methods no longer auto-sync cursor position. Sync is now driven
solely by the cursor handlers in main.ts, gated on the active tab. When
switching to a sync tab, an initial sync is triggered.
Port two guards from vscode-fink: skip non-Ident bind sites (synthetic
nodes from lambdas/patterns) and skip module-level bindings in multi-
expression modules (parent_scope check for the synthetic module-fn
wrapper). Fixes spurious "unused binding '?'" warnings on anonymous fns.
@github-actions

Copy link
Copy Markdown

This PR will release v1.11.0

@kollhof kollhof merged commit 599b31c into main Mar 24, 2026
2 checks passed
@kollhof kollhof deleted the feat/go-to-definition branch March 24, 2026 14:55
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.11.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