test(order-flow): cover block comments through the write path - #195
Merged
Merged
Conversation
- Add a trivia case asserting `/* */` comments survive serialize and reattach in all four positions, including one spanning two lines - Put a block comment in the sample returns.process, so the example workspace demonstrates a construct no model file used, and the structured-write-path round trip asserts it comes back byte-identical - Regenerate the browser workspace seed, which embeds those files A line comment runs to the end of its line and a block comment does not, so a misplaced splice leaves live syntax to its right instead of commenting the remainder out. Preservation already handles both; nothing exercised the second. returns.process rather than fulfillment.process because the browser e2e needs a header comment and an effect line visible in one Monaco viewport, and five more lines between them pushes one out.
martin-fleck-at
force-pushed
the
fix/ml-comment-fixture
branch
from
September 23, 2026 21:31
c4952a3 to
9417b7d
Compare
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.
ML_COMMENTwas the one grammar rule no model file in the sample workspace used, in all three grammars — and the trivia round-trip test only used//as well. So the block-comment half of comment preservation was never exercised anywhere.The two forms are not interchangeable for this code path. A line comment's range runs to the end of its line, so a splice that misplaces one comments out whatever followed. A block comment's does not, so the same misplacement leaves live syntax to its right. Same defect, different symptom, and only the first was covered.
Preservation already handles both. This closes a coverage hole rather than fixing a bug.
/* */survives serialize and reattach in all four positions — leading, trailing on a line, dangling after the last member, and document-level — including one spanning two lines, which keeps its own line breaks because the preserver carries the token rather than a reflowed rendering.orders/returns.process, so the example workspace demonstrates a construct the grammar supports and no model file used.structured-write-pathalready round-trips that file and asserts it comes back byte-identical, so the comment is covered there for free.Why
returns.processThe first push put the comment in
fulfillment.processand e2e failed. The browser spec needs a header comment line and the effect line visible in one Monaco viewport at the same time;.view-lineelements only exist for rendered lines, so five extra lines between them pushed one out of view and two occurrence-highlighting cases found zero elements.returns.processis referenced by the spec only for a diagnostics badge count, which a comment does not change.That was my miss: I ran the order-flow server suite and not the e2e tier. This time both were run locally — 413 server tests and 69 e2e tests pass.
Found by running
langium-ai-tools'LangiumDocumentAnalyzerover the sample workspace while evaluating whether Langium AI is worth adopting. It isn't, for unrelated reasons, but the coverage report was worth keeping.