Skip to content

Commit 01c3f16

Browse files
authored
Rename category to kind (#23744)
1 parent 2d66ae9 commit 01c3f16

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

src/client/pythonEnvironments/base/locators/common/nativePythonFinder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface NativeEnvInfo {
2828
displayName?: string;
2929
name?: string;
3030
executable?: string;
31-
category: string;
31+
kind: string;
3232
version?: string;
3333
prefix?: string;
3434
manager?: NativeEnvManagerInfo;

src/client/pythonEnvironments/base/locators/composite/envsCollectionService.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -443,50 +443,49 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
443443

444444
const nativeEnvironmentsWithoutPython = nativeEnvs.filter((e) => e.executable === undefined).length;
445445
const nativeCondaEnvs = nativeEnvs.filter(
446-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Conda,
446+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Conda,
447447
).length;
448448
const nativeCustomEnvs = nativeEnvs.filter(
449-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Custom,
449+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Custom,
450450
).length;
451451
const nativeMicrosoftStoreEnvs = nativeEnvs.filter(
452-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.MicrosoftStore,
452+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.MicrosoftStore,
453453
).length;
454454
const nativeOtherGlobalEnvs = nativeEnvs.filter(
455-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.OtherGlobal,
455+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.OtherGlobal,
456456
).length;
457457
const nativeOtherVirtualEnvs = nativeEnvs.filter(
458-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.OtherVirtual,
458+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.OtherVirtual,
459459
).length;
460460
const nativePipEnvEnvs = nativeEnvs.filter(
461-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Pipenv,
461+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Pipenv,
462462
).length;
463463
const nativePoetryEnvs = nativeEnvs.filter(
464-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Poetry,
464+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Poetry,
465465
).length;
466466
const nativePyenvEnvs = nativeEnvs.filter(
467-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Pyenv,
467+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Pyenv,
468468
).length;
469469
const nativeSystemEnvs = nativeEnvs.filter(
470-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.System,
470+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.System,
471471
).length;
472472
const nativeUnknownEnvs = nativeEnvs.filter(
473-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Unknown,
474-
).length;
475-
const nativeVenvEnvs = nativeEnvs.filter(
476-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Venv,
473+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Unknown,
477474
).length;
475+
const nativeVenvEnvs = nativeEnvs.filter((e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Venv)
476+
.length;
478477
const nativeVirtualEnvEnvs = nativeEnvs.filter(
479-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.VirtualEnv,
478+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.VirtualEnv,
480479
).length;
481480
const nativeVirtualEnvWrapperEnvs = nativeEnvs.filter(
482-
(e) => this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.VirtualEnvWrapper,
481+
(e) => this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.VirtualEnvWrapper,
483482
).length;
484483
const nativeGlobal = nativeEnvs.filter(
485484
(e) =>
486-
this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.OtherGlobal ||
487-
this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.System ||
488-
this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.Custom ||
489-
this.nativeFinder.categoryToKind(e.category) === PythonEnvKind.OtherVirtual,
485+
this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.OtherGlobal ||
486+
this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.System ||
487+
this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.Custom ||
488+
this.nativeFinder.categoryToKind(e.kind) === PythonEnvKind.OtherVirtual,
490489
).length;
491490

492491
// Intent is to capture time taken for discovery of all envs to complete the first time.
@@ -582,7 +581,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
582581
if (!resolvedEnv) {
583582
return;
584583
}
585-
const kind = this.nativeFinder.categoryToKind(e.category);
584+
const kind = this.nativeFinder.categoryToKind(e.kind);
586585
const nativeVersion = e.version ? parseVersion(e.version) : undefined;
587586
if (
588587
nativeVersion &&

src/client/pythonEnvironments/base/locators/lowLevel/nativeLocator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class NativeLocator implements ILocator<BasicEnvInfo>, IDisposable {
9292
if (data.executable) {
9393
const arch = (data.arch || '').toLowerCase();
9494
const env: BasicEnvInfo = {
95-
kind: this.finder.categoryToKind(data.category),
95+
kind: this.finder.categoryToKind(data.kind),
9696
executablePath: data.executable ? data.executable : '',
9797
envPath: data.prefix ? data.prefix : undefined,
9898
version: data.version ? parseVersion(data.version) : undefined,

0 commit comments

Comments
 (0)