Skip to content

Conversation

@stefanvanburen
Copy link
Member

Ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_foldingRange
Ref: https://go.dev/gopls/features/passive#folding-range

This adds folding range support to the LSP. Folding ranges apply to messages, nested messages, enums, extensions, options, import blocks, multi-line comments, oneofs, services and methods.

By default, it looks like VS Code might use tree-sitter to compute folds, which isn't too bad, but this approach is more precise. neovim also supports either tree-sitter or LSP as a fold provider. For testing, reference: https://neovim.io/doc/user/lsp.html#vim.lsp.foldexpr().

Ref: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_foldingRange
Ref: https://go.dev/gopls/features/passive#folding-range

This adds folding range support to the LSP. Folding ranges apply to
messages, nested messages, enums, extensions, options, import blocks,
multi-line comments, oneofs, services and methods.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 14, 2026, 5:40 PM

Copy link
Member

@doriable doriable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me -- going to stamp under the assumption that the merge will be resolved. Thank you!

@stefanvanburen stefanvanburen merged commit f037928 into main Jan 14, 2026
10 checks passed
@stefanvanburen stefanvanburen deleted the svanburen/lsp-folding-range branch January 14, 2026 17:49
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.

3 participants