[ty] Add support for goto in literal enum member inlay hint#24792
[ty] Add support for goto in literal enum member inlay hint#24792MatthewMckee4 wants to merge 4 commits intoastral-sh:mainfrom
Conversation
| | Self::BoundSuper(_) => self.to_meta_type(db).definition(db), | ||
|
|
||
| Self::TypeVar(bound_typevar) => Some(TypeDefinition::TypeVar(bound_typevar.typevar(db).definition(db)?)), | ||
| Self::TypeVar(bound_typevar) => Some(TypeDefinition::TypeVar( |
There was a problem hiding this comment.
Don't know why this formatting isn't failing on main
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133. |
Memory usage reportMemory usage unchanged ✅ |
|
|
The PR itself looks good to me. Thanks for implementing it. Unfortunately, it does make a pre-existing issue more prominent: from test import Color
x = Color.RED
from enum import Enum
class Color(Enum):
RED = 1
BLUE = 2Applying the inlay adds I'm inclined to merge this PR, given that it's a pre-existing issue. However, this becomes a much more prominent problem with enums. Which is why I'd prefer if we try to fix astral-sh/ty#3313 first, if it's not too hard. |
|
I label this as invalid syntax, which would disable the edit, so we wouldn't have this issue. edit: I see that this is not this simple, we need to test like reachability from global scope or something |
|
Ill fix in a separate PR |
c452372 to
5ee87ed
Compare
Summary
The goal of this change was to add support for goto on the literal enum member in inlay hints, this led me to adding a new
TypeDefinition. I do believe this is the right approach, but perhaps we could go for something simplerTest Plan
ty_ide test