Skip to content

Conversation

@deathaxe
Copy link
Member

@deathaxe deathaxe commented Jan 11, 2026

This PR...

  1. updates stubs from ST4202, primarily to be able to run mypy.
  2. updates typehints to a more modern format (AFAIK python 3.9+ format), which is possible due to type hints being excluded from runtime evaluation and type checkers likely running on more modern python.

There are some mypy errors, which may require further investigation about how to fix...

Example:

sublime_lib\view_stream.py:39: error: Self argument missing for a non-static method (or an invalid type for self)  [misc]

Update sublime API stubs from ST4202.
This commit sorts some imports and modernizes type hints.
Copy link
Member

@FichteFoll FichteFoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the official stubs from the ST distribution?

@deathaxe
Copy link
Member Author

Took original sublime.py and sublime_types.py, modified type hints to more modern format and added additional hints to satisfy mypy. Existing sublime_plugin.pyi was extended by missing classes and methods from official sublime_plugin.py

This commit re-uses ST4's `Value` type instead of defining its own duplicate.

Note: adjusts missed import sort order
satisfy mypy as sublime does not export Value, explicitly.
@FichteFoll
Copy link
Member

Perhaps we should add a mypy job to our PR lint workflow.

It is not supported by ST4107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants