Repository navigation
fix(lsp): the read fix and its reseed reach dev - #317
Merged
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Зачем
PR 295 был открыт в
main, и я влил его туда же — это моя ошибка потока: в этом дереве всё идёт черезdev, и релизный коммит 0.7.24 (c7226d395) лежит в обеих ветках одним хешем. После того слиянияmainоказался впередиdevна две правки, которых вdevнет, а значит следующий выпуск собрался бы из дерева без них либо с конфликтом в семени.Эта ветка переносит обе правки в
dev.Что внутри
fix(lsp), автор правки — её автор, коммит перенесён черри-пиком): язык-сервер отвечает, не дожидаясь закрытия ввода, и разбирает\uXXXXв JSON.mainчерри-пиком не лёг (обе стороны разъехались вbootstrap/flang_repl.cиscripts/seed-fingerprint), поэтому семя сделано тем прибором, которым положено:run-script seed:refresh— «шапка 9 строк + источник 21410 строк — обновлён», затем отпечаток снят тем жеbootstrap-reprint.sh --otpechatok, что и у печати: «строк 65, все литералы закрыты: файлов 6, строк 35547».bootstrap830200 → 830283, рантаймы печати 52231 → 52314,*.vim390 → 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 зелены.