From 6db3b11ced0d1172ca5838621aba65bafd5d8c84 Mon Sep 17 00:00:00 2001 From: Aaron Munger Date: Mon, 9 Sep 2024 13:14:30 -0700 Subject: [PATCH] no code lenses in cells or repl inputs (#16023) --- .../editor-integration/codelensprovider.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interactive-window/editor-integration/codelensprovider.ts b/src/interactive-window/editor-integration/codelensprovider.ts index 16928468b44..a80c00f7f40 100644 --- a/src/interactive-window/editor-integration/codelensprovider.ts +++ b/src/interactive-window/editor-integration/codelensprovider.ts @@ -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));