Skip to content

Narrow HtmlSheet return type in type stubs - #3010

Merged
rwols merged 1 commit into
sublimelsp:mainfrom
jwortmann:stubs-htmlsheet
Aug 15, 2026
Merged

rwols merged 1 commit into
sublimelsp:mainfrom
jwortmann:stubs-htmlsheet

Conversation

@jwortmann

Copy link
Copy Markdown
Member

I've seen that this return type from our type stubs causes some lint errors in a few packages (or require type: ignore workarounds) for valid code like

sheet = window.new_html_sheet('My HtmlSheet', '')
sheet.set_contents('Hello')  # Cannot access attribute "set_contents" for class "Sheet"

I initially copied the return type Sheet from the original type hints in sublime.py, but this return type is actually not accurate and can be narrowed to HtmlSheet. So now that we have type checking for community packages in CI, let's fix it here.

@rwols
rwols merged commit 5bbe795 into sublimelsp:main Aug 15, 2026
9 checks passed
@jwortmann
jwortmann deleted the stubs-htmlsheet branch August 15, 2026 20:53
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.

2 participants