LSP: Should renaming a field change fields in other definitions if they are unified #4164
-
|
I started using the LSP server some more and testing out the renaming refactor capabilities. I had a situation which can be imagined as the following: I intuitively expected when renaming A similar question could be, would you expect |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I've implemented a fix for this. It's now landed on master 27f5797 Essentially, my current thinking is you're correct, and it should behave as you wish. Rename is built entirely on top of find-references, so fixing find-references is all that's needed. The interesting thing is that this does, in some ways, make find-references not the opposite of jump-to-definition - see my comments in the general area of https://github.com/cue-lang/cue/blob/master/internal/lsp/definitions/definitions_test.go#L3354 This non-opposite aspect doesn't upset me though because it only rears its head when you're doing jump-to-definition from a field declaration. And similarly find-references (or rename) to field declarations. I guess our github integrations don't close things if they're discussions rather than issues. I'll close this, but please do reopen if you think there are remaining problems with this functionality. |
Beta Was this translation helpful? Give feedback.
-
|
This is working and i love it. Thanks |
Beta Was this translation helpful? Give feedback.
I've implemented a fix for this. It's now landed on master 27f5797
Essentially, my current thinking is you're correct, and it should behave as you wish. Rename is built entirely on top of find-references, so fixing find-references is all that's needed. The interesting thing is that this does, in some ways, make find-references not the opposite of jump-to-definition - see my comments in the general area of https://github.com/cue-lang/cue/blob/master/internal/lsp/definitions/definitions_test.go#L3354 This non-opposite aspect doesn't upset me though because it only rears its head when you're doing jump-to-definition from a field declaration. And similarly find-references (or rename) to field…