Page 1 of 1

Micropython Language for VS Code

Posted: Wed May 08, 2019 7:47 am
by Jerremy09
Hello all,

I would like to ask if there is some posibility to add directly "Micropython" language into VS Code with linghter? Currently I use Python with Pylint, but it would be nice to have directly Micropython insiide.

Thank you

Jan

Re: Micropython Language for VS Code

Posted: Wed May 08, 2019 7:50 am
by torwag
It depends on what you want to achieve.

Just syntax or do you want to have a way to run the code directly on a connected uC?

You might want to look into platformio, which works together with VS code and afaik they work on micropython support. There is a plugin already.

Re: Micropython Language for VS Code

Posted: Fri Jun 14, 2019 11:29 am
by klindber
There is one extension on VS Code calle PyMakr, it is focused on Pycom boards but it seemed to work for many people who wanted to run MicroPython on VSCode.

For me personally it didn't work. After installation it always prompt an error message about serialport module one time and another (I think it was some problem with my NodeJS version), so I changed to uPycraft which is working very well but it does not have Intellisense. :roll:
***
torwag wrote:
Wed May 08, 2019 7:50 am
It depends on what you want to achieve.

Just syntax or do you want to have a way to run the code directly on a connected uC?

You might want to look into platformio, which works together with VS code and afaik they work on micropython support. There is a plugin already.
Oh I didn't know about this, PlatformIO is great, I will see if I can get it to work with MicroPython. Thanks for the info!

Re: Micropython Language for VS Code

Posted: Tue Jun 18, 2019 2:37 pm
by zouden
Hi Jerremy,

For language support I use this: https://github.com/Josverl/micropython-stubber
Follow the instructions there and you'll get *most* of the micropython modules supported by pylint. It doesn't pick up 3rd party modules though. But it's better than nothing!

Also, I wrote an extension called Micropython REPLink. It lets you send code to the REPL and/or save it as a file. I wrote it because I wasn't happy with any of the other extensions like pymakr. It relies on you to provide a REPL shell, and for that I use mpfshell. Hope you find it useful :)

Re: Micropython Language for VS Code

Posted: Fri Jul 26, 2019 2:17 am
by BradenM
Hi,

continuing on what @zouden said, you may be interested in my project: https://github.com/BradenM/micropy-cli

It uses micropython-stubber, what zouden had linked above, but also solves the issue of 3rd party modules with its dependency management system. Basically, you can install modules to your project with Micropy and it will automatically stub them, allowing you to import them as you would on your device and have autocompletion/intellisense like the included modules.