From be54a246e67d196b3a7998c20d298b489cb9adbe Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Tue, 7 Nov 2023 14:38:05 +0800 Subject: [PATCH] feat: detect python interpreter from pdm --- src/configSettings.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/configSettings.ts b/src/configSettings.ts index f88ad2f4..8be347de 100644 --- a/src/configSettings.ts +++ b/src/configSettings.ts @@ -94,6 +94,12 @@ export class PythonSettings implements IPythonSettings { } } + // pdm + p = path.join(this.workspaceRoot, '.pdm-python'); + if (fs.existsSync(p)) { + return child_process.spawnSync('pdm', ['info', '--python'], { encoding: 'utf8' }).stdout.trim(); + } + // virtualenv in the workspace root const files = fs.readdirSync(this.workspaceRoot); for (const file of files) {