No micropython specific syntax highlights
Josverl opened this issue · 4 comments
There is no awareness of what non standard modules exist in micropython, and it assumes the full cpython stdlib is available
How does it "assume" anything about cpython stdlib?
Also, please clarify what is wrong with MPY syntax.
The codemirrors syntax highlighter is based on CPython, and there are quite a few subtle and more significant differences in what is / is not supported in Micropython. https://docs.micropython.org/en/latest/genrst/index.html
This is quite hard to get right even in full fledged IDEs such as VSCode, Pycharm and also in Thonny.
but all have some level of support for type stubs , and that is where the micropython-stubs may be able to help.
as another sample of some of the differences you could look at the validation tests for the stubs
But if you want to keep things quick, clean and simple, there are no big problems waiting, perhaps just some end-user confusion.
It may be useful to add common Micropython keywords such as non standard modules and common GPIO Pin names to make life easier for your users.
ref: https://codemirror.net/try/?example=Custom%20completions
So feel free to reach out if you are interested in integrating such functionality.
Lastly from the commend in the codemirror discussion - it appears that while codemirror does support custom linters, it does not do so for Python.
So Custom completions is the best option available for codemirror.
Ruff is now used for code analysis / linting in ViperIDE.
Custom Completions and keywords may be added later