Skip to content

Commit d99acd7

Browse files
author
Kartik Raj
committed
Undo unintentional formatting changes
1 parent 98c0387 commit d99acd7

File tree

2 files changed

+17
-24
lines changed
  • src
    • client/pythonEnvironments/base/info
    • test/pythonEnvironments/base

2 files changed

+17
-24
lines changed

src/client/pythonEnvironments/base/info/env.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function buildEnvInfo(init?: {
6767
export function copyEnvInfo(
6868
env: PythonEnvInfo,
6969
updates?: {
70-
kind?: PythonEnvKind;
70+
kind?: PythonEnvKind,
7171
},
7272
): PythonEnvInfo {
7373
// We don't care whether or not extra/hidden properties
@@ -79,15 +79,12 @@ export function copyEnvInfo(
7979
return copied;
8080
}
8181

82-
function updateEnv(
83-
env: PythonEnvInfo,
84-
updates: {
85-
kind?: PythonEnvKind;
86-
executable?: string;
87-
location?: string;
88-
version?: PythonVersion;
89-
},
90-
): void {
82+
function updateEnv(env: PythonEnvInfo, updates: {
83+
kind?: PythonEnvKind;
84+
executable?: string;
85+
location?: string;
86+
version?: PythonVersion;
87+
}): void {
9188
if (updates.kind !== undefined) {
9289
env.kind = updates.kind;
9390
}

src/test/pythonEnvironments/base/common.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export function createNamedEnv(
6464

6565
export class SimpleLocator extends Locator {
6666
private deferred = createDeferred<void>();
67-
6867
constructor(
6968
private envs: PythonEnvInfo[],
7069
private callbacks?: {
@@ -75,24 +74,21 @@ export class SimpleLocator extends Locator {
7574
beforeEach?(e: PythonEnvInfo): Promise<void>;
7675
afterEach?(e: PythonEnvInfo): Promise<void>;
7776
onQuery?(query: PythonLocatorQuery | undefined, envs: PythonEnvInfo[]): Promise<PythonEnvInfo[]>;
78-
},
77+
}
7978
) {
8079
super();
8180
}
82-
8381
public get done(): Promise<void> {
8482
return this.deferred.promise;
8583
}
86-
8784
public fire(event: PythonEnvsChangedEvent) {
8885
this.emitter.fire(event);
8986
}
90-
9187
public iterEnvs(query?: PythonLocatorQuery): IPythonEnvsIterator {
92-
const { deferred } = this;
93-
const { callbacks } = this;
94-
let { envs } = this;
95-
const iterator: IPythonEnvsIterator = (async function* () {
88+
const deferred = this.deferred;
89+
const callbacks = this.callbacks;
90+
let envs = this.envs;
91+
const iterator: IPythonEnvsIterator = async function*() {
9692
if (callbacks?.onQuery !== undefined) {
9793
envs = await callbacks.onQuery(query, envs);
9894
}
@@ -119,23 +115,23 @@ export class SimpleLocator extends Locator {
119115
}
120116
}
121117
}
122-
if (callbacks?.after !== undefined) {
118+
if (callbacks?.after!== undefined) {
123119
await callbacks.after;
124120
}
125121
deferred.resolve();
126-
}());
122+
}();
127123
iterator.onUpdated = this.callbacks?.onUpdated;
128124
return iterator;
129125
}
130-
131126
public async resolveEnv(env: string | PythonEnvInfo): Promise<PythonEnvInfo | undefined> {
132127
const envInfo: PythonEnvInfo = typeof env === 'string' ? createLocatedEnv('', '', undefined, env) : env;
133128
if (this.callbacks?.resolve === undefined) {
134129
return envInfo;
135-
} if (this.callbacks?.resolve === null) {
130+
} else if (this.callbacks?.resolve === null) {
136131
return undefined;
132+
} else {
133+
return this.callbacks.resolve(envInfo);
137134
}
138-
return this.callbacks.resolve(envInfo);
139135
}
140136
}
141137

0 commit comments

Comments
 (0)