diff --git a/lib/main.js b/lib/main.js index e867475e..b63d0323 100644 --- a/lib/main.js +++ b/lib/main.js @@ -64,14 +64,14 @@ class PythonLanguageClient extends AutoLanguageClient { if (venvPath) { pylsEnvironment["VIRTUAL_ENV"] = venvPath } - const python = replacePipEnvPathVar(atom.config.get("ide-python.python"), venvPath) + this.python = replacePipEnvPathVar(atom.config.get("ide-python.python"), venvPath) let pyls = atom.config.get("ide-python.pyls") || "pylsp" // check if it exists if (whichSync(pyls, { nothrow: true }) === null) { pyls = "pyls" } - const childProcess = super.spawn(python, ["-m", pyls], { + const childProcess = super.spawn(this.python, ["-m", pyls], { cwd: projectPath, env: pylsEnvironment, }) @@ -81,8 +81,8 @@ class PythonLanguageClient extends AutoLanguageClient { onSpawnError(err) { const description = err.code == "ENOENT" - ? `No Python interpreter found at \`${python}\`.` - : `Could not spawn the Python interpreter \`${python}\`.` + ? `No Python interpreter found at \`${this.python}\`.` + : `Could not spawn the Python interpreter \`${this.python}\`.` atom.notifications.addError("`ide-python` could not launch your Python runtime.", { dismissable: true, description: `${description}<p>If you have Python installed please set "Python Executable" setting correctly. If you do not please install Python.</p>`, @@ -106,8 +106,8 @@ class PythonLanguageClient extends AutoLanguageClient { description: "Make sure to install `pylsp` 0.19 or newer by running:\n" + "```\n" + - `${python} -m pip install 'python-lsp-server[all]'\n` + - `${python} -m pip install git+https://github.com/tomv564/pyls-mypy.git\n` + + `${this.python} -m pip install 'python-lsp-server[all]'\n` + + `${this.python} -m pip install git+https://github.com/tomv564/pyls-mypy.git\n` + "```", }) }