Count GPUI editor positions in UTF-16 code units like ProseMirror
Summary
Problem: The round-trip harness (#7537) found that the GPUI ProseMirror port sizes text nodes in Unicode scalar values, while ProseMirror uses JS string length (UTF-16 code units). Any position exchanged with web-authored data — paste fixture offsets, comment anchor fromHint/toHint, future collaborative positions — is off by one per astral character (emoji, some CJK extension B).
Fix: pm/node.rs node_size/cut now count and slice by UTF-16 units (utf16_len, utf16_slice; a mid-surrogate index — which JS would express as a lone surrogate — clamps to the containing Rust char), and paste.rs position/caret convert byte offsets ↔ UTF-16 units instead of chars. model.rs stays byte-based internally as before. basic-unicode and markdown-table are removed from the harness's KNOWN_DIVERGENCES, so the web fixtures now assert nodeSize equality for them.
Stacked on #7537 (base branch is that PR's branch).
Verification
ubuntu-24.04 CI-equivalent container:
cargo test --locked -p desktop-gpui editor(70 passed, incl. paste.gen.json fixtures, roundtrip, new astral-text tests for sizes/cuts/resolve/caret)cargo test --locked -p desktop-gpui(466 passed)cargo clippy --locked -p desktop-gpui --all-targets --no-deps -- -D warningsrustfmt --edition 2024on changed files
Link to Devin session: https://app.devin.ai/sessions/f83ed73d85c648fcbdbd041cd4f15720
Open in Devin Desktop: https://app.devin.ai/desktop/session/f83ed73d85c648fcbdbd041cd4f15720?variant=devin
Requested by: @ComputelessComputer