Possibility to disable comment suggestion? #8062
Replies: 42 comments 30 replies
-
Just chiming in to say that the only gripe I have with Copilot is that inline suggestions show while I'm writing a comment. It distracts my thought process and slows me down significantly. Without that issue, Copilot is game-breaking. But with that issue, it's kind of a double-edged sword in terms of improving your productivity. |
Beta Was this translation helpful? Give feedback.
-
Here's a workaround I figured out for how to fix the comment suggestions problem! 🚀 The basic idea is to create a keyboard shortcut that we press in order to disable the inline suggestions from popping up. So before we write a comment, we can just press the keyboard shortcut to disable suggestions, then write the comment, and then press the keyboard shortcut to enable suggestions again. It's not a perfect solution, but it works! To do this:
{
"key": "shift+cmd+c", // set this to whatever works for you
"command": "toggle",
// By the way, this "when" expression was inspired from the "when" expression for Copilot
// extension's "Trigger Inline Suggestions" keyboard shortcut.
"when": "editorTextFocus && !editorHasSelection",
"args": {
// This id is just a unique name you come up with yourself
"id": "toggleGithubCopilotInlineSuggestionsBeingEnabled",
// The names and values of the setting you want to toggle. In this case, it's to enable/disable the
// `github.copilot.inlineSuggest.enable` setting.
"value": [
{
"github.copilot.inlineSuggest.enable": true
},
{
"github.copilot.inlineSuggest.enable": false
}
]
}
}, For more info on how to setup a toggle keyboard shortcut you can look at the extension page for the Toggle extension. You can also read more info about it here.
Note: This will allow you to disable inline suggestions from showing up. But it won't make a current inline suggestion, that's already showing, vanish. Just press Esc in that situation if it ever comes up. Ideally, you'd disable inline suggestions ahead of time before they'll pop up. That way you'll never have to press Esc. |
Beta Was this translation helpful? Give feedback.
-
Github Copilot extension contributors, if you were to provide a keyboard shortcut to toggle enabling inline suggestions then the above instructions wouldn't be needed. I highly suggest you provide one! |
Beta Was this translation helpful? Give feedback.
-
I too got tired of copilot throwing suggestions in my face and breaking up my mental flow, so I wrote a VSCode extension that makes Copilot STFU when you're writing comments. It might be a better solution than your hotkey fix @jaquinocode |
Beta Was this translation helpful? Give feedback.
-
Instead of just disabling comments suggestions it could be better to increase the threshold of confidence required to show the suggestion when you detect that the suggestion is entirely commented out text, because when Copilot completes a long variable names in a comment is useful. |
Beta Was this translation helpful? Give feedback.
-
I would love to see this feature. In 99% cases the comment suggestions are incredibly disruptive, useless and annoying. In the remaining 1% they're still disruptive and useless, but at least they're so absurd they become funny. |
Beta Was this translation helpful? Give feedback.
-
This is my #1 feature request. We should be able to disable comments. When writing a comment, I have the "intent to clarify." There's 0 cases out of hundreds where Copilot correctly guessed this intent (IMO this isn't possible by definition), so it's either a source of amusement or noise, and devalues what it's actually good at. |
Beta Was this translation helpful? Give feedback.
-
Big +1... the comment suggestions are hilariously wrong and really distracting. I haven't had a single one that's even related to what I want to actually write. And my brain auto-reads whatever pops up, which hijacks my thought process. I'd love the ability to disable inline suggestions for all comment blocks. I'm disabling copilot for now until this is supported. |
Beta Was this translation helpful? Give feedback.
-
I'd really like to disable comments-completion in JetBrains editors as well. |
Beta Was this translation helpful? Give feedback.
-
+1 on this. Very distracting. Is providing an option here on a roadmap anywhere? I like Copilot enough to keep it enabled but I find myself looking away from the computer screen while I type longer comments!! I guess it's good typing accuracy practice. |
Beta Was this translation helpful? Give feedback.
-
This is single-handedly keeping me from buying copilot. I comment a lot and this breaks my flow entirely. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback, y'all. What I'm hearing is:
|
Beta Was this translation helpful? Give feedback.
-
perhaps copilot could be set so if you start the line double comment chars (for example ## instead of just #), copilot would know not to suggest anything? that would allow for in-the-moment disabling without having to start/stop the extension. |
Beta Was this translation helpful? Give feedback.
-
I do occasionally have situations where Copilot produces useful completions in comments, so I don't want to completely disable it in comments. But I agree with the original poster that it's distractingly noisy at the moment. So I think that ideally, Copilot would suggest completions in comments only when it's reasonably sure about them. |
Beta Was this translation helpful? Give feedback.
-
This really needs to be an option. I just started trialing Copilot and I've already had to disable inline autocompletion on everything solely because of the distraction it causes when autocompleting comments. The existing workarounds aren't great for a paid product. |
Beta Was this translation helpful? Give feedback.
-
Can we get an explanation why this is either A) difficult to implement or B) not seen as an important option? Copilot has been great except the comment suggestions. My team comments a lot and this breaks flow entirely. The success rate is probably 1%. We'd much rather be in charge of comments, then have Copilot attempt to create the line/block based on our comments rather than it just wildly guessing at what we're attempting to do. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
If GH doesn't want to allow completely disable the processing of comments, then as a compromise they could add a option so that they're only processed with a prefix. This comment would be processed: // copilot loop through the response and create a DOM element for each item, then append it to the container This comment wouldn't be processed: // todo refactor this after launch That'd work similar to how |
Beta Was this translation helpful? Give feedback.
-
The disable-copilot-comment-completion plugin works quite well! The only confusing thing is that it changes the .vscode/settings.json file to set "github.copilot.inlineSuggest.enable": false whenever you're in a comment. Then it changes back when you're in a piece of code. (I guess it's VSCode itself that changes the file, as a result of the setting being toggled) |
Beta Was this translation helpful? Give feedback.
-
2024 — There is a certain Zen to finding the right moment to comment, and writing a quality comment that truly serves its purpose The constant auto-suggested comment text is driving me crazy because CoPilot is wrong regarding comments 99% of the time Business context, nuance, and precise control of ordering and level of detail is required for comments to have their intended impact I use WebStorm (same as IntelliJ) by JetBrains, so VSCode-specific solutions do not work for me |
Beta Was this translation helpful? Give feedback.
-
This is wrong how long it has taken to address something as silly as this... VSCode user for years... Let humans turn off the AI's annotation of the code. We use AI to write tedious code that people have done millions of times, not to understand and intuit purposes that the AI almost always knows very little about. The AI cannot understand the assignment right now like a human can. |
Beta Was this translation helpful? Give feedback.
-
+1. The comment suggestions completely break my thought process and they're not as helpful as the code suggestions. Also some times it start the comment with |
Beta Was this translation helpful? Give feedback.
-
I use https://github.com/github/copilot.vim. The inability to disable comment suggestions made Copilot pretty frustrating. Luckily, I was just able to figure this out. I haven't messed with it much but it seems to help: diff --git a/autoload/copilot.vim b/autoload/copilot.vim
index 0236325..c623233 100644
--- a/autoload/copilot.vim
+++ b/autoload/copilot.vim
@@ -408,6 +408,15 @@ function! copilot#IsMapped() abort
endfunction
function! copilot#Schedule(...) abort
+ " Only fire if not in a comment. Have to step back one column -- see note at
+ " :help synID().
+ " Caveat 1: Copilot will still fire if the cursor is on a blank line. -_-
+ " Caveat 2: "[synID] can be very slow."
+ let synName = synIDattr(synIDtrans(synID(line("."),max([1,col(".")-1]),1)),"name")
+ if synName ==# "Comment"
+ call copilot#Clear()
+ return
+ endif
if !s:has_ghost_text || !copilot#Enabled() || !copilot#IsMapped()
call copilot#Clear()
return |
Beta Was this translation helpful? Give feedback.
-
@ryanjsalva It's 2024 and this issue remains unresolved. I can only assume the delay for fixing this is due to expectations that Copilot will over time provide more helpful comments. However, it's important to note that the concern isn't solely about verbosity but rather about accuracy in understanding user intent. // Unsubscribing yet again |
Beta Was this translation helpful? Give feedback.
-
I disabled copilot due to this issue despite my company purchased the enterprise license. |
Beta Was this translation helpful? Give feedback.
-
Kinda nuts that 3 years on, this issue, which is by far my number 1 gripe with Copilot, and sounds like it is for many others, is still not only unresolved, but hasn't had any comments or acknowledgment from the Github team in more than a year and a half (and thank you, @ryanjsalva, for that, when you did). It would be nice to have some kind of idea of whether this is even on the radar, and if so, for what kind of schedule. |
Beta Was this translation helpful? Give feedback.
-
For those struggling with this, I personally have found the keybind |
Beta Was this translation helpful? Give feedback.
-
Just throwing my voice into the wind. The day an AI can write a comment for me is the day I'm obsolete, so I'll never need this distracting feature. Attention is the only currency. |
Beta Was this translation helpful? Give feedback.
-
+1 pls @ryanjsalva |
Beta Was this translation helpful? Give feedback.
-
This has been bothering me too, so my first thought was to ask Copilot about itself before resorting to a web search. So I ask Copilot Chat "How can I disable Copilot comment suggestions while retaining other functionality?" According to Copilot:
Of course, this is pure hallucination (there is no gear in the lower left, and no such setting exists), but it's offered with such confidence! |
Beta Was this translation helpful? Give feedback.
-
This product is really incredible. The one thing I would like to have is the ability to disable these two behaviors upon will:
-disable comment auto-complete - I like to write my comments myself and a suggestion that appears on screen distracts the thought process because I automatically read it
-disable suggestion of functions when nothing is being typed. I find that when I'm inside a class between methods, CoPilot starts suggestion full methods without nothing being typed. I don't want this because I constantly have to hit esc to stop suggestions. Please see the attachment. This sometimes happen, sometimes not (don't know the reason yet).
Both are related to CoPilot trying too much and this requires my constant attention and becomes a distraction.
But I really like the method and code line autocomplete, they save a ton of time so just some checkboxes to limit the feature functionality would be nice.
Beta Was this translation helpful? Give feedback.
All reactions