{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/29343486","id":29343486,"diff_hunk":"@@ -2117,71 +2117,18 @@ public static bool IsLabelContext(this SyntaxTree syntaxTree, int position, Canc\n         public static bool IsNameOfContext(this SyntaxTree syntaxTree, int position, SemanticModel semanticModelOpt = null, CancellationToken cancellationToken = default(CancellationToken))\n         {\n             var token = syntaxTree.FindTokenOnLeftOfPosition(position, cancellationToken);\n-            token = token.GetPreviousTokenIfTouchingWord(position);\n \n-            // nameof(Foo.|\n-            // nameof(Foo.Bar.|\n-            // Locate the open paren.\n-            if (token.IsKind(SyntaxKind.DotToken))\n-            {\n-                // Could have been parsed as member access\n-                if (token.Parent.IsKind(SyntaxKind.SimpleMemberAccessExpression))\n-                {\n-                    var parentMemberAccess = token.Parent;\n-                    while (parentMemberAccess.IsParentKind(SyntaxKind.SimpleMemberAccessExpression))\n-                    {\n-                        parentMemberAccess = parentMemberAccess.Parent;\n-                    }\n-\n-                    if (parentMemberAccess.IsParentKind(SyntaxKind.Argument) &&\n-                        parentMemberAccess.Parent.IsChildNode<ArgumentListSyntax>(a => a.Arguments.FirstOrDefault()))\n-                    {\n-                        token = ((ArgumentListSyntax)parentMemberAccess.Parent.Parent).OpenParenToken;\n-                    }\n-                }\n+            \n \n-                // Could have been parsed as a qualified name.\n-                if (token.Parent.IsKind(SyntaxKind.QualifiedName))\n-                {\n-                    var parentQualifiedName = token.Parent;\n-                    while (parentQualifiedName.IsParentKind(SyntaxKind.QualifiedName))\n-                    {\n-                        parentQualifiedName = parentQualifiedName.Parent;\n-                    }\n+            var invocationExpression = token.GetAncestor(a => a.IsKind(SyntaxKind.InvocationExpression)) as InvocationExpressionSyntax;","path":"src/Workspaces/CSharp/Portable/Extensions/ContextQuery/SyntaxTreeExtensions.cs","position":36,"original_position":36,"commit_id":"c45e97a6a33075dceb7460a082911d38bc4138d9","original_commit_id":"c45e97a6a33075dceb7460a082911d38bc4138d9","user":{"login":"Pilchie","id":312835,"avatar_url":"https://avatars.githubusercontent.com/u/312835?v=3","gravatar_id":"","url":"https://api.github.com/users/Pilchie","html_url":"https://github.com/Pilchie","followers_url":"https://api.github.com/users/Pilchie/followers","following_url":"https://api.github.com/users/Pilchie/following{/other_user}","gists_url":"https://api.github.com/users/Pilchie/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilchie/subscriptions","organizations_url":"https://api.github.com/users/Pilchie/orgs","repos_url":"https://api.github.com/users/Pilchie/repos","events_url":"https://api.github.com/users/Pilchie/events{/privacy}","received_events_url":"https://api.github.com/users/Pilchie/received_events","type":"User","site_admin":false},"body":"Using `GetAncestor` here will walk up through lambda's into containing syntax that has `nameof`.  Is that okay? E.g. `nameof(a => { return 3; });` will be true inside the lambda body.","created_at":"2015-04-29T14:54:31Z","updated_at":"2015-04-29T14:54:31Z","html_url":"https://github.com/dotnet/roslyn/pull/2359#discussion_r29343486","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2359","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/29343486"},"html":{"href":"https://github.com/dotnet/roslyn/pull/2359#discussion_r29343486"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2359"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/2359","id":34368327,"html_url":"https://github.com/dotnet/roslyn/pull/2359","diff_url":"https://github.com/dotnet/roslyn/pull/2359.diff","patch_url":"https://github.com/dotnet/roslyn/pull/2359.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/2359","number":2359,"state":"open","locked":false,"title":"Update C# IsNameOfContext Extension","user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"body":"Fixes #1439\r\n\r\nC#'s version of IsNameOfContext was written against a previous compiler\r\nimplementation of nameof in which the expression. Now, we only need to\r\ncheck whether the nearest containing invocation expression is an\r\nunqualified invocation of \"nameof\" that doesn't bind to anything.","created_at":"2015-04-29T14:29:07Z","updated_at":"2015-04-29T14:54:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc98764773d8abb85e6ff642f7e0d0f03d9bf267","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2359/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/2359/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2359/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/c45e97a6a33075dceb7460a082911d38bc4138d9","head":{"label":"dpoeschl:IsNameOfContextFix","ref":"IsNameOfContextFix","sha":"c45e97a6a33075dceb7460a082911d38bc4138d9","user":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"repo":{"id":30046829,"name":"roslyn","full_name":"dpoeschl/roslyn","owner":{"login":"dpoeschl","id":235241,"avatar_url":"https://avatars.githubusercontent.com/u/235241?v=3","gravatar_id":"","url":"https://api.github.com/users/dpoeschl","html_url":"https://github.com/dpoeschl","followers_url":"https://api.github.com/users/dpoeschl/followers","following_url":"https://api.github.com/users/dpoeschl/following{/other_user}","gists_url":"https://api.github.com/users/dpoeschl/gists{/gist_id}","starred_url":"https://api.github.com/users/dpoeschl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpoeschl/subscriptions","organizations_url":"https://api.github.com/users/dpoeschl/orgs","repos_url":"https://api.github.com/users/dpoeschl/repos","events_url":"https://api.github.com/users/dpoeschl/events{/privacy}","received_events_url":"https://api.github.com/users/dpoeschl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dpoeschl/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/dpoeschl/roslyn","forks_url":"https://api.github.com/repos/dpoeschl/roslyn/forks","keys_url":"https://api.github.com/repos/dpoeschl/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpoeschl/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpoeschl/roslyn/teams","hooks_url":"https://api.github.com/repos/dpoeschl/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dpoeschl/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dpoeschl/roslyn/events","assignees_url":"https://api.github.com/repos/dpoeschl/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dpoeschl/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dpoeschl/roslyn/tags","blobs_url":"https://api.github.com/repos/dpoeschl/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpoeschl/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpoeschl/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpoeschl/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpoeschl/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dpoeschl/roslyn/languages","stargazers_url":"https://api.github.com/repos/dpoeschl/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dpoeschl/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dpoeschl/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dpoeschl/roslyn/subscription","commits_url":"https://api.github.com/repos/dpoeschl/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpoeschl/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpoeschl/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpoeschl/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpoeschl/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dpoeschl/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpoeschl/roslyn/merges","archive_url":"https://api.github.com/repos/dpoeschl/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpoeschl/roslyn/downloads","issues_url":"https://api.github.com/repos/dpoeschl/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dpoeschl/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dpoeschl/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dpoeschl/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpoeschl/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dpoeschl/roslyn/releases{/id}","created_at":"2015-01-29T23:37:29Z","updated_at":"2015-03-18T18:28:52Z","pushed_at":"2015-04-29T14:30:02Z","git_url":"git://github.com/dpoeschl/roslyn.git","ssh_url":"git@github.com:dpoeschl/roslyn.git","clone_url":"https://github.com/dpoeschl/roslyn.git","svn_url":"https://github.com/dpoeschl/roslyn","homepage":"","size":67993,"stargazers_count":0,"watchers_count":0,"language":"C#","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":"dotnet:master","ref":"master","sha":"80b0d828f4a0a1727a5141620b15412965e52979","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":29078997,"name":"roslyn","full_name":"dotnet/roslyn","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","created_at":"2015-01-11T02:39:03Z","updated_at":"2015-04-29T14:28:04Z","pushed_at":"2015-04-29T14:29:07Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":118352,"stargazers_count":2037,"watchers_count":2037,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":437,"mirror_url":null,"open_issues_count":750,"forks":437,"open_issues":750,"watchers":2037,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2359"},"html":{"href":"https://github.com/dotnet/roslyn/pull/2359"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/2359"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/2359/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2359/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/2359/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/c45e97a6a33075dceb7460a082911d38bc4138d9"}}}}