tomaciazek / vscode-ansible

Ansible VS Code Extension
MIT License
28 stars 3 forks source link

Select virtual env from selected Python #8

Open tomaxsas opened 3 years ago

tomaxsas commented 3 years ago

Problem

Currently manually need enter virtual env activation script

Solution

Take activation script from python or use selected python env.

Alternatives

No response

Additional context

No response

tomaciazek commented 3 years ago

I'll see what are the options of integrating with the Python (base) extension, but at a glance, I can't find a way to get that value (it is now stored in the internal storage of the extension).

tomaxsas commented 3 years ago

Built in terminal sources venv when selected so worth look at it

tomaciazek commented 3 years ago

Built in terminal sources venv when selected so worth look at it

Ah, that's a good lead - there might be a clue somewhere there.

tomaciazek commented 3 years ago

I've looked into this, and it's not going to be easy to implement:

And I'm also considering that some projects will have multiple different Python virtual environments for various Python scripts, and only a single venv for Ansible, so distinguishing this by having a separate setting makes sense in such case; ability to choose between these sources of Python interpreter path should be implemented.

All in all, I might implement this in the future (depending on the demand from the community), but currently this is not a priority.