✨ Code Folding
@thecoolwinter がすでに取り組んでいます。
2025年4月25日 から。
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- Swift
- スター
- 720
- フォーク
- 162
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeEditApp/CodeEditSourceEditor のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
CodeEditApp/CodeEditSourceEditor#377 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CodeEditApp/CodeEditSourceEditor#376 · コメント 1 件 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
CodeEditApp/CodeEditSourceEditor#378 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
CodeEditApp/CodeEditSourceEditor の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
manaflow-ai/cmux#13763 ·
-
type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
googleapis/google-cloud-swift#1036 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
wultra/mtoken-sdk-ios#253 ·
-
area:dictation documentation P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
uttrflow/uttrflow-swift#1180 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100