-
Notifications
You must be signed in to change notification settings - Fork 645
Extract Method feature #588
Comments
How about integrating godoctor which has the same feature ? |
We did try godoctor back in July, but it had a few limitations. See #370 for the discussions that followed. |
Another way to go about this would be to use the "free variables" feature from guru if anyone wants to give this a try |
I just tried the current 0.5 version of GoDoctor and it seems to handle simple cases (including the not so simple multiple return values) just fine and would IMO be an improvement over nothing. Maybe you could re-re-review :) |
Sorry to be a bit pedantic, but just wanted to note that this should be called "extract function", since "method" refers specifically to a function with a receiver, e.g. |
@ramya-rao-a I take it that #588 is the main enhancement for tracking the |
@conradwt No one is working on this at the moment as far as I know. |
@ramya-rao-a I had a go at this issue here. I also added "Extract expression to local variable" feature to see if it works here. It seems to work for all the simple examples I tried. I would be happy to make a PR if its good enough. |
@aswinmprabhu Make the PR regardless :) I am sure we can work together to get the feature in. |
@aswinmprabhu Good work and I agree with @ramya-rao-a 200% that you should make a PR regardless. |
Thanks @ramya-rao-a and @conradwt. |
The latest beta version (0.9.3-beta.2) of this extension has this feature. Please see Refactoring in VS Code on how you can use the refactor feature. Thanks @aswinmprabhu! |
This feature is out in the latest release(0.10.0) of the Go extension We have noticed a few cases where godoctor doesn't as expected. Therefore, the features are available as the below commands, but not as default refactoring as detailed in Refactoring in VS Code
|
No description provided.
The text was updated successfully, but these errors were encountered: