Is there a way to disable automatic inline suggestions from GitHub Copilot in Visual Studio?
Asked Answered
R

3

8

Is it possible to not have GitHub Copilot automatically suggest code, instead only showing its suggestions when using the "trigger inline suggestion" shortcut?

I saw there is a setting github.copilot.inlineSuggest.enable in Visual Studio Code for this, but can't find any way to do this in Visual Studio.

Reahard answered 1/5, 2023 at 15:1 Comment(1)
Does disabling this extension solve your problem?Verenaverene
M
1

Yes, this is extremely straightforward. We simply need to

  1. Download the VSIX package from marketplace.visualstudio.com
  2. Extract the VSIX contents as a zip archive
  3. Decompile the GitHub.Copilot.Vsix.dll library into C# using JetBrains dotPeek
  4. Modify Method:GitHub.Copilot.CopilotOptionPage.SaveSettingsToStorage() to add the option InlineSuggest
    copilotSettings.InlineSuggest = this.viewModel.InlineSuggest;
    
  5. Decompile the copilot-agent-win.exe vercel/pkg build package from the above folder using the NSA ghidra tool and the NodeJS plugin fork of ghidra_nodejs
  6. Download the VS Code VSIX bundled version of copilot and extract as zip archive.
  7. Inspect the JavaScript and identify how the InlineSuggest is implemented.
  8. Add the InlineSuggest option to the JavaScript of the decompiled code mimicking the functionality in the VS Code extension.
  9. Re-package the JavaScript as a vercel/pkg build package.
  10. Re-package the VSIX extension for Visual Studio using the extension development procedure.
  11. Load the double-reverse-engineered extension into Visual Studio.

If you are feeling generous, share the modified code with Microsoft so they can implement your improvement in their extension. Mind you, the code base is not public, so you may want to submit the changes anonymously.

Medic answered 14/7, 2023 at 12:23 Comment(0)
P
0

Under Options,

  1. GitHub
  2. Copilot
  3. Untick "Enable Copilot Completions" under the "Copilot Completions" section.

Search "GitHub" within the search field in Visual Studio to find it easily.

Pitfall answered 20/9, 2024 at 1:16 Comment(0)
S
-1

From what I could find: GitHub Copilot does not have an explicit option to disable automatic code suggestions and only shows them when using the "trigger inline suggestion" shortcut.

Also, it's worth mentioning that Visual Studio Code and GitHub Copilot are separate entities, and they might have different configurations and settings available. Therefore, it is possible that the setting github.copilot.inlineSuggest.enable is specific to Visual Studio Code and may not be applicable to Visual Studio.

Now, there's a solution, that will satisfy your request, but it's in a different environment app: Webstorm.

Here's the the answer. Good luck!

Schoenberg answered 14/7, 2023 at 3:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.