Partial Acceptance of Suggestions #12426
Replies: 10 comments 4 replies
-
I already almost started new discussion thread with very similar requirement for Is it possible to make in content_type = ContentType.objects.get_for_model(UUIDArticle, for_concrete_model=False) The beginning of the suggestion is correct, but I want to use different function, for example: content_type = ContentType.objects.get_content_type() I would like to pres to move one letter in the suggestion ahead and to move one word ahead. This is inspired by how |
Beta Was this translation helpful? Give feedback.
-
After few hours of experimenting with neoVIM's scripting and mapping I was finally able achieve this without any other support from the Copilot's implementation in neoVIM: function! SuggestOneCharacter()
let suggestion = copilot#Accept("")
let bar = copilot#TextQueuedForInsertion()
return bar[0]
endfunction
function! SuggestOneWord()
let suggestion = copilot#Accept("")
let bar = copilot#TextQueuedForInsertion()
return split(bar, '[ .]\zs')[0]
endfunction
imap <script><expr> <C-l> SuggestOneWord()
imap <script><expr> <C-left> SuggestOneCharacter() This maps one word suggestion on Ctrl-l and one character suggestions on Ctrl-left (I was not able to use Ctrl-Shift key combinations). |
Beta Was this translation helpful? Give feedback.
-
For IntelliJ IDEs I wrote a plugin that solves the problem: https://github.com/cmp-nct/Stewardess From working with it for a few days I can see the potential use of Copilot is significantly hindered by the Plugin implementation. |
Beta Was this translation helpful? Give feedback.
-
The fact that someone actually took the pain to write a companion plugin just to do that is a testimony on how this feature is so needed! |
Beta Was this translation helpful? Give feedback.
-
Just want to mention ticket #7331 which seems to have more traction, and is the same idea (even though the title specifically mentions VSCode, whereas this feature would benefit any IDE). |
Beta Was this translation helpful? Give feedback.
-
According to this: microsoft/vscode#166956 (comment) , it is already supported in visual studio code extension. Just press ⌘ + → |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Not sure if it's worth paying for Copilot if I end up rejecting a lot of the suggestions because only the first words are interesting. |
Beta Was this translation helpful? Give feedback.
-
It's been more than one year, and still for all JetBrains products, I am missing this very important and critical feature, Partial World Accept. When VS Code already has it, why not JetBrains? I don't want to install any other third-party plugin. When I'm paying for software, it looks like the team at Copilot are sleeping. |
Beta Was this translation helpful? Give feedback.
-
Look what I got after updating today 🎉 This ticket can be closed. |
Beta Was this translation helpful? Give feedback.
-
In -- Copilot setup.
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
-- Accept the current completion with Ctrl-].
vim.keymap.set('i', '<C-]>', 'copilot#Accept("\\<CR>")', {
expr = true,
replace_keycodes = false
})
-- Accept the current completion word with Ctrl-\.
vim.keymap.set('i', '<C-\\>', '<Plug>(copilot-accept-word)')
-- Accept the current completion line with Ctrl-|.
vim.keymap.set('i', '<C-|>', '<Plug>(copilot-accept-line)')
-- Request a suggestion with Ctrl-.
vim.keymap.set('i', '<C-.>', '<Plug>(copilot-suggest)') You can see a list of commands with |
Beta Was this translation helpful? Give feedback.
-
Often CoPilot will offer a suggestion that is quite a long line of code, but e.g. you only want to accept the first 2/3's of the line, instead of having to accept the whole line then go back and edit it. Some sort of keyboard shortcut would be nice where you can e.g. accept one 'word' of the suggested line at a time and stop when you have the code you want, or still just accept the whole line.
The same thing applies for when CoPilot makes a large, multiline suggestion, and you only want the first so many lines: it would be nice to have another keyboard shortcut that lets you accept the suggestion one line at a time, in addition to being able to accept the whole suggestion. Again, I know I can accept the whole suggestion and edit it, but that slows me down more.
Beta Was this translation helpful? Give feedback.
All reactions