Skip to content

[bat] Make #region folding markers case-insensitive for REM#317784

Merged
aeschli merged 2 commits into
mainfrom
copilot/feature-make-folding-markers-case-insensitive
Jun 1, 2026
Merged

[bat] Make #region folding markers case-insensitive for REM#317784
aeschli merged 2 commits into
mainfrom
copilot/feature-make-folding-markers-case-insensitive

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Batch folding markers currently only matched uppercase REM, so region folding failed for common rem/Rem comment styles in case-insensitive CMD scripts. This change updates Bat region marker matching to accept all REM case variants (with optional @) while preserving existing :: behavior.

  • Scope

    • Update extensions/bat/language-configuration.json folding marker regexes for start and end.
  • Behavior change

    • #region / #endregion now match:
      • REM ...
      • rem ...
      • Rem ...
      • @REM ... / @rem ...
      • :: ... (unchanged)
  • Regex update

    "folding": {
      "markers": {
        "start": "^\\s*(::|@?[Rr][Ee][Mm])\\s*#region",
        "end": "^\\s*(::|@?[Rr][Ee][Mm])\\s*#endregion"
      }
    }

Copilot AI review requested due to automatic review settings May 21, 2026 15:05
Copilot AI review requested due to automatic review settings May 21, 2026 15:05
Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 21, 2026 15:15
Copilot AI changed the title [WIP] Add case-insensitivity for folding markers in Bat [bat] Make #region folding markers case-insensitive for REM May 21, 2026
Copilot AI requested a review from aeschli May 21, 2026 15:16
@aeschli aeschli marked this pull request as ready for review May 22, 2026 10:03
Copilot AI review requested due to automatic review settings May 22, 2026 10:03
Copy link
Copy Markdown
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 updates the batch (bat) language configuration’s folding marker regex so that #region / #endregion folding works for common case variants of REM comments in Windows CMD scripts, while keeping existing :: comment folding behavior intact.

Changes:

  • Adjust batch folding marker patterns to match REM in a case-insensitive way (including optional leading @).
  • Preserve the existing ::-based folding marker support.
Show a summary per file
File Description
extensions/bat/language-configuration.json Updates folding marker regexes so region folding recognizes rem/Rem/REM and @rem variants.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@aeschli aeschli merged commit b9b2d90 into main Jun 1, 2026
26 checks passed
@aeschli aeschli deleted the copilot/feature-make-folding-markers-case-insensitive branch June 1, 2026 13:46
@aeschli aeschli added this to the 1.124.0 milestone Jun 1, 2026
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.

[Bat] Feature: Make folding markers (#region) case-insensitive for 'REM'

4 participants