Accept partial copilot suggestions (#8682)

Fixes https://github.com/zed-industries/zed/issues/8020
 
This PR adds a new shortcut cmd-right, if a copilot suggestion exists.
The suggestions is accepted word by word.
It emulates the behaviour of VS Code's Github Copilot implementation.


Release Notes:

- Added ability to accept partial copilot suggestions ([8020](https://github.com/zed-industries/zed/issues/8020))
This commit is contained in:
Jonathan
2024-03-03 18:24:48 +02:00
committed by GitHub
parent 56f0418c93
commit 08f9c3f568
6 changed files with 187 additions and 4 deletions
+13 -2
View File
@@ -135,10 +135,21 @@
"focus": true
}
],
"alt-\\": "copilot::Suggest",
"ctrl->": "assistant::QuoteSelection"
}
},
{
"context": "Editor && mode == full && copilot_suggestion",
"bindings": {
"alt-]": "copilot::NextSuggestion",
"alt-[": "copilot::PreviousSuggestion",
"ctrl->": "assistant::QuoteSelection"
"alt-right": "editor::AcceptPartialCopilotSuggestion"
}
},
{
"context": "Editor && !copilot_suggestion",
"bindings": {
"alt-\\": "copilot::Suggest"
}
},
{