Exafunction / codeium.vim

Free, ultrafast Copilot alternative for Vim and Neovim
https://codeium.com
MIT License
4.05k stars 145 forks source link

FR: Option to disable in comments #29

Open chrisgrieser opened 1 year ago

chrisgrieser commented 1 year ago

when typing in a comment, I find suggestions in general not useful. At the same time, they are somewhat distracting. Could there be an option to disable codeium suggestions when typing inside a comment?

pqn commented 1 year ago

This is an interesting idea, cc @njiang747. Will have to be probably implemented at the AST level.

dundalek commented 11 months ago

+1

Good comments should explain the WHYs that are not apparent from the code. Current suggestions based on the surrounding code instead end up explaining WHAT the code does. In other words if a human or AI are able to figure that from the surrounding code, then there is no point in writing such a comment in the first place.

Therefore the suggestions inside a comment are not helpful, because they interrupt and break the flow when trying to write a proper comment.

There is also a thread where people are being frustrated with Copilot for this reason. Might be another edge that Codeium could gain when Copilot team does not care about papercuts like this.

pqn commented 11 months ago

I've just implemented this. We'll test it and see if we should disable on comments by default. (If not, there should be a toggle.)

pqn commented 11 months ago

This is now available on the VS Code pre-release extension. If all goes well, I'll describe here how to make use of it in vim if anyone would like to make a PR before we have time to get to it.

dundalek commented 11 months ago

Great to hear! Does it work by passing some option to the server or does the editor need to know whether to invoke suggestions?

pqn commented 11 months ago

It's just a server option.

pqn commented 10 months ago

https://github.com/Exafunction/codeium.vim/blob/d23654372ae4036a835192b98eeda9a9bb6a22c2/autoload/codeium/doc.vim#L115-L118

Here you will need to add 'disable_autocomplete_in_comments': v:true, and then it should work on any language we have tree-sitter support for (see here for a list).

hedges333 commented 8 months ago

It would be really helpful to have a switch for this in the editor, with a keybinding, so it only applies in the editor window in use. I want its suggestions when writing comments for code that doesn't have them already, but then when I write a new block I want to turn that off so I can write the comments first before writing the code.

On that note, keybindings to turn all autocomplete features or individual autocomplete features on and off would be very useful.

This is amazing though. Jet-powered vim. Wow.

pqn commented 8 months ago

Happy to accept a contribution for this setting, I imagine it's relatively straightforward to add. If anyone wants to mention us in the Copilot thread about this either, I wouldn't mind 😉