Skip to content

Variable substitution doesn't work for python.envFile setting #4619

@sepich

Description

@sepich

Environment data

  • VS Code version: 1.32.0-insider
  • Extension version (available under the Extensions sidebar): 2019.2.5433
  • OS and version: osx mojave
  • Python version (& distribution if applicable, e.g. Anaconda): python3.7 installed via brew
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: XXX

Expected behaviour

User setting:

"python.envFile": "/tmp/.vscode/${workspaceFolderBasename}/env"

would expand $macro and work.

Actual behaviour

I cannot store .env file in projects, so have to store it outside.
It is working for debugging with launch.json having

"envFile": "/tmp/.vscode/${workspaceFolderBasename}/env"

But when i put the same to User settings - all local imports are highlighted with error:
unresolved import 'ss' Python(unresolved-import)
If i fix setting to be without macro:

"python.envFile": "/tmp/.vscode/be/env"

it works fine.

Steps to reproduce:

Reproducible only with new language-server

"python.jediEnabled": false,

The env file contains just PYTHONPATH=/Users/aryabov/Projects/be/lib to make new lang-server usable.
There is no need to use such env file with jedi, as it is able to detect local modules fine.
But jedi is too slow, >5sec for each press of Cmd+R even in same file ;(

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Starting Microsoft Python language server.
##########Linting Output - flake8##########
Microsoft Python Language Server version 0.1.80.0
Initializing for /Users/aryabov/Projects/venvs/be/bin/python
##########Linting Output - flake8##########

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsarea-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.feature-requestRequest for new features or functionalitygood first issueverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions