Skip to content

Skip Markdown structure scans without link delimiters - #35055

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/editor-link-free-admission
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/editor-link-free-admission

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

Problem

getMarkdownDocLinkDecorationRanges runs when a Markdown source pane mounts and on every debounced content change. Each run builds the fenced-code ranges and walks every line, even when the document has no [[...]] wiki links, which is true of most Markdown files.

Fix

Search for the delimiters before doing any structural work. If there is no [[, or no ]] after the first [[, no link can exist, so return [] before the fence scan and the line walk. The first ]] search now starts at nextOpen + 2 instead of 0. This finds the same closing delimiter the loop's re-search would have found, so output does not change.

Test

  • pnpm test src/renderer/src/components/editor/monaco-markdown-doc-link-decorations: the existing output oracle, generated-syntax corpus, fence, CRLF and inline-code tests pass unchanged.
  • pnpm check:changed passes.

@OrcaWin
OrcaWin force-pushed the OrcaWin/editor-link-free-admission branch from 91075c6 to 55ef4ff Compare October 28, 2026 23:17
@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 00:08
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 42d1348b-7e09-448c-8b58-11bffae73f12
Commits

Reviewing files that changed from the base of the PR and between b2feed0 and 0f18d39.

Files selected for processing: 1
  • src/renderer/src/components/editor/monaco-markdown-doc-link-decorations.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

getMarkdownDocLinkDecorationRanges now checks for link delimiters before scanning fences and lines.

  • The Markdown link scan checks for possible links before scanning document structure.

Reviews (2) · Last reviewed commit: "perf(editor): skip Markdown link structu..." · Reviewed by Greptile

@OrcaWin
OrcaWin force-pushed the OrcaWin/editor-link-free-admission branch from 55ef4ff to 0f18d39 Compare October 29, 2026 00:27
@OrcaWin
OrcaWin merged commit dd34216 into main Oct 29, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant