ty icon indicating copy to clipboard operation
ty copied to clipboard

Align docs/type signatures (hover) of different types/objects

Open Julian-J-S opened this issue 2 months ago • 3 comments

Atm the documentation/type signatures on hover are a little weird/inconsistent. Pyright is very consistent here (and helpful).

Example

import os


def my_function(): ...


class MyClass:
    def my_method(self): ...


my_var = my_function()
MY_CONSTANT = 0
type ty pyright
module <module 'os'> (module) os
class <class 'MyClass'> (class) MyClass
method def my_method(self) -> Unknown (method) def my_method(self: Self@MyClass) -> None
function def my_function() -> Unknown (function) def my_function() -> None
variable Unknown (variable) my_var: None
constant Literal[0] (constant) MY_CONSTANT: Literal[0]

Julian-J-S avatar Dec 21 '25 08:12 Julian-J-S

Can you say more about what specifically you find confusing? Is it the variable type or how the information is presented?

MichaReiser avatar Dec 21 '25 20:12 MichaReiser

Can you say more about what specifically you find confusing? Is it the variable type or how the information is presented?

Oh yes sure, sorry 🤓

I am talking about the presentation/wording.

Pyright

  • consistent format: (kind) info
  • useful information like function/method or variable/constant

ty:

  • inconsistent wording
  • mixing in xml like <module 'os'> which feels out of place

Julian-J-S avatar Dec 22 '25 17:12 Julian-J-S

Thanks, that makes sense.

I think there are multiple issues here:

  • For variables, show the name of the variable rather than just the type
  • Decide if we want to show the kind separately from the type

MichaReiser avatar Dec 22 '25 17:12 MichaReiser