{"action":"created","comment":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments/221299691","pull_request_review_id":159919196,"id":221299691,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTI5OTY5MQ==","diff_hunk":"@@ -15,15 +16,23 @@\n public class FileSystemSourceInput implements CompilerInput {\n \n     private final Path path;\n+    private Path packageRoot;\n \n     public FileSystemSourceInput(Path path) {\n         this.path = path;\n     }\n \n+    public FileSystemSourceInput(Path filePath, Path packageRoot) {\n+        this.path = filePath;\n+        this.packageRoot = packageRoot;\n+    }\n+\n     @Override\n     public String getEntryName() {\n         Path fileName = path.getFileName();\n-        return fileName == null ? path.toString() : fileName.toString();\n+        return packageRoot != null ?\n+                new File(packageRoot.toString()).toURI().relativize(new File(path.toString()).toURI()).getPath() :\n+                (fileName != null ? fileName.toString() : path.toString());","path":"compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/converters/FileSystemSourceInput.java","position":29,"original_position":29,"commit_id":"c5eba0aedf030b29c856dc991171fb074cf778d8","original_commit_id":"c5eba0aedf030b29c856dc991171fb074cf778d8","user":{"login":"SupunS","id":7834839,"node_id":"MDQ6VXNlcjc4MzQ4Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7834839?v=4","gravatar_id":"","url":"https://api.github.com/users/SupunS","html_url":"https://github.com/SupunS","followers_url":"https://api.github.com/users/SupunS/followers","following_url":"https://api.github.com/users/SupunS/following{/other_user}","gists_url":"https://api.github.com/users/SupunS/gists{/gist_id}","starred_url":"https://api.github.com/users/SupunS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SupunS/subscriptions","organizations_url":"https://api.github.com/users/SupunS/orgs","repos_url":"https://api.github.com/users/SupunS/repos","events_url":"https://api.github.com/users/SupunS/events{/privacy}","received_events_url":"https://api.github.com/users/SupunS/received_events","type":"User","site_admin":false},"body":"Also add some comments to explain what you are doing here.","created_at":"2018-09-28T15:50:02Z","updated_at":"2018-09-28T15:54:34Z","html_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10605#discussion_r221299691","pull_request_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments/221299691"},"html":{"href":"https://github.com/ballerina-platform/ballerina-lang/pull/10605#discussion_r221299691"},"pull_request":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605"}},"in_reply_to_id":221299263},"pull_request":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605","id":218898622,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4ODk4NjIy","html_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10605","diff_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10605.diff","patch_url":"https://github.com/ballerina-platform/ballerina-lang/pull/10605.patch","issue_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10605","number":10605,"state":"open","locked":false,"title":"Track relative file path instead of filename in compilation unit","user":{"login":"pranavan15","id":15685415,"node_id":"MDQ6VXNlcjE1Njg1NDE1","avatar_url":"https://avatars0.githubusercontent.com/u/15685415?v=4","gravatar_id":"","url":"https://api.github.com/users/pranavan15","html_url":"https://github.com/pranavan15","followers_url":"https://api.github.com/users/pranavan15/followers","following_url":"https://api.github.com/users/pranavan15/following{/other_user}","gists_url":"https://api.github.com/users/pranavan15/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavan15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavan15/subscriptions","organizations_url":"https://api.github.com/users/pranavan15/orgs","repos_url":"https://api.github.com/users/pranavan15/repos","events_url":"https://api.github.com/users/pranavan15/events{/privacy}","received_events_url":"https://api.github.com/users/pranavan15/received_events","type":"User","site_admin":false},"body":"## Purpose\r\nThis PR fixes https://github.com/ballerina-platform/ballerina-lang/issues/8042. Currently, the filename is obtained from the `FileSystemSourceInput`. Changing it to the relative file path from the package root fixes the following issues. \r\n\r\n Eg: Consider following package structure\r\n```\r\n.\r\n├── .ballerina\r\n├── Ballerina.toml\r\n└──  test\r\n    ├── inside\r\n    │   └── abc.bal    \r\n    ├── main.bal\r\n    └── abc.bal    \r\n```\r\n\r\n1. Two files in the same package but different folders logged with the same name when printing errors\r\n\r\nLogged errors\r\n```\r\nerror: test:0.0.0::abc.bal:6:1: invalid token '}'\r\nerror: test:0.0.0::abc.bal:8:1: invalid token '}'\r\n```\r\n2. No way to distinguish the files with same name when debugging\r\n\r\n3. Compilation units having the same file name cannot be identified separately\r\n\r\n","created_at":"2018-09-28T08:59:13Z","updated_at":"2018-09-28T15:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"649cd4531f45de7e21b5c1d10c9e457656a7f2c4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605/commits","review_comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605/comments","review_comment_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10605/comments","statuses_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/c5eba0aedf030b29c856dc991171fb074cf778d8","head":{"label":"pranavan15:master","ref":"master","sha":"c5eba0aedf030b29c856dc991171fb074cf778d8","user":{"login":"pranavan15","id":15685415,"node_id":"MDQ6VXNlcjE1Njg1NDE1","avatar_url":"https://avatars0.githubusercontent.com/u/15685415?v=4","gravatar_id":"","url":"https://api.github.com/users/pranavan15","html_url":"https://github.com/pranavan15","followers_url":"https://api.github.com/users/pranavan15/followers","following_url":"https://api.github.com/users/pranavan15/following{/other_user}","gists_url":"https://api.github.com/users/pranavan15/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavan15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavan15/subscriptions","organizations_url":"https://api.github.com/users/pranavan15/orgs","repos_url":"https://api.github.com/users/pranavan15/repos","events_url":"https://api.github.com/users/pranavan15/events{/privacy}","received_events_url":"https://api.github.com/users/pranavan15/received_events","type":"User","site_admin":false},"repo":{"id":140685117,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA2ODUxMTc=","name":"ballerina-lang","full_name":"pranavan15/ballerina-lang","private":false,"owner":{"login":"pranavan15","id":15685415,"node_id":"MDQ6VXNlcjE1Njg1NDE1","avatar_url":"https://avatars0.githubusercontent.com/u/15685415?v=4","gravatar_id":"","url":"https://api.github.com/users/pranavan15","html_url":"https://github.com/pranavan15","followers_url":"https://api.github.com/users/pranavan15/followers","following_url":"https://api.github.com/users/pranavan15/following{/other_user}","gists_url":"https://api.github.com/users/pranavan15/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavan15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavan15/subscriptions","organizations_url":"https://api.github.com/users/pranavan15/orgs","repos_url":"https://api.github.com/users/pranavan15/repos","events_url":"https://api.github.com/users/pranavan15/events{/privacy}","received_events_url":"https://api.github.com/users/pranavan15/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pranavan15/ballerina-lang","description":"Ballerina is a compiled, transactional, statically and strongly typed programming language with textual and graphical syntaxes.","fork":true,"url":"https://api.github.com/repos/pranavan15/ballerina-lang","forks_url":"https://api.github.com/repos/pranavan15/ballerina-lang/forks","keys_url":"https://api.github.com/repos/pranavan15/ballerina-lang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pranavan15/ballerina-lang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pranavan15/ballerina-lang/teams","hooks_url":"https://api.github.com/repos/pranavan15/ballerina-lang/hooks","issue_events_url":"https://api.github.com/repos/pranavan15/ballerina-lang/issues/events{/number}","events_url":"https://api.github.com/repos/pranavan15/ballerina-lang/events","assignees_url":"https://api.github.com/repos/pranavan15/ballerina-lang/assignees{/user}","branches_url":"https://api.github.com/repos/pranavan15/ballerina-lang/branches{/branch}","tags_url":"https://api.github.com/repos/pranavan15/ballerina-lang/tags","blobs_url":"https://api.github.com/repos/pranavan15/ballerina-lang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pranavan15/ballerina-lang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pranavan15/ballerina-lang/git/refs{/sha}","trees_url":"https://api.github.com/repos/pranavan15/ballerina-lang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pranavan15/ballerina-lang/statuses/{sha}","languages_url":"https://api.github.com/repos/pranavan15/ballerina-lang/languages","stargazers_url":"https://api.github.com/repos/pranavan15/ballerina-lang/stargazers","contributors_url":"https://api.github.com/repos/pranavan15/ballerina-lang/contributors","subscribers_url":"https://api.github.com/repos/pranavan15/ballerina-lang/subscribers","subscription_url":"https://api.github.com/repos/pranavan15/ballerina-lang/subscription","commits_url":"https://api.github.com/repos/pranavan15/ballerina-lang/commits{/sha}","git_commits_url":"https://api.github.com/repos/pranavan15/ballerina-lang/git/commits{/sha}","comments_url":"https://api.github.com/repos/pranavan15/ballerina-lang/comments{/number}","issue_comment_url":"https://api.github.com/repos/pranavan15/ballerina-lang/issues/comments{/number}","contents_url":"https://api.github.com/repos/pranavan15/ballerina-lang/contents/{+path}","compare_url":"https://api.github.com/repos/pranavan15/ballerina-lang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pranavan15/ballerina-lang/merges","archive_url":"https://api.github.com/repos/pranavan15/ballerina-lang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pranavan15/ballerina-lang/downloads","issues_url":"https://api.github.com/repos/pranavan15/ballerina-lang/issues{/number}","pulls_url":"https://api.github.com/repos/pranavan15/ballerina-lang/pulls{/number}","milestones_url":"https://api.github.com/repos/pranavan15/ballerina-lang/milestones{/number}","notifications_url":"https://api.github.com/repos/pranavan15/ballerina-lang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pranavan15/ballerina-lang/labels{/name}","releases_url":"https://api.github.com/repos/pranavan15/ballerina-lang/releases{/id}","deployments_url":"https://api.github.com/repos/pranavan15/ballerina-lang/deployments","created_at":"2018-07-12T08:33:31Z","updated_at":"2018-09-28T08:34:07Z","pushed_at":"2018-09-28T08:34:04Z","git_url":"git://github.com/pranavan15/ballerina-lang.git","ssh_url":"git@github.com:pranavan15/ballerina-lang.git","clone_url":"https://github.com/pranavan15/ballerina-lang.git","svn_url":"https://github.com/pranavan15/ballerina-lang","homepage":"","size":256525,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ballerina-platform:compilation-unit-path-change","ref":"compilation-unit-path-change","sha":"3a567518a4d291480d442fa99b233fbea257ec9c","user":{"login":"ballerina-platform","id":34733518,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NzMzNTE4","avatar_url":"https://avatars2.githubusercontent.com/u/34733518?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-platform","html_url":"https://github.com/ballerina-platform","followers_url":"https://api.github.com/users/ballerina-platform/followers","following_url":"https://api.github.com/users/ballerina-platform/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-platform/subscriptions","organizations_url":"https://api.github.com/users/ballerina-platform/orgs","repos_url":"https://api.github.com/users/ballerina-platform/repos","events_url":"https://api.github.com/users/ballerina-platform/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":73930305,"node_id":"MDEwOlJlcG9zaXRvcnk3MzkzMDMwNQ==","name":"ballerina-lang","full_name":"ballerina-platform/ballerina-lang","private":false,"owner":{"login":"ballerina-platform","id":34733518,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NzMzNTE4","avatar_url":"https://avatars2.githubusercontent.com/u/34733518?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-platform","html_url":"https://github.com/ballerina-platform","followers_url":"https://api.github.com/users/ballerina-platform/followers","following_url":"https://api.github.com/users/ballerina-platform/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-platform/subscriptions","organizations_url":"https://api.github.com/users/ballerina-platform/orgs","repos_url":"https://api.github.com/users/ballerina-platform/repos","events_url":"https://api.github.com/users/ballerina-platform/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-platform/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ballerina-platform/ballerina-lang","description":"Ballerina is a compiled, transactional, statically and strongly typed programming language with textual and graphical syntaxes.","fork":false,"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang","forks_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/forks","keys_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/teams","hooks_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/hooks","issue_events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/events{/number}","events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/events","assignees_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/assignees{/user}","branches_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/branches{/branch}","tags_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/tags","blobs_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/refs{/sha}","trees_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/{sha}","languages_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/languages","stargazers_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/stargazers","contributors_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/contributors","subscribers_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/subscribers","subscription_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/subscription","commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/commits{/sha}","git_commits_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/git/commits{/sha}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/comments{/number}","issue_comment_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/comments{/number}","contents_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/contents/{+path}","compare_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/merges","archive_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/downloads","issues_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues{/number}","pulls_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls{/number}","milestones_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/milestones{/number}","notifications_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/labels{/name}","releases_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/releases{/id}","deployments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/deployments","created_at":"2016-11-16T14:58:44Z","updated_at":"2018-09-28T13:24:03Z","pushed_at":"2018-09-28T15:38:36Z","git_url":"git://github.com/ballerina-platform/ballerina-lang.git","ssh_url":"git@github.com:ballerina-platform/ballerina-lang.git","clone_url":"https://github.com/ballerina-platform/ballerina-lang.git","svn_url":"https://github.com/ballerina-platform/ballerina-lang","homepage":"","size":255998,"stargazers_count":1345,"watchers_count":1345,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":395,"mirror_url":null,"archived":false,"open_issues_count":576,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":395,"open_issues":576,"watchers":1345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605"},"html":{"href":"https://github.com/ballerina-platform/ballerina-lang/pull/10605"},"issue":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10605"},"comments":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/10605/comments"},"review_comments":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605/comments"},"review_comment":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/pulls/10605/commits"},"statuses":{"href":"https://api.github.com/repos/ballerina-platform/ballerina-lang/statuses/c5eba0aedf030b29c856dc991171fb074cf778d8"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SupunS"}}