@@ -16,7 +16,6 @@ import { IInterpreterLocatorService, IInterpreterService, KNOWN_PATH_SERVICE } f
1616import { captureTelemetry } from '../../telemetry' ;
1717import { getRealPath } from '../common' ;
1818import { Telemetry } from '../constants' ;
19- import { defaultKernelSpecName } from '../jupyter/kernels/helpers' ;
2019import { JupyterKernelSpec } from '../jupyter/kernels/jupyterKernelSpec' ;
2120import { IDataScienceFileSystem , IJupyterKernelSpec } from '../types' ;
2221import { IKernelFinder } from './types' ;
@@ -70,35 +69,32 @@ export class KernelFinder implements IKernelFinder {
7069 const kernelName = kernelSpecMetadata ?. name ;
7170
7271 if ( kernelSpecMetadata && kernelName ) {
73- // For a non default kernelspec search for it
74- if ( ! kernelName . includes ( defaultKernelSpecName ) ) {
75- let kernelSpec = await this . searchCache ( kernelName ) ;
72+ let kernelSpec = await this . searchCache ( kernelName ) ;
7673
77- if ( kernelSpec ) {
78- return kernelSpec ;
79- }
74+ if ( kernelSpec ) {
75+ return kernelSpec ;
76+ }
8077
81- // Check in active interpreter first
82- kernelSpec = await this . getKernelSpecFromActiveInterpreter ( kernelName , resource ) ;
78+ // Check in active interpreter first
79+ kernelSpec = await this . getKernelSpecFromActiveInterpreter ( kernelName , resource ) ;
8380
84- if ( kernelSpec ) {
85- this . writeCache ( ) . ignoreErrors ( ) ;
86- return kernelSpec ;
87- }
88-
89- const diskSearch = this . findDiskPath ( kernelName ) ;
90- const interpreterSearch = this . getInterpreterPaths ( resource ) . then ( ( interpreterPaths ) => {
91- return this . findInterpreterPath ( interpreterPaths , kernelName ) ;
92- } ) ;
81+ if ( kernelSpec ) {
82+ this . writeCache ( ) . ignoreErrors ( ) ;
83+ return kernelSpec ;
84+ }
9385
94- let result = await Promise . race ( [ diskSearch , interpreterSearch ] ) ;
95- if ( ! result ) {
96- const both = await Promise . all ( [ diskSearch , interpreterSearch ] ) ;
97- result = both [ 0 ] ? both [ 0 ] : both [ 1 ] ;
98- }
86+ const diskSearch = this . findDiskPath ( kernelName ) ;
87+ const interpreterSearch = this . getInterpreterPaths ( resource ) . then ( ( interpreterPaths ) => {
88+ return this . findInterpreterPath ( interpreterPaths , kernelName ) ;
89+ } ) ;
9990
100- foundKernel = result ;
91+ let result = await Promise . race ( [ diskSearch , interpreterSearch ] ) ;
92+ if ( ! result ) {
93+ const both = await Promise . all ( [ diskSearch , interpreterSearch ] ) ;
94+ result = both [ 0 ] ? both [ 0 ] : both [ 1 ] ;
10195 }
96+
97+ foundKernel = result ;
10298 }
10399
104100 this . writeCache ( ) . ignoreErrors ( ) ;
0 commit comments