-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[move-ide] Added on-hover for inlay type hints #17900
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
/// are resolved (the main problem is that adding it enables a drop-down menu | ||
/// containing options that are not supported for the type definition, such | ||
/// as go-to-declaration, and which jump to weird locations in the file). | ||
fn additional_hint_info(sp!(_, t): &N::Type, symbols: &Symbols) -> Option<InlayHintTooltip> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main part (the rest are some refactorings)
Some(serde_json::to_value(loc).unwrap()) | ||
}, | ||
); | ||
} | ||
|
||
pub fn def_ide_location(def_loc: &DefLoc, symbols: &Symbols) -> Location { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a strictly necessary one but I hope we will be able to ultimately support locations in inlay type hints for additional information to be displayed (that's why this was introduced in the first place).
@@ -136,6 +136,10 @@ pub struct DefLoc { | |||
} | |||
|
|||
impl DefLoc { | |||
pub fn new(fhash: FileHash, start: Position) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not strictly necessary (for the same reasons as described here) but using it instead of struct constructors made the code look nicer so I left it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for chopping these up!
Description
Added on-hover when hovering over struct type hints:
Test plan
Verified that on-hover works for struct type hints