posit-dev / py-shiny

Shiny for Python
https://shiny.posit.co/py/
MIT License
1.1k stars 62 forks source link

Make sure that `Id` type is kept in type stub #1455

Closed wch closed 3 weeks ago

wch commented 3 weeks ago

Previously, when generating type stubs with pyright, the Id type would get stripped out of module.py because it was only used inside of functions in the file. This causes the pyright/pylance LSP to report the type as Unknown instead of as Id.

image

After this change, the Id type is kept in module.py, and the LSP correctly reports the type as Id instead of Unknown.