How to disable default GitHub Copilot message in empty Jupyter notebook cells?

393 views Asked by At

I use GitHub Copilot and GitHub Copilot Chat extensions in VSCode. Recently, in empty cells of Jupyter notebooks, the following message started appearing:

enter image description here

Press Ctrl+K I to ask GitHub Copilot Chat to do something. Start typing to dismiss.

I find it distracting and would like to disable it. How can I do that? Is there a dedicated option?


Update. The versions I currently use:

  • VSCode v1.81.1 (2023-11-06)
  • GitHub Copilot Chat v0.10.1 (Last updated 2023-11-06, 21:55:36);
  • GitHub Copilot v1.135.0 (Last updated 2023-11-08, 13:01:28);
1

There are 1 answers

0
starball On

TL;DR

Use the workbench.editor.empty.hint setting.

Ordinarily, I'd vote to close this as a duplicate (of VSCode | New Window select language) for this reason, but I think there's some fun extra info that can be given for this particular question.

Listen to starball ramble

Ah ok. I needed to search differently: https://github.com/search?q=%22something+or+start+typing+to+dismiss.%22&type=code, which turns up VS Code's https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.ts in the _getHintInlineChat function (I.e. it's behaviour of VS Code and not of the GitHub Copilot extension in particular). At the time of this writing (VS Code 1.84), the line of code is:

let ariaLabel = `Ask ${providerName} something or start typing to dismiss.`;

To disable the message, you could figure it out by guessing (or being familiar with VS Code settings), but let's do the fun way: there's a _shouldRenderHint function, and if you read it, you'll see it does const configValue = this.configurationService.getValue(emptyTextEditorHintSetting);, which is defined to workbench.editor.empty.hint. So there's your setting.

As for why it differs slightly from what you show in your question post, you mention you're on VS Code 1.81. The file was originally located at src/vs/workbench/contrib/codeEditor/browser/untitledTextEditorHint/untitledTextEditorHint.ts, but interestingly, I don't see such a string template in there... I don't know.