{"action":"created","comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments/192862004","pull_request_review_id":125720269,"id":192862004,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mjg2MjAwNA==","diff_hunk":"@@ -28,10 +28,20 @@ class Crystal::Path\n     end\n \n     similar_name = type.lookup_similar_path(self)\n+\n     if similar_name\n       self.raise(\"undefined constant #{self} #{type.program.colorize(\"(did you mean '#{similar_name}')\").yellow.bold}\")\n     else\n-      self.raise(\"undefined constant #{self}\")\n+      example_require = %(require \"./#{self.to_s.underscore}\")\n+      colorized_require_example = type.program.colorize(example_require).yellow.bold\n+      self.raise <<-ERROR\n+      undefined constant #{type.program.colorize(self).bold.yellow}\n+\n+      Try this...\n+\n+        ▸ Require the file with #{type.program.colorize(self).bold}. For example: #{colorized_require_example}","path":"src/compiler/crystal/semantic/call_error.cr","position":16,"original_position":16,"commit_id":"24090f041f92260c018e08594ee69157c0826790","original_commit_id":"24090f041f92260c018e08594ee69157c0826790","user":{"login":"straight-shoota","id":466378,"node_id":"MDQ6VXNlcjQ2NjM3OA==","avatar_url":"https://avatars0.githubusercontent.com/u/466378?v=4","gravatar_id":"","url":"https://api.github.com/users/straight-shoota","html_url":"https://github.com/straight-shoota","followers_url":"https://api.github.com/users/straight-shoota/followers","following_url":"https://api.github.com/users/straight-shoota/following{/other_user}","gists_url":"https://api.github.com/users/straight-shoota/gists{/gist_id}","starred_url":"https://api.github.com/users/straight-shoota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/straight-shoota/subscriptions","organizations_url":"https://api.github.com/users/straight-shoota/orgs","repos_url":"https://api.github.com/users/straight-shoota/repos","events_url":"https://api.github.com/users/straight-shoota/events{/privacy}","received_events_url":"https://api.github.com/users/straight-shoota/received_events","type":"User","site_admin":false},"body":"*the file with Foo* seems a bit imprecise. What about *the file that defines Foo*?\r\nOr, more similar to the second suggestion:\r\n> If Foo is declared in a file, add a relative require `require \"./foo\"`","created_at":"2018-06-04T19:58:28Z","updated_at":"2018-06-04T20:01:30Z","html_url":"https://github.com/crystal-lang/crystal/pull/6146#discussion_r192862004","pull_request_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments/192862004"},"html":{"href":"https://github.com/crystal-lang/crystal/pull/6146#discussion_r192862004"},"pull_request":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146"}}},"pull_request":{"url":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146","id":191624450,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNjI0NDUw","html_url":"https://github.com/crystal-lang/crystal/pull/6146","diff_url":"https://github.com/crystal-lang/crystal/pull/6146.diff","patch_url":"https://github.com/crystal-lang/crystal/pull/6146.patch","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/6146","number":6146,"state":"open","locked":false,"title":"Helpful error when constant not found","user":{"login":"paulcsmith","id":22394,"node_id":"MDQ6VXNlcjIyMzk0","avatar_url":"https://avatars0.githubusercontent.com/u/22394?v=4","gravatar_id":"","url":"https://api.github.com/users/paulcsmith","html_url":"https://github.com/paulcsmith","followers_url":"https://api.github.com/users/paulcsmith/followers","following_url":"https://api.github.com/users/paulcsmith/following{/other_user}","gists_url":"https://api.github.com/users/paulcsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcsmith/subscriptions","organizations_url":"https://api.github.com/users/paulcsmith/orgs","repos_url":"https://api.github.com/users/paulcsmith/repos","events_url":"https://api.github.com/users/paulcsmith/events{/privacy}","received_events_url":"https://api.github.com/users/paulcsmith/received_events","type":"User","site_admin":false},"body":"Closes #6122 \r\n\r\n<img width=\"993\" alt=\"screen shot 2018-05-30 at 9 51 40 pm\" src=\"https://user-images.githubusercontent.com/22394/40756879-b458c888-6453-11e8-9cff-358ce70db53b.png\">\r\n","created_at":"2018-05-31T01:57:25Z","updated_at":"2018-06-04T20:01:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc55f32b286b22810be14096cd8a846de3c2da15","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146/commits","review_comments_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146/comments","review_comment_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/6146/comments","statuses_url":"https://api.github.com/repos/crystal-lang/crystal/statuses/24090f041f92260c018e08594ee69157c0826790","head":{"label":"paulcsmith:ps-6122-undefined-constant-error","ref":"ps-6122-undefined-constant-error","sha":"24090f041f92260c018e08594ee69157c0826790","user":{"login":"paulcsmith","id":22394,"node_id":"MDQ6VXNlcjIyMzk0","avatar_url":"https://avatars0.githubusercontent.com/u/22394?v=4","gravatar_id":"","url":"https://api.github.com/users/paulcsmith","html_url":"https://github.com/paulcsmith","followers_url":"https://api.github.com/users/paulcsmith/followers","following_url":"https://api.github.com/users/paulcsmith/following{/other_user}","gists_url":"https://api.github.com/users/paulcsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcsmith/subscriptions","organizations_url":"https://api.github.com/users/paulcsmith/orgs","repos_url":"https://api.github.com/users/paulcsmith/repos","events_url":"https://api.github.com/users/paulcsmith/events{/privacy}","received_events_url":"https://api.github.com/users/paulcsmith/received_events","type":"User","site_admin":false},"repo":{"id":60713524,"node_id":"MDEwOlJlcG9zaXRvcnk2MDcxMzUyNA==","name":"crystal","full_name":"paulcsmith/crystal","owner":{"login":"paulcsmith","id":22394,"node_id":"MDQ6VXNlcjIyMzk0","avatar_url":"https://avatars0.githubusercontent.com/u/22394?v=4","gravatar_id":"","url":"https://api.github.com/users/paulcsmith","html_url":"https://github.com/paulcsmith","followers_url":"https://api.github.com/users/paulcsmith/followers","following_url":"https://api.github.com/users/paulcsmith/following{/other_user}","gists_url":"https://api.github.com/users/paulcsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcsmith/subscriptions","organizations_url":"https://api.github.com/users/paulcsmith/orgs","repos_url":"https://api.github.com/users/paulcsmith/repos","events_url":"https://api.github.com/users/paulcsmith/events{/privacy}","received_events_url":"https://api.github.com/users/paulcsmith/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulcsmith/crystal","description":"The Crystal Programming Language","fork":true,"url":"https://api.github.com/repos/paulcsmith/crystal","forks_url":"https://api.github.com/repos/paulcsmith/crystal/forks","keys_url":"https://api.github.com/repos/paulcsmith/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulcsmith/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulcsmith/crystal/teams","hooks_url":"https://api.github.com/repos/paulcsmith/crystal/hooks","issue_events_url":"https://api.github.com/repos/paulcsmith/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/paulcsmith/crystal/events","assignees_url":"https://api.github.com/repos/paulcsmith/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/paulcsmith/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/paulcsmith/crystal/tags","blobs_url":"https://api.github.com/repos/paulcsmith/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulcsmith/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulcsmith/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulcsmith/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulcsmith/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/paulcsmith/crystal/languages","stargazers_url":"https://api.github.com/repos/paulcsmith/crystal/stargazers","contributors_url":"https://api.github.com/repos/paulcsmith/crystal/contributors","subscribers_url":"https://api.github.com/repos/paulcsmith/crystal/subscribers","subscription_url":"https://api.github.com/repos/paulcsmith/crystal/subscription","commits_url":"https://api.github.com/repos/paulcsmith/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulcsmith/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulcsmith/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulcsmith/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulcsmith/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/paulcsmith/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulcsmith/crystal/merges","archive_url":"https://api.github.com/repos/paulcsmith/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulcsmith/crystal/downloads","issues_url":"https://api.github.com/repos/paulcsmith/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/paulcsmith/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/paulcsmith/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/paulcsmith/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulcsmith/crystal/labels{/name}","releases_url":"https://api.github.com/repos/paulcsmith/crystal/releases{/id}","deployments_url":"https://api.github.com/repos/paulcsmith/crystal/deployments","created_at":"2016-06-08T16:38:59Z","updated_at":"2016-06-08T16:39:02Z","pushed_at":"2018-05-31T04:10:43Z","git_url":"git://github.com/paulcsmith/crystal.git","ssh_url":"git@github.com:paulcsmith/crystal.git","clone_url":"https://github.com/paulcsmith/crystal.git","svn_url":"https://github.com/paulcsmith/crystal","homepage":"http://crystal-lang.org","size":65986,"stargazers_count":0,"watchers_count":0,"language":"Crystal","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"crystal-lang:master","ref":"master","sha":"61da45f2dd96c57e0d2757257b0b6a5ca0689b7a","user":{"login":"crystal-lang","id":6539796,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1Mzk3OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/6539796?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-lang","html_url":"https://github.com/crystal-lang","followers_url":"https://api.github.com/users/crystal-lang/followers","following_url":"https://api.github.com/users/crystal-lang/following{/other_user}","gists_url":"https://api.github.com/users/crystal-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-lang/subscriptions","organizations_url":"https://api.github.com/users/crystal-lang/orgs","repos_url":"https://api.github.com/users/crystal-lang/repos","events_url":"https://api.github.com/users/crystal-lang/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":6887813,"node_id":"MDEwOlJlcG9zaXRvcnk2ODg3ODEz","name":"crystal","full_name":"crystal-lang/crystal","owner":{"login":"crystal-lang","id":6539796,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1Mzk3OTY=","avatar_url":"https://avatars0.githubusercontent.com/u/6539796?v=4","gravatar_id":"","url":"https://api.github.com/users/crystal-lang","html_url":"https://github.com/crystal-lang","followers_url":"https://api.github.com/users/crystal-lang/followers","following_url":"https://api.github.com/users/crystal-lang/following{/other_user}","gists_url":"https://api.github.com/users/crystal-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-lang/subscriptions","organizations_url":"https://api.github.com/users/crystal-lang/orgs","repos_url":"https://api.github.com/users/crystal-lang/repos","events_url":"https://api.github.com/users/crystal-lang/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crystal-lang/crystal","description":"The Crystal Programming Language","fork":false,"url":"https://api.github.com/repos/crystal-lang/crystal","forks_url":"https://api.github.com/repos/crystal-lang/crystal/forks","keys_url":"https://api.github.com/repos/crystal-lang/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crystal-lang/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crystal-lang/crystal/teams","hooks_url":"https://api.github.com/repos/crystal-lang/crystal/hooks","issue_events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/crystal-lang/crystal/events","assignees_url":"https://api.github.com/repos/crystal-lang/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/crystal-lang/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/crystal-lang/crystal/tags","blobs_url":"https://api.github.com/repos/crystal-lang/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crystal-lang/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crystal-lang/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/crystal-lang/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crystal-lang/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/crystal-lang/crystal/languages","stargazers_url":"https://api.github.com/repos/crystal-lang/crystal/stargazers","contributors_url":"https://api.github.com/repos/crystal-lang/crystal/contributors","subscribers_url":"https://api.github.com/repos/crystal-lang/crystal/subscribers","subscription_url":"https://api.github.com/repos/crystal-lang/crystal/subscription","commits_url":"https://api.github.com/repos/crystal-lang/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/crystal-lang/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/crystal-lang/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/crystal-lang/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crystal-lang/crystal/merges","archive_url":"https://api.github.com/repos/crystal-lang/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crystal-lang/crystal/downloads","issues_url":"https://api.github.com/repos/crystal-lang/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/crystal-lang/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/crystal-lang/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/crystal-lang/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crystal-lang/crystal/labels{/name}","releases_url":"https://api.github.com/repos/crystal-lang/crystal/releases{/id}","deployments_url":"https://api.github.com/repos/crystal-lang/crystal/deployments","created_at":"2012-11-27T17:32:32Z","updated_at":"2018-06-04T18:32:35Z","pushed_at":"2018-06-04T16:45:54Z","git_url":"git://github.com/crystal-lang/crystal.git","ssh_url":"git@github.com:crystal-lang/crystal.git","clone_url":"https://github.com/crystal-lang/crystal.git","svn_url":"https://github.com/crystal-lang/crystal","homepage":"https://crystal-lang.org","size":36936,"stargazers_count":10896,"watchers_count":10896,"language":"Crystal","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":858,"mirror_url":null,"archived":false,"open_issues_count":659,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":858,"open_issues":659,"watchers":10896,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146"},"html":{"href":"https://github.com/crystal-lang/crystal/pull/6146"},"issue":{"href":"https://api.github.com/repos/crystal-lang/crystal/issues/6146"},"comments":{"href":"https://api.github.com/repos/crystal-lang/crystal/issues/6146/comments"},"review_comments":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146/comments"},"review_comment":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/6146/commits"},"statuses":{"href":"https://api.github.com/repos/crystal-lang/crystal/statuses/24090f041f92260c018e08594ee69157c0826790"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"straight-shoota"}}