This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Feature Request: Expand func types to func snippets #1553
Closed
Description
openedon Mar 2, 2018
Given the code:
type HandlerFunc func(ResponseWriter, *Request)
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):
http.HandlerFunc(func(arg1 http.ResponseWriter, arg2 *http.Request) {
})
or without the http.HandlerFunc prefix...
func(arg1 http.ResponseWriter, arg2 *http.Request) {
}
Ideally the cursors would be at each arg, and then inside the function like so:
func(${1:"arg1 http.ResponseWriter"}, ${2:"arg2 *http.Request"}) {
$3
}
gocode
returns enough information to do this, and it was done in Atom's Go package here: joefitzgerald/go-plus#719
I'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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment