Skip to content

Commit 2c438e0

Browse files
author
Kartik Raj
authored
Fallback to the old mechanism to calculate displayName if displayName is not set by new discovery component (#15226)
1 parent eaf646f commit 2c438e0

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/client/interpreter/interpreterService.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,17 @@ export class InterpreterService implements Disposable, IInterpreterService {
144144

145145
@captureTelemetry(EventName.PYTHON_INTERPRETER_DISCOVERY, { locator: 'all' }, true)
146146
public async getInterpreters(resource?: Uri, options?: GetInterpreterOptions): Promise<PythonEnvironment[]> {
147+
let environments: PythonEnvironment[] = [];
147148
if (await inDiscoveryExperiment(this.experimentService)) {
148-
return this.pyenvs.getInterpreters(resource) && Promise.resolve([]);
149+
environments = (await this.pyenvs.getInterpreters(resource)) ?? [];
150+
} else {
151+
const locator = this.serviceContainer.get<IInterpreterLocatorService>(
152+
IInterpreterLocatorService,
153+
INTERPRETER_LOCATOR_SERVICE,
154+
);
155+
environments = await locator.getInterpreters(resource, options);
149156
}
150157

151-
const locator = this.serviceContainer.get<IInterpreterLocatorService>(
152-
IInterpreterLocatorService,
153-
INTERPRETER_LOCATOR_SERVICE,
154-
);
155-
const environments = await locator.getInterpreters(resource, options);
156-
157158
await Promise.all(
158159
environments
159160
.filter((item) => !item.displayName)

0 commit comments

Comments
 (0)