diff --git a/extension/package-lock.json b/extension/package-lock.json index 5f2461d..afed7f0 100644 --- a/extension/package-lock.json +++ b/extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "pylyzer", - "version": "0.1.9", + "version": "0.1.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pylyzer", - "version": "0.1.9", + "version": "0.1.10", "dependencies": { "vscode-languageclient": "^8.0.2" }, @@ -859,9 +859,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001668", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001668.tgz", - "integrity": "sha512-nWLrdxqCdblixUO+27JtGJJE/txpJlyUy5YN1u53wLZkP0emYCo5zgS6QYft7VUYR42LGgi/S5hdLZTrnyIddw==", + "version": "1.0.30001669", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz", + "integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==", "dev": true, "funding": [ { @@ -1150,9 +1150,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.38", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.38.tgz", - "integrity": "sha512-VbeVexmZ1IFh+5EfrYz1I0HTzHVIlJa112UEWhciPyeOcKJGeTv6N8WnG4wsQB81DGCaVEGhpSb6o6a8WYFXXg==", + "version": "1.5.39", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.39.tgz", + "integrity": "sha512-4xkpSR6CjuiaNyvwiWDI85N9AxsvbPawB8xc7yzLPonYTuP19BVgYweKyUMFtHEZgIcHWMt1ks5Cqx2m+6/Grg==", "dev": true, "license": "ISC" }, diff --git a/extension/package.json b/extension/package.json index 3f51807..50b9948 100644 --- a/extension/package.json +++ b/extension/package.json @@ -3,7 +3,7 @@ "displayName": "pylyzer", "description": "A fast Python static code analyzer & language server for VSCode", "publisher": "pylyzer", - "version": "0.1.9", + "version": "0.1.10", "engines": { "vscode": "^1.70.0" }, diff --git a/extension/src/extension.ts b/extension/src/extension.ts index 9915f2d..b82632d 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -1,5 +1,6 @@ import { type ExtensionContext, commands, window, workspace } from "vscode"; import { LanguageClient, type LanguageClientOptions, type ServerOptions } from "vscode-languageclient/node"; +import fs from "node:fs"; import { showReferences } from "./commands"; let client: LanguageClient | undefined; @@ -7,6 +8,11 @@ let client: LanguageClient | undefined; async function startLanguageClient(context: ExtensionContext) { try { const executablePath = (() => { + const fp = workspace.workspaceFolders?.at(0)?.uri.fsPath; + const venvExecutablePath = `${fp}/.venv/bin/pylyzer`; + if (fs.existsSync(venvExecutablePath)) { + return venvExecutablePath; + } const executablePath = workspace.getConfiguration("pylyzer").get("executablePath", ""); return executablePath === "" ? "pylyzer" : executablePath; })();