@@ -16,7 +16,6 @@ import { IInterpreterLocatorService, IInterpreterService, KNOWN_PATH_SERVICE } f
16
16
import { captureTelemetry } from '../../telemetry' ;
17
17
import { getRealPath } from '../common' ;
18
18
import { Telemetry } from '../constants' ;
19
- import { defaultKernelSpecName } from '../jupyter/kernels/helpers' ;
20
19
import { JupyterKernelSpec } from '../jupyter/kernels/jupyterKernelSpec' ;
21
20
import { IDataScienceFileSystem , IJupyterKernelSpec } from '../types' ;
22
21
import { IKernelFinder } from './types' ;
@@ -70,35 +69,32 @@ export class KernelFinder implements IKernelFinder {
70
69
const kernelName = kernelSpecMetadata ?. name ;
71
70
72
71
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 ) ;
76
73
77
- if ( kernelSpec ) {
78
- return kernelSpec ;
79
- }
74
+ if ( kernelSpec ) {
75
+ return kernelSpec ;
76
+ }
80
77
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 ) ;
83
80
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
+ }
93
85
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
+ } ) ;
99
90
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 ] ;
101
95
}
96
+
97
+ foundKernel = result ;
102
98
}
103
99
104
100
this . writeCache ( ) . ignoreErrors ( ) ;
0 commit comments