Skip to content

feat(editor): add indentation folding for legacy modes(as fallback)#2538

Merged
bajrangCoder merged 1 commit into
mainfrom
feat/legacy-mode-indentation-folding
Jul 26, 2026
Merged

feat(editor): add indentation folding for legacy modes(as fallback)#2538
bajrangCoder merged 1 commit into
mainfrom
feat/legacy-mode-indentation-folding

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds indentation-based code folding as a fallback for plain text and legacy StreamLanguage modes.

  • Registers the fallback alongside CodeMirror’s fold gutter when code folding is enabled.
  • Computes fold ranges from contiguous, more-deeply-indented nonblank lines while preserving internal blank lines.
  • Adds coverage for indentation folding in a legacy stream language.

Confidence Score: 5/5

The pull request appears safe to merge, with no concrete correctness or security defects identified.

The fallback is limited to plain text and legacy stream languages, respects the existing code-folding toggle, and leaves syntax-aware folding unchanged for modern language modes.

Important Files Changed

Filename Overview
src/cm/baseExtensions.ts Registers the indentation fold service only when the existing code-folding option is enabled.
src/cm/indentationFolding.ts Implements cached indentation fold discovery for plain text and StreamLanguage modes while deferring modern language modes to syntax-aware folding.
src/test/editor.tests.js Verifies that legacy stream modes fold an indented block across an internal blank line.

Reviews (1): Last reviewed commit: "feat(editor): add indentation folding fo..." | Re-trigger Greptile

@bajrangCoder
bajrangCoder added this pull request to the merge queue Jul 26, 2026
Merged via the queue into main with commit 9cf831b Jul 26, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant