GitHub PullRequestReviewCommentEvent at 2014-09-15 22:11:50
Repository: TypeScript
Actor: DanielRosenwasser
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/17572398","id":17572398,"diff_hunk":"@@ -1817,34 +1884,23 @@ module ts {\n \r\n                 // Object literal expression, look up possible property names from contextual type\r\n                 if (containingObjectLiteral) {\r\n-                    var searchPosition = Math.min(position, TypeScript.end(containingObjectLiteral));\r\n-                    var path = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, searchPosition);\r\n-                    // Get the object literal node\r\n+                    var objectLiteral = mappedNode.kind === SyntaxKind.ObjectLiteral ? <ObjectLiteral>mappedNode : <ObjectLiteral>getAncestor(mappedNode, SyntaxKind.ObjectLiteral);\r\n \r\n-                    while (node && node.kind() !== TypeScript.SyntaxKind.ObjectLiteralExpression) {\r\n-                        node = node.parent;\r\n-                    }\r\n-\r\n-                    if (!node || node.kind() !== TypeScript.SyntaxKind.ObjectLiteralExpression) {\r\n-                        // AST Path look up did not result in the same node as Fidelity Syntax Tree look up.\r\n-                        // Once we remove AST this will no longer be a problem.\r\n-                        return null;\r\n-                    }\r\n+                    Debug.assert(objectLiteral);\r\n \r\n                     isMemberCompletion = true;\r\n \r\n-                    //// Try to get the object members form contextual typing\r\n-                    //var contextualMembers = compiler.getContextualMembersFromAST(node, document);\r\n-                    //if (contextualMembers && contextualMembers.symbols && contextualMembers.symbols.length > 0) {\r\n-                    //    // get existing members\r\n-                    //    var existingMembers = compiler.getVisibleMemberSymbolsFromAST(node, document);\r\n+                    var contextualType = typeInfoResolver.getContextualType(objectLiteral);\r\n+                    if (!contextualType) {\r\n+                        return undefined;\r\n+                    }\r\n \r\n-                    //    // Add filtterd items to the completion list\r\n-                    //    getCompletionEntriesFromSymbols({\r\n-                    //        symbols: filterContextualMembersList(contextualMembers.symbols, existingMembers, filename, position),\r\n-                    //        enclosingScopeSymbol: contextualMembers.enclosingScopeSymbol\r\n-                    //    }, entries);\r\n-                    //}\r\n+                    var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);\r\n+                    if (contextualTypeMembers && contextualTypeMembers.length > 0) {\r\n+                        // Add filtterd items to the completion list\r","path":"src/services/services.ts","position":186,"original_position":186,"commit_id":"511c0769ff2ac177b8fb6b00b93a5a66ad700c88","original_commit_id":"511c0769ff2ac177b8fb6b00b93a5a66ad700c88","user":{"login":"DanielRosenwasser","id":972891,"avatar_url":"https://avatars.githubusercontent.com/u/972891?v=2","gravatar_id":"a0600a1c0b04a206e787fb5a29038d3a","url":"https://api.github.com/users/DanielRosenwasser","html_url":"https://github.com/DanielRosenwasser","followers_url":"https://api.github.com/users/DanielRosenwasser/followers","following_url":"https://api.github.com/users/DanielRosenwasser/following{/other_user}","gists_url":"https://api.github.com/users/DanielRosenwasser/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielRosenwasser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielRosenwasser/subscriptions","organizations_url":"https://api.github.com/users/DanielRosenwasser/orgs","repos_url":"https://api.github.com/users/DanielRosenwasser/repos","events_url":"https://api.github.com/users/DanielRosenwasser/events{/privacy}","received_events_url":"https://api.github.com/users/DanielRosenwasser/received_events","type":"User","site_admin":false},"body":"Correct to \"filtered\".","created_at":"2014-09-15T22:11:50Z","updated_at":"2014-09-15T22:11:50Z","html_url":"https://github.com/Microsoft/TypeScript/pull/676#discussion_r17572398","pull_request_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/17572398"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/676#discussion_r17572398"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676","id":21260799,"html_url":"https://github.com/Microsoft/TypeScript/pull/676","diff_url":"https://github.com/Microsoft/TypeScript/pull/676.diff","patch_url":"https://github.com/Microsoft/TypeScript/pull/676.patch","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/676","number":676,"state":"open","locked":false,"title":"Completion fixes","user":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=2","gravatar_id":"17e2da9785d45119a4c4cfed99e40d9c","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"body":"Cleaning up some rough edges with completion list:\r\n* completion on call/new expressions\r\n* completions in type positions\r\n* completions on module exports\r\n* filtering private member completions based on location\r\n* disable completion list in with blocks\r\n* completion for object literal property names based on contextual type\r\n* completions before keywords\r\n\r\nThere changes were driven by tests, so tests were all enabled in the beginning. sorry if this makes it harder to review changes.\r\n","created_at":"2014-09-15T21:04:41Z","updated_at":"2014-09-15T22:11:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7aaa06ae5f5d99d904a595a7642a4ff926214d8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676/commits","review_comments_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676/comments","review_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/676/comments","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/511c0769ff2ac177b8fb6b00b93a5a66ad700c88","head":{"label":"Microsoft:completionFixes","ref":"completionFixes","sha":"511c0769ff2ac177b8fb6b00b93a5a66ad700c88","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-09-15T17:17:36Z","pushed_at":"2014-09-15T21:00:42Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":88388,"stargazers_count":2106,"watchers_count":2106,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":197,"forks":153,"open_issues":197,"watchers":2106,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"11b9118cab321ae81b528f6aee7668154bda8a8e","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":20929025,"name":"TypeScript","full_name":"Microsoft/TypeScript","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=2","gravatar_id":"7d3b0469b6f73dd41ed7de7931e44510","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/TypeScript","description":"TypeScript is a superset of JavaScript that compiles to clean JavaScript output.","fork":false,"url":"https://api.github.com/repos/Microsoft/TypeScript","forks_url":"https://api.github.com/repos/Microsoft/TypeScript/forks","keys_url":"https://api.github.com/repos/Microsoft/TypeScript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/TypeScript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/TypeScript/teams","hooks_url":"https://api.github.com/repos/Microsoft/TypeScript/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/TypeScript/events","assignees_url":"https://api.github.com/repos/Microsoft/TypeScript/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/TypeScript/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/TypeScript/tags","blobs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/TypeScript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/TypeScript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/TypeScript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/TypeScript/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/TypeScript/languages","stargazers_url":"https://api.github.com/repos/Microsoft/TypeScript/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/TypeScript/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/TypeScript/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/TypeScript/subscription","commits_url":"https://api.github.com/repos/Microsoft/TypeScript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/TypeScript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/{number}","contents_url":"https://api.github.com/repos/Microsoft/TypeScript/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/TypeScript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/TypeScript/merges","archive_url":"https://api.github.com/repos/Microsoft/TypeScript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/TypeScript/downloads","issues_url":"https://api.github.com/repos/Microsoft/TypeScript/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/TypeScript/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/TypeScript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/TypeScript/releases{/id}","created_at":"2014-06-17T15:28:39Z","updated_at":"2014-09-15T17:17:36Z","pushed_at":"2014-09-15T21:00:42Z","git_url":"git://github.com/Microsoft/TypeScript.git","ssh_url":"git@github.com:Microsoft/TypeScript.git","clone_url":"https://github.com/Microsoft/TypeScript.git","svn_url":"https://github.com/Microsoft/TypeScript","homepage":"http://www.typescriptlang.org","size":88388,"stargazers_count":2106,"watchers_count":2106,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":197,"forks":153,"open_issues":197,"watchers":2106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676"},"html":{"href":"https://github.com/Microsoft/TypeScript/pull/676"},"issue":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/676"},"comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/issues/676/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/TypeScript/pulls/676/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/TypeScript/statuses/511c0769ff2ac177b8fb6b00b93a5a66ad700c88"}}}}