{"action":"created","issue":{"url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/905","labels_url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/905/labels{/name}","comments_url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/905/comments","events_url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/905/events","html_url":"https://github.com/ceylon/ceylon-ide-eclipse/issues/905","id":29442764,"number":905,"title":"convert if/else to switch (and vice versa)","user":{"login":"gavinking","id":579974,"avatar_url":"https://avatars.githubusercontent.com/u/579974?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinking","html_url":"https://github.com/gavinking","followers_url":"https://api.github.com/users/gavinking/followers","following_url":"https://api.github.com/users/gavinking/following{/other_user}","gists_url":"https://api.github.com/users/gavinking/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinking/subscriptions","organizations_url":"https://api.github.com/users/gavinking/orgs","repos_url":"https://api.github.com/users/gavinking/repos","events_url":"https://api.github.com/users/gavinking/events{/privacy}","received_events_url":"https://api.github.com/users/gavinking/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/labels/feature","name":"feature","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":{"login":"gavinking","id":579974,"avatar_url":"https://avatars.githubusercontent.com/u/579974?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinking","html_url":"https://github.com/gavinking","followers_url":"https://api.github.com/users/gavinking/followers","following_url":"https://api.github.com/users/gavinking/following{/other_user}","gists_url":"https://api.github.com/users/gavinking/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinking/subscriptions","organizations_url":"https://api.github.com/users/gavinking/orgs","repos_url":"https://api.github.com/users/gavinking/repos","events_url":"https://api.github.com/users/gavinking/events{/privacy}","received_events_url":"https://api.github.com/users/gavinking/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/milestones/11","html_url":"https://github.com/ceylon/ceylon-ide-eclipse/milestones/Ceylon%201.2","labels_url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/milestones/11/labels","id":822285,"number":11,"title":"Ceylon 1.2","description":"","creator":{"login":"gavinking","id":579974,"avatar_url":"https://avatars.githubusercontent.com/u/579974?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinking","html_url":"https://github.com/gavinking","followers_url":"https://api.github.com/users/gavinking/followers","following_url":"https://api.github.com/users/gavinking/following{/other_user}","gists_url":"https://api.github.com/users/gavinking/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinking/subscriptions","organizations_url":"https://api.github.com/users/gavinking/orgs","repos_url":"https://api.github.com/users/gavinking/repos","events_url":"https://api.github.com/users/gavinking/events{/privacy}","received_events_url":"https://api.github.com/users/gavinking/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":131,"state":"open","created_at":"2014-10-11T14:48:54Z","updated_at":"2015-05-03T17:03:51Z","due_on":"2014-11-23T23:00:00Z","closed_at":null},"comments":2,"created_at":"2014-03-14T15:30:28Z","updated_at":"2015-05-03T17:03:51Z","closed_at":"2015-05-03T17:03:51Z","body":"We should have a quick assist to convert between `if`/`else` and `switch`/`case`."},"comment":{"url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/comments/98504724","html_url":"https://github.com/ceylon/ceylon-ide-eclipse/issues/905#issuecomment-98504724","issue_url":"https://api.github.com/repos/ceylon/ceylon-ide-eclipse/issues/905","id":98504724,"user":{"login":"gavinking","id":579974,"avatar_url":"https://avatars.githubusercontent.com/u/579974?v=3","gravatar_id":"","url":"https://api.github.com/users/gavinking","html_url":"https://github.com/gavinking","followers_url":"https://api.github.com/users/gavinking/followers","following_url":"https://api.github.com/users/gavinking/following{/other_user}","gists_url":"https://api.github.com/users/gavinking/gists{/gist_id}","starred_url":"https://api.github.com/users/gavinking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavinking/subscriptions","organizations_url":"https://api.github.com/users/gavinking/orgs","repos_url":"https://api.github.com/users/gavinking/repos","events_url":"https://api.github.com/users/gavinking/events{/privacy}","received_events_url":"https://api.github.com/users/gavinking/received_events","type":"User","site_admin":false},"created_at":"2015-05-03T17:03:51Z","updated_at":"2015-05-03T17:03:51Z","body":"Well, there's various kinds of patterns of `if` that we could decide to recognize and convert to `switch` statements, though none of them seem very generally useful. I've written code to handle three simple cases, but to be honest I don't even find these ones very convincing.\r\n\r\nWell, if anyone has any additional particular case they would like to see, they can open a new issue.\r\n\r\nI'm closing this one."}}