Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

✨ Code Folding

Abierto
#43 8 comentarios 7 reacciones 1 asignado Ver en GitHub

@thecoolwinter ya está trabajando en esto.

Desde el 25/4/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

editor enhancement UI
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

https://user-images.githubusercontent.com/47652746/164981601-56c531e4-9420-4d46-96d7-f9d8456e5821.mov

Additional Screenshots Screen Shot 2022-04-24 at 8 30 03 AM

Hover:
Screen Shot 2022-04-24 at 8 31 04 AM

Clicked (folded code):
Screen Shot 2022-04-24 at 8 31 40 AM

dark and light mode:
imgonline-com-ua-twotoone-0btV6nX2OfPxYH

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
Lenguaje dominante
Swift
Estrellas
720
Forks
162
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CodeEditApp/CodeEditSourceEditor

Todos los issues de CodeEditApp/CodeEditSourceEditor

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.