adonovan opened this issue
Apr 11, 2023
· 0 comments
Assignees
Labels
goplsIssues related to the Go language server, gopls.NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
The kubernetes repo has multiple submodules (k8s.io/xyz), each with a replace directive in the main module that maps them to ./staging/xyz. The vendor directory contains symbolic links vendor/xyz to ../staging/xyz. This means files and directories in staging have aliases such vendor/k8s.io/kubectl -> ../../staging/src/k8s.io/kubectl.
I have observed that some gopls renamings cause the same edits to be applied to both aliases of the same file. If the renaming is length-preserving, this is harmless, but otherwise a renaming from A to AB results in ABB, with a repeated suffix. (Presuambly a renaming that shortened would be even more destructive.)
We need to merge edits not just based on URI equivalence (as we do already), but based on the file system's notion of equivalence, using os.SameFile or robustio.FileID.
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Apr 11, 2023
goplsIssues related to the Go language server, gopls.NeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.
3 participants
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.
The kubernetes repo has multiple submodules (
k8s.io/xyz
), each with a replace directive in the main module that maps them to./staging/xyz
. Thevendor
directory contains symbolic linksvendor/xyz
to../staging/xyz
. This means files and directories in staging have aliases suchvendor/k8s.io/kubectl -> ../../staging/src/k8s.io/kubectl
.I have observed that some gopls renamings cause the same edits to be applied to both aliases of the same file. If the renaming is length-preserving, this is harmless, but otherwise a renaming from A to AB results in ABB, with a repeated suffix. (Presuambly a renaming that shortened would be even more destructive.)
We need to merge edits not just based on URI equivalence (as we do already), but based on the file system's notion of equivalence, using os.SameFile or robustio.FileID.
(See also https://go.dev/cl/457615, which did the same thing for the go/analysis -fix logic.)
The text was updated successfully, but these errors were encountered: