{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/130474232","pull_request_review_id":53353813,"id":130474232,"diff_hunk":"@@ -146,6 +147,7 @@ struct SyntaxStructureNode {\n     case SyntaxStructureKind::StaticVariable:\n     case SyntaxStructureKind::ClassVariable:\n     case SyntaxStructureKind::Parameter:\n+    case SyntaxStructureKind::Subscript:","path":"include/swift/IDE/SyntaxModel.h","position":20,"original_position":12,"commit_id":"c4dad0c32123b0ddad315950782a1231b06ab483","original_commit_id":"84d1437f790101c71d0018fe7857da15278ba944","user":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars1.githubusercontent.com/u/833072?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"body":"Renamed and amended the commit.","created_at":"2017-07-31T22:00:55Z","updated_at":"2017-07-31T22:00:56Z","html_url":"https://github.com/apple/swift/pull/11258#discussion_r130474232","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/11258","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/130474232"},"html":{"href":"https://github.com/apple/swift/pull/11258#discussion_r130474232"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/11258"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/11258","id":133105172,"html_url":"https://github.com/apple/swift/pull/11258","diff_url":"https://github.com/apple/swift/pull/11258.diff","patch_url":"https://github.com/apple/swift/pull/11258.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/11258","number":11258,"state":"open","locked":false,"title":"[SourceKit] Add subscript to doc structure (SR-5035)","user":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars1.githubusercontent.com/u/833072?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"body":"This adds `subscript` to the structure reported by SourceKit.\r\n\r\nFor example, for this file:\r\n```swift\r\nclass Foo {\r\n    subscript(index: Int) -> Int {\r\n        get {\r\n            return 0\r\n        }\r\n        set {\r\n            print(newValue)\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nWe get this structure now:\r\n```\r\n{\r\n  key.offset: 0,\r\n  key.length: 104,\r\n  key.diagnostic_stage: source.diagnostic.stage.swift.parse,\r\n  key.substructure: [\r\n    {\r\n      key.kind: source.lang.swift.decl.class,\r\n      key.accessibility: source.lang.swift.accessibility.internal,\r\n      key.name: \"Foo\",\r\n      key.offset: 0,\r\n      key.length: 103,\r\n      key.runtime_name: \"_TtC8__main__3Foo\",\r\n      key.nameoffset: 6,\r\n      key.namelength: 3,\r\n      key.bodyoffset: 11,\r\n      key.bodylength: 91,\r\n      key.substructure: [\r\n        {\r\n          key.kind: source.lang.swift.decl.function.subscript,\r\n          key.accessibility: source.lang.swift.accessibility.internal,\r\n          key.setter_accessibility: source.lang.swift.accessibility.internal,\r\n          key.name: \"subscript(_:)\",\r\n          key.offset: 13,\r\n          key.length: 88,\r\n          key.nameoffset: 0,\r\n          key.namelength: 0,\r\n          key.bodyoffset: 43,\r\n          key.bodylength: 57,\r\n          key.substructure: [\r\n            {\r\n              key.kind: source.lang.swift.decl.var.parameter,\r\n              key.name: \"index\",\r\n              key.offset: 23,\r\n              key.length: 10,\r\n              key.typename: \"Int\",\r\n              key.nameoffset: 0,\r\n              key.namelength: 0\r\n            }\r\n          ]\r\n        },\r\n        {\r\n          key.kind: source.lang.swift.expr.call,\r\n          key.name: \"print\",\r\n          key.offset: 79,\r\n          key.length: 15,\r\n          key.nameoffset: 79,\r\n          key.namelength: 5,\r\n          key.bodyoffset: 85,\r\n          key.bodylength: 8\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nResolves [SR-5035](https://bugs.swift.org/browse/SR-5035).\r\n\r\nThis wouldn't be possible without the help from @johnfairh and @CodaFi. Thanks so much! 🙌 ","created_at":"2017-07-29T20:24:45Z","updated_at":"2017-07-31T22:00:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e189715ca670cd41c08cd817ac8ea273eeb0d2b7","assignee":null,"assignees":[],"requested_reviewers":[{"login":"nkcsgexi","id":2191945,"avatar_url":"https://avatars0.githubusercontent.com/u/2191945?v=4","gravatar_id":"","url":"https://api.github.com/users/nkcsgexi","html_url":"https://github.com/nkcsgexi","followers_url":"https://api.github.com/users/nkcsgexi/followers","following_url":"https://api.github.com/users/nkcsgexi/following{/other_user}","gists_url":"https://api.github.com/users/nkcsgexi/gists{/gist_id}","starred_url":"https://api.github.com/users/nkcsgexi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkcsgexi/subscriptions","organizations_url":"https://api.github.com/users/nkcsgexi/orgs","repos_url":"https://api.github.com/users/nkcsgexi/repos","events_url":"https://api.github.com/users/nkcsgexi/events{/privacy}","received_events_url":"https://api.github.com/users/nkcsgexi/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/11258/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/11258/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/11258/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/c4dad0c32123b0ddad315950782a1231b06ab483","head":{"label":"marcelofabri:add-subscript-to-sourcekit-structure","ref":"add-subscript-to-sourcekit-structure","sha":"c4dad0c32123b0ddad315950782a1231b06ab483","user":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars1.githubusercontent.com/u/833072?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"repo":{"id":98756740,"name":"swift","full_name":"marcelofabri/swift","owner":{"login":"marcelofabri","id":833072,"avatar_url":"https://avatars1.githubusercontent.com/u/833072?v=4","gravatar_id":"","url":"https://api.github.com/users/marcelofabri","html_url":"https://github.com/marcelofabri","followers_url":"https://api.github.com/users/marcelofabri/followers","following_url":"https://api.github.com/users/marcelofabri/following{/other_user}","gists_url":"https://api.github.com/users/marcelofabri/gists{/gist_id}","starred_url":"https://api.github.com/users/marcelofabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcelofabri/subscriptions","organizations_url":"https://api.github.com/users/marcelofabri/orgs","repos_url":"https://api.github.com/users/marcelofabri/repos","events_url":"https://api.github.com/users/marcelofabri/events{/privacy}","received_events_url":"https://api.github.com/users/marcelofabri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcelofabri/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/marcelofabri/swift","forks_url":"https://api.github.com/repos/marcelofabri/swift/forks","keys_url":"https://api.github.com/repos/marcelofabri/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcelofabri/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcelofabri/swift/teams","hooks_url":"https://api.github.com/repos/marcelofabri/swift/hooks","issue_events_url":"https://api.github.com/repos/marcelofabri/swift/issues/events{/number}","events_url":"https://api.github.com/repos/marcelofabri/swift/events","assignees_url":"https://api.github.com/repos/marcelofabri/swift/assignees{/user}","branches_url":"https://api.github.com/repos/marcelofabri/swift/branches{/branch}","tags_url":"https://api.github.com/repos/marcelofabri/swift/tags","blobs_url":"https://api.github.com/repos/marcelofabri/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcelofabri/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcelofabri/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcelofabri/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcelofabri/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/marcelofabri/swift/languages","stargazers_url":"https://api.github.com/repos/marcelofabri/swift/stargazers","contributors_url":"https://api.github.com/repos/marcelofabri/swift/contributors","subscribers_url":"https://api.github.com/repos/marcelofabri/swift/subscribers","subscription_url":"https://api.github.com/repos/marcelofabri/swift/subscription","commits_url":"https://api.github.com/repos/marcelofabri/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcelofabri/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcelofabri/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcelofabri/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcelofabri/swift/contents/{+path}","compare_url":"https://api.github.com/repos/marcelofabri/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcelofabri/swift/merges","archive_url":"https://api.github.com/repos/marcelofabri/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcelofabri/swift/downloads","issues_url":"https://api.github.com/repos/marcelofabri/swift/issues{/number}","pulls_url":"https://api.github.com/repos/marcelofabri/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/marcelofabri/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/marcelofabri/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcelofabri/swift/labels{/name}","releases_url":"https://api.github.com/repos/marcelofabri/swift/releases{/id}","deployments_url":"https://api.github.com/repos/marcelofabri/swift/deployments","created_at":"2017-07-29T20:18:31Z","updated_at":"2017-07-29T20:19:00Z","pushed_at":"2017-07-31T22:00:30Z","git_url":"git://github.com/marcelofabri/swift.git","ssh_url":"git@github.com:marcelofabri/swift.git","clone_url":"https://github.com/marcelofabri/swift.git","svn_url":"https://github.com/marcelofabri/swift","homepage":"https://swift.org/","size":226491,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"c55e07b1d87ad276edca68fd528a65e1227aedff","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2017-07-31T21:16:45Z","pushed_at":"2017-07-31T22:00:32Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":226510,"stargazers_count":39647,"watchers_count":39647,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6008,"mirror_url":null,"open_issues_count":167,"forks":6008,"open_issues":167,"watchers":39647,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/11258"},"html":{"href":"https://github.com/apple/swift/pull/11258"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/11258"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/11258/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/11258/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/11258/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/c4dad0c32123b0ddad315950782a1231b06ab483"}}}}
{"actor":{"display_login":"marcelofabri"}}