Skip to content

feat: go.nvim + AI#608

Merged
ray-x merged 22 commits intomasterfrom
GoAI
Mar 14, 2026
Merged

feat: go.nvim + AI#608
ray-x merged 22 commits intomasterfrom
GoAI

Conversation

@ray-x
Copy link
Copy Markdown
Owner

@ray-x ray-x commented Mar 2, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) providing GoAI (NL command translator), GoCodeReview (AI code review to quickfix), GoAIChat (interactive Q&A), plus GoCmtAI and GoDocAI features
  • 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_suittest_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" }
},
ray-x and others added 8 commits March 14, 2026 22:09
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>
@ray-x ray-x merged commit dbb4a01 into master Mar 14, 2026
4 checks passed
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.

2 participants