{"action":"created","comment":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/comments/232684321","pull_request_review_id":173933200,"id":232684321,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjY4NDMyMQ==","diff_hunk":"@@ -17,25 +18,20 @@ object TastyFileUtil {\n    *    package foo\n    *    class Foo\n    *  ```\n-   *  then `getClassName(\"./out/foo/Foo.tasty\") returns `(\"./out\", \"foo.Foo\")`\n+   *  then `getClassName(\"./out/foo/Foo.tasty\") returns `Some((\"./out\", \"foo.Foo\"))`\n    */\n-  def getClassName(path: Path): (String, String) = {\n+  def getClassName(path: Path): Option[(String, String)] = {\n     assert(path.toString.endsWith(\".tasty\"))\n     assert(Files.exists(path))\n     val bytes = Files.readAllBytes(path)\n-    val unpickler: TastyUnpickler = new TastyUnpickler(bytes)\n-    val className =\n-      unpickler.nameAtRef.contents.iterator.dropWhile {\n-        name => name.toString == TreePickler.sectionName || name == nme.EMPTY_PACKAGE\n-      }.takeWhile {\n-        case name: SimpleName => name != nme.CONSTRUCTOR\n-        case name => !name.is(NameKinds.ModuleClassName)\n-      }.collect {\n-        case name: SimpleName => name.toString\n-      }.toList\n-    val classInPath = className.mkString(\"\", \"/\", \".tasty\")\n-    val classpath = path.toString.replace(classInPath, \"\")\n-    (classpath, className.mkString(\".\"))\n+    val names = new core.tasty.TastyClassName(bytes).readName()\n+    names.map { case (packName, className) =>\n+      val fullName = s\"$packName.${className.lastPart}\"\n+      val classInPath = fullName.replace(\".\", \"/\") + \".tasty\"","path":"compiler/src/dotty/tools/dotc/fromtasty/TastyFileUtil.scala","position":30,"original_position":35,"commit_id":"f4ada7d180c30f8626e4283829a614ad6125eb05","original_commit_id":"f4ada7d180c30f8626e4283829a614ad6125eb05","user":{"login":"tuvior","id":4102586,"node_id":"MDQ6VXNlcjQxMDI1ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/4102586?v=4","gravatar_id":"","url":"https://api.github.com/users/tuvior","html_url":"https://github.com/tuvior","followers_url":"https://api.github.com/users/tuvior/followers","following_url":"https://api.github.com/users/tuvior/following{/other_user}","gists_url":"https://api.github.com/users/tuvior/gists{/gist_id}","starred_url":"https://api.github.com/users/tuvior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuvior/subscriptions","organizations_url":"https://api.github.com/users/tuvior/orgs","repos_url":"https://api.github.com/users/tuvior/repos","events_url":"https://api.github.com/users/tuvior/events{/privacy}","received_events_url":"https://api.github.com/users/tuvior/received_events","type":"User","site_admin":false},"body":"Need to use `File.separator` instead of `/` as otherwise the replace fails on Windows and we get the full tasty file path as classpath.\r\n\r\nExample:\r\n\r\n```\r\n[info] file:///c%3A/Users/Tobias/Programming/Scala/dotty/out/bootstrap/dotty-language-server/scala-0.11/classes/dotty/tools/languageserver/DottyLanguageServer.tasty\r\n[info] classPath: c:\\Users\\Tobias\\Programming\\Scala\\dotty\\out\\bootstrap\\dotty-language-server\\scala-0.11\\classes\\dotty\\tools\\languageserver\\DottyLanguageServer.tasty\r\n[info] className: dotty.tools.languageserver.DottyLanguageServer\r\n[error] class dotty.tools.languageserver.DottyLanguageServer cannot be unpickled because no class file was found\r\n```","created_at":"2018-11-12T14:46:18Z","updated_at":"2018-11-12T14:47:05Z","html_url":"https://github.com/lampepfl/dotty/pull/5325#discussion_r232684321","pull_request_url":"https://api.github.com/repos/lampepfl/dotty/pulls/5325","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/comments/232684321"},"html":{"href":"https://github.com/lampepfl/dotty/pull/5325#discussion_r232684321"},"pull_request":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/5325"}}},"pull_request":{"url":"https://api.github.com/repos/lampepfl/dotty/pulls/5325","id":225821930,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1ODIxOTMw","html_url":"https://github.com/lampepfl/dotty/pull/5325","diff_url":"https://github.com/lampepfl/dotty/pull/5325.diff","patch_url":"https://github.com/lampepfl/dotty/pull/5325.patch","issue_url":"https://api.github.com/repos/lampepfl/dotty/issues/5325","number":5325,"state":"open","locked":false,"title":"Allow tasty files to be the input of -from-tasty","user":{"login":"nicolasstucki","id":3648029,"node_id":"MDQ6VXNlcjM2NDgwMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3648029?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolasstucki","html_url":"https://github.com/nicolasstucki","followers_url":"https://api.github.com/users/nicolasstucki/followers","following_url":"https://api.github.com/users/nicolasstucki/following{/other_user}","gists_url":"https://api.github.com/users/nicolasstucki/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolasstucki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolasstucki/subscriptions","organizations_url":"https://api.github.com/users/nicolasstucki/orgs","repos_url":"https://api.github.com/users/nicolasstucki/repos","events_url":"https://api.github.com/users/nicolasstucki/events{/privacy}","received_events_url":"https://api.github.com/users/nicolasstucki/received_events","type":"User","site_admin":false},"body":"Also works for -decompile and any other compiler that has the -form-tatsy flag.","created_at":"2018-10-25T16:16:51Z","updated_at":"2018-11-12T14:47:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"055f9412900a32d81457ed8ea8773a6ca68dd3d9","assignee":{"login":"smarter","id":63430,"node_id":"MDQ6VXNlcjYzNDMw","avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false},"assignees":[{"login":"smarter","id":63430,"node_id":"MDQ6VXNlcjYzNDMw","avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"smarter","id":63430,"node_id":"MDQ6VXNlcjYzNDMw","avatar_url":"https://avatars2.githubusercontent.com/u/63430?v=4","gravatar_id":"","url":"https://api.github.com/users/smarter","html_url":"https://github.com/smarter","followers_url":"https://api.github.com/users/smarter/followers","following_url":"https://api.github.com/users/smarter/following{/other_user}","gists_url":"https://api.github.com/users/smarter/gists{/gist_id}","starred_url":"https://api.github.com/users/smarter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarter/subscriptions","organizations_url":"https://api.github.com/users/smarter/orgs","repos_url":"https://api.github.com/users/smarter/repos","events_url":"https://api.github.com/users/smarter/events{/privacy}","received_events_url":"https://api.github.com/users/smarter/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":386605863,"node_id":"MDU6TGFiZWwzODY2MDU4NjM=","url":"https://api.github.com/repos/lampepfl/dotty/labels/stat:needs%20review","name":"stat:needs review","color":"f9d0c4","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/lampepfl/dotty/pulls/5325/commits","review_comments_url":"https://api.github.com/repos/lampepfl/dotty/pulls/5325/comments","review_comment_url":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lampepfl/dotty/issues/5325/comments","statuses_url":"https://api.github.com/repos/lampepfl/dotty/statuses/f4ada7d180c30f8626e4283829a614ad6125eb05","head":{"label":"dotty-staging:add-tasty-file-input","ref":"add-tasty-file-input","sha":"f4ada7d180c30f8626e4283829a614ad6125eb05","user":{"login":"dotty-staging","id":6998674,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg2NzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6998674?v=4","gravatar_id":"","url":"https://api.github.com/users/dotty-staging","html_url":"https://github.com/dotty-staging","followers_url":"https://api.github.com/users/dotty-staging/followers","following_url":"https://api.github.com/users/dotty-staging/following{/other_user}","gists_url":"https://api.github.com/users/dotty-staging/gists{/gist_id}","starred_url":"https://api.github.com/users/dotty-staging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotty-staging/subscriptions","organizations_url":"https://api.github.com/users/dotty-staging/orgs","repos_url":"https://api.github.com/users/dotty-staging/repos","events_url":"https://api.github.com/users/dotty-staging/events{/privacy}","received_events_url":"https://api.github.com/users/dotty-staging/received_events","type":"Organization","site_admin":false},"repo":{"id":17904384,"node_id":"MDEwOlJlcG9zaXRvcnkxNzkwNDM4NA==","name":"dotty","full_name":"dotty-staging/dotty","private":false,"owner":{"login":"dotty-staging","id":6998674,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg2NzQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6998674?v=4","gravatar_id":"","url":"https://api.github.com/users/dotty-staging","html_url":"https://github.com/dotty-staging","followers_url":"https://api.github.com/users/dotty-staging/followers","following_url":"https://api.github.com/users/dotty-staging/following{/other_user}","gists_url":"https://api.github.com/users/dotty-staging/gists{/gist_id}","starred_url":"https://api.github.com/users/dotty-staging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotty-staging/subscriptions","organizations_url":"https://api.github.com/users/dotty-staging/orgs","repos_url":"https://api.github.com/users/dotty-staging/repos","events_url":"https://api.github.com/users/dotty-staging/events{/privacy}","received_events_url":"https://api.github.com/users/dotty-staging/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dotty-staging/dotty","description":"Research platform for new language concepts and compiler technologies for Scala.","fork":true,"url":"https://api.github.com/repos/dotty-staging/dotty","forks_url":"https://api.github.com/repos/dotty-staging/dotty/forks","keys_url":"https://api.github.com/repos/dotty-staging/dotty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotty-staging/dotty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotty-staging/dotty/teams","hooks_url":"https://api.github.com/repos/dotty-staging/dotty/hooks","issue_events_url":"https://api.github.com/repos/dotty-staging/dotty/issues/events{/number}","events_url":"https://api.github.com/repos/dotty-staging/dotty/events","assignees_url":"https://api.github.com/repos/dotty-staging/dotty/assignees{/user}","branches_url":"https://api.github.com/repos/dotty-staging/dotty/branches{/branch}","tags_url":"https://api.github.com/repos/dotty-staging/dotty/tags","blobs_url":"https://api.github.com/repos/dotty-staging/dotty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotty-staging/dotty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotty-staging/dotty/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotty-staging/dotty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotty-staging/dotty/statuses/{sha}","languages_url":"https://api.github.com/repos/dotty-staging/dotty/languages","stargazers_url":"https://api.github.com/repos/dotty-staging/dotty/stargazers","contributors_url":"https://api.github.com/repos/dotty-staging/dotty/contributors","subscribers_url":"https://api.github.com/repos/dotty-staging/dotty/subscribers","subscription_url":"https://api.github.com/repos/dotty-staging/dotty/subscription","commits_url":"https://api.github.com/repos/dotty-staging/dotty/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotty-staging/dotty/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotty-staging/dotty/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotty-staging/dotty/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotty-staging/dotty/contents/{+path}","compare_url":"https://api.github.com/repos/dotty-staging/dotty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotty-staging/dotty/merges","archive_url":"https://api.github.com/repos/dotty-staging/dotty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotty-staging/dotty/downloads","issues_url":"https://api.github.com/repos/dotty-staging/dotty/issues{/number}","pulls_url":"https://api.github.com/repos/dotty-staging/dotty/pulls{/number}","milestones_url":"https://api.github.com/repos/dotty-staging/dotty/milestones{/number}","notifications_url":"https://api.github.com/repos/dotty-staging/dotty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotty-staging/dotty/labels{/name}","releases_url":"https://api.github.com/repos/dotty-staging/dotty/releases{/id}","deployments_url":"https://api.github.com/repos/dotty-staging/dotty/deployments","created_at":"2014-03-19T13:06:15Z","updated_at":"2018-11-12T12:08:36Z","pushed_at":"2018-11-12T12:26:57Z","git_url":"git://github.com/dotty-staging/dotty.git","ssh_url":"git@github.com:dotty-staging/dotty.git","clone_url":"https://github.com/dotty-staging/dotty.git","svn_url":"https://github.com/dotty-staging/dotty","homepage":"","size":59280,"stargazers_count":68,"watchers_count":68,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":10,"open_issues":0,"watchers":68,"default_branch":"master"}},"base":{"label":"lampepfl:master","ref":"master","sha":"80319782a1539225a0d5b5e2bdd2730e5c81174d","user":{"login":"lampepfl","id":2684793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQ3OTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684793?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk3MDM1NjUx","name":"dotty","full_name":"lampepfl/dotty","private":false,"owner":{"login":"lampepfl","id":2684793,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQ3OTM=","avatar_url":"https://avatars1.githubusercontent.com/u/2684793?v=4","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},"html_url":"https://github.com/lampepfl/dotty","description":"Research compiler that will become Scala 3","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":"2018-11-11T22:10:25Z","pushed_at":"2018-11-12T12:26:59Z","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":"http://dotty.epfl.ch","size":48116,"stargazers_count":2995,"watchers_count":2995,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":428,"mirror_url":null,"archived":false,"open_issues_count":505,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":428,"open_issues":505,"watchers":2995,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/5325"},"html":{"href":"https://github.com/lampepfl/dotty/pull/5325"},"issue":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/5325"},"comments":{"href":"https://api.github.com/repos/lampepfl/dotty/issues/5325/comments"},"review_comments":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/5325/comments"},"review_comment":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lampepfl/dotty/pulls/5325/commits"},"statuses":{"href":"https://api.github.com/repos/lampepfl/dotty/statuses/f4ada7d180c30f8626e4283829a614ad6125eb05"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tuvior"}}