Skip to content

Commit

Permalink
no code lenses in cells or repl inputs (#16023)
Browse files Browse the repository at this point in the history
  • Loading branch information
amunger authored Sep 9, 2024
1 parent 7b7c900 commit 6db3b11
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export class DataScienceCodeLensProvider implements IDataScienceCodeLensProvider
private onChangedActiveTextEditor() {
const activeEditor = vscode.window.activeTextEditor;

if (!activeEditor || activeEditor.document.languageId != PYTHON_LANGUAGE) {
if (
!activeEditor ||
activeEditor.document.languageId != PYTHON_LANGUAGE ||
[NotebookCellScheme, InteractiveInputScheme].includes(activeEditor.document.uri.scheme)
) {
// set the context to false so our command doesn't run for other files
const hasCellsContext = new ContextKey(EditorContexts.HasCodeCells);
hasCellsContext.set(false).catch((ex) => logger.warn('Failed to set jupyter.HasCodeCells context', ex));
Expand Down

0 comments on commit 6db3b11

Please sign in to comment.