-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
initial implementation of goto types and separating annotations #2914
Conversation
Does that mean if I have this code ( pub type Thing {
Thing(value: ][ String)
} then it shows documentation for |
Yeah because of how the parser sets the location the entire arg is String. We could add some additional information to the AST if we wanna split it but I think the way it seemed to me rn "value" is treated as a label in the AST |
Huh actually, I wanted to test this out after I typed that and I guess somewhere along the line that statement became no longer true and I'm not sure why. Wondering if maybe I had a bug in an earlier version or if there is something I am not remembering rn |
Ok yeah the actual behavior is that the label has no hover (which matches the previous behavior). I think i had a bug at some middle phase that meant i was checking the wrong location and fixed it when I switched to do the TypeAst method of finding the 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.
Smashing it as always! Thank you!
Left some v small questions
I pulled the windows path fix into #2941 |
6cf0a8a
to
3bd6463
Compare
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.
Fab! Really like this, will be a huge improvement to the language server.
There's a few tests I would like to have added here (autocompletions for the various places that annotations can happen) and I'd like to go back to how the definition location method worked before. See the note inline.
Thank you so much!!
91ec94e
to
3301ff1
Compare
move type_constructor_from_modules back to build replace typeast with srcspan switch to collapse links
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.
Beautiful! Thank you so much!!!
An initial implementation for making annotations distinct from the thing being annotated. Currently in most places where the user hovers over an annotation it either doesn't work or hovers the larger object being annotated (function head, constant, custom type). This change is the first part of separating that out and allowing for operations on the located annotation. Currently that means hovering will display the type itself, completions will always be type completions (this seems to be exactly the same as current in all cases), and goto definition now will go to where the type is declared. There are a couple known gaps here but overall its still an improvement so want to start with this and get feedback
Known things to improve:
Hovering over a type won't show documentationBecause of how locations/labels for CustomType constructor args are implemented hovering over the arg label will be treated as hovering over the annotationThis is probably fixable but honestly I kinda like it so wanna get thoughts