Skip to content
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

feat(commands): unify user commands into Aider user command #45

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

GeorgesAlkhouri
Copy link
Owner

No description provided.

🔍 Improves plugin architecture by moving user command definitions from
init.lua to the standard plugin/nvim_aider.lua location. This follows
Neovim plugin best practices for automatic loading.

✨ Enhances command completion to better handle subcommands
🧪 Updates tests to create proper buffer environment for testing
♻️ Changes API method calls to use direct requires for better modularity
The automatic setup of tree-related commands has been removed from the
plugin initialization process. This change:

• 🧩 Makes tree functions public so they can be called directly
• 🛠️ Fixes nil reference bugs in neo-tree integration
• 📝 Changes invalid command error level from ERROR to INFO
• 🧪 Updates tests to call API functions directly rather than vim.cmd

This creates a more explicit API and prevents unnecessary command
registration when the related tree plugins are not installed.
✨ This change refactors how text is sent to the Aider terminal:
- 🔀 Renamed 'terminal' command to 'toggle' for better clarity
- 📤 Moved text handling logic from plugin to API function
- 🎮 Enhanced send_to_terminal to handle visual and normal modes
- 💬 Added interactive prompts for sending text with optional input

The terminal interaction is now more consistent and follows a cleaner
architecture with logic properly encapsulated in the API module.
@GeorgesAlkhouri GeorgesAlkhouri linked an issue Apr 4, 2025 that may be closed by this pull request
Reorganize the command structure to support hierarchical subcommands:
- Move `readonly` command to become a subcommand of `add`
- Enhance menu display to properly indent and format subcommands
- Update command completion to intelligently suggest subcommands
- Improve command execution to properly handle subcommand paths

This change makes the command interface more organized and extensible,
allowing for better structured command grouping while maintaining an
intuitive user experience.
🛠️ Add proper error notification when an invalid subcommand is passed
to a valid command.

✅ Add comprehensive test suite for command menu functionality that
covers:
  - Command registration and verification
  - Command execution flow for both top-level and subcommands
  - Input handling with various scenarios
  - Error handling for invalid commands and subcommands
@GeorgesAlkhouri GeorgesAlkhouri changed the title 35 dont create user commands feat(commands): unify user commands into Aider user command Apr 6, 2025
🔍 Capture original buffer before creating the picker menu
🛠️ Wrap command implementations to restore proper buffer context
🔄 Ensure subcommands maintain correct buffer references

This fixes an issue where commands executed from the picker would
operate on the picker's buffer rather than the original editing buffer
where the menu was invoked. The implementation now properly preserves
the user's context when selecting and executing commands from the menu.
@GeorgesAlkhouri GeorgesAlkhouri force-pushed the 35-dont-create-user-commands branch from 9268d04 to 6cb31c5 Compare April 6, 2025 19:21
@GeorgesAlkhouri GeorgesAlkhouri force-pushed the 35-dont-create-user-commands branch from c792a5d to 372bd57 Compare April 6, 2025 19:26
🧪 Add new test block to verify command menu structure:
  - Validate all top-level commands are present
  - Verify subcommands are correctly displayed

🔍 Ensures the menu presents the expected hierarchy of commands to users
   and maintains consistency with the actual command implementation.

♻️ Also removed unused variables in api_methods_spec.lua
@GeorgesAlkhouri GeorgesAlkhouri marked this pull request as ready for review April 7, 2025 19:42
@GeorgesAlkhouri GeorgesAlkhouri force-pushed the 35-dont-create-user-commands branch from 099ac26 to d69e2c3 Compare April 7, 2025 20:09
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.

Don't create user commands
1 participant