nixd/Controller: implement textDocument/foldingRange#754
Conversation
- Implement onFoldingRange handler for textDocument/foldingRange LSP requests - Recursively collect foldable regions from AST nodes including attribute sets, lists, lambdas, let/with/if expressions, and multiline strings - Register folding range provider and method in controller - Update build to include new FoldingRange implementation
…ze checks - Add basic.md to test folding for attribute sets and lists - Add let-lambda.md to test folding for let expressions and lambdas - Update initialize.md and semantic-tokens/initialize.md to check foldingRangeProvider capability
- Add foldmethod, foldexpr, foldlevel, and foldenable to options - Improve code folding experience using LSP folding capabilities
inclyc
left a comment
There was a problem hiding this comment.
LGTM! The quality of this PR looks excellent. Thank you so much for your contribution; I don't think I have any further comments.
Did you use Claude Code or any other AI tools to assist with the development? The documentation for nixd is honestly not great, so I imagine it’s quite challenging for newcomers to get started.
If you are still interested in contributing to nixd, here is a list of features that users want the most:
- Support for Code Actions: For example, issue #466. This is the most requested feature that hasn't been implemented yet.
- Reducing "Noisy" Error Reporting: Some current error messages are far too intrusive. We should probably use
elogfor these specific cases:
textDocument/definitiontextDocument/codeActiontextDocument/documentSymboltextDocument/inlayHinttextDocument/documentLink
- Advancing PR #749: This involves adding comment parsing functionality into
nixf.
LGTM! このPRは非常にクオリティが高いですね。貢献していただき、本当にありがとうございます。私からの修正要望は特にありません。
開発にあたって、Claude Codeや他のAIツールなどを使用されましたか?nixdは開発ドキュメントがあまり整っていないので、新しく参加される方にはハードルが高いのではないかと思っています。
もし引き続きnixdの開発にご興味があれば、ユーザーから特に要望の多い機能をまとめましたので、参考にしてください:
- Code Actions への対応: 例:issue #466。これは最もリクエストが多いものの、未実装の機能です。
- エラー通知の整理: 現在、一部のエラーが少し「うるさすぎる(ノイズが多い)」状態です。以下の項目については、直接
elogを使用して報告するのが適切かもしれません:
textDocument/definitiontextDocument/codeActiontextDocument/documentSymboltextDocument/inlayHinttextDocument/documentLink
- PR #749 の推進:
nixfにコメント解析機能を追加する作業です。
|
@inclyc Although I’ve been an engineer for about 10 years, I don't have much experience with C++, so I made sure to test everything very carefully. I’m planning to contribute a lot to nixd, so thanks for the collaborator invite! I’m excited to dive in and get to work! 最近AIをかなり活用していますねー エンジニア歴は10年ほどありますが、C++の経験は浅いため、全てを入念にテストしました。 nixdへガンガンcontributionしていくつもりです!! |
Summary
Implement LSP
textDocument/foldingRangesupport for nixd, enabling code folding in editors.Relative Issue #150
Changes
FoldingRange.cppimplementing the folding range handlertextDocument/foldingRangemethod inSupport.cppfoldingRangeProvider: truecapability inLifeTime.cpponFoldingRangemethod declaration inController.hmeson.buildto include new source filenvim-lsp.nixfor testingSupported Folding Regions
{ },rec { })[ ]){ args }: ...,x: ...)let ... in ...)with ...; ...)if ... then ... else ...)'' ... '')Implementation Details
"region"kind for all folding ranges (per LSP spec)Test Plan
meson testpasses (all 62 lit tests)folding-range/basic.md)folding-range/let-lambda.md)nix develop .#nvim