Skip to content

Commit 728877c

Browse files
committed
fixes
1 parent 331c9f1 commit 728877c

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

src/extension/common/application/commands/reportIssueCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export async function openReportIssue(): Promise<void> {
2626
const interpreterPath = await getActiveEnvironmentPath();
2727
let interpreter: PythonEnvironment | undefined = undefined;
2828
if (interpreterPath && 'environmentPath' in interpreterPath) {
29-
interpreter = interpreterPath ? await resolveEnvironment(interpreterPath.environmentPath.fsPath) : undefined;
29+
interpreter = await resolveEnvironment(interpreterPath.environmentPath.fsPath);
3030
} else if (interpreterPath && 'path' in interpreterPath) {
31-
interpreter = interpreterPath ? await resolveEnvironment(interpreterPath.path) : undefined;
31+
interpreter = await resolveEnvironment(interpreterPath.path);
3232
}
3333
const virtualEnvKind = interpreter && interpreter.envId ? interpreter.envId.managerId : 'Unknown';
3434
const pythonVersion = interpreter?.version ?? 'unknown';

src/extension/common/python.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const onDidChangePythonInterpreterEvent = new EventEmitter<IInterpreterDetails>(
2828
export const onDidChangePythonInterpreter: Event<IInterpreterDetails> = onDidChangePythonInterpreterEvent.event;
2929

3030
async function activateExtensions() {
31-
traceWarn('Value during activateExtensions of useEnvExtension(): ', useEnvExtension());
31+
traceLog('Value during activateExtensions of useEnvExtension(): ', useEnvExtension());
3232
await activatePythonExtension();
3333
await activateEnvsExtension();
3434
}
@@ -73,7 +73,6 @@ export async function initializePython(disposables: Disposable[]): Promise<void>
7373
if (api) {
7474
disposables.push(
7575
api.onDidChangeEnvironments(async () => {
76-
// not sure if this is the right event....
7776
const details = await getInterpreterDetails();
7877
traceLog(`initializePython:onDidChangeEnvironments fired executable='${details.path?.[0]}'`);
7978
onDidChangePythonInterpreterEvent.fire(details);
@@ -217,8 +216,7 @@ export async function resolveEnvironment(
217216
export async function getActiveEnvironmentPath(
218217
resource?: Resource,
219218
): Promise<PythonEnvironment | EnvironmentPath | undefined> {
220-
// if I add environmentPath. or there needs to be some conversion between the two here
221-
//TODO: fix this return type??
219+
222220
if (!useEnvExtension()) {
223221
const envPath: EnvironmentPath = await legacyGetActiveEnvironmentPath(resource);
224222
traceLog(`getActiveEnvironmentPath: legacy active path='${envPath.path}'`);

src/extension/debugger/adapter/factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
199199
// Parse version string (e.g., "3.8.10" -> major: 3, minor: 8)
200200
const parseMajorMinor = (v: string) => {
201201
const m = v.match(/^(\d+)(?:\.(\d+))?/);
202-
return { major: m ? Number(m[1]) : 0, minor: m && m[2] ? Number(m[2]) : 0 };
202+
return { major: m && m[1] ? Number(m[1]) : 0, minor: m && m[2] ? Number(m[2]) : 0 };
203203
};
204204
const { major, minor } = parseMajorMinor(version || '');
205205

src/test/unittest/common/pythonFalse.unit.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
('use strict');
5-
64
import { expect } from 'chai';
75
import * as sinon from 'sinon';
86
import { Uri, Disposable, Extension, commands, extensions } from 'vscode';

0 commit comments

Comments
 (0)