{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/194030529","pull_request_review_id":127127752,"id":194030529,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDAzMDUyOQ==","diff_hunk":"@@ -14,9 +14,59 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Structure\n                                                   spans As ArrayBuilder(Of BlockSpan),\n                                                   options As OptionSet,\n                                                   cancellationToken As CancellationToken)\n-            spans.AddIfNotNull(CreateBlockSpanFromBlock(\n-                               node, node.IfStatement, autoCollapse:=False,\n-                               type:=BlockTypes.Conditional, isCollapsible:=True))\n+\n+            ' The full block: eg If ... Then ... End If\n+            spans.AddIfNotNull(CreateBlockSpanFromBlock(node, node.IfStatement,\n+                                                        autoCollapse:=False,\n+                                                        type:=BlockTypes.Conditional,\n+                                                        isCollapsible:=True))\n+\n+            ' Attempt to make the code block after the If...Then collapsable.\n+            Make_IfThenCodeBlockCollapsible(node, spans)\n+\n+            ' Make the ElseIfs collapsable.\n+            Make_ElseIfCodeBlocksCollapsible(node, spans)\n+\n+            ' Make the Else section collapsable.\n+            Make_ElseCodeBlockCollapsible(node, spans)\n+\n+        End Sub\n+\n+        Private Shared Sub Make_ElseCodeBlockCollapsible(node As MultiLineIfBlockSyntax, spans As ArrayBuilder(Of BlockSpan))\n+            If node.ElseBlock IsNot Nothing Then\n+                spans.AddIfNotNull(CreateBlockSpanFromBlock(node.ElseBlock, \"Else ... \",\n+                                                            autoCollapse:=False,\n+                                                            type:=BlockTypes.Conditional,\n+                                                            isCollapsible:=True))\n+            End If\n+        End Sub\n+\n+        Private Shared Sub Make_ElseIfCodeBlocksCollapsible(node As MultiLineIfBlockSyntax, spans As ArrayBuilder(Of BlockSpan))\n+            For Each [ElseIf] In node.ElseIfBlocks\n+                spans.AddIfNotNull(CreateBlockSpanFromBlock([ElseIf], [ElseIf].ElseIfStatement,\n+                                                            autoCollapse:=False,\n+                                                            type:=BlockTypes.Conditional,\n+                                                            isCollapsible:=True))\n+            Next\n+        End Sub\n+\n+        Private Shared Sub Make_IfThenCodeBlockCollapsible(node As MultiLineIfBlockSyntax, spans As ArrayBuilder(Of BlockSpan))\n+            Dim statements = node.Statements\n+            If statements.Count > 0 Then\n+                Dim starting = node.Statements(0).GetLeadingTrivia.Where(Function(t) t.IsWhitespaceOrEndOfLine Or t.IsRegularOrDocComment)\n+                Dim start = starting.Skip(1).FirstOrDefault.SpanStart\n+                Dim finish = statements.Last.FullSpan.End - 2","path":"src/Features/VisualBasic/Portable/Structure/Providers/MultiLineIfBlockStructureProvider.vb","position":48,"original_position":48,"commit_id":"2c778be7b9ca232429ced36a8ec013aca70ad7d8","original_commit_id":"2c778be7b9ca232429ced36a8ec013aca70ad7d8","user":{"login":"CyrusNajmabadi","id":4564579,"node_id":"MDQ6VXNlcjQ1NjQ1Nzk=","avatar_url":"https://avatars3.githubusercontent.com/u/4564579?v=4","gravatar_id":"","url":"https://api.github.com/users/CyrusNajmabadi","html_url":"https://github.com/CyrusNajmabadi","followers_url":"https://api.github.com/users/CyrusNajmabadi/followers","following_url":"https://api.github.com/users/CyrusNajmabadi/following{/other_user}","gists_url":"https://api.github.com/users/CyrusNajmabadi/gists{/gist_id}","starred_url":"https://api.github.com/users/CyrusNajmabadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyrusNajmabadi/subscriptions","organizations_url":"https://api.github.com/users/CyrusNajmabadi/orgs","repos_url":"https://api.github.com/users/CyrusNajmabadi/repos","events_url":"https://api.github.com/users/CyrusNajmabadi/events{/privacy}","received_events_url":"https://api.github.com/users/CyrusNajmabadi/received_events","type":"User","site_admin":false},"body":"what is this -2 for?","created_at":"2018-06-08T11:38:34Z","updated_at":"2018-06-08T11:38:34Z","html_url":"https://github.com/dotnet/roslyn/pull/27617#discussion_r194030529","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/27617","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/194030529"},"html":{"href":"https://github.com/dotnet/roslyn/pull/27617#discussion_r194030529"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27617"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/27617","id":193501550,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNTAxNTUw","html_url":"https://github.com/dotnet/roslyn/pull/27617","diff_url":"https://github.com/dotnet/roslyn/pull/27617.diff","patch_url":"https://github.com/dotnet/roslyn/pull/27617.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/27617","number":27617,"state":"open","locked":false,"title":"[wip] Added additional collapsible regions for IF and Select Blocks.","user":{"login":"AdamSpeight2008","id":900107,"node_id":"MDQ6VXNlcjkwMDEwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/900107?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"body":"@DustinCampbell I've implemented the added additional collapsible regions proposed in #8278\r\nFor\r\n  * If..Then..ElseIf..Else..End If\r\n  * Select Case ... Case ... End Select\r\n","created_at":"2018-06-08T03:42:32Z","updated_at":"2018-06-08T11:38:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7078ce33425bef29f0f27f8324f92f1636d63bc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"node_id":"MDQ6VGVhbTE3ODE3MDY=","slug":"roslyn-ide","description":"Roslyn IDE Team","privacy":"closed","url":"https://api.github.com/teams/1781706","members_url":"https://api.github.com/teams/1781706/members{/member}","repositories_url":"https://api.github.com/teams/1781706/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/27617/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/27617/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/27617/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/2c778be7b9ca232429ced36a8ec013aca70ad7d8","head":{"label":"AdamSpeight2008:AdditionalCollapsibleRegions","ref":"AdditionalCollapsibleRegions","sha":"2c778be7b9ca232429ced36a8ec013aca70ad7d8","user":{"login":"AdamSpeight2008","id":900107,"node_id":"MDQ6VXNlcjkwMDEwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/900107?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"repo":{"id":30550436,"node_id":"MDEwOlJlcG9zaXRvcnkzMDU1MDQzNg==","name":"roslyn-AdamSpeight2008","full_name":"AdamSpeight2008/roslyn-AdamSpeight2008","owner":{"login":"AdamSpeight2008","id":900107,"node_id":"MDQ6VXNlcjkwMDEwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/900107?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AdamSpeight2008/roslyn-AdamSpeight2008","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008","forks_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/forks","keys_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/teams","hooks_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/hooks","issue_events_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/issues/events{/number}","events_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/events","assignees_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/assignees{/user}","branches_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/branches{/branch}","tags_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/tags","blobs_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/git/refs{/sha}","trees_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/statuses/{sha}","languages_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/languages","stargazers_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/stargazers","contributors_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/contributors","subscribers_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/subscribers","subscription_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/subscription","commits_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/commits{/sha}","git_commits_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/git/commits{/sha}","comments_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/comments{/number}","issue_comment_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/issues/comments{/number}","contents_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/contents/{+path}","compare_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/merges","archive_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/downloads","issues_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/issues{/number}","pulls_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/pulls{/number}","milestones_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/milestones{/number}","notifications_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/labels{/name}","releases_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/releases{/id}","deployments_url":"https://api.github.com/repos/AdamSpeight2008/roslyn-AdamSpeight2008/deployments","created_at":"2015-02-09T18:12:45Z","updated_at":"2018-04-11T20:38:54Z","pushed_at":"2018-06-08T03:36:35Z","git_url":"git://github.com/AdamSpeight2008/roslyn-AdamSpeight2008.git","ssh_url":"git@github.com:AdamSpeight2008/roslyn-AdamSpeight2008.git","clone_url":"https://github.com/AdamSpeight2008/roslyn-AdamSpeight2008.git","svn_url":"https://github.com/AdamSpeight2008/roslyn-AdamSpeight2008","homepage":"","size":338493,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"d959a70c3debbd0d5b41637be340e00076fefa01","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2018-06-08T05:38:20Z","pushed_at":"2018-06-08T11:24:21Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":390246,"stargazers_count":9410,"watchers_count":9410,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2242,"mirror_url":null,"archived":false,"open_issues_count":4868,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2242,"open_issues":4868,"watchers":9410,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27617"},"html":{"href":"https://github.com/dotnet/roslyn/pull/27617"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/27617"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/27617/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27617/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27617/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/2c778be7b9ca232429ced36a8ec013aca70ad7d8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"CyrusNajmabadi"}}