Closed rchl closed 3 years ago
I'd like to get it working with pyright, but I've had other issues as well. For instance, it seems to complain about using Union[T, U]
instead of the new T | U
syntax. I may need to change my configuration.
It does show error but with clear explanation why it is shown:
The python version should be controllable with the pythonVersion
setting in the configuration file
But for compatibility with the ST runtime I guess you wouldn't want to use that new syntax.
Noticed this as well :)
This is likely related because it uses stubbed List
type here instead of the proper one.
Opening this project in ST with LSP-pyright enabled highlights all type annotations with errors. This is because pyright can't handle try/except based import logic like in: https://github.com/SublimeText/sublime_lib/blob/54bcf41ee8de4a7c6482a3e60aa0d72383465d96/st3/sublime_lib/_compat/typing.py It will always use the "last" import in such case.
The solution to that is doing a check based on python version like in: https://github.com/sublimelsp/LSP/blob/7fc1f80c3d3730b34d1f2fb8be65e41cfb43f2fe/plugin/core/typing.py#L3-L3
Fixing that would improve developer experience.