Add announcement

This commit is contained in:
Saoud Rizwan
2024-09-02 01:15:22 -04:00
parent b02692e2f7
commit 520ef5281e
6 changed files with 14 additions and 28 deletions

View File

@@ -4,14 +4,12 @@ export async function getPythonEnvPath(): Promise<string | undefined> {
const pythonExtension = vscode.extensions.getExtension("ms-python.python")
if (!pythonExtension) {
console.log("Python extension is not installed.")
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
console.log("Python extension is not active.")
return undefined
}
@@ -20,12 +18,10 @@ export async function getPythonEnvPath(): Promise<string | undefined> {
// Get the active environment path for the current workspace
const workspaceFolder = vscode.workspace.workspaceFolders?.[0]
if (!workspaceFolder) {
console.log("No workspace folder is open.")
return undefined
}
// Get the active python environment path for the current workspace
const pythonEnv = await pythonApi?.environments?.getActiveEnvironmentPath(workspaceFolder.uri)
console.log("Python environment path:", pythonEnv)
if (pythonEnv && pythonEnv.path) {
return pythonEnv.path
} else {