Skip to content

[Repo Assist] fix: add //#region folding markers to language configuration#2151

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-2125-region-folding-markers-20260314-b2273827855e5c55
Draft

[Repo Assist] fix: add //#region folding markers to language configuration#2151
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-2125-region-folding-markers-20260314-b2273827855e5c55

Conversation

@github-actions
Copy link
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Closes #2125

Adds //#region and //#endregion folding markers to release/language-configuration.json, enabling region-based code folding in F# files when Ionide is active.

Problem

VS Code's built-in folding correctly folds //#region blocks in standalone .fs files (where it uses its own token-based provider). However, once Ionide is active, FSAC's FoldingRangeProvider takes over and the built-in region markers stop working — there's no fold indicator in the gutter for //#region blocks.

Fix

Add the folding.markers section to release/language-configuration.json:

"folding": {
  "markers": {
    "start": "^\\s*\\/\\/#region\\b",
    "end": "^\\s*\\/\\/#endregion\\b"
  }
}

As of VS Code 1.76, the editor evaluates folding.markers from the language configuration alongside the LSP folding range provider rather than as a pure fallback. This means region markers declared here are honoured even when FSAC provides its own structural folding ranges — users get both structural fold points from FSAC and explicit //#region / //#endregion regions.

Users on VS Code < 1.76 will not see any regression: the change is purely additive and existing behaviour is unchanged on older versions.

Test Status

This is a JSON configuration file change — no build step required. Validated that the file remains syntactically valid JSON (python3 -m json.tool passes cleanly).

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

VS Code 1.76+ evaluates folding.markers from the language configuration
alongside the LSP folding range provider. Declaring region markers here
allows //#region and //#endregion to create collapsible sections in F#
files even when Ionide is active.

Previously these markers only worked for standalone .fs files, but were
ignored when FSAC's FoldingRangeProvider was active.

Closes #2125

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for region folding

0 participants