-
-
Notifications
You must be signed in to change notification settings - Fork 354
CodeCompanionComplete command for tab-autocompletion #1977
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
base: main
Are you sure you want to change the base?
Conversation
One of the most powerful features of Cursor is tab-completion. I think we can emulate something similar in CodeCompanion too.
|
@olimorris I am not sure if this fits within the scope of the library. I personally have been finding this feature very useful. The current PR is a draft. I can work on improving it if you too find it useful. Improvements to make:
|
| self:start_diff() | ||
| pcall(vim.cmd.undojoin) | ||
| self:output(json.code) | ||
| -- After auto-applying inline edits (e.g., no_diff), move cursor to end of insertion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very nice QOL feature!
|
Hey @pratyushmittal
It definitely does and would be an awesome addition. I'm not sure I'd want to have this as a separate command though. As this utilizes the inline assistant, I think it would make sense for it to be Bottom line, totally want this in CodeCompanion just need to workout what the UX would be.
I wouldn't want this directly in CodeCompanion but we could fire some events with the buffer number, line numbers etc so users could hook into that themselves. I will always endeavour for CodeCompanion to not force anything on a user from a UI perspective beyond what happens in the chat buffer.
This would be so good and so powerful, but I suspect this could be quite complicated to achieve. How are you envisioning this would work? |
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
Description
This PR adds a
CodeCompanionCompletecommand to trigger a code completion on demand.Though I added it as a test POC (proof-of-concept), I ended us using it extensively.
I use it with this setting in my
init.lua:The above triggers a tab-style code completion on pressing
Ctrl+fin insert mode. No need to pass any chat instructions. Usually the comments and context around the cursor is sufficient to provide a good completion.Screenshots
CodeCompanionComplete.mp4
Checklist
CodeCompanion.hasin the init.lua file for my new featuremake allto ensure docs are generated, tests pass and my formatting is applied