Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[FEATURE] Stubs for python language server#1173

John-Schreiber started this conversation inProposals
Discussion options

It would be useful to have stubs for the pyodide and js modules so syntax highlighting and autocorrect work. Pyodide haspyodide/pyodide#1839, but I can't get it to work.

You must be logged in to vote

Replies: 1 comment 5 replies

Comment options

It would!
Interesting thing to tackle. :)

You must be logged in to vote
5 replies
@microhobby
Comment options

oh no, since 2022.
It would be great to have these stubs to use VS Code for example with the completions and mypy checks.

@microhobby
Comment options

@John-Schreiber the pyodide, as I understand, is the runtime. We will need the stubs for the pyscript module. Also, thedocument andwindow for example, and maybe others, are runtime bind. So, it only exists inside the wasm runtime. Maybe I'm talking shit, but it is what I understand.

@WebReflection
Comment options

document andwindow are the entry point to the entirety of the JS / Web world and I've no idea how to tell the IDE to switch code hints or completion once those two things are referenced ... thepyscript module itself has many things to hint/document but fromwindow ordocument ref on, it's a Web world, not Python anymore ... yet I'd love to have something first, so then we can thing about the "something else too"

@WebReflection
Comment options

P.S. on a second though ... how is Pyodide doing with itsjs import? if they found a solution there, we might as well reuse the exact same, asfrom pyodide import js is our equivalent offrom pyscript import window (except our case is about the main thread world, not the current worker scope, when in workers)

@Josverl
Comment options

There is a webassembly version of the MicroPython-stubs on PyPI.
You canpip install micropython-webassembly-stubs --target typings into a local folder and configure you IDE / typechecker / CI to use that.

its not perfect - if you want to help make it better then please take a look at improvingthe reference stubs that are used to build the actual stub packages.

Improving types , docstrings can be without much effort.

Also let me know if you want to help, but find my documentation on how to do that too terse. Then I know where to improve.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
type: featureNew feature or requestbacklogissue has been triaged but has not been earmarked for any upcoming release
5 participants
@John-Schreiber@WebReflection@Josverl@microhobby@marimeireles
Converted from issue

This discussion was converted from issue #361 on February 12, 2023 01:58.


[8]ページ先頭

©2009-2025 Movatter.jp