basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

Show inlay hints when destructuring

Open npip99 opened this issue 1 year ago • 2 comments

When using destructuring, inlay hints currently don't appear.

Screenshot 2024-09-22 at 6 58 47 PM

related: #349

(Potential Future Edge Case: Currently, for loops never show inlay hints, whether or not it's destructured. This issue could be relevant if inlay hints are included with for loops but not the destructured variants.)

npip99 avatar Sep 23 '24 01:09 npip99

do you want the inlay hints to show like this?

result: str, metadata: str = await task()

or like this?:

result, metadata: tuple[str, str] = await task()

i would probably prefer the first one. however i'm still on the fence about inlay hints that don't correspond to valid syntax, which is the case here. (related: #198)

DetachHead avatar Sep 23 '24 02:09 DetachHead

@DetachHead Hm, good question. In the example if you gave both are fine. But, if the list is long (e.g. 5-6+) items, I think it would have to be the first one or it'll be difficult to figure out which one maps to which simply by eye. So, I'd go with the first syntax.

Left my 2c on #198 , imo I just want max info because mouse hovering is annoying esp. for many items; bring to real-life isn't a use-case for me. Not sure whether or not my usage is actually representative of the average user though.

npip99 avatar Sep 23 '24 03:09 npip99