You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Collapsing ruby functions with ensure blocks don't fully collapse #7
I looked into whether this could be implemented directly in the Zed extension and it looks like it’s not possible. Zed folds based on the indentation level.
We can control which syntax queries trigger indents and outdents, which is why when you type ensure it is automatically outdented. But there’s no way to write queries for folding ranges as far as I can tell.
Activity
andyw8 commentedon Mar 24, 2025
If Zed implemented language server support for
textDocument/foldingRangethen it could use Ruby LSP's implementation which collapses the wholedef.Doesn't seem on the radar though: zed-industries/zed#26916
andyw8 commentedon Mar 25, 2025
andyw8 commentedon Apr 4, 2025
textDocument/foldingRangefor LSP zed-industries/zed#28091joeldrapper commentedon Apr 28, 2025
I looked into whether this could be implemented directly in the Zed extension and it looks like it’s not possible. Zed folds based on the indentation level.
We can control which syntax queries trigger indents and outdents, which is why when you type
ensureit is automatically outdented. But there’s no way to write queries for folding ranges as far as I can tell.andyw8 commentedon Feb 6, 2026
I haven't tried it yet, but
foldingRangesupport was just merged: zed-industries/zed#48611