From fa2d8d9afbb049c5c9458be7920b367ea3580b7d Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 1 Dec 2022 15:02:52 -0600 Subject: [PATCH] Don't create more than one notebook detection task per-type (#167878) 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 7d6ff757c83..03254dd3980 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 });