-
Notifications
You must be signed in to change notification settings - Fork 645
Feature Request: Expand func types to func snippets #1553
Comments
@joncalhoun Basic set up steps are described here: Building and Debugging the Go extension It assumes you have node installed. Once you are set up, add a breakpoint at https://github.com/Microsoft/vscode-go/blob/0.6.77/src/goSuggest.ts#L154 For your case above, you will see that the So when Checkout https://github.com/Microsoft/vscode-go/blob/0.6.77/src/goSuggest.ts#L169-L186 to see how we build snippets for functions Let's re-use the settings Good luck! Let me know if you have any issues. You can also ping me on the gophers slack |
Given a type that defines a function, added a code completion suggestion to expand the type into a closure. Eg: type Demo func(int) string Will expand into the the suggest with the name "Demo" and upon triggering it the following snippet will be used: Demo(func(${1:arg1} int) { $2 })
Given a type that defines a function, added a code completion suggestion to expand the type into a closure. Eg: type Demo func(int) string Will expand into the the suggest with the name "Demo" and upon triggering it the following snippet will be used: Demo(func(${1:arg1} int) { $2 })
Given a type that defines a function, added a code completion suggestion to expand the type into a closure. Eg: type Demo func(int) string Will expand into the the suggest with the name "Demo" and upon triggering it the following snippet will be used: Demo(func(${1:arg1} int) { $2 })
Given a type that defines a function, added a code completion suggestion to expand the type into a closure. Eg: type Demo func(int) string Will expand into the the suggest with the name "Demo" and upon triggering it the following snippet will be used: Demo(func(${1:arg1} int) { $2 })
This feature is now out in the latest update to the Go extension (0.6.80) |
Given the code:
I would like to see an expansion setting in vscode-go for expanding
http.HandlerFunc
into one of the following (I'm impartial on which is used):or without the http.HandlerFunc prefix...
Ideally the cursors would be at each arg, and then inside the function like so:
gocode
returns enough information to do this, and it was done in Atom's Go package here: joefitzgerald/go-plus#719I'm willing to help with this, but have no experience working on extensions for vscode so I'll have to find some time and figure the basics out. I suspect the actual PR will be fairly small once I learn how to get going.
Any suggestions on how to start developing the vscode-go extension are appreciated.
The text was updated successfully, but these errors were encountered: