Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export namespace Diagnostics {
);
export const invalidPythonPathInDebuggerSettings = localize(
'diagnostics.invalidPythonPathInDebuggerSettings',
'You need to select a Python interpreter before you start debugging.\n\nTip: click on "Select Python Interpreter" in the status bar.',
'You need to select a Python interpreter before you start debugging.\n\nTip: click on "Select Interpreter" in the status bar.',
);
export const invalidPythonPathInDebuggerLaunch = localize(
'diagnostics.invalidPythonPathInDebuggerLaunch',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
(await this.interpreterService.getActiveInterpreter(workspaceFolder))?.path ??
this.configurationService.getSettings(workspaceFolder).pythonPath;
debugConfiguration.pythonPath = interpreterPath;
this.pythonPathSource = PythonPathSource.settingsJson;
} else {
debugConfiguration.pythonPath = systemVariables.resolveAny(debugConfiguration.pythonPath);
}
if (debugConfiguration.python === '${command:python.interpreterPath}' || !debugConfiguration.python) {
this.pythonPathSource = PythonPathSource.settingsJson;
} else {
this.pythonPathSource = PythonPathSource.launchJson;
}
debugConfiguration.python = systemVariables.resolveAny(debugConfiguration.python);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { IConfigurationService } from '../../../../common/types';
import { IInterpreterService } from '../../../../interpreter/contracts';
import { DebuggerTypeName } from '../../../constants';
import { DebugOptions, DebugPurpose, LaunchRequestArguments } from '../../../types';
import { PythonPathSource } from '../../types';
import { BaseConfigurationResolver } from './base';
import { IDebugEnvironmentVariablesService } from './helper';

Expand Down Expand Up @@ -195,9 +194,7 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
debugConfiguration.debugAdapterPython,
debugConfiguration.debugLauncherPython,
]) {
const source =
executable === debugConfiguration.pythonPath ? this.pythonPathSource : PythonPathSource.launchJson;
if (!(await diagnosticService.validatePythonPath(executable, source, folder?.uri))) {
if (!(await diagnosticService.validatePythonPath(executable, this.pythonPathSource, folder?.uri))) {
return false;
}
}
Expand Down