{"action":"created","issue":{"url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/703","repository_url":"https://api.github.com/repos/joefitzgerald/go-plus","labels_url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/703/comments","events_url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/703/events","html_url":"https://github.com/joefitzgerald/go-plus/issues/703","id":273068798,"number":703,"title":"Feature Request: Expansion for function types","user":{"login":"joncalhoun","id":1677817,"avatar_url":"https://avatars2.githubusercontent.com/u/1677817?v=4","gravatar_id":"","url":"https://api.github.com/users/joncalhoun","html_url":"https://github.com/joncalhoun","followers_url":"https://api.github.com/users/joncalhoun/followers","following_url":"https://api.github.com/users/joncalhoun/following{/other_user}","gists_url":"https://api.github.com/users/joncalhoun/gists{/gist_id}","starred_url":"https://api.github.com/users/joncalhoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joncalhoun/subscriptions","organizations_url":"https://api.github.com/users/joncalhoun/orgs","repos_url":"https://api.github.com/users/joncalhoun/repos","events_url":"https://api.github.com/users/joncalhoun/events{/privacy}","received_events_url":"https://api.github.com/users/joncalhoun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-11-10T21:41:52Z","updated_at":"2017-11-12T03:07:31Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"While writing some code today I was writing something like this:\r\n\r\n```go\r\nfunc demo(...) http.HandlerFunc {\r\n  return func(w http.ResponseWriter, r *http.Request) {\r\n    // ...\r\n  }\r\n}\r\n```\r\n\r\nThis got me thinking - how hard would be it be enable dynamic code expansion for function types with go-plus?\r\n\r\nThat is, if I were to have this:\r\n\r\n```go\r\nfunc demo(...) http.HandlerFunc {\r\n  return <cursor is here>\r\n}\r\n```\r\n\r\nI want to be able to type `http.HandlerFunc` and hit tab (or whatever autocompletion key you have) and have it replace that with the Go type - `func(http.ResponseWriter, *http.Request)` and then use snippet tab-stops to let me name each variable. That is, if this were a static snippet in Atom it might look like this:\r\n\r\n```\r\nfunc($1 http.ResponseWriter, $2 *http.Request) {\r\n  $3\r\n}\r\n```\r\n\r\nI realize you could create this with a bunch of static snippets and write code to generate them, but this way seems much more dynamic and it feels like information that at least is partially available to go-plus (but perhaps not?).\r\n\r\nThoughts? Is this remotely plausible or am I better off just creating something to generate snippets?\r\n"},"comment":{"url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/comments/343710194","html_url":"https://github.com/joefitzgerald/go-plus/issues/703#issuecomment-343710194","issue_url":"https://api.github.com/repos/joefitzgerald/go-plus/issues/703","id":343710194,"user":{"login":"zmb3","id":7527103,"avatar_url":"https://avatars3.githubusercontent.com/u/7527103?v=4","gravatar_id":"","url":"https://api.github.com/users/zmb3","html_url":"https://github.com/zmb3","followers_url":"https://api.github.com/users/zmb3/followers","following_url":"https://api.github.com/users/zmb3/following{/other_user}","gists_url":"https://api.github.com/users/zmb3/gists{/gist_id}","starred_url":"https://api.github.com/users/zmb3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmb3/subscriptions","organizations_url":"https://api.github.com/users/zmb3/orgs","repos_url":"https://api.github.com/users/zmb3/repos","events_url":"https://api.github.com/users/zmb3/events{/privacy}","received_events_url":"https://api.github.com/users/zmb3/received_events","type":"User","site_admin":false},"created_at":"2017-11-12T03:07:31Z","updated_at":"2017-11-12T03:07:31Z","author_association":"COLLABORATOR","body":"It would be very difficult - go plus isn’t really syntax aware. All of the completions come from gocode so it would probably require updates to gocode. "}}
{"actor":{"display_login":"zmb3"}}