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
This commit is contained in:
Rob Lourens
2022-12-01 22:02:52 +01:00
committed by GitHub
parent 9b3371e6e3
commit fa2d8d9afb
@@ -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
});