jamesonknutson / disable-copilot-comment-completions

MIT License
17 stars 3 forks source link

VSCode Extension Marketplace Download

Features

Prevents Github Copilot from providing inline suggestions in comments (and anywhere else you might not want copilot to be providing suggestions).

Can be used to define "exclusion rules" that instruct the Extension to temporarily disable Copilot's inline suggestions feature when certain strings of text from the document itself are matched at the cursor position, or when certain glob patterns match the active document, or when certain TextMate scopes are found at the cursor position.

Some example use cases / configurations include:

The extension works by listening to VSCode's onDidChangeTextEditorSelection event and iterating over all the configured 'exclusion rules' to determine whether or not copilot's inline suggestions should be artificially disabled by the extension at the current position. If so, the extension will disable inline suggestions until the inverse is true (none of the exclusion rules match), at which point inline suggestions will be enabled again.

The Extension can be toggled on or off using the disable-copilot-comment-completions.toggle Command (Command Palette: Toggle Copilot Scope Inhibitor), and/or set in your settings.json file using the setting key: disable-copilot-comment-completions.active (boolean). You can also force-enable/disable the Extension using the commands disable-copilot-comment-completions.enable and disable-copilot-comment-completions.disable.

For ease of use with TextMate Scopes, the extension provides an easy way to select TextMate Scopes to exclude selections within. You can run the disable-copilot-comment-completions.addScopes command whenever your cursor position is in some file that has a TextMate Grammar associated with it, and it will present you with a menu comprising of the TextMate Scopes at the cursor position to add/remove exclusion rules for.

demo

Demo also available here if the GIF isn't loading

Requirements

  1. Github Copilot (obviously).
  2. HyperScopes - This extension is used to grab the scopes of wherever you're typing. You need to install it before this extension can work.

Extension Settings

Commands

Known Issues

Release Notes

See CHANGELOG.md for more details.

1.0.0

1.0.1

1.0.2

2.0.0