Repository navigation
Keep Markdown completions available when a sibling pane changes files - #34975
Conversation
5d7414e to
858315e
Compare
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] The PR appears safe to merge. SummaryKeeps Markdown
No actionable issues were found. Tests were inspected, not run.
|
858315e to
bb1134d
Compare
Problem
Split panes that show the same Markdown file share one Monaco model, because the model URI is keyed by file and host/worktree owner, not by pane. The
[[doc-link completion catalog was stored per model. When either pane closed or switched files, it cleared that model's catalog. The pane still open then got no[[completions until its document list changed or it remounted.Fix
monaco-markdown-doc-completions.ts: each model's entry now records which pane owns each catalog. Set and clear take an owner symbol.use-monaco-editor-decorations.ts: each hook instance has a stable owner symbol, which it passes on model swap, on language change and on unmount.Tests
monaco-markdown-doc-completions-retention.test.ts: two hook-level tests render the real hook in two panes on a shared model and check the actual provider output:pnpm check:changedpasses.