Skip to content

Conversation

@jlelong
Copy link
Contributor

@jlelong jlelong commented Oct 20, 2025

This PR fixes jlelong/vscode-latex-basics#123. It prevents the bracket pair colorizer to be misled by \@ifnextchar{, \@ifnextchar( and \@ifnextchar[.

Copilot AI review requested due to automatic review settings October 20, 2025 18:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses an issue where the bracket pair colorizer incorrectly processes \@ifnextchar commands in LaTeX syntax. The fix adds a specific pattern to identify and mark \@ifnextchar{, \@ifnextchar(, and \@ifnextchar[ as special control keywords, then configures them as unbalanced bracket scopes to prevent the bracket pair colorizer from being misled.

Key Changes:

  • Added a new syntax pattern to recognize \@ifnextchar followed by opening brackets
  • Configured the new pattern as an unbalanced bracket scope in the LaTeX grammar configuration
  • Updated version references to reflect the upstream commit containing this fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
extensions/latex/syntaxes/TeX.tmLanguage.json Added ifnextchar pattern definition and inclusion to recognize \@ifnextchar commands with brackets
extensions/latex/package.json Registered the ifnextchar scope as an unbalanced bracket scope to exclude it from pair colorization
extensions/latex/cgmanifest.json Updated commit hash reference to track the upstream fix

@vs-code-engineering vs-code-engineering bot added this to the October 2025 milestone Oct 21, 2025
@hediet hediet enabled auto-merge (squash) October 21, 2025 08:36
@hediet hediet merged commit 0af4f80 into microsoft:main Oct 21, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

highlight syntax for unpaired delimiters for \@ifnextchar

3 participants