{"action":"created","comment":{"url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/comments/74649956","id":74649956,"diff_hunk":"@@ -38,3 +46,206 @@ export class DocumentDescriptor implements Descriptor {\n     return this.document.url;\n   }\n }\n+\n+export interface Feature {\n+  kinds: Iterable<string>;\n+  identifiers?: Iterable<string>;\n+  // sourceLocation: SourceLocation;\n+}\n+\n+\n+export interface Resolvable extends ScannedFeature {\n+  resolve(document: Document): Feature;\n+}\n+function isResolvable(x: any): x is Resolvable {\n+  return x.resolve && typeof x.resolve === 'function';\n+}\n+\n+export class Document implements Feature {\n+  url: string;\n+  parsedDocument: ParsedDocument<any, any>;\n+  isInline: boolean;\n+\n+  kinds: Iterable<string>;\n+  identifiers: Set<string>;\n+\n+  private _rootDocument: Document;\n+  // Should be able to emulate this once every Feature has a SourceLocation by\n+  // just filtering out by feature.sourceLocation.file === this.url;\n+  private _localFeatures = new Set<Feature>();\n+\n+  static makeRootDocument(scannedDocument: ScannedDocument): Document {\n+    const result = new Document(scannedDocument);","path":"src/ast/document-descriptor.ts","position":73,"original_position":73,"commit_id":"1f48efafd771db2187b7beca55f07fd4d7c22d96","original_commit_id":"1f48efafd771db2187b7beca55f07fd4d7c22d96","user":{"login":"rictic","id":1659,"avatar_url":"https://avatars.githubusercontent.com/u/1659?v=3","gravatar_id":"","url":"https://api.github.com/users/rictic","html_url":"https://github.com/rictic","followers_url":"https://api.github.com/users/rictic/followers","following_url":"https://api.github.com/users/rictic/following{/other_user}","gists_url":"https://api.github.com/users/rictic/gists{/gist_id}","starred_url":"https://api.github.com/users/rictic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rictic/subscriptions","organizations_url":"https://api.github.com/users/rictic/orgs","repos_url":"https://api.github.com/users/rictic/repos","events_url":"https://api.github.com/users/rictic/events{/privacy}","received_events_url":"https://api.github.com/users/rictic/received_events","type":"User","site_admin":false},"body":"Not at computer to add comment but this is to resolve import cycles that include the root document.","created_at":"2016-08-12T19:44:43Z","updated_at":"2016-08-12T19:44:43Z","html_url":"https://github.com/Polymer/polymer-analyzer/pull/283#discussion_r74649956","pull_request_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283","_links":{"self":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/comments/74649956"},"html":{"href":"https://github.com/Polymer/polymer-analyzer/pull/283#discussion_r74649956"},"pull_request":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283","id":81051943,"html_url":"https://github.com/Polymer/polymer-analyzer/pull/283","diff_url":"https://github.com/Polymer/polymer-analyzer/pull/283.diff","patch_url":"https://github.com/Polymer/polymer-analyzer/pull/283.patch","issue_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/283","number":283,"state":"open","locked":false,"title":"The mega redesign PR","user":{"login":"rictic","id":1659,"avatar_url":"https://avatars.githubusercontent.com/u/1659?v=3","gravatar_id":"","url":"https://api.github.com/users/rictic","html_url":"https://github.com/rictic","followers_url":"https://api.github.com/users/rictic/followers","following_url":"https://api.github.com/users/rictic/following{/other_user}","gists_url":"https://api.github.com/users/rictic/gists{/gist_id}","starred_url":"https://api.github.com/users/rictic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rictic/subscriptions","organizations_url":"https://api.github.com/users/rictic/orgs","repos_url":"https://api.github.com/users/rictic/repos","events_url":"https://api.github.com/users/rictic/events{/privacy}","received_events_url":"https://api.github.com/users/rictic/received_events","type":"User","site_admin":false},"body":"After this the public API of the project should be more or less set.\r\n\r\nThe main known issues:\r\n* things aren't in their correct files. There was so much upheaval in this PR, and github's move detection isn't the best. IMO we should do a followup PR to get things into more reasonable files. (e.g. the only reference to the term `descriptor` in the codebase now is in filenames).\r\n* documentation is not up to snuff. I'll be sending follow on commits into this PR to add documentation. yelling about the worst spots appreciated!\r\n* three tests that are currently set to skip:\r\n  * extracting polymer elements as es6 classes is mostly disabled. the code was over-sensitive and started firing for vanilla elements. we need to rewrite that anyways, as it's not robust\r\n  * two tests in the elements.json generation, because Analysis handled package directories and the new Document-centric api doesn't, so that needs some thinking\r\n* After a lot of floundering I completely stopped trying to optimize Document and just focused on getting something that's correct. At the moment every resolved feature lookup is O(N) on the total number of features, and the constant isn't very small. Recursive tree walk with lots of set construction and for-of iterable walking. Without telemetry though it's hard to say whether that's a problem.\r\n","created_at":"2016-08-12T00:17:42Z","updated_at":"2016-08-12T19:44:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0519319f6161349fa8920134b798a2648fd5592","assignee":{"login":"justinfagnani","id":522948,"avatar_url":"https://avatars.githubusercontent.com/u/522948?v=3","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},"assignees":[{"login":"justinfagnani","id":522948,"avatar_url":"https://avatars.githubusercontent.com/u/522948?v=3","gravatar_id":"","url":"https://api.github.com/users/justinfagnani","html_url":"https://github.com/justinfagnani","followers_url":"https://api.github.com/users/justinfagnani/followers","following_url":"https://api.github.com/users/justinfagnani/following{/other_user}","gists_url":"https://api.github.com/users/justinfagnani/gists{/gist_id}","starred_url":"https://api.github.com/users/justinfagnani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinfagnani/subscriptions","organizations_url":"https://api.github.com/users/justinfagnani/orgs","repos_url":"https://api.github.com/users/justinfagnani/repos","events_url":"https://api.github.com/users/justinfagnani/events{/privacy}","received_events_url":"https://api.github.com/users/justinfagnani/received_events","type":"User","site_admin":false},{"login":"FredKSchott","id":622227,"avatar_url":"https://avatars.githubusercontent.com/u/622227?v=3","gravatar_id":"","url":"https://api.github.com/users/FredKSchott","html_url":"https://github.com/FredKSchott","followers_url":"https://api.github.com/users/FredKSchott/followers","following_url":"https://api.github.com/users/FredKSchott/following{/other_user}","gists_url":"https://api.github.com/users/FredKSchott/gists{/gist_id}","starred_url":"https://api.github.com/users/FredKSchott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredKSchott/subscriptions","organizations_url":"https://api.github.com/users/FredKSchott/orgs","repos_url":"https://api.github.com/users/FredKSchott/repos","events_url":"https://api.github.com/users/FredKSchott/events{/privacy}","received_events_url":"https://api.github.com/users/FredKSchott/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283/commits","review_comments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283/comments","review_comment_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/283/comments","statuses_url":"https://api.github.com/repos/Polymer/polymer-analyzer/statuses/1f48efafd771db2187b7beca55f07fd4d7c22d96","head":{"label":"Polymer:renaming","ref":"renaming","sha":"1f48efafd771db2187b7beca55f07fd4d7c22d96","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":30035812,"name":"polymer-analyzer","full_name":"Polymer/polymer-analyzer","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/polymer-analyzer","description":"A utility for analyzing polymer elements.","fork":false,"url":"https://api.github.com/repos/Polymer/polymer-analyzer","forks_url":"https://api.github.com/repos/Polymer/polymer-analyzer/forks","keys_url":"https://api.github.com/repos/Polymer/polymer-analyzer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/polymer-analyzer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/polymer-analyzer/teams","hooks_url":"https://api.github.com/repos/Polymer/polymer-analyzer/hooks","issue_events_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/polymer-analyzer/events","assignees_url":"https://api.github.com/repos/Polymer/polymer-analyzer/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/polymer-analyzer/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/polymer-analyzer/tags","blobs_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/polymer-analyzer/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/polymer-analyzer/languages","stargazers_url":"https://api.github.com/repos/Polymer/polymer-analyzer/stargazers","contributors_url":"https://api.github.com/repos/Polymer/polymer-analyzer/contributors","subscribers_url":"https://api.github.com/repos/Polymer/polymer-analyzer/subscribers","subscription_url":"https://api.github.com/repos/Polymer/polymer-analyzer/subscription","commits_url":"https://api.github.com/repos/Polymer/polymer-analyzer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/polymer-analyzer/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/polymer-analyzer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/polymer-analyzer/merges","archive_url":"https://api.github.com/repos/Polymer/polymer-analyzer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/polymer-analyzer/downloads","issues_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/polymer-analyzer/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/polymer-analyzer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/polymer-analyzer/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/polymer-analyzer/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/deployments","created_at":"2015-01-29T18:56:38Z","updated_at":"2016-08-08T06:53:11Z","pushed_at":"2016-08-12T00:17:42Z","git_url":"git://github.com/Polymer/polymer-analyzer.git","ssh_url":"git@github.com:Polymer/polymer-analyzer.git","clone_url":"https://github.com/Polymer/polymer-analyzer.git","svn_url":"https://github.com/Polymer/polymer-analyzer","homepage":"","size":29782,"stargazers_count":83,"watchers_count":83,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":46,"forks":37,"open_issues":46,"watchers":83,"default_branch":"master"}},"base":{"label":"Polymer:master","ref":"master","sha":"274e7cc09364d2bb218496001ac04b8d18b3a642","user":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"repo":{"id":30035812,"name":"polymer-analyzer","full_name":"Polymer/polymer-analyzer","owner":{"login":"Polymer","id":2159051,"avatar_url":"https://avatars.githubusercontent.com/u/2159051?v=3","gravatar_id":"","url":"https://api.github.com/users/Polymer","html_url":"https://github.com/Polymer","followers_url":"https://api.github.com/users/Polymer/followers","following_url":"https://api.github.com/users/Polymer/following{/other_user}","gists_url":"https://api.github.com/users/Polymer/gists{/gist_id}","starred_url":"https://api.github.com/users/Polymer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Polymer/subscriptions","organizations_url":"https://api.github.com/users/Polymer/orgs","repos_url":"https://api.github.com/users/Polymer/repos","events_url":"https://api.github.com/users/Polymer/events{/privacy}","received_events_url":"https://api.github.com/users/Polymer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Polymer/polymer-analyzer","description":"A utility for analyzing polymer elements.","fork":false,"url":"https://api.github.com/repos/Polymer/polymer-analyzer","forks_url":"https://api.github.com/repos/Polymer/polymer-analyzer/forks","keys_url":"https://api.github.com/repos/Polymer/polymer-analyzer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Polymer/polymer-analyzer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Polymer/polymer-analyzer/teams","hooks_url":"https://api.github.com/repos/Polymer/polymer-analyzer/hooks","issue_events_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/events{/number}","events_url":"https://api.github.com/repos/Polymer/polymer-analyzer/events","assignees_url":"https://api.github.com/repos/Polymer/polymer-analyzer/assignees{/user}","branches_url":"https://api.github.com/repos/Polymer/polymer-analyzer/branches{/branch}","tags_url":"https://api.github.com/repos/Polymer/polymer-analyzer/tags","blobs_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Polymer/polymer-analyzer/statuses/{sha}","languages_url":"https://api.github.com/repos/Polymer/polymer-analyzer/languages","stargazers_url":"https://api.github.com/repos/Polymer/polymer-analyzer/stargazers","contributors_url":"https://api.github.com/repos/Polymer/polymer-analyzer/contributors","subscribers_url":"https://api.github.com/repos/Polymer/polymer-analyzer/subscribers","subscription_url":"https://api.github.com/repos/Polymer/polymer-analyzer/subscription","commits_url":"https://api.github.com/repos/Polymer/polymer-analyzer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Polymer/polymer-analyzer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Polymer/polymer-analyzer/contents/{+path}","compare_url":"https://api.github.com/repos/Polymer/polymer-analyzer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Polymer/polymer-analyzer/merges","archive_url":"https://api.github.com/repos/Polymer/polymer-analyzer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Polymer/polymer-analyzer/downloads","issues_url":"https://api.github.com/repos/Polymer/polymer-analyzer/issues{/number}","pulls_url":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls{/number}","milestones_url":"https://api.github.com/repos/Polymer/polymer-analyzer/milestones{/number}","notifications_url":"https://api.github.com/repos/Polymer/polymer-analyzer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Polymer/polymer-analyzer/labels{/name}","releases_url":"https://api.github.com/repos/Polymer/polymer-analyzer/releases{/id}","deployments_url":"https://api.github.com/repos/Polymer/polymer-analyzer/deployments","created_at":"2015-01-29T18:56:38Z","updated_at":"2016-08-08T06:53:11Z","pushed_at":"2016-08-12T00:17:42Z","git_url":"git://github.com/Polymer/polymer-analyzer.git","ssh_url":"git@github.com:Polymer/polymer-analyzer.git","clone_url":"https://github.com/Polymer/polymer-analyzer.git","svn_url":"https://github.com/Polymer/polymer-analyzer","homepage":"","size":29782,"stargazers_count":83,"watchers_count":83,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":46,"forks":37,"open_issues":46,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283"},"html":{"href":"https://github.com/Polymer/polymer-analyzer/pull/283"},"issue":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/283"},"comments":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/Polymer/polymer-analyzer/statuses/1f48efafd771db2187b7beca55f07fd4d7c22d96"}}}}
{"actor":{"display_login":"rictic"}}