From da6f705df28dccc65b134b49cc1677cf27c0f86c Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Tue, 1 Jul 2025 14:06:14 -0700 Subject: [PATCH] Remove unused file get-python-env.ts (#4604) --- src/integrations/workspace/get-python-env.ts | 43 -------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/integrations/workspace/get-python-env.ts diff --git a/src/integrations/workspace/get-python-env.ts b/src/integrations/workspace/get-python-env.ts deleted file mode 100644 index f47f0d4c..00000000 --- a/src/integrations/workspace/get-python-env.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { getCwd } from "@/utils/path" -import * as vscode from "vscode" - -/* -Used to get user's current python environment (unnecessary now that we use the IDE's terminal) -${await (async () => { - try { - const pythonEnvPath = await getPythonEnvPath() - if (pythonEnvPath) { - return `\nPython Environment: ${pythonEnvPath}` - } - } catch {} - return "" - })()} -*/ -export async function getPythonEnvPath(): Promise { - const pythonExtension = vscode.extensions.getExtension("ms-python.python") - - if (!pythonExtension) { - return undefined - } - - // Ensure the Python extension is activated - if (!pythonExtension.isActive) { - // if the python extension is not active, we can assume the project is not a python project - return undefined - } - - // Access the Python extension API - const pythonApi = pythonExtension.exports - // Get the active environment path for the current workspace - const workspaceFolder = await getCwd() - if (!workspaceFolder) { - return undefined - } - // Get the active python environment path for the current workspace - const pythonEnv = await pythonApi?.environments?.getActiveEnvironmentPath(workspaceFolder) - if (pythonEnv && pythonEnv.path) { - return pythonEnv.path - } else { - return undefined - } -}