{"action":"created","comment":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/comments/80941803","pull_request_review_id":1958935,"id":80941803,"diff_hunk":"@@ -0,0 +1,98 @@\n+package dotty.tools\n+package dotc\n+package reporting\n+package diagnostic\n+\n+import util.SourcePosition\n+import core.Contexts.Context\n+\n+object Message {\n+  /** This implicit conversion provides a fallback for error messages that have\n+    * not yet been ported to the new scheme. Comment out this `implicit def` to\n+    * see where old errors still exist\n+    */\n+  implicit def toNoExplanation(str: String): Message =\n+    new NoExplanation(str)\n+}\n+\n+abstract class Message(val errorId: Int) { self =>\n+  import messages._\n+\n+  /** The `msg` contains the diagnostic message e.g:\n+    *\n+    * > expected: String\n+    * > found:    Int\n+    *\n+    * This message wil be placed underneath the position given by the enclosing\n+    * `MessageContainer`\n+    */\n+  def msg: String\n+\n+  /** The kind of the error message is something like \"Syntax\" or \"Type\n+    * Mismatch\"\n+    */","path":"src/dotty/tools/dotc/reporting/diagnostic/Message.scala","position":33,"original_position":33,"commit_id":"2a09fcf052d4947af53e7c259bcae2462742e78c","original_commit_id":"2a09fcf052d4947af53e7c259bcae2462742e78c","user":{"login":"felixmulder","id":1530049,"avatar_url":"https://avatars.githubusercontent.com/u/1530049?v=3","gravatar_id":"","url":"https://api.github.com/users/felixmulder","html_url":"https://github.com/felixmulder","followers_url":"https://api.github.com/users/felixmulder/followers","following_url":"https://api.github.com/users/felixmulder/following{/other_user}","gists_url":"https://api.github.com/users/felixmulder/gists{/gist_id}","starred_url":"https://api.github.com/users/felixmulder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixmulder/subscriptions","organizations_url":"https://api.github.com/users/felixmulder/orgs","repos_url":"https://api.github.com/users/felixmulder/repos","events_url":"https://api.github.com/users/felixmulder/events{/privacy}","received_events_url":"https://api.github.com/users/felixmulder/received_events","type":"User","site_admin":false},"body":"Huh, didn't know this. I'll fix this in my commments.","created_at":"2016-09-28T15:14:25Z","updated_at":"2016-09-28T15:14:25Z","html_url":"https://github.com/lampepfl/dotty/pull/1521#discussion_r80941803","pull_request_url":"https://api.github.com/repos/lampepfl/dotty/pulls/1521","_links":{"self":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/comments/80941803"},"html":{"href":"https://github.com/lampepfl/dotty/pull/1521#discussion_r80941803"},"pull_request":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/1521"}}},"pull_request":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/1521","id":85604455,"html_url":"https://github.com/lampepfl/dotty/pull/1521","diff_url":"https://github.com/lampepfl/dotty/pull/1521.diff","patch_url":"https://github.com/lampepfl/dotty/pull/1521.patch","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/1521","number":1521,"state":"open","locked":false,"title":"Operation beautify error messages","user":{"login":"felixmulder","id":1530049,"avatar_url":"https://avatars.githubusercontent.com/u/1530049?v=3","gravatar_id":"","url":"https://api.github.com/users/felixmulder","html_url":"https://github.com/felixmulder","followers_url":"https://api.github.com/users/felixmulder/followers","following_url":"https://api.github.com/users/felixmulder/following{/other_user}","gists_url":"https://api.github.com/users/felixmulder/gists{/gist_id}","starred_url":"https://api.github.com/users/felixmulder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixmulder/subscriptions","organizations_url":"https://api.github.com/users/felixmulder/orgs","repos_url":"https://api.github.com/users/felixmulder/repos","events_url":"https://api.github.com/users/felixmulder/events{/privacy}","received_events_url":"https://api.github.com/users/felixmulder/received_events","type":"User","site_admin":false},"body":"We want to provide beautiful and above all helpful error messages to the users of dotty. We aspire to do just as well as Elm and Rust in this category and this PR is the first step in that direction.\r\n\r\nThis PR adds a few things to error messages of dotty:\r\n\r\n* [x] Colored output\r\n* [x] Clearer distinction between individual error messages\r\n* [x] Underlining of single line errors\r\n* [x] Show line number on sourceline\r\n* [x] Adds explanations via a `-explain` flag\r\n* [x] Obeys the `-color:option` flag, never will give you a `ConsoleReporter` and the other options will give you the new `FancyConsoleReporter`\r\n* [x] Adds error kinds (currently `Syntax` and`Type`)\r\n* [x]  Adds string interpolator `hl\"1 + 2\"` for syntax highlighting\r\n* [x] Obey pagewidth setting\r\n* [x] Align error messages under error for better legibility\r\n* [x] Add better structure to regular color highlighting instead of using `Console` directly\r\n* [x] Make CI tests use boring reporter - so that tests may pass :+1:\r\n* [x] Make console reporters 1:1\r\n  - [x] Make `FancyConsoleReporter` and highlighting \"color-aware\"\r\n  - [x] Fix tests to obey new error messages\r\n* [x] Improve explanation text highlighting\r\n* [x] Improve syntax highlighter\r\n* [x] Type diffs i.e. `List[Map[A,C]]` diff `List[Map[B,C]]`\r\n  - [x] Implement diffing on shown types\r\n  - [x] Refactor `expanded2` and make sure that output from `ex\"$found\"` is equal to `Mismatch(found)`\r\ncompiling:\r\n* [ ] Highlighting multiline errors\r\n\r\n```scala\r\nobject Test {\r\n  try {\r\n    2 + 3\r\n  }\r\n}\r\n```\r\n\r\nwith `./bin/dotc -explain test.scala` yields:\r\n\r\n![screen shot 2016-09-16 at 18 45 23](https://cloud.githubusercontent.com/assets/1530049/18593885/b9adf114-7c3d-11e6-888e-fe3ab7d3084d.png)\r\n\r\ncompiling:\r\n\r\n```scala\r\nobject C1 { def foo: Int = 1 }\r\nobject C2 { def foo: Int = 2 }\r\n\r\nobject Test {\r\n  import C1._\r\n  import C2._\r\n\r\n  println(s\"The number you're looking for is: $foo\")\r\n\r\n  foo\r\n}\r\n```\r\n\r\nyields:\r\n\r\n![screen shot 2016-09-16 at 18 48 06](https://cloud.githubusercontent.com/assets/1530049/18594004/3b8bfea6-7c3e-11e6-831c-f8a2cf666335.png)\r\n","created_at":"2016-09-16T16:43:53Z","updated_at":"2016-09-28T15:14:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f49680f4874d7b3dfc55f9e4f0d6cd52174cd191","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lampepfl/dotty/pulls/1521/commits","review_comments_url":"https://api.github.com/repos/lampepfl/dotty/pulls/1521/comments","review_comment_url":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/1521/comments","statuses_url":"https://api.github.com/repos/lampepfl/dotty/statuses/2a09fcf052d4947af53e7c259bcae2462742e78c","head":{"label":"felixmulder:topic/better-errormessages","ref":"topic/better-errormessages","sha":"2a09fcf052d4947af53e7c259bcae2462742e78c","user":{"login":"felixmulder","id":1530049,"avatar_url":"https://avatars.githubusercontent.com/u/1530049?v=3","gravatar_id":"","url":"https://api.github.com/users/felixmulder","html_url":"https://github.com/felixmulder","followers_url":"https://api.github.com/users/felixmulder/followers","following_url":"https://api.github.com/users/felixmulder/following{/other_user}","gists_url":"https://api.github.com/users/felixmulder/gists{/gist_id}","starred_url":"https://api.github.com/users/felixmulder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixmulder/subscriptions","organizations_url":"https://api.github.com/users/felixmulder/orgs","repos_url":"https://api.github.com/users/felixmulder/repos","events_url":"https://api.github.com/users/felixmulder/events{/privacy}","received_events_url":"https://api.github.com/users/felixmulder/received_events","type":"User","site_admin":false},"repo":{"id":52869692,"name":"dotty","full_name":"felixmulder/dotty","owner":{"login":"felixmulder","id":1530049,"avatar_url":"https://avatars.githubusercontent.com/u/1530049?v=3","gravatar_id":"","url":"https://api.github.com/users/felixmulder","html_url":"https://github.com/felixmulder","followers_url":"https://api.github.com/users/felixmulder/followers","following_url":"https://api.github.com/users/felixmulder/following{/other_user}","gists_url":"https://api.github.com/users/felixmulder/gists{/gist_id}","starred_url":"https://api.github.com/users/felixmulder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixmulder/subscriptions","organizations_url":"https://api.github.com/users/felixmulder/orgs","repos_url":"https://api.github.com/users/felixmulder/repos","events_url":"https://api.github.com/users/felixmulder/events{/privacy}","received_events_url":"https://api.github.com/users/felixmulder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felixmulder/dotty","description":"Research platform for new language concepts and compiler technologies for Scala.","fork":true,"url":"https://api.github.com/repos/felixmulder/dotty","forks_url":"https://api.github.com/repos/felixmulder/dotty/forks","keys_url":"https://api.github.com/repos/felixmulder/dotty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felixmulder/dotty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felixmulder/dotty/teams","hooks_url":"https://api.github.com/repos/felixmulder/dotty/hooks","issue_events_url":"https://api.github.com/repos/felixmulder/dotty/issues/events{/number}","events_url":"https://api.github.com/repos/felixmulder/dotty/events","assignees_url":"https://api.github.com/repos/felixmulder/dotty/assignees{/user}","branches_url":"https://api.github.com/repos/felixmulder/dotty/branches{/branch}","tags_url":"https://api.github.com/repos/felixmulder/dotty/tags","blobs_url":"https://api.github.com/repos/felixmulder/dotty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felixmulder/dotty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felixmulder/dotty/git/refs{/sha}","trees_url":"https://api.github.com/repos/felixmulder/dotty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felixmulder/dotty/statuses/{sha}","languages_url":"https://api.github.com/repos/felixmulder/dotty/languages","stargazers_url":"https://api.github.com/repos/felixmulder/dotty/stargazers","contributors_url":"https://api.github.com/repos/felixmulder/dotty/contributors","subscribers_url":"https://api.github.com/repos/felixmulder/dotty/subscribers","subscription_url":"https://api.github.com/repos/felixmulder/dotty/subscription","commits_url":"https://api.github.com/repos/felixmulder/dotty/commits{/sha}","git_commits_url":"https://api.github.com/repos/felixmulder/dotty/git/commits{/sha}","comments_url":"https://api.github.com/repos/felixmulder/dotty/comments{/number}","issue_comment_url":"https://api.github.com/repos/felixmulder/dotty/issues/comments{/number}","contents_url":"https://api.github.com/repos/felixmulder/dotty/contents/{+path}","compare_url":"https://api.github.com/repos/felixmulder/dotty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felixmulder/dotty/merges","archive_url":"https://api.github.com/repos/felixmulder/dotty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felixmulder/dotty/downloads","issues_url":"https://api.github.com/repos/felixmulder/dotty/issues{/number}","pulls_url":"https://api.github.com/repos/felixmulder/dotty/pulls{/number}","milestones_url":"https://api.github.com/repos/felixmulder/dotty/milestones{/number}","notifications_url":"https://api.github.com/repos/felixmulder/dotty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felixmulder/dotty/labels{/name}","releases_url":"https://api.github.com/repos/felixmulder/dotty/releases{/id}","deployments_url":"https://api.github.com/repos/felixmulder/dotty/deployments","created_at":"2016-03-01T10:47:55Z","updated_at":"2016-05-03T10:53:51Z","pushed_at":"2016-09-28T11:05:20Z","git_url":"git://github.com/felixmulder/dotty.git","ssh_url":"git@github.com:felixmulder/dotty.git","clone_url":"https://github.com/felixmulder/dotty.git","svn_url":"https://github.com/felixmulder/dotty","homepage":"","size":20728,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"lampepfl:master","ref":"master","sha":"ec28ea175c32ee192a28139ee88f39afbd30d159","user":{"login":"lampepfl","id":2684793,"avatar_url":"https://avatars.githubusercontent.com/u/2684793?v=3","gravatar_id":"","url":"https://api.github.com/users/lampepfl","html_url":"https://github.com/lampepfl","followers_url":"https://api.github.com/users/lampepfl/followers","following_url":"https://api.github.com/users/lampepfl/following{/other_user}","gists_url":"https://api.github.com/users/lampepfl/gists{/gist_id}","starred_url":"https://api.github.com/users/lampepfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampepfl/subscriptions","organizations_url":"https://api.github.com/users/lampepfl/orgs","repos_url":"https://api.github.com/users/lampepfl/repos","events_url":"https://api.github.com/users/lampepfl/events{/privacy}","received_events_url":"https://api.github.com/users/lampepfl/received_events","type":"Organization","site_admin":false},"repo":{"id":7035651,"name":"dotty","full_name":"lampepfl/dotty","owner":{"login":"lampepfl","id":2684793,"avatar_url":"https://avatars.githubusercontent.com/u/2684793?v=3","gravatar_id":"","url":"https://api.github.com/users/lampepfl","html_url":"https://github.com/lampepfl","followers_url":"https://api.github.com/users/lampepfl/followers","following_url":"https://api.github.com/users/lampepfl/following{/other_user}","gists_url":"https://api.github.com/users/lampepfl/gists{/gist_id}","starred_url":"https://api.github.com/users/lampepfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampepfl/subscriptions","organizations_url":"https://api.github.com/users/lampepfl/orgs","repos_url":"https://api.github.com/users/lampepfl/repos","events_url":"https://api.github.com/users/lampepfl/events{/privacy}","received_events_url":"https://api.github.com/users/lampepfl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lampepfl/dotty","description":"Research platform for new language concepts and compiler technologies for Scala.","fork":false,"url":"https://api.github.com/repos/lampepfl/dotty","forks_url":"https://api.github.com/repos/lampepfl/dotty/forks","keys_url":"https://api.github.com/repos/lampepfl/dotty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lampepfl/dotty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lampepfl/dotty/teams","hooks_url":"https://api.github.com/repos/lampepfl/dotty/hooks","issue_events_url":"https://api.github.com/repos/lampepfl/dotty/issues/events{/number}","events_url":"https://api.github.com/repos/lampepfl/dotty/events","assignees_url":"https://api.github.com/repos/lampepfl/dotty/assignees{/user}","branches_url":"https://api.github.com/repos/lampepfl/dotty/branches{/branch}","tags_url":"https://api.github.com/repos/lampepfl/dotty/tags","blobs_url":"https://api.github.com/repos/lampepfl/dotty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lampepfl/dotty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lampepfl/dotty/git/refs{/sha}","trees_url":"https://api.github.com/repos/lampepfl/dotty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lampepfl/dotty/statuses/{sha}","languages_url":"https://api.github.com/repos/lampepfl/dotty/languages","stargazers_url":"https://api.github.com/repos/lampepfl/dotty/stargazers","contributors_url":"https://api.github.com/repos/lampepfl/dotty/contributors","subscribers_url":"https://api.github.com/repos/lampepfl/dotty/subscribers","subscription_url":"https://api.github.com/repos/lampepfl/dotty/subscription","commits_url":"https://api.github.com/repos/lampepfl/dotty/commits{/sha}","git_commits_url":"https://api.github.com/repos/lampepfl/dotty/git/commits{/sha}","comments_url":"https://api.github.com/repos/lampepfl/dotty/comments{/number}","issue_comment_url":"https://api.github.com/repos/lampepfl/dotty/issues/comments{/number}","contents_url":"https://api.github.com/repos/lampepfl/dotty/contents/{+path}","compare_url":"https://api.github.com/repos/lampepfl/dotty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lampepfl/dotty/merges","archive_url":"https://api.github.com/repos/lampepfl/dotty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lampepfl/dotty/downloads","issues_url":"https://api.github.com/repos/lampepfl/dotty/issues{/number}","pulls_url":"https://api.github.com/repos/lampepfl/dotty/pulls{/number}","milestones_url":"https://api.github.com/repos/lampepfl/dotty/milestones{/number}","notifications_url":"https://api.github.com/repos/lampepfl/dotty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lampepfl/dotty/labels{/name}","releases_url":"https://api.github.com/repos/lampepfl/dotty/releases{/id}","deployments_url":"https://api.github.com/repos/lampepfl/dotty/deployments","created_at":"2012-12-06T12:57:33Z","updated_at":"2016-09-27T21:47:54Z","pushed_at":"2016-09-28T13:07:28Z","git_url":"git://github.com/lampepfl/dotty.git","ssh_url":"git@github.com:lampepfl/dotty.git","clone_url":"https://github.com/lampepfl/dotty.git","svn_url":"https://github.com/lampepfl/dotty","homepage":"","size":27908,"stargazers_count":1240,"watchers_count":1240,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":162,"mirror_url":null,"open_issues_count":193,"forks":162,"open_issues":193,"watchers":1240,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/1521"},"html":{"href":"https://github.com/lampepfl/dotty/pull/1521"},"issue":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/1521"},"comments":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/1521/comments"},"review_comments":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/1521/comments"},"review_comment":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/1521/commits"},"statuses":{"href":"https://api.github.com/repos/lampepfl/dotty/statuses/2a09fcf052d4947af53e7c259bcae2462742e78c"}}}}
{"actor":{"display_login":"felixmulder"}}