Skip to content

Add automatic connection feature with CLI support#56

Merged
linw1995 merged 3 commits intomainfrom
feat/auto_connect
Aug 19, 2025
Merged

Add automatic connection feature with CLI support#56
linw1995 merged 3 commits intomainfrom
feat/auto_connect

Conversation

@linw1995
Copy link
Copy Markdown
Owner

Summary

• Adds automatic connection feature to detect and connect to project-associated Neovim instances
• Implements CLI support with --connect auto option for streamlined workflow
• Updates documentation with new automatic connection capabilities

- Add --connect CLI option supporting manual/auto/specific target modes
- Implement auto_connect_current_project_targets() for project-wide auto-connect
- Add auto_connect_single_target() for connecting to specific targets
- Export auto-connect functions in public API via lib.rs
- Support TCP addresses and socket paths in specific target mode
- Find project targets using git root with fallback to current directory
- Add comprehensive logging for connection status and failures
- Add comprehensive CLI options documentation for --connect parameter
- Document auto-connection workflow in README and instructions
- Update CHANGELOG with detailed auto-connection features and behavior
- Include project detection and socket pattern matching details
- Fix markdown formatting issues with blank lines around code blocks
@linw1995 linw1995 requested a review from Copilot August 19, 2025 13:57
@linw1995 linw1995 self-assigned this Aug 19, 2025
@linw1995 linw1995 added the enhancement New feature or request label Aug 19, 2025
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 automatic connection functionality to the nvim-mcp server, enabling streamlined workflows through CLI-driven auto-discovery and connection to project-associated Neovim instances.

  • Implements automatic connection feature with project-scoped discovery of Neovim instances
  • Adds CLI support with --connect option supporting manual, auto, and specific target modes
  • Updates documentation to reflect new automatic connection capabilities

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/server/mod.rs Changes module visibility from pub(crate) to pub for core module
src/server/core.rs Adds auto-connection functions and project-scoped target discovery
src/main.rs Implements CLI support for connection modes with validation logic
src/lib.rs Exports new auto-connection functions from the core module
docs/instructions.md Documents automatic connection workflow and usage patterns
README.md Updates usage examples and adds auto-connection workflow documentation
CLAUDE.md Updates development documentation with new CLI options
CHANGELOG.md Documents new features and CLI options for automatic connection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Add proper warning logging for errors in get_current_project_root() and
find_targets_for_current_project() functions to help diagnose issues
when automatic connection fails to locate project directories or sockets.
@linw1995 linw1995 merged commit 4a617ca into main Aug 19, 2025
1 check passed
@linw1995 linw1995 deleted the feat/auto_connect branch August 19, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants