Repository navigation
Accept a details tuple of any length - #16
Merged
Merged
Conversation
FichteFoll
approved these changes
Nov 4, 2026
FichteFoll
pushed a commit
that referenced
this pull request
Nov 5, 2026
The `details` parameter and attribute of `QuickPanelItem` and `ListInputItem` are typed `str | list[str] | tuple[str]`, as in the reference. But `tuple[str]` is a tuple of exactly one string, so passing details with several lines as a tuple is rejected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
detailsparameter and attribute ofQuickPanelItemandListInputItemare typedstr | list[str] | tuple[str], as in the reference. Buttuple[str]is a tuple of exactly one string, so passing details with several lines as a tuple is rejected:The docstrings call it "a
minihtmlstring or list of strings", so any number of strings is meant. This changestuple[str]totuple[str, ...]in both constructors and on both attributes.I kept the containers the reference names (
listandtuple) rather than widening toSequence[str], as LSP's bundled stubs do, because other sequences don't work.Window.show_quick_panel()andListInputHandler.setup_()only join the lines whenisinstance(item.details, (list, tuple))(references/python314/sublime.py:1864, sublime_plugin.py:1359, and the same lines in the python38 references). Anything else is passed on as it is. I checked this on ST 4215 (Python 3.14 host) in the UnitTesting Docker runner, with two-linedetails:detailsQuickPanelIteminshow_quick_panel()ListInputIteminsetup_()tuple'first line\x1fsecond line'list'first line\x1fsecond line'collections.UserListTypeError: String requiredUserListThis came up while moving LSP to this package (sublimelsp/LSP#3129).
The fix is
PARAMSandATTRIBUTESoverrides, with the regenerated stub. The newmulti_line_detailstest intests/typing/check_sublime.pyfails onmain(both constructors reject a two-element tuple, andassert_typeon the attribute fails) and passes with this change. The generator's--check, all four checkers, and ruff for both the stubs and the tools pass locally.This targets
main. It will need a backport tost-4200as well; happy to open that once this is settled.