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: add automatic chat autocompletion #507

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

deathbeam
Copy link
Collaborator

Adds new config option chat_autocomplete (enabled by default) that will trigger completion automatically when typing trigger characters (@, /, #, $, :). This replaces the nvim-cmp integration which is now deprecated in favor of this new solution.

The automatic completion is debounced to avoid too many triggers and uses the same completion logic as before, just moved to separate function.

@deathbeam deathbeam added the enhancement New feature or request label Nov 17, 2024
@deathbeam deathbeam force-pushed the autocomplete branch 5 times, most recently from 3ad770a to d84d2a1 Compare November 18, 2024 07:46
Adds new config option `chat_autocomplete` (enabled by default) that will
trigger completion automatically when typing trigger characters (@, /, #,
$). This replaces the nvim-cmp integration which is now deprecated in
favor of this new solution.

The automatic completion is debounced to avoid too many triggers and
uses the same completion logic as before, just moved to separate
function.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
@deathbeam deathbeam merged commit 9d07da5 into CopilotC-Nvim:canary Nov 18, 2024
1 check passed
@deathbeam deathbeam deleted the autocomplete branch November 18, 2024 08:41
@dfsnow
Copy link

dfsnow commented Dec 2, 2024

Is it possible to make this change optional i.e. keep the cmp integration but have it off by default? The new built-in completion behavior does fully replicate cmp and it trips me up constantly.

As an example, hitting escape while in cmp will remove the completed text and return to insert mode. Hitting escape in the built-in completion leaves the completed text and returns to normal mode.

The new built-in also prevents completion from other sources within copilot-* buffers.

@deathbeam
Copy link
Collaborator Author

Is it possible to make this change optional i.e. keep the cmp integration but have it off by default? The new built-in completion behavior does fully replicate cmp and it trips me up constantly.

As an example, hitting escape while in cmp will remove the completed text and return to insert mode. Hitting escape in the built-in completion leaves the completed text and returns to normal mode.

The new built-in also prevents completion from other sources within copilot-* buffers.

I think what we have now makes more sense than trying to support nvim-cmp and every other completion plugin that ppl would ask for. This was mostly in response to bunch of new popular completion plugins coming out and I think simply providing api for easy integration like the plugin does now and providing sensible default implementation is better than trying to integrate everything. And the behaviour of the default vim completion menu is configurable as well so im sure theres some stuff you can do with it.

I guess we could also maybe set omnifunc for the buffer and then you can integrate it with other completion providers even more easily, i might look at that as well, but other than that I think the current implementation is fine.

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