{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8198","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8198/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8198/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8198/events","html_url":"https://github.com/Microsoft/TypeScript/issues/8198","id":149604687,"number":8198,"title":"Suggestion: guess types for function params when completion is applied","user":{"login":"angelozerr","id":1932211,"avatar_url":"https://avatars.githubusercontent.com/u/1932211?v=3","gravatar_id":"","url":"https://api.github.com/users/angelozerr","html_url":"https://github.com/angelozerr","followers_url":"https://api.github.com/users/angelozerr/followers","following_url":"https://api.github.com/users/angelozerr/following{/other_user}","gists_url":"https://api.github.com/users/angelozerr/gists{/gist_id}","starred_url":"https://api.github.com/users/angelozerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angelozerr/subscriptions","organizations_url":"https://api.github.com/users/angelozerr/orgs","repos_url":"https://api.github.com/users/angelozerr/repos","events_url":"https://api.github.com/users/angelozerr/events{/privacy}","received_events_url":"https://api.github.com/users/angelozerr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-19T22:47:34Z","updated_at":"2016-06-07T19:40:35Z","closed_at":null,"body":"It should be cool if tsserver could provide a new command `guesstypes` to give the capability to guess parameter types when completion is applied\r\n\r\nIn other word, I would like to support the [same feature that I have done with tern ](https://github.com/angelozerr/tern-guess-types)\r\n\r\nFor instance if you open completion for `document` and select `addEventListener` : \r\n\r\n![Tern completion](https://github.com/angelozerr/tern-guess-types/wiki/images/TernCompletion.png)\r\n\r\nWhen you apply completion, I would like call a tsserver command 'guesstypes' to retrieve variables, functions for each function parameters. Here a screenshot which shows a list of variable with string type for the `addEventListener` type argument : \r\n\r\n![Tern completion](https://github.com/angelozerr/tern-guess-types/wiki/images/TernGuessTypes.png)"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/224391131","html_url":"https://github.com/Microsoft/TypeScript/issues/8198#issuecomment-224391131","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8198","id":224391131,"user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T19:40:35Z","updated_at":"2016-06-07T19:40:35Z","body":"This should boil down to setting the `Preselect` property on the completion item (see Roslyn's API definition http://source.roslyn.io/#Microsoft.CodeAnalysis.Features/Completion/CompletionItemRules.cs,48). the logic would be to use the contextual type to select the most appropriate entry."}}
{"actor":{"display_login":"mhegazy"}}