Skip to content

fix(lsp): the read fix and its reseed reach dev - #317

Merged
the-homeless-god merged 3 commits into
devfrom
a/the-lsp-read-fix-reaches-dev
Oct 4, 2026
Merged

the-homeless-god merged 3 commits into
devfrom
a/the-lsp-read-fix-reaches-dev

Conversation

@the-homeless-god

Copy link
Copy Markdown
Member

Зачем

PR 295 был открыт в main, и я влил его туда же — это моя ошибка потока: в этом дереве всё идёт через dev, и релизный коммит 0.7.24 (c7226d395) лежит в обеих ветках одним хешем. После того слияния main оказался впереди dev на две правки, которых в dev нет, а значит следующий выпуск собрался бы из дерева без них либо с конфликтом в семени.

Эта ветка переносит обе правки в dev.

Что внутри

  1. Сама починка (fix(lsp), автор правки — её автор, коммит перенесён черри-пиком): язык-сервер отвечает, не дожидаясь закрытия ввода, и разбирает \uXXXX в JSON.
  2. Пересев семени прибором, а не руками. Коммит перепечатки из main черри-пиком не лёг (обе стороны разъехались в bootstrap/flang_repl.c и scripts/seed-fingerprint), поэтому семя сделано тем прибором, которым положено: run-script seed:refresh — «шапка 9 строк + источник 21410 строк — обновлён», затем отпечаток снят тем же bootstrap-reprint.sh --otpechatok, что и у печати: «строк 65, все литералы закрыты: файлов 6, строк 35547».
  3. Пять счётных примет — числа с прогона сторожа, не арифметикой: C 882835 → 883001, bootstrap 830200 → 830283, рантаймы печати 52231 → 52314, *.vim 390 → 394, строка редактора 615 → 619. После правки: «примет 209: сошлось 209, разошлось 0», опись сходится с документом по 17 языкам.

Что нужно сделать на стволе после слияния

Отпечаток называет коммит ЭТОЙ ветки (a1102df50), и rebase-слияние его перепишет — строка начнёт показывать на мёртвый sha, причём --bystro при этом останется зелёным (он находит коммит по входам печати и только советует починку). Лечение — одна строка на стволе: sh scripts/bootstrap-reprint.sh --perekommit. Сделаю сам сразу после слияния и проверю git merge-base --is-ancestor <коммит> HEAD.

Заслон перед пушем: 21 проверка из 21 зелены.

f-tester and others added 3 commits October 4, 2026 18:51
`flang lsp` and `--mcp-mode` read stdin with fread(chunk, 1, 8192, stdin),
which returns only after 8192 bytes or end of input. An editor never closes
the server's stdin, so the reply to `initialize` (334 bytes) never left: 0
bytes while the input is open, 334 after it closes. Read with read(2), which
returns what has arrived (repl_read_some).

run_text rejected any JSON string with \uXXXX, so the server dropped such a
message with "unparsed JSON" on stderr. Decode \uXXXX and surrogate pairs to
UTF-8; a lone half of a pair is still rejected.

The printed copy in bootstrap/ comes in the next commit, from a reprint
(scripts/bootstrap-reprint.sh), not by hand.

scripts/editors/lsp-check.fscript now gates on the binary answering while
stdin is open (the Node server it gated on is gone, so the gate passed
vacuously) and runs Neovim on bootstrap/flang with g:flang_dvoichnyy_lsp = 1.
Its expected definition line was 6; the declaration in
probe-transition.flang is on line 3. The check never reached that step
before, because Neovim found no server.

The binary stays opt-in in autoload/flang.vim: released binaries up to
0.7.24 still hang. README and the autoload comment say so.
docs/tree-inventory.md: five line counts remeasured.
scripts/ledgers/proved-share-ledger.txt: lsp-check.fscript remeasured with
--proof (21 written: 17 proved, 4 declared; the old line said 23/23 for a
file whose md5 had already changed).

Refs #294
The LSP fix changed flang/src/emit/c/flang_repl.c, and the seed is that
file plus a nine line header. The seed reprint commit of the main
branch could not be cherry-picked onto dev (both sides had moved), so
the seed is made by the instrument instead: run-script seed:refresh
copied the source (header 9 lines plus source 21410 lines) and stamped
the fingerprint with the same tool the print uses.

Stamped commit is the one of this branch, so after a rebase merge the
trunk needs one line of repair: bootstrap-reprint.sh --perekommit.
The fix added lines to the runtime and, through the reseed, to the
seed: C 882835 to 883001, bootstrap 830200 to 830283, print runtimes
52231 to 52314, vim 390 to 394 and the editor row 615 to 619.

Every number comes from the guard run, not from arithmetic. After the
edit: marks 209, agreed 209, diverged 0; the census agrees with the
document, 17 languages.
@the-homeless-god
the-homeless-god merged commit 6f71149 into dev Oct 4, 2026
32 checks passed
@the-homeless-god
the-homeless-god deleted the a/the-lsp-read-fix-reaches-dev branch October 4, 2026 19:13
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