✨ Code Folding
@thecoolwinter arbeitet bereits daran.
Seit 25.4.2025.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Description
Code folding allows developers to collapse and expand sections of code (such as functions, classes, conditionals, and comments) to reduce visual clutter and focus on the parts they’re working on. This feature is particularly useful when navigating large files or deeply nested structures.
Proposed Behavior
- Enable folding for code blocks such as:
- Functions and methods
- Classes and structs
- Loops and conditionals
- Multi-line comments and regions
- Display a vertical folding ribbon in the gutter next to line numbers, where users can click to collapse or expand blocks.
- Collapsed blocks should show an inline indicator with an expand toggle.
- Optionally, include editor commands for fold all / unfold all.
Implementation Notes
- Can be powered by the existing Tree-sitter syntax trees to determine foldable ranges based on code structure.
- Should maintain fold state across file/tab switches and ideally across sessions.
- Folding ribbon interactions should be smooth and intuitive, with hover states and visual cues.
- Should add animation for folding and unfolding to make transitions feel natural and responsive.
Benefits
- Reduces visual noise and helps maintain focus while editing.
- Makes it easier to navigate and manage large files.
- Provides a cleaner overview of structural code layout.
Additional Context
The folding ribbon provides a familiar and discoverable UI for interacting with folded sections and complements keyboard or menu-based folding commands.
Screenshots
Additional Screenshots
Hover:

Clicked (folded code):

dark and light mode:

In Progress TODOs
- Fold Ribbon
- Draw nested folds
- Draw adjacent folds with a horizontal line (instead of overlapping rounded edges)
- Draw folded ranges
- Fold Model
- Generate folds from a provider for a document
- Update folds as a document is edited
- Fold Providers
- Line indent provider
- TreeSitter provider
- Perform Folding
- Draw text attachment for fold range
- Animate folded text
- Vorherrschende Sprache
- Swift
- Sterne
- 720
- Forks
- 162
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CodeEditApp/CodeEditSourceEditor
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 Kommentar ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 32/100
Alle Issues in CodeEditApp/CodeEditSourceEditor
Ähnliche Issues
-
area:dictation documentation P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
uttrflow/uttrflow-swift#1180 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
OneBusAway/onebusaway-ios#1451 ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
type: docs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
googleapis/google-cloud-swift#971 ·