sg-wireless / pymakr-vsc

GNU General Public License v3.0
97 stars 25 forks source link

[BUG] pymakr `open in device explorer` stops pylance from working #260

Closed Josverl closed 2 years ago

Josverl commented 2 years ago

pymakr open in device explorer stops pylance from working when a MCU is attached and the rootpath of the device is /

(likely is similar but much smaller problem is also found for devices with /flash rootpath ) this was reported in : https://github.com/Josverl/micropython-stubs/issues/580 please refer to this for additional info

To Reproduce See : https://github.com/Josverl/stubs-esp-test/blob/main/repro.md

Expected behavior Pylance to work as expected when a MCU is mounted in the explorer view

Desktop :

Josverl commented 2 years ago

@jakobrosenberg , after testing it appears that this is caused by PyLance : https://github.com/microsoft/pylance-release/issues/2978

the good news is that devices with rootPath = \flash or \sd could have much less impact (as long as the local filesystem does not have that folder. however in the current logic you seem to remove/hide the \flash part in the logic and expose / as the root of the virtual device depending how quick Pylance resolve this it may actually be good to expose the actual location \flash\foo.py in the virtual filesystem

jakobrosenberg commented 2 years ago

I have considered exposing the full path, but the gains vs unforeseen implications make it a low priority. Is it correct that this is not a bug of Pymakr but an issue between VSCode and Pylance?

Josverl commented 2 years ago

Indeed I can repro outside of Pymakr , and Pylance flagged this as a BUG to be resolved by them

jakobrosenberg commented 2 years ago

Closing as not currently planned, but I'd love a discussion on whether we should expose the full path in the file provider. This is something I couldn't decide on when the feature was added and it almost came down to a coin flip.