Skip to content

Match structural brackets in native Scheme and Common Lisp - #8

Merged
tiensonqin merged 4 commits into
masterfrom
devin/1796078690-structural-lisp-brackets
Nov 30, 2026
Merged

tiensonqin merged 4 commits into
masterfrom
devin/1796078690-structural-lisp-brackets

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Emit one UTF-16 code unit per structural bracket in the native Scheme and Common Lisp stream parsers. Delimiter nodes carry matching metadata and retain their syntax style across token merging. The shared matcher uses the marked nodes and updates when the parser publishes a new tree. Long Lisp lines yield between token batches while retaining lexer state.

This addresses the examples from #7. Scheme '(")") matches offsets 1 and 5, and Common Lisp (\)) matches 0 and 3. Custom readtables and additional dialect-specific syntax remain outside the stream modes' coverage.

Validation

  • dune build @all, dune runtest, and dune build @melange-tests passed. Native and Melange cover bracket repaint with the caret stationary after parser completion.
  • The standalone native catalog built and passed its tests, including UTF-16 offsets, pairs spanning stream chunks, and lexer continuity after yielding on a long line.
  • Isolated macOS SDL/Metal testing at Logseq 8374b2ab8e linked CodeMirror ML c4ff288 and temporarily enabled matching for both native modes. The shipping Logseq dependency pin and allowlist are handled separately.

Scheme structural bracket highlighting
Common Lisp structural bracket highlighting

Link to Devin session: https://app.devin.ai/sessions/97b992ac6a93453796bebbf311e43f75
Open in Devin Desktop: https://app.devin.ai/desktop/session/97b992ac6a93453796bebbf311e43f75?variant=devin
Requested by: @tiensonqin


🟢 Devin fixed all 2 findings · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Parser-only refresh lacks coverage — Added a Native/Melange editor case that publishes a previously out-of-viewport structural closer and checks that both marks refresh while the selection remains identical.
  • Unbounded token emission on long lines — Long Lisp lines now yield between token batches and preserve lexer state when resumed. A regression checks that a continued string still excludes its literal closing parenthesis.

View findings in Devin Review · Follow Devin's work

Devin Review

@tiensonqin
tiensonqin merged commit b8e1c44 into master Nov 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant