Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic type aliases show two inlay hints #6427

Closed
Jammf opened this issue Sep 22, 2024 · 2 comments
Closed

Generic type aliases show two inlay hints #6427

Jammf opened this issue Sep 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working fixed in next version (release) A fix has been implemented and will appear in an upcoming version

Comments

@Jammf
Copy link

Jammf commented Sep 22, 2024

Generic type aliases show two inlay hints that each function independently, with no visual separation between them. I'm not sure if it's just restricted to type aliases with generics, but I first noticed it happening when hints from numpy functions such as np.array(3) would be things like Anyndarray[Any, dtype[Any]]. I tried to reduce it down to a minimal example from there.

Environment data

  • Language Server version: 2024.9.101
  • OS and version: darwin arm64
  • Python version (and distribution if applicable, e.g. Anaconda): 3.12.4
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: off

Code Snippet

from typing import TypeVar

T = TypeVar("T")
type U = list[T]

def func() -> U: ...
a = func()

def func2() -> U[int]: ...
b = func2()

Expected behavior

I'd expect only the second inlay hint to be present, for example a: list and b: list[int].

Actual behavior

(Previous) Behavior in 2024.8.100:

image

(Current) Behavior from 2024.8.101 to 2024.9.101:

image

Logs

XXX
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 22, 2024
@debonte debonte assigned StellaHuang95 and unassigned KacieKK Sep 23, 2024
@debonte debonte added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Sep 23, 2024
@debonte
Copy link
Contributor

debonte commented Sep 23, 2024

@StellaHuang95, reassigned to you. Given that this regressed in 2024.8.101, I'm guessing this has something to do with the inlay hint go to def feature.

@StellaHuang95 StellaHuang95 added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 24, 2024
@bschnurr bschnurr added fixed in next version (release) A fix has been implemented and will appear in an upcoming version and removed fixed in next version (main) A fix has been implemented and will appear in an upcoming version labels Sep 26, 2024
@StellaHuang95
Copy link
Contributor

This issue has been fixed in prerelease version 2024.9.102, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (release) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

5 participants