Skip to content

Prevent hover hangs outside single-line display math - #1212

Open
moritzketzer wants to merge 1 commit into
quarto-dev:mainfrom
moritzketzer:fix/display-math-hover-hang
Open

moritzketzer wants to merge 1 commit into
quarto-dev:mainfrom
moritzketzer:fix/display-math-hover-hang

Conversation

@moritzketzer

Copy link
Copy Markdown

Hovering over after in a .qmd file containing Before $$x$$ after hangs the language server.

The single-line display-math regex is missing the g flag, so inlineMathRange() keeps finding the same match when the cursor is outside it. Adding the flag lets the scan advance and terminate.

Includes regression tests for positions before, between and after expressions, plus repeated lookups. The tests use a timeout so this regression cannot hang the test suite.

Reproduced with the language servers bundled in Quarto VS Code 1.138.0 and 1.139.0 on macOS arm64. Core and LSP tests, core lint, and the LSP build pass.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

2 participants