this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix site build, merlin hover errors, and mermaid SPA navigation

build-site.sh: Use dune-built worker.js (--no-worker + cp) so the
worker always matches the source tree. Previously jtw compiled against
the installed js_top_worker-web package via ocamlfind, which could be
stale. Also make @site and @doc steps fail on errors instead of
swallowing them.

js_top_worker: Add blank_directives to strip #require lines from source
before sending to merlin. The pre_source context prepends previous cells'
source (including #require directives) which causes Menhir's incremental
parser to throw force_reduction errors.

x-ocaml: Add bounds checking to Typed_enclosings response in
merlin_ext.ml, matching the existing pattern for Errors. Prevents
CodeMirror RangeError when merlin returns positions outside the cell's
document range.

odoc-mermaid-extension: Fix SPA navigation by replacing Js_inline init
script with Js_url support file using MutationObserver pattern. The old
startOnLoad:true approach only worked on full page loads; now mermaid.run()
is called explicitly whenever new pre.mermaid elements appear in the DOM.

site/dune.inc: Regenerated with --warn-error on odoc compile/link/
html-generate, and -L/-P flags for library/package cross-references
from @doc build output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+8 -2
+8 -2
src/merlin_ext.ml
··· 51 51 to_ = completions.to_ - pre_len; 52 52 } 53 53 | Protocol.Typed_enclosings typed_enclosings -> 54 + let doc_len = String.length doc in 54 55 Typed_enclosings 55 - (List.map 56 - (fun (loc, a, b) -> (fix_loc pre_len loc, a, b)) 56 + (List.filter_map 57 + (fun (loc, a, b) -> 58 + let loc = fix_loc pre_len loc in 59 + let from = loc.loc_start.pos_cnum in 60 + let to_ = loc.loc_end.pos_cnum in 61 + if from < 0 || to_ > doc_len then None 62 + else Some (loc, a, b)) 57 63 typed_enclosings) 58 64 | Protocol.Added_cmis -> msg 59 65