Skip to content

Add upstream folding queries and Runestone integration - #39

Merged
simonbs merged 8 commits into
mainfrom
codex/code-folding-queries
Oct 28, 2026
Merged

simonbs merged 8 commits into
mainfrom
codex/code-folding-queries

Conversation

@simonbs

@simonbs simonbs commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Add folding queries for 44 languages, using definitions from the grammar repositories and Neovim's nvim-treesitter. The Runestone language factories load these queries automatically.

With Runestone #467, enable gutter folding on a text view:

textView.isCodeFoldingEnabled = true

Tap a gutter chevron to collapse or expand code blocks and Markdown sections. Markdown supports ATX and Setext headings, fenced code, and nested folds.

For custom language setup, the query packages expose an optional Query.foldsFileURL for use with TreeSitterLanguage.foldsQuery. Comment, JSDoc, JSON5, MarkdownInline, R, and Regex return nil.

Pinned source definitions, provenance, and license notices are included alongside an importer for updating the queries.

@simonbs
simonbs merged commit 723a077 into main Oct 28, 2026
2 checks passed
@simonbs
simonbs deleted the codex/code-folding-queries branch October 28, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant