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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generalization of renaming a symbol X to Y is to rename X to otherpkg.Y, causing the declaration of X, along with any necessary supporting declarations, to be moved into some file in the designated other package. There are a fair number of edge cases to consider, and UI questions such as how best to obtain the name of otherpkg: the only current LSP operation that supports dialog is Rename, which rather forces our hand. (Another possibility is to use the web interface, which could give a rich interactive menu of which declarations should be moved and optionally renamed at the same time.)
Aside: I think it is time we took matters into our own hands and discussed with other language-server maintainers what they would like to see in a protocol extension for dialog support. Then we can all implement it in our servers, and divide up the client-side work for various popular editors. It will be faster than waiting for something to happen on the LSP issue tracker; even PRs to contribute minor features on which there is broad consensus go neglected for months.
Change https://go.dev/cl/856421 mentions this issue: gopls/internal/golang: MoveDeclaration - reject if staying symbol references unexported field in moving symbol
Activity
gabyhelp commentedon Nov 26, 2024
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
xzbdmw commentedon Dec 3, 2024
+1 for web interface, also TextBased UI is interesting.
adonovan commentedon Dec 3, 2024
Aside: I think it is time we took matters into our own hands and discussed with other language-server maintainers what they would like to see in a protocol extension for dialog support. Then we can all implement it in our servers, and divide up the client-side work for various popular editors. It will be faster than waiting for something to happen on the LSP issue tracker; even PRs to contribute minor features on which there is broad consensus go neglected for months.
33 remaining items
internal/refactor: consider multiple positions when adding imports
gopls/internal/golang: MoveDeclaration - move doc comments and traili…
gopls/internal/golang: MoveDeclaration - fix spacing and add tests fo…
gopherbot commentedon Oct 20, 2026
Change https://go.dev/cl/851548 mentions this issue:
gopls/internal/golang: MoveDeclaration - create package if it doesn't existgopherbot commentedon Oct 29, 2026
Change https://go.dev/cl/856421 mentions this issue:
gopls/internal/golang: MoveDeclaration - reject if staying symbol references unexported field in moving symbolgopherbot commentedon Oct 30, 2026
Change https://go.dev/cl/856981 mentions this issue:
gopls/internal/golang: MoveDeclaration - fix crash when moving to new file in a test-only dirgopherbot commentedon Nov 4, 2026
Change https://go.dev/cl/859061 mentions this issue:
gopls/internal/golang: MoveDeclaration - block moving single name in multi-specgopls/internal/golang: MoveDeclaration - create package if it doesn't…
gopls/internal/golang: MoveDeclaration - reject if staying symbol ref…
gopls/internal/golang: MoveDeclaration - fix crash when moving to new…
gopls/internal/golang: MoveDeclaration - block moving single name in …
gopherbot commentedon Nov 11, 2026
Change https://go.dev/cl/862124 mentions this issue:
gopls/internal/golang: MoveDeclaration - reject moves to same filegopls/internal/golang: MoveDeclaration - reject moves to same file
gopherbot commentedon Nov 17, 2026
Change https://go.dev/cl/865141 mentions this issue:
gopls/internal/golang: MoveDeclaration - fix moves involving test files