feat: implement automatic python discovery for zero-config extension#19
feat: implement automatic python discovery for zero-config extension#19Mohamed-Sobea wants to merge 6 commits into
Conversation
|
Hi @Mohamed-Sobea Thanks for the work on this, and sorry for the late reply/review (I was down with a cold…). This looks basically good to me, although it isn't quite working for me, but that might also have to do with some semi-broken virtual environment setup on my machine. It would be great (also for testing) if this would be even more powerful though, i.e. it would automatically reload the language server when the activated python environment changes. I guess there is some kind of hook from the Python extension that we can use for that? Oh, and something rather trivial: the |
|
Hi @mstimberg, I hope you're feeling much better now. |
|
Hi Marcel @mstimberg, I’ve implemented the hook we discussed. I found the Changes:
About 'not working' issue: this is a screenshot of the logs showing the extension successfully detecting and launching from a local virtual environment (stranger_test/.venv) and the AttributeError . |
|
Hi @Mohamed-Sobea, I finally had a look! I had to correct the server for the most recent pygls version so that I could actually run it, but it seems to pick up the correct environment on start. I did not quite manage to trigger the environment change/server reload, though. I tried switching to an environment that does not have Brian installed (which should fail), but it did still work? Are you able to test this feature? |


Overview
This PR implements automatic Python interpreter discovery as discussed in Issue #13. The goal was to remove the requirement for users to manually configure the
python.interpreterpathsetting.Changes
ms-python.pythonas an extension dependency inpackage.json.activate()to utilize the official Python Extension API for environment discovery.getPythonPathhelper to dynamically fetch the active environment.Testing
Demo:

Closes #13