Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6be1387
feature(processing): upd fragments cross reference
Nov 28, 2026
9b2c415
feature(processing): upd fragments cross reference
Nov 28, 2026
f2e1d77
Docs: review and revise the inline inclusion spec; fill in submission.
Arsen-kbtu Nov 28, 2026
3061a13
Docs: review and revise the inline inclusion spec; fill in submission.
Arsen-kbtu Nov 28, 2026
8914440
Docs: fill in the last review in submission.md.
Arsen-kbtu Nov 28, 2026
8808984
Docs: fill in the last review in submission.md.
Arsen-kbtu Nov 28, 2026
19ade8f
feature(processing): upd fragments cross reference
Nov 28, 2026
d3e07d0
feature(processing): upd fragments cross reference
Nov 28, 2026
6a8cbc2
Fix Windows extension build by invoking NAPI through pnpm
Dec 2, 2026
65a38bf
Fix Windows extension build by invoking NAPI through pnpm
drj228 Dec 2, 2026
876c518
Correct Markdown fragment scope and record specification reviews
Dec 2, 2026
293c7b6
Correct Markdown fragment scope and record specification reviews
drj228 Dec 2, 2026
f6cd61d
Merge pull request #1 from drj228/feature-markdown-2
ASPLightNext Dec 2, 2026
f812c11
Merge pull request #1 from drj228/feature-markdown-2
ASPLightNext Dec 2, 2026
bb29737
feature(processing): fragments in markdown upd
Dec 2, 2026
748d856
feature(processing): fragments in markdown upd
Dec 2, 2026
93e1c4d
Merge remote-tracking branch 'origin/feature-markdown-2' into feature…
Dec 2, 2026
cfe5d79
feature(processing): upd fragments markdown
Dec 2, 2026
0df1b03
feature(processing): upd fragments markdown
Dec 2, 2026
43c014c
feature(processing): upd fragments markdown
Dec 2, 2026
4e7a67a
feature(processing): upd fragments markdown
Dec 2, 2026
8110458
feature(processing): upd fragments markdown
Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ target/
/server/scripts/capture-analysis-*/

# CodeChat Editor lexer: python. See TODO.

# Local editor, OS, and personal files.
.DS_Store
.idea/
/app.log
/out/
4 changes: 2 additions & 2 deletions builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ fn run_extensions_build(
let distflag = if dist { "--minify" } else { "--sourcemap" };

// The NAPI build.
let mut napi_args = vec!["napi", "build", "--platform", "--output-dir", "src"];
let mut napi_args = vec!["exec", "napi", "build", "--platform", "--output-dir", "src"];
if dist {
napi_args.push("--release");
}
Expand All @@ -701,7 +701,7 @@ fn run_extensions_build(
target = tmp;
napi_args.extend(["--target", &target]);
}
run_script("npx", &napi_args, VSCODE_PATH, true)?;
run_script("pnpm", &napi_args, VSCODE_PATH, true)?;

// Ensure the JavaScript data structures generated from Rust are up to date.
run_cmd!(
Expand Down
2 changes: 1 addition & 1 deletion extensions/VSCode/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static/
# NAPI-RS
src/index.d.ts
src/index.js
src/codechat-editor-client.win32-x64-msvc.node
src/codechat-editor-client.*.node
.windows/
*.log
# CodeChat Editor lexer: python. See TODO.
91 changes: 91 additions & 0 deletions review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
Review: "Fragments in Markdown documents" (round 1)
=================================================

Section reviewed: "Fragments in Markdown documents" (`cc-JzLRfBr83U`) in
`server/src/processing/cache-spec.md`, checked against the rest of the spec and
the current implementation (`server/src/processing.rs`: `hydrate_html`,
`hydrating_walk_node`, `store_fragment_contents`, `CLEAN_FRAGMENT_HTML`). The
implementation still rejects every fragment in a Markdown document, so this is
a review of the specification only.

Findings
--------

1. **Medium: the opening contradicts the details.** The first paragraph says
that "the rules above don't apply" to a Markdown document, yet the details
say that "the other rules for fragments hold unchanged" (id, `following`
parsing, hoisting, errors, gather elements in the extent). The section
should name the rules it replaces: the extent, what `following` counts, what
`following="0"` encloses, clamping, and the rendered layout (line numbers,
indents, `cc-fragment-*` wrappers).

2. **Medium: when blocks are counted is ambiguous.** "Blocks are counted in the
rendered HTML" doesn't say before or after hydration. Hydration adds a
top-level `<div class="cc-gather-items">` after each gather element, which
would change `following` counts and section contents if counted. "Stored
content" implies the count happens before gather lists, but the extent rules
should say so directly: blocks are the top-level nodes of the HTML
translated from the Markdown, after hoisting fragment content and before
cache hydration. Math and diagram hydration replace elements one for one,
so they don't change the count.

3. **Medium: top-level nodes other than elements aren't covered.**
* A raw HTML block (CommonMark type 7) can leave non-whitespace text at the
top level, e.g. text on the lines after `<span>` alone on a line. Is it
a block, part of a neighboring block, or ignored?
* `<fragment id="a">` alone on a line, without its closing tag on that line,
is a type 7 HTML block, so the `<fragment>` element is itself a top-level
node; after hoisting, the text which followed it is top-level too. Which
block "holds the tag" in that case is undefined.

4. **Minor: trailing whitespace and comments.** "Stored content" says
whitespace and comments between enclosed blocks are kept and those before
the first enclosed block aren't, but says nothing about those after the
last enclosed block.

5. **Minor: other parts of the spec still describe only source files.**
* The introduction says the cache stores "code/doc blocks for fragments".
* The fragments section says that fragments store "an HTML rendering of the
code and doc blocks they contain" which reproduces the source layout, that
`following="0"` "contains only the current doc block", and that
`following` is clamped to "the number of code/doc blocks". Each should say
"in a source file" or point to the Markdown section, as the paragraph at
the top of that section already does.

6. **Minor: the test plan omits two needed tests.**
* `test_hydrate_fragment_in_markdown` in `processing/tests.rs` expects the
error "fragments are not allowed in Markdown documents"; the plan should
say it is replaced, not kept.
* The round-trip requirement (a paragraph holding only a `<fragment>` tag is
saved as its own paragraph) needs a test through
`doc_block_html_to_markdown`, not only through hydration.

7. **Minor: the section is placed under the implementation gather element.**
The new `h3` follows `<h3 data-gather="cc-St8Bme4paE">Implementation of
Fragments and gather elements</h3>`, so it reads as part of that gathered
implementation. Put it before that gather element, or make it an `h2` as the
other top-level topics are.

8. **Nit: tables.** The details mention a tag in a list item or a block quote,
but not a tag in a table cell, which anchors to the whole table by the same
rule. One word would remove the doubt.

9. **Nit: the examples' notation.** `<f following="0">` mixes the placeholder
`<f>` with an attribute; say once that `<f ...>` stands for
`<fragment id="f" ...></fragment>`.

Counts: 9 findings (0 major, 3 medium, 4 minor, 2 nit).

Verified as correct
-------------------

* All seven rows of the example table follow from the extent rules.
* `following` accepts surrounding spaces, matching `trim().parse::<usize>()`
in `hydrating_walk_node`.
* Removing other fragments' backlinks from the content matches
`CLEAN_FRAGMENT_HTML` (`add_clean_content_tags(["fragment"])`), and keeping
comments matches `strip_comments(false)`.
* Storing content after cross-reference hydration and before gather lists
matches the phase order in `hydrate_html` (`hydrate_dom`, then
`store_fragment_contents`, then `hydrate_gathers`), and keeps
`Fragment::content` in layer 3.
Loading