-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implements Rename
provider
#314
Conversation
…the results to Java types
/** | ||
* Result types for GoTo references location search results. | ||
*/ | ||
sealed trait GoToRef extends GoTo | ||
sealed trait GoToRef extends Rename |
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.
it sounds weird that GoToRef
extends Rename
, is it expected?
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.
Good catch. The only reason for this is to save a transformation because rename
returns the same result type as GoToRef
. Having GoToRef
as a subtype of Rename
means we can return the GoToRef
results from rename
immediately without the need to transform them to the GoTo.Rename
type.
If in the future the Rename
result types needs additional types, then the transformation will be applied and we can seperate them:
sealed trait Rename extends GoTo
sealed trait GoToRef extends GoTo
If you prefer, I can seperate them now? I was just saving it from doing a transformation, which really isn't that expensive.
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.
ok let's keep it like this for now then.
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.
Minor comment, but LGTM
I tested it and it works great.
I have one remarks compared to metals
, if I try to rename Future
, I will directly get a notification: Nothing to rename
.
While here if I try to rename Contract
it will sill ask me with what I want to rename and when i confirm, nothing happen (as expected).
I just found in the lsp doc that there's a prepare rename request to test the validity of the request.
I'll open an issue with that prepare rename request
, it improves a bit the UX.
On this is useful. Thank you. |
CodeProvider
execution (completion, goto definition etc) #104 disallows renaming in files where the parsed AST is unavailable.