GitHub Copilot - Strange Injection of characters with Visual Studio - Javascript AND C#

50 Views Asked by At

I was using Visual Studio for an ASP.netcore project at work with Github Copilot. I was writing javascript in one of the Views. A strange thing happened where lowercase d's were injected into the code at random times and random places.

In the editor, there were characters that were being inject in places in the source causing errors, and either I had to undo the insertion of the characters or delete them. Yet, when I would add more code to the source, the characters would be inserted again. This proved to be difficult to debug as it kept happening.

This was also happening with C# in a DotNet 7 project. It was a hard time to clean up and I had to turn off Copilot. There were a couple curly braces that were injected, also.

This is peculiar behavior. What is happening here?

1

There are 1 best solutions below

1
nicholasrjohnson On

I realized that the issue with this was that I was using the Vim extension in Visual Studio. Because I had been using Vim commands, GitHub Copilot was getting very confused.

I hope this helps someone having the same behavior to save some time. It was very confusing, and it took me a long time to make the connection. You would think that GitHub Copilot would not take the time to learn Vim. It is hard enough for a human to learn it.

I have not had other issues with GitHub Copilot and prompt programming has become very useful. I just hope they iron out these kind of kinks in the future versions. I would love to be able to continue using Vim.