-
Notifications
You must be signed in to change notification settings - Fork 775
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
Deprecate "Go: Extract to variable/function" command (obsolete by gopls's code action) #2862
Comments
Thanks. Not sure if this belongs in VS Code or gopls issue tracker, but this is a useful feature suggestion (and should be easy to implement, given that we already support extracting to variable). |
@hyangah if I'm reading the source correctly this command still uses godoctor? Is that right? We should use gopls instead. |
Yes, the Extract to variable/function commands still use godoctor. |
Change https://go.dev/cl/538756 mentions this issue: |
@benclauss I filed golang/go#63852 for the followup. In cl/5387566, we are moving the "Go: Extract to variable" and "Go: Extract to function" vscode commands. Equivalent functionalities are currently available through code action. How important is it in your workflow to access them through the vscode command interface? To access the gopls-based extract features, you can either find the light bulb, or use refactoring context menu or key bindings https://code.visualstudio.com/docs/getstarted/keybindings#_custom-keybindings-for-refactorings. If they are not as convenient, we can consider to add back the "Go: Extract to variable/function" commands interface to minimize disruption. |
This change removes "Go: Extract to function" and "Go: Extract to variable" commands, which were using godoctor. Extract function/var features are implemented in gopls, which can be accessible by selecting the range to extract trigger code action If users want access through commands, we can consider to add commands (as we are doing for "Go: Fill struct" command). Updates #2862 Change-Id: Id43374513dcd347c06ae8107aa1c25a41e884641 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/538756 Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Suzy Mueller <suzmue@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
Sorry for using this feature request (extending a legacy feature) for deprecating the legacy feature. I hope we can get to golang/go#63842. Please follow the issue. Thanks! |
Is your feature request related to a problem? Please describe.
I would like to be able to extract a value to a
const
. I can only extract to a variable.Describe the solution you'd like
Go: Extract to const
Describe alternatives you've considered
N/A
The text was updated successfully, but these errors were encountered: