fix(modules): count name characters without Intl.Segmenter (LSP crash on Fedora's Node) #312

Merged
abiwab merged 1 commit from fix/lint-no-intl-segmenter into dev/1.6 2026-11-29 11:06:28 +01:00
Owner

Found while running editors/smoke/run.sh for the tree-sitter bump: in the smoke container (Fedora 43, nodejs-22.22.2-2.fc43, reduced ICU), the language server died with SIGSEGV on the first document it linted: Intl.Segmenter#segment() segfaults on that Node build, and SUSPECT_INGREDIENT_NAME (dev/1.6 only, nothing on main) used it to count graphemes. A user on that Node would see the server crash on every file.

  • characterCount(): code points, minus combining marks, variation selectors, skin-tone modifiers and ZWJ + joined emoji (regex property escapes, which work on that build). Close enough to graphemes for a 40-character threshold.
  • Test: a decomposed accent and a ZWJ emoji count as one character each.
  • No Intl.Segmenter left in packages/*/src.

Checks: modules / language-server tests, lint; editors/smoke/run.sh (Neovim, Helix, Emacs) all ok, combined with #313's bump. Unreleased dev/1.6 code: no changeset.

Found while running `editors/smoke/run.sh` for the tree-sitter bump: in the smoke container (Fedora 43, `nodejs-22.22.2-2.fc43`, reduced ICU), **the language server died with SIGSEGV on the first document it linted**: `Intl.Segmenter#segment()` segfaults on that Node build, and `SUSPECT_INGREDIENT_NAME` (dev/1.6 only, nothing on `main`) used it to count graphemes. A user on that Node would see the server crash on every file. - `characterCount()`: code points, minus combining marks, variation selectors, skin-tone modifiers and ZWJ + joined emoji (regex property escapes, which work on that build). Close enough to graphemes for a 40-character threshold. - Test: a decomposed accent and a ZWJ emoji count as one character each. - No `Intl.Segmenter` left in `packages/*/src`. Checks: modules / language-server tests, lint; `editors/smoke/run.sh` (Neovim, Helix, Emacs) all `ok`, combined with #313's bump. Unreleased dev/1.6 code: no changeset.
fix(modules): count name characters without Intl.Segmenter, which crashes some Node builds
All checks were successful
CI / Build & Test (pull_request) Successful in 5m13s
c8e99b76f4
abiwab merged commit f0a1bfcadc into dev/1.6 2026-11-29 11:06:28 +01:00
abiwab deleted branch fix/lint-no-intl-segmenter 2026-11-29 11:06:29 +01:00
Sign in to join this conversation.
No description provided.