-
Notifications
You must be signed in to change notification settings - Fork 68
Add cook lsp sub command for language server #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add a new `cook lsp` command that starts the Cooklang Language Server Protocol server. The LSP server provides IDE features for Cooklang recipe files including real-time syntax checking, auto-completion, semantic highlighting, hover documentation, and document symbols. Uses the cooklang-language-server crate and communicates over stdin/stdout using the standard LSP protocol for editor integration.
This comment was marked as outdated.
This comment was marked as outdated.
Add comprehensive documentation for the LSP command including: - Overview of features (diagnostics, completions, hover, symbols) - Editor integration guides for VS Code, Neovim, Vim, Emacs, Helix, Sublime Text, and Zed - Troubleshooting section - Protocol details and supported LSP features
This comment was marked as outdated.
This comment was marked as outdated.
- Add Context parameter to lsp::run for consistency with other commands and future extensibility (e.g., accessing config files) - Use #[tokio::main] attribute instead of manual runtime creation, matching the pattern used by the server command - Add signal handling with tokio::select! for graceful shutdown on SIGINT (Ctrl+C) - Add tracing info messages for startup and shutdown events
This comment was marked as outdated.
This comment was marked as outdated.
Log base_path, aisle.conf, and pantry.conf paths at debug level when starting the LSP server. Currently the cooklang-language-server crate receives workspace configuration from the editor during LSP initialization, but these paths are logged for debugging and future extensibility when the upstream crate supports custom configuration paths.
This comment was marked as outdated.
This comment was marked as outdated.
Update snapshot tests to match current cooklang parser output: - scalable field changed from true to false - unit abbreviations updated (cups -> c, tsp -> tbsp) - fraction representation changes in scaled output
Code Review: Add cook lsp sub command for language serverThank you for this contribution! This is a well-structured PR that adds LSP support to CookCLI. Here's my comprehensive review: ✅ Strengths
🔍 Code Quality Observationssrc/lsp.rsGood:
Minor Concerns:
🐛 Potential IssuesTest Snapshot UpdatesThe PR includes unrelated test snapshot changes (recipes showing different unit formatting like Files affected:
Questions:
⚡ Performance Considerations
🔒 Security Concerns
🧪 Test CoverageMissing:
Suggestions:
Note: The help output snapshot test was correctly updated to include the new LSP command. 📝 DocumentationExcellent:
Suggestions:
🎯 Best Practices Adherence✅ Follows Rust idioms and conventions 🔧 RecommendationsHigh Priority:
Medium Priority:
Low Priority:
📊 SummaryOverall Assessment: ✅ Approve with minor suggestions This is a solid implementation that adds valuable IDE functionality to CookCLI. The code is clean, well-documented, and follows project conventions. The main concerns are:
The implementation is production-ready, and the suggestions above are mostly about polish and completeness rather than blocking issues. Recommendation: Approve and merge after:
Great work! 🎉 |
Code Review: Add cook lsp subcommand for language serverI've reviewed PR #241 and have the following feedback: ✅ Strengths
|
Add a new
cook lspcommand that starts the Cooklang Language Server Protocol server. The LSP server provides IDE features for Cooklang recipe files including real-time syntax checking, auto-completion, semantic highlighting, hover documentation, and document symbols.Uses the cooklang-language-server crate and communicates over stdin/stdout using the standard LSP protocol for editor integration.