{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/59481440","id":59481440,"diff_hunk":"@@ -0,0 +1,316 @@\n+﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+using Microsoft.CodeAnalysis.CodeActions;\n+using Microsoft.CodeAnalysis.CodeFixes;\n+using Microsoft.CodeAnalysis.CSharp.Syntax;\n+using Microsoft.CodeAnalysis.Shared.Extensions;\n+using System.Collections.Generic;\n+using System.Collections.Immutable;\n+using System.Composition;\n+using System.Diagnostics;\n+using System.Linq;\n+using System.Threading;\n+using System.Threading.Tasks;\n+\n+namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.AddParameterXmlDocumentation\n+{\n+    [ExportCodeFixProvider(LanguageNames.CSharp, Name = PredefinedCodeFixProviderNames.AddParameterXmlDocumentaion), Shared]\n+    internal partial class AddParameterXmlDocumentationCodeFixProvider : CodeFixProvider\n+    {\n+        // Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)\n+        private const string CS1573 = nameof(CS1573);\n+        // Type parameter 'type parameter' has no matching typeparam tag in the XML comment on 'type' (but other type parameters do)\n+        private const string CS1712 = nameof(CS1712);\n+\n+        public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(CS1573, CS1712);\n+\n+        public sealed override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;\n+\n+        private BaseParameterListSyntax FindFirstAncestorParameterItem(SyntaxNode node)\n+        {\n+            for (; node != null; node = node.Parent)\n+            {\n+                if (node is BaseMethodDeclarationSyntax)\n+                {\n+                    return ((BaseMethodDeclarationSyntax)node).ParameterList;\n+                }\n+                if (node is IndexerDeclarationSyntax)\n+                {\n+                    return ((IndexerDeclarationSyntax)node).ParameterList;\n+                }\n+                if (node is DelegateDeclarationSyntax)\n+                {\n+                    return ((DelegateDeclarationSyntax)node).ParameterList;\n+                }\n+            }\n+            return null;\n+        }\n+\n+        // Can't use the generic GetAncestor method because structs and classes can nest each other.\n+        private TypeParameterListSyntax FindFirstAncestorTypeParameterItem(SyntaxNode node)\n+        {\n+            for (; node != null; node = node.Parent)\n+            {\n+                if (node is MethodDeclarationSyntax)\n+                {\n+                    return ((MethodDeclarationSyntax)node).TypeParameterList;\n+                }\n+                if (node is ClassDeclarationSyntax)\n+                {\n+                    return ((ClassDeclarationSyntax)node).TypeParameterList;\n+                }\n+                if (node is StructDeclarationSyntax)\n+                {\n+                    return ((StructDeclarationSyntax)node).TypeParameterList;\n+                }\n+                if (node is InterfaceDeclarationSyntax)\n+                {\n+                    return ((InterfaceDeclarationSyntax)node).TypeParameterList;\n+                }\n+                if (node is DelegateDeclarationSyntax)\n+                {\n+                    return ((DelegateDeclarationSyntax)node).TypeParameterList;\n+                }","path":"src/Features/CSharp/Portable/CodeFixes/AddParameterXmlDocumentation/AddParameterXmlDocumentationCodeFixProvider.cs","position":73,"original_position":73,"commit_id":"119fc90dfc93d59b65e1c933e9aa3d460cce4e74","original_commit_id":"119fc90dfc93d59b65e1c933e9aa3d460cce4e74","user":{"login":"DustinCampbell","id":116161,"avatar_url":"https://avatars.githubusercontent.com/u/116161?v=3","gravatar_id":"","url":"https://api.github.com/users/DustinCampbell","html_url":"https://github.com/DustinCampbell","followers_url":"https://api.github.com/users/DustinCampbell/followers","following_url":"https://api.github.com/users/DustinCampbell/following{/other_user}","gists_url":"https://api.github.com/users/DustinCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/DustinCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DustinCampbell/subscriptions","organizations_url":"https://api.github.com/users/DustinCampbell/orgs","repos_url":"https://api.github.com/users/DustinCampbell/repos","events_url":"https://api.github.com/users/DustinCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/DustinCampbell/received_events","type":"User","site_admin":false},"body":"There is an existing extension method you can use for this: http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp.Workspaces/Extensions/MemberDeclarationSyntaxExtensions.cs,8c01aa4c9978cdbd","created_at":"2016-04-13T01:30:17Z","updated_at":"2016-04-13T01:30:17Z","html_url":"https://github.com/dotnet/roslyn/pull/10520#discussion_r59481440","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/10520","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/59481440"},"html":{"href":"https://github.com/dotnet/roslyn/pull/10520#discussion_r59481440"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/10520"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/10520","id":66249855,"html_url":"https://github.com/dotnet/roslyn/pull/10520","diff_url":"https://github.com/dotnet/roslyn/pull/10520.diff","patch_url":"https://github.com/dotnet/roslyn/pull/10520.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/10520","number":10520,"state":"open","locked":false,"title":"Add parameter xml documentation code fix provider [work in progress]","user":{"login":"3jr","id":1631450,"avatar_url":"https://avatars.githubusercontent.com/u/1631450?v=3","gravatar_id":"","url":"https://api.github.com/users/3jr","html_url":"https://github.com/3jr","followers_url":"https://api.github.com/users/3jr/followers","following_url":"https://api.github.com/users/3jr/following{/other_user}","gists_url":"https://api.github.com/users/3jr/gists{/gist_id}","starred_url":"https://api.github.com/users/3jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3jr/subscriptions","organizations_url":"https://api.github.com/users/3jr/orgs","repos_url":"https://api.github.com/users/3jr/repos","events_url":"https://api.github.com/users/3jr/events{/privacy}","received_events_url":"https://api.github.com/users/3jr/received_events","type":"User","site_admin":false},"body":"This is about #5611.\r\n\r\n###### Questions\r\n* I use the SyntaxExtensions [GetElementKind](http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Syntax/SyntaxExtensions.cs,a76a73b7059fb837) but it's internal  and in a different project. Currently I pretty much need this exact functionality. It's the only method that has  [XmlNameAttributeElementKind](http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Syntax/XmlNameAttributeElementKind.cs,7229a8a7617ccd8f) in its signature and XmlNameAttributeElementKind is public. How bad is the idea to make it part of the public API in the compiler layer?\r\n* Should we have the same CodeFixProvider for param and typeparam as I have now?\r\n  * Note: I even use the same EquivalenceKey for the resulting code action.\r\n\r\n###### TODO\r\n- [ ] `/** */` comments are handled incorrect! An idea and details in #5611.\r\n- [ ] I'm still working to get several occurrences fixed at once.\r\n- [ ] I need more unit tests for different things with parameters or type parametes  (e.g. delegates).\r\n- [ ] Small things and `// TODO` comments\r\n\r\n###### Marginal remarks\r\n* I copied some of the practices from the [HideBaseCodeFixProvider](http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp.Features/CodeFixes/HideBase/HideBaseCodeFixProvider.cs).\r\n* Performance: I don't really know. I think that it might not be so important as this only executes if the warning appears.\r\n* In the pull request #9246 the file src\\Features\\CSharp\\Portable\\CSharpFeaturesResources.resx changed which causes Visual Studio to change the ....Designer.cs (only the comments). That produced changes that don't belong here so I'll remove them before this PR becomes ready for review. Maybe someone should fix that (maybe not?). I would make a pull request if someone wants me to.\r\n* I'll squash all commits.\r\n* I'm new to programming things that have many other involved and are supposed to live a little longer. So I especially welcome critique/comments as my code may not be the result of taste but of ignorance.\r\n\r\n\r\n","created_at":"2016-04-13T00:31:31Z","updated_at":"2016-04-13T01:30:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b8b1ee3646b75e7ad8d71f9d28d50e9befa6130","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/10520/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/10520/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/10520/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/119fc90dfc93d59b65e1c933e9aa3d460cce4e74","head":{"label":"3jr:AddParameterXmlDocumentationCodeFixProvider","ref":"AddParameterXmlDocumentationCodeFixProvider","sha":"119fc90dfc93d59b65e1c933e9aa3d460cce4e74","user":{"login":"3jr","id":1631450,"avatar_url":"https://avatars.githubusercontent.com/u/1631450?v=3","gravatar_id":"","url":"https://api.github.com/users/3jr","html_url":"https://github.com/3jr","followers_url":"https://api.github.com/users/3jr/followers","following_url":"https://api.github.com/users/3jr/following{/other_user}","gists_url":"https://api.github.com/users/3jr/gists{/gist_id}","starred_url":"https://api.github.com/users/3jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3jr/subscriptions","organizations_url":"https://api.github.com/users/3jr/orgs","repos_url":"https://api.github.com/users/3jr/repos","events_url":"https://api.github.com/users/3jr/events{/privacy}","received_events_url":"https://api.github.com/users/3jr/received_events","type":"User","site_admin":false},"repo":{"id":55379153,"name":"roslyn","full_name":"3jr/roslyn","owner":{"login":"3jr","id":1631450,"avatar_url":"https://avatars.githubusercontent.com/u/1631450?v=3","gravatar_id":"","url":"https://api.github.com/users/3jr","html_url":"https://github.com/3jr","followers_url":"https://api.github.com/users/3jr/followers","following_url":"https://api.github.com/users/3jr/following{/other_user}","gists_url":"https://api.github.com/users/3jr/gists{/gist_id}","starred_url":"https://api.github.com/users/3jr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/3jr/subscriptions","organizations_url":"https://api.github.com/users/3jr/orgs","repos_url":"https://api.github.com/users/3jr/repos","events_url":"https://api.github.com/users/3jr/events{/privacy}","received_events_url":"https://api.github.com/users/3jr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/3jr/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/3jr/roslyn","forks_url":"https://api.github.com/repos/3jr/roslyn/forks","keys_url":"https://api.github.com/repos/3jr/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/3jr/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/3jr/roslyn/teams","hooks_url":"https://api.github.com/repos/3jr/roslyn/hooks","issue_events_url":"https://api.github.com/repos/3jr/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/3jr/roslyn/events","assignees_url":"https://api.github.com/repos/3jr/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/3jr/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/3jr/roslyn/tags","blobs_url":"https://api.github.com/repos/3jr/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/3jr/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/3jr/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/3jr/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/3jr/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/3jr/roslyn/languages","stargazers_url":"https://api.github.com/repos/3jr/roslyn/stargazers","contributors_url":"https://api.github.com/repos/3jr/roslyn/contributors","subscribers_url":"https://api.github.com/repos/3jr/roslyn/subscribers","subscription_url":"https://api.github.com/repos/3jr/roslyn/subscription","commits_url":"https://api.github.com/repos/3jr/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/3jr/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/3jr/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/3jr/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/3jr/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/3jr/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/3jr/roslyn/merges","archive_url":"https://api.github.com/repos/3jr/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/3jr/roslyn/downloads","issues_url":"https://api.github.com/repos/3jr/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/3jr/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/3jr/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/3jr/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/3jr/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/3jr/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/3jr/roslyn/deployments","created_at":"2016-04-04T01:55:38Z","updated_at":"2016-04-04T01:56:10Z","pushed_at":"2016-04-12T23:44:14Z","git_url":"git://github.com/3jr/roslyn.git","ssh_url":"git@github.com:3jr/roslyn.git","clone_url":"https://github.com/3jr/roslyn.git","svn_url":"https://github.com/3jr/roslyn","homepage":"","size":155643,"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":"69233e8c3159b9f59ed955b565c2a979b8aa1f10","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}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-04-12T17:29:23Z","pushed_at":"2016-04-13T01:24:51Z","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":215927,"stargazers_count":4867,"watchers_count":4867,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1227,"mirror_url":null,"open_issues_count":2647,"forks":1227,"open_issues":2647,"watchers":4867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/10520"},"html":{"href":"https://github.com/dotnet/roslyn/pull/10520"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/10520"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/10520/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/10520/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/10520/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/119fc90dfc93d59b65e1c933e9aa3d460cce4e74"}}}}