-
-
Notifications
You must be signed in to change notification settings - Fork 830
Add hover info for custom types #4458
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
base: main
Are you sure you want to change the base?
Conversation
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.
Thank you. I've left a note inline
.as_ref() | ||
.map(|(_, doc)| doc) | ||
.unwrap_or(&empty_str); | ||
let contents = format!("```gleam\n{name}({arguments})\n```\n{documentation}"); |
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.
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.
Yeah I made a note of that here: #4451 (comment)
It's been a while since I worked on this, but if I remember correctly, the reason it differs is because RecordConstructor
doesn't store any information about the custom type its a member of (aka the return type of the constructor). Should I add a string in RecordConstructor
with the name of the custom type?
Not sure if there are other approaches, but adding a string wouldn't allow for code reuse. The return type would have to be a Type
.
94ef4ab
to
0c6acae
Compare
Adds hover info for custom types and closes #4451.
I marked this PR as a draft, because the behavior I implemented differs slightly from the original proposed behavior I proposed. See #4451 (comment) for more context. Otherwise, this is ready to be reviewed.
This PR changes the language server display type info like the following: