{"action":"created","comment":{"url":"https://api.github.com/repos/atom/tree-view/pulls/comments/72758094","id":72758094,"diff_hunk":"@@ -67,3 +67,6 @@ class File\n \n   isPathEqual: (pathToCompare) ->\n     @path is pathToCompare or @realPath is pathToCompare\n+\n+  # Return a snapshot of the instance's filesystem properties for API consumption\n+  getMetadata: -> {@symlink, @realPath, @status, @stats}","path":"lib/file.coffee","position":6,"original_position":6,"commit_id":"38be0cba14d97bc5fd8c1e20855747b7d68521c1","original_commit_id":"38be0cba14d97bc5fd8c1e20855747b7d68521c1","user":{"login":"as-cii","id":482957,"avatar_url":"https://avatars.githubusercontent.com/u/482957?v=3","gravatar_id":"","url":"https://api.github.com/users/as-cii","html_url":"https://github.com/as-cii","followers_url":"https://api.github.com/users/as-cii/followers","following_url":"https://api.github.com/users/as-cii/following{/other_user}","gists_url":"https://api.github.com/users/as-cii/gists{/gist_id}","starred_url":"https://api.github.com/users/as-cii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/as-cii/subscriptions","organizations_url":"https://api.github.com/users/as-cii/orgs","repos_url":"https://api.github.com/users/as-cii/repos","events_url":"https://api.github.com/users/as-cii/events{/privacy}","received_events_url":"https://api.github.com/users/as-cii/received_events","type":"User","site_admin":true},"body":"> To be honest, I think we can probably justify having an extra filesystem call to return the missing info to stay consistent with tree-view's handling. Let's face it: there won't be nearly as many icon-displaying tabs as there will be icon-displaying file listings.\r\n\r\nThat's fair, although this feels like a clear indicator that this interface is inconsistent and more complex than it should need to be. I think we should try to design services in an elegant manner, so I am 👎 on passing different arguments based on the package, and I think we should issue `fs.stat` calls directly in the `FileIcons` service, delegating to it all the concerns about determining if a file is symlink and whatnot.\r\n\r\nThe only reasonable alternative I could think of (that doesn't involve a major redesign in Atom core) is to provide an alternative `iconClassForPath` method that returns a `Promise`, so that the UI thread never blocks and we can do whatever I/O is needed on that function. It would make the calling code a little more complex, but it's probably worth a try if performance-wise the file-icons package becomes a problem.","created_at":"2016-07-29T08:31:58Z","updated_at":"2016-07-29T08:31:58Z","html_url":"https://github.com/atom/tree-view/pull/825#discussion_r72758094","pull_request_url":"https://api.github.com/repos/atom/tree-view/pulls/825","_links":{"self":{"href":"https://api.github.com/repos/atom/tree-view/pulls/comments/72758094"},"html":{"href":"https://github.com/atom/tree-view/pull/825#discussion_r72758094"},"pull_request":{"href":"https://api.github.com/repos/atom/tree-view/pulls/825"}}},"pull_request":{"url":"https://api.github.com/repos/atom/tree-view/pulls/825","id":68417254,"html_url":"https://github.com/atom/tree-view/pull/825","diff_url":"https://github.com/atom/tree-view/pull/825.diff","patch_url":"https://github.com/atom/tree-view/pull/825.patch","issue_url":"https://api.github.com/repos/atom/tree-view/issues/825","number":825,"state":"open","locked":false,"title":"Allow file-icons service to set multiple class names","user":{"login":"Alhadis","id":2346707,"avatar_url":"https://avatars.githubusercontent.com/u/2346707?v=3","gravatar_id":"","url":"https://api.github.com/users/Alhadis","html_url":"https://github.com/Alhadis","followers_url":"https://api.github.com/users/Alhadis/followers","following_url":"https://api.github.com/users/Alhadis/following{/other_user}","gists_url":"https://api.github.com/users/Alhadis/gists{/gist_id}","starred_url":"https://api.github.com/users/Alhadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alhadis/subscriptions","organizations_url":"https://api.github.com/users/Alhadis/orgs","repos_url":"https://api.github.com/users/Alhadis/repos","events_url":"https://api.github.com/users/Alhadis/events{/privacy}","received_events_url":"https://api.github.com/users/Alhadis/received_events","type":"User","site_admin":false},"body":"Packages that provide the `atom.file-icons` service are currently limited to setting only one class name per file. This is because any attempt to add a DOMTokenList item with a whitespace character will trigger an exception, as per the spec.\r\n\r\nHowever, this is particularly limiting for packages that need flexibility. For example, the [File Icons](https://github.com/DanBrooker/file-icons) package will be adding two different classes: one for the icon, and another for its colour.\r\n\r\nI've amended the service consumption routine to allow a list of classes to be specified as either an array or a whitespace-delimited string (analogous to jQuery's approach).\r\n\r\nSo this:\r\n```js\r\nservice.iconClassForPath(\"gear-icon medium-orange\");\r\n```\r\n\r\nwill now lead to this:\r\n```html\r\n<span class=\"name icon gear-icon medium-orange\">\r\n```\r\n\r\n... instead of, well, this:\r\n<img src=\"https://cloud.githubusercontent.com/assets/2346707/14926664/8ca0248c-0e90-11e6-823e-c32042ec7e65.png\" width=\"487\" />","created_at":"2016-04-29T18:53:52Z","updated_at":"2016-07-29T08:31:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7651bce1f788bed169ccc37ad297954078af965","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/atom/tree-view/pulls/825/commits","review_comments_url":"https://api.github.com/repos/atom/tree-view/pulls/825/comments","review_comment_url":"https://api.github.com/repos/atom/tree-view/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/tree-view/issues/825/comments","statuses_url":"https://api.github.com/repos/atom/tree-view/statuses/38be0cba14d97bc5fd8c1e20855747b7d68521c1","head":{"label":"Alhadis:class-list-fix","ref":"class-list-fix","sha":"38be0cba14d97bc5fd8c1e20855747b7d68521c1","user":{"login":"Alhadis","id":2346707,"avatar_url":"https://avatars.githubusercontent.com/u/2346707?v=3","gravatar_id":"","url":"https://api.github.com/users/Alhadis","html_url":"https://github.com/Alhadis","followers_url":"https://api.github.com/users/Alhadis/followers","following_url":"https://api.github.com/users/Alhadis/following{/other_user}","gists_url":"https://api.github.com/users/Alhadis/gists{/gist_id}","starred_url":"https://api.github.com/users/Alhadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alhadis/subscriptions","organizations_url":"https://api.github.com/users/Alhadis/orgs","repos_url":"https://api.github.com/users/Alhadis/repos","events_url":"https://api.github.com/users/Alhadis/events{/privacy}","received_events_url":"https://api.github.com/users/Alhadis/received_events","type":"User","site_admin":false},"repo":{"id":57396477,"name":"tree-view","full_name":"Alhadis/tree-view","owner":{"login":"Alhadis","id":2346707,"avatar_url":"https://avatars.githubusercontent.com/u/2346707?v=3","gravatar_id":"","url":"https://api.github.com/users/Alhadis","html_url":"https://github.com/Alhadis","followers_url":"https://api.github.com/users/Alhadis/followers","following_url":"https://api.github.com/users/Alhadis/following{/other_user}","gists_url":"https://api.github.com/users/Alhadis/gists{/gist_id}","starred_url":"https://api.github.com/users/Alhadis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alhadis/subscriptions","organizations_url":"https://api.github.com/users/Alhadis/orgs","repos_url":"https://api.github.com/users/Alhadis/repos","events_url":"https://api.github.com/users/Alhadis/events{/privacy}","received_events_url":"https://api.github.com/users/Alhadis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Alhadis/tree-view","description":"Pull request: https://github.com/atom/tree-view/pull/825 (and #833, #859)","fork":true,"url":"https://api.github.com/repos/Alhadis/tree-view","forks_url":"https://api.github.com/repos/Alhadis/tree-view/forks","keys_url":"https://api.github.com/repos/Alhadis/tree-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alhadis/tree-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alhadis/tree-view/teams","hooks_url":"https://api.github.com/repos/Alhadis/tree-view/hooks","issue_events_url":"https://api.github.com/repos/Alhadis/tree-view/issues/events{/number}","events_url":"https://api.github.com/repos/Alhadis/tree-view/events","assignees_url":"https://api.github.com/repos/Alhadis/tree-view/assignees{/user}","branches_url":"https://api.github.com/repos/Alhadis/tree-view/branches{/branch}","tags_url":"https://api.github.com/repos/Alhadis/tree-view/tags","blobs_url":"https://api.github.com/repos/Alhadis/tree-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alhadis/tree-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alhadis/tree-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alhadis/tree-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alhadis/tree-view/statuses/{sha}","languages_url":"https://api.github.com/repos/Alhadis/tree-view/languages","stargazers_url":"https://api.github.com/repos/Alhadis/tree-view/stargazers","contributors_url":"https://api.github.com/repos/Alhadis/tree-view/contributors","subscribers_url":"https://api.github.com/repos/Alhadis/tree-view/subscribers","subscription_url":"https://api.github.com/repos/Alhadis/tree-view/subscription","commits_url":"https://api.github.com/repos/Alhadis/tree-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alhadis/tree-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alhadis/tree-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alhadis/tree-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alhadis/tree-view/contents/{+path}","compare_url":"https://api.github.com/repos/Alhadis/tree-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alhadis/tree-view/merges","archive_url":"https://api.github.com/repos/Alhadis/tree-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alhadis/tree-view/downloads","issues_url":"https://api.github.com/repos/Alhadis/tree-view/issues{/number}","pulls_url":"https://api.github.com/repos/Alhadis/tree-view/pulls{/number}","milestones_url":"https://api.github.com/repos/Alhadis/tree-view/milestones{/number}","notifications_url":"https://api.github.com/repos/Alhadis/tree-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alhadis/tree-view/labels{/name}","releases_url":"https://api.github.com/repos/Alhadis/tree-view/releases{/id}","deployments_url":"https://api.github.com/repos/Alhadis/tree-view/deployments","created_at":"2016-04-29T15:57:10Z","updated_at":"2016-06-11T11:43:46Z","pushed_at":"2016-07-25T13:31:48Z","git_url":"git://github.com/Alhadis/tree-view.git","ssh_url":"git@github.com:Alhadis/tree-view.git","clone_url":"https://github.com/Alhadis/tree-view.git","svn_url":"https://github.com/Alhadis/tree-view","homepage":"","size":1337,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"atom:master","ref":"master","sha":"21f4a44ec94571343f591898cde04e280a66d1e2","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":12089001,"name":"tree-view","full_name":"atom/tree-view","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/tree-view","description":"Explore and open project files in Atom","fork":false,"url":"https://api.github.com/repos/atom/tree-view","forks_url":"https://api.github.com/repos/atom/tree-view/forks","keys_url":"https://api.github.com/repos/atom/tree-view/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/tree-view/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/tree-view/teams","hooks_url":"https://api.github.com/repos/atom/tree-view/hooks","issue_events_url":"https://api.github.com/repos/atom/tree-view/issues/events{/number}","events_url":"https://api.github.com/repos/atom/tree-view/events","assignees_url":"https://api.github.com/repos/atom/tree-view/assignees{/user}","branches_url":"https://api.github.com/repos/atom/tree-view/branches{/branch}","tags_url":"https://api.github.com/repos/atom/tree-view/tags","blobs_url":"https://api.github.com/repos/atom/tree-view/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/tree-view/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/tree-view/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/tree-view/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/tree-view/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/tree-view/languages","stargazers_url":"https://api.github.com/repos/atom/tree-view/stargazers","contributors_url":"https://api.github.com/repos/atom/tree-view/contributors","subscribers_url":"https://api.github.com/repos/atom/tree-view/subscribers","subscription_url":"https://api.github.com/repos/atom/tree-view/subscription","commits_url":"https://api.github.com/repos/atom/tree-view/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/tree-view/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/tree-view/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/tree-view/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/tree-view/contents/{+path}","compare_url":"https://api.github.com/repos/atom/tree-view/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/tree-view/merges","archive_url":"https://api.github.com/repos/atom/tree-view/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/tree-view/downloads","issues_url":"https://api.github.com/repos/atom/tree-view/issues{/number}","pulls_url":"https://api.github.com/repos/atom/tree-view/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/tree-view/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/tree-view/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/tree-view/labels{/name}","releases_url":"https://api.github.com/repos/atom/tree-view/releases{/id}","deployments_url":"https://api.github.com/repos/atom/tree-view/deployments","created_at":"2013-08-13T18:17:54Z","updated_at":"2016-07-23T00:33:47Z","pushed_at":"2016-07-28T22:11:53Z","git_url":"git://github.com/atom/tree-view.git","ssh_url":"git@github.com:atom/tree-view.git","clone_url":"https://github.com/atom/tree-view.git","svn_url":"https://github.com/atom/tree-view","homepage":"","size":1794,"stargazers_count":249,"watchers_count":249,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":250,"forks":189,"open_issues":250,"watchers":249,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/tree-view/pulls/825"},"html":{"href":"https://github.com/atom/tree-view/pull/825"},"issue":{"href":"https://api.github.com/repos/atom/tree-view/issues/825"},"comments":{"href":"https://api.github.com/repos/atom/tree-view/issues/825/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/tree-view/pulls/825/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/tree-view/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/tree-view/pulls/825/commits"},"statuses":{"href":"https://api.github.com/repos/atom/tree-view/statuses/38be0cba14d97bc5fd8c1e20855747b7d68521c1"}}}}
{"actor":{"display_login":"as-cii"}}