{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/comments/146861178","pull_request_review_id":71865818,"id":146861178,"diff_hunk":"@@ -81,12 +84,23 @@ private static void AnalyzeInvocation(OperationAnalysisContext context)\n                             preferredVariable.Name));\n                 }\n             }\n+\n+            bool ShouldAnalyzeArgument(IArgument arg) =>\n+                arg.ArgumentKind == ArgumentKind.DefaultValue && arg.Parameter != null;\n         }\n \n-        internal static IEnumerable<ISymbol> GetVariablesInScope(SyntaxNode syntaxNode, SemanticModel semanticModel) =>\n-            from symbol in semanticModel.LookupSymbols(syntaxNode.SpanStart)\n-            where symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Parameter\n-            select symbol;\n+        internal static IEnumerable<ISymbol> GetVariablesInScope(SyntaxNode syntaxNode, SemanticModel semanticModel)","path":"tools/Google.Cloud.Tools.Analyzers/InternalOptionalParametersRequiredAnalyzer.cs","position":36,"original_position":36,"commit_id":"d3428d85b490fa5c4a025df458ddd522bab1c243","original_commit_id":"d3428d85b490fa5c4a025df458ddd522bab1c243","user":{"login":"jskeet","id":17011,"avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false},"body":"Possibly rename to `GetUsableVariables` or similar? A variable is in scope from the start of the block that it's declared in, even before its declaration.\r\n\r\nThis is possibly the nit-pickiest code review comment I've ever made ;)","created_at":"2017-10-25T13:45:56Z","updated_at":"2017-10-25T13:46:05Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582#discussion_r146861178","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/comments/146861178"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582#discussion_r146861178"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582","id":148670791,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1582","number":1582,"state":"open","locked":false,"title":"Prevent optional parameter analyzer suggesting unassigned locals","user":{"login":"evildour","id":4014815,"avatar_url":"https://avatars2.githubusercontent.com/u/4014815?v=4","gravatar_id":"","url":"https://api.github.com/users/evildour","html_url":"https://github.com/evildour","followers_url":"https://api.github.com/users/evildour/followers","following_url":"https://api.github.com/users/evildour/following{/other_user}","gists_url":"https://api.github.com/users/evildour/gists{/gist_id}","starred_url":"https://api.github.com/users/evildour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildour/subscriptions","organizations_url":"https://api.github.com/users/evildour/orgs","repos_url":"https://api.github.com/users/evildour/repos","events_url":"https://api.github.com/users/evildour/events{/privacy}","received_events_url":"https://api.github.com/users/evildour/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-25T13:40:13Z","updated_at":"2017-10-25T13:46:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd994829e32639bed6d5d72e89ec63a62c56bfcc","assignee":{"login":"jskeet","id":17011,"avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false},"assignees":[{"login":"jskeet","id":17011,"avatar_url":"https://avatars1.githubusercontent.com/u/17011?v=4","gravatar_id":"","url":"https://api.github.com/users/jskeet","html_url":"https://github.com/jskeet","followers_url":"https://api.github.com/users/jskeet/followers","following_url":"https://api.github.com/users/jskeet/following{/other_user}","gists_url":"https://api.github.com/users/jskeet/gists{/gist_id}","starred_url":"https://api.github.com/users/jskeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskeet/subscriptions","organizations_url":"https://api.github.com/users/jskeet/orgs","repos_url":"https://api.github.com/users/jskeet/repos","events_url":"https://api.github.com/users/jskeet/events{/privacy}","received_events_url":"https://api.github.com/users/jskeet/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1582/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/statuses/d3428d85b490fa5c4a025df458ddd522bab1c243","head":{"label":"evildour:invalid-local-suggest-fix","ref":"invalid-local-suggest-fix","sha":"d3428d85b490fa5c4a025df458ddd522bab1c243","user":{"login":"evildour","id":4014815,"avatar_url":"https://avatars2.githubusercontent.com/u/4014815?v=4","gravatar_id":"","url":"https://api.github.com/users/evildour","html_url":"https://github.com/evildour","followers_url":"https://api.github.com/users/evildour/followers","following_url":"https://api.github.com/users/evildour/following{/other_user}","gists_url":"https://api.github.com/users/evildour/gists{/gist_id}","starred_url":"https://api.github.com/users/evildour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildour/subscriptions","organizations_url":"https://api.github.com/users/evildour/orgs","repos_url":"https://api.github.com/users/evildour/repos","events_url":"https://api.github.com/users/evildour/events{/privacy}","received_events_url":"https://api.github.com/users/evildour/received_events","type":"User","site_admin":false},"repo":{"id":62015644,"name":"google-cloud-dotnet","full_name":"evildour/google-cloud-dotnet","owner":{"login":"evildour","id":4014815,"avatar_url":"https://avatars2.githubusercontent.com/u/4014815?v=4","gravatar_id":"","url":"https://api.github.com/users/evildour","html_url":"https://github.com/evildour","followers_url":"https://api.github.com/users/evildour/followers","following_url":"https://api.github.com/users/evildour/following{/other_user}","gists_url":"https://api.github.com/users/evildour/gists{/gist_id}","starred_url":"https://api.github.com/users/evildour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evildour/subscriptions","organizations_url":"https://api.github.com/users/evildour/orgs","repos_url":"https://api.github.com/users/evildour/repos","events_url":"https://api.github.com/users/evildour/events{/privacy}","received_events_url":"https://api.github.com/users/evildour/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evildour/google-cloud-dotnet","description":"Google Cloud Client Library for .NET","fork":true,"url":"https://api.github.com/repos/evildour/google-cloud-dotnet","forks_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/forks","keys_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/teams","hooks_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/hooks","issue_events_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/events","assignees_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/tags","blobs_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/languages","stargazers_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/stargazers","contributors_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/contributors","subscribers_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/subscribers","subscription_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/subscription","commits_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/merges","archive_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/downloads","issues_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/evildour/google-cloud-dotnet/deployments","created_at":"2016-06-27T01:02:10Z","updated_at":"2016-10-24T18:27:48Z","pushed_at":"2017-10-25T13:37:08Z","git_url":"git://github.com/evildour/google-cloud-dotnet.git","ssh_url":"git@github.com:evildour/google-cloud-dotnet.git","clone_url":"https://github.com/evildour/google-cloud-dotnet.git","svn_url":"https://github.com/evildour/google-cloud-dotnet","homepage":null,"size":13945,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"25c93b6ab8c57baea4ee0874b62cf13427f388d2","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":35877412,"name":"google-cloud-dotnet","full_name":"GoogleCloudPlatform/google-cloud-dotnet","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet","description":"Google Cloud Client Libraries for .NET","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/deployments","created_at":"2015-05-19T11:14:02Z","updated_at":"2017-10-25T11:06:39Z","pushed_at":"2017-10-25T13:40:13Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-dotnet.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-dotnet.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet","homepage":"https://googlecloudplatform.github.io/google-cloud-dotnet/","size":40937,"stargazers_count":168,"watchers_count":168,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":66,"mirror_url":null,"archived":false,"open_issues_count":42,"forks":66,"open_issues":42,"watchers":168,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/pull/1582"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1582"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1582/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/pulls/1582/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/statuses/d3428d85b490fa5c4a025df458ddd522bab1c243"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jskeet"}}