Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds AI-powered features to go.nvim, integrating LLM capabilities (via GitHub Copilot or OpenAI-compatible APIs) for code review, documentation generation, comment generation, natural-language command dispatch, and interactive chat. It also adds MCP (Model Context Protocol) support for enriching AI reviews with semantic context from gopls, and significantly expands the documentation.
Changes:
- New AI module (
lua/go/ai.lua) providingGoAI(NL command translator),GoCodeReview(AI code review to quickfix),GoAIChat(interactive Q&A), plusGoCmtAIandGoDocAIfeatures - MCP client and context-gathering infrastructure (
lua/go/mcp/) that uses the running gopls LSP to enrich reviews with references, callers, and implementations - Comprehensive documentation updates to
doc/go.txt,README.md, gopls command reference, and health checks
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/go/ai.lua | Core AI module: Copilot/OpenAI integration, command dispatch, code review, chat |
| lua/go/prompts.lua | Shared Go review prompt building blocks |
| lua/go/mcp/init.lua | MCP module entry point (setup, client lifecycle) |
| lua/go/mcp/client.lua | JSON-RPC MCP client over stdio for gopls |
| lua/go/mcp/context.lua | Semantic context gathering via LSP (references, callers, implementations) |
| lua/go/mcp/review.lua | MCP-enhanced code review with semantic context |
| lua/go/comment.lua | GoCmtAI — AI doc comment generation |
| lua/go/godoc.lua | GoDocAI — AI-powered documentation lookup |
| lua/go/commands.lua | Register new commands (GoAI, GoCodeReview, GoDocAI, GoAIChat, GoGopls, GoCmtAI) |
| lua/go/health.lua | Health check for AI provider configuration |
| lua/go.lua | Default config for ai and mcp options |
| lua/go/gopls.lua | Added doc comments and gopls command reference |
| lua/go/gotest.lua | Rename test_suit → test_suite, formatting fixes |
| doc/go.txt | Major documentation expansion covering all commands |
| README.md | Updated feature list and AI documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+176
to
+179
| mcp = { | ||
| enable = false, -- set to true to enable gopls MCP features | ||
| gopls_cmd = {'gopls', 'mcp'}, -- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls", "mcp" } | ||
| }, |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.