I'm using GitHub—Copilot in a VS-Code environment. Given the autocompletion feature, I want to have the possibility to only accept line by line.
For example: The autocomplete shows five lines on TAB, but I just need the first two of them.
Is there a config file or any other possibility to achieve this?


Method 1 (Config):
Go to Co-pilot extension settings.
Edit advanced settings
paste this in the
settings.jsonfileYou must adjust based on the number of tokens. Try it out a few times to see what works best for you
Method 2 (With Intuition):
This is something I found annoying at times. Upon using it for months, I found that if you want only a line but it is showing you 5-6 lines of autocomplete, you just type something in the current line and it should only autosuggest the line you are on.
for eg, let's say you are trying to make a function that counts prime numbers. Let us say you write a comment and expect it to finish the function. Usually, when you comment, it should show you the whole function at once when you name your function or sometimes even hit enter right after the comment.
But instead, you simply name a variable called
primand it should autocomplete the rest based on its approach. It could beprimes = 0and keep on hitting enter, you should see line-by-line.TLDR;; If you want it to complete, just "restrict" its predictions by telling it how you want it to look by just trying about your business!
Edit:
As Randolph said in the comments, now you have a setting to do this