From 042da476fd2e49d7201ca40eb843346417780e69 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 1 Dec 2022 14:28:32 -0600 Subject: [PATCH] Don't create more than one notebook detection task per-type. This is creating detection tasks to cover the period between opening a notebook, and the notebook extension activating and starting its own detection task. This code is a bit more complex than necessary, and it would be simpler to manage the lifecycle of this task from the `activateByEvent` promise. Fix #167875 --- .../browser/contrib/kernelDetection/notebookKernelDetection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.ts b/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.ts index 7d6ff757c838d..03254dd3980db 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.ts @@ -58,7 +58,7 @@ class NotebookKernelDetection extends Disposable implements IWorkbenchContributi } }); - if (shouldStartDetection) { + if (shouldStartDetection && !this._detectionMap.has(notebookType)) { const task = this._notebookKernelService.registerNotebookKernelDetectionTask({ notebookType: notebookType });