{"action":"created","comment":{"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments/173189019","pull_request_review_id":102336075,"id":173189019,"diff_hunk":"@@ -0,0 +1,57 @@\n+﻿using System;\r\n+using System.Collections.Generic;\r\n+using System.Collections.Immutable;\r\n+using System.Linq;\r\n+using System.Text;\r\n+using System.Threading;\r\n+using System.Threading.Tasks;\r\n+using Microsoft.CodeAnalysis;\r\n+using Microsoft.CodeAnalysis.CodeActions;\r\n+using Microsoft.CodeAnalysis.CodeFixes;\r\n+using Microsoft.CodeAnalysis.CSharp;\r\n+using Microsoft.CodeAnalysis.CSharp.Syntax;\r\n+using Microsoft.CodeAnalysis.Text;\r\n+\r\n+namespace D2L.CodeStyle.Analyzers.ApiUsage.JsonParamBinderAttribute {\r\n+\r\n+\t[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(JsonParamBinderAnalyzerFixer) )]\r\n+\tpublic class JsonParamBinderAnalyzerFixer : CodeFixProvider {\r\n+\r\n+\t\tpublic override FixAllProvider GetFixAllProvider() {\r\n+\t\t\treturn WellKnownFixAllProviders.BatchFixer;\r\n+\t\t}\r\n+\r\n+\t\tpublic override async Task RegisterCodeFixesAsync( CodeFixContext context ) {\r\n+\t\t\tDiagnostic diagnostic = context.Diagnostics.First();\r\n+\t\t\tTextSpan sourceSpan = diagnostic.Location.SourceSpan;\r\n+\r\n+\t\t\tSyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken);\r\n+\r\n+\t\t\tAttributeSyntax oldAttribute = root.FindToken(sourceSpan.Start)\r\n+\t\t\t\t.Parent.AncestorsAndSelf().OfType<AttributeSyntax>().First();\r\n+\r\n+\t\t\tcontext.RegisterCodeFix( \r\n+\t\t\t\tCodeAction.Create( \r\n+\t\t\t\t\tDiagnostics.ObsoleteJsonParamBinder.Title.ToString(),\r\n+\t\t\t\t\tct => SwapAttributes( context.Document, oldAttribute, ct)\r\n+\t\t\t\t), \r\n+\t\t\t\tdiagnostic\r\n+\t\t\t);\r\n+\t\t}\r\n+\r\n+\t\tprivate async Task<Document> SwapAttributes( Document document, AttributeSyntax oldAttribute, CancellationToken ct ) {\r\n+\t\t\tSyntaxNode root = await document.GetSyntaxRootAsync(ct);\r\n+\r\n+\t\t\tAttributeSyntax newAttribute = SyntaxFactory.Attribute(\r\n+\t\t\t\tSyntaxFactory.IdentifierName( \"JsonConvertParameterBinder\" ) );\r\n+\r\n+\t\t\tSyntaxNode newRoot = root.ReplaceNode(oldAttribute, newAttribute );\r","path":"src/D2L.CodeStyle.Analyzers/ApiUsage/JsonParamBinderAttribute/JsonParamBinderAnalyzerFixer.cs","position":48,"original_position":48,"commit_id":"373082efa9a505707602964ef2286da01ccb635b","original_commit_id":"373082efa9a505707602964ef2286da01ccb635b","user":{"login":"j3parker","id":597907,"avatar_url":"https://avatars2.githubusercontent.com/u/597907?v=4","gravatar_id":"","url":"https://api.github.com/users/j3parker","html_url":"https://github.com/j3parker","followers_url":"https://api.github.com/users/j3parker/followers","following_url":"https://api.github.com/users/j3parker/following{/other_user}","gists_url":"https://api.github.com/users/j3parker/gists{/gist_id}","starred_url":"https://api.github.com/users/j3parker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j3parker/subscriptions","organizations_url":"https://api.github.com/users/j3parker/orgs","repos_url":"https://api.github.com/users/j3parker/repos","events_url":"https://api.github.com/users/j3parker/events{/privacy}","received_events_url":"https://api.github.com/users/j3parker/received_events","type":"User","site_admin":false},"body":"Amazing, they are.","created_at":"2018-03-08T15:19:35Z","updated_at":"2018-03-08T15:19:35Z","html_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/305#discussion_r173189019","pull_request_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments/173189019"},"html":{"href":"https://github.com/Brightspace/D2L.CodeStyle/pull/305#discussion_r173189019"},"pull_request":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305"}},"in_reply_to_id":173188303},"pull_request":{"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305","id":173762559,"html_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/305","diff_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/305.diff","patch_url":"https://github.com/Brightspace/D2L.CodeStyle/pull/305.patch","issue_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/305","number":305,"state":"open","locked":false,"title":"Adding a code fix for ObsoleteJsonParamBinder","user":{"login":"drose-d2l","id":12099837,"avatar_url":"https://avatars3.githubusercontent.com/u/12099837?v=4","gravatar_id":"","url":"https://api.github.com/users/drose-d2l","html_url":"https://github.com/drose-d2l","followers_url":"https://api.github.com/users/drose-d2l/followers","following_url":"https://api.github.com/users/drose-d2l/following{/other_user}","gists_url":"https://api.github.com/users/drose-d2l/gists{/gist_id}","starred_url":"https://api.github.com/users/drose-d2l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drose-d2l/subscriptions","organizations_url":"https://api.github.com/users/drose-d2l/orgs","repos_url":"https://api.github.com/users/drose-d2l/repos","events_url":"https://api.github.com/users/drose-d2l/events{/privacy}","received_events_url":"https://api.github.com/users/drose-d2l/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-08T15:14:28Z","updated_at":"2018-03-08T15:19:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64a4b9bd99ad5322a0723a7ebea8290c84d596df","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305/commits","review_comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305/comments","review_comment_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/305/comments","statuses_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/373082efa9a505707602964ef2286da01ccb635b","head":{"label":"drose-d2l:ObsoleteJsonParamBinderFixer","ref":"ObsoleteJsonParamBinderFixer","sha":"373082efa9a505707602964ef2286da01ccb635b","user":{"login":"drose-d2l","id":12099837,"avatar_url":"https://avatars3.githubusercontent.com/u/12099837?v=4","gravatar_id":"","url":"https://api.github.com/users/drose-d2l","html_url":"https://github.com/drose-d2l","followers_url":"https://api.github.com/users/drose-d2l/followers","following_url":"https://api.github.com/users/drose-d2l/following{/other_user}","gists_url":"https://api.github.com/users/drose-d2l/gists{/gist_id}","starred_url":"https://api.github.com/users/drose-d2l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drose-d2l/subscriptions","organizations_url":"https://api.github.com/users/drose-d2l/orgs","repos_url":"https://api.github.com/users/drose-d2l/repos","events_url":"https://api.github.com/users/drose-d2l/events{/privacy}","received_events_url":"https://api.github.com/users/drose-d2l/received_events","type":"User","site_admin":false},"repo":{"id":124408740,"name":"D2L.CodeStyle-2","full_name":"drose-d2l/D2L.CodeStyle-2","owner":{"login":"drose-d2l","id":12099837,"avatar_url":"https://avatars3.githubusercontent.com/u/12099837?v=4","gravatar_id":"","url":"https://api.github.com/users/drose-d2l","html_url":"https://github.com/drose-d2l","followers_url":"https://api.github.com/users/drose-d2l/followers","following_url":"https://api.github.com/users/drose-d2l/following{/other_user}","gists_url":"https://api.github.com/users/drose-d2l/gists{/gist_id}","starred_url":"https://api.github.com/users/drose-d2l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drose-d2l/subscriptions","organizations_url":"https://api.github.com/users/drose-d2l/orgs","repos_url":"https://api.github.com/users/drose-d2l/repos","events_url":"https://api.github.com/users/drose-d2l/events{/privacy}","received_events_url":"https://api.github.com/users/drose-d2l/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drose-d2l/D2L.CodeStyle-2","description":"Annotations and analysis tools for D2L C# code style","fork":true,"url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2","forks_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/forks","keys_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/teams","hooks_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/hooks","issue_events_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/issues/events{/number}","events_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/events","assignees_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/assignees{/user}","branches_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/branches{/branch}","tags_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/tags","blobs_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/git/refs{/sha}","trees_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/statuses/{sha}","languages_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/languages","stargazers_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/stargazers","contributors_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/contributors","subscribers_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/subscribers","subscription_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/subscription","commits_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/commits{/sha}","git_commits_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/git/commits{/sha}","comments_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/comments{/number}","issue_comment_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/issues/comments{/number}","contents_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/contents/{+path}","compare_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/merges","archive_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/downloads","issues_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/issues{/number}","pulls_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/pulls{/number}","milestones_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/milestones{/number}","notifications_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/labels{/name}","releases_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/releases{/id}","deployments_url":"https://api.github.com/repos/drose-d2l/D2L.CodeStyle-2/deployments","created_at":"2018-03-08T15:13:08Z","updated_at":"2018-03-08T15:13:10Z","pushed_at":"2018-03-08T15:14:00Z","git_url":"git://github.com/drose-d2l/D2L.CodeStyle-2.git","ssh_url":"git@github.com:drose-d2l/D2L.CodeStyle-2.git","clone_url":"https://github.com/drose-d2l/D2L.CodeStyle-2.git","svn_url":"https://github.com/drose-d2l/D2L.CodeStyle-2","homepage":"","size":945,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Brightspace:master","ref":"master","sha":"05b882262c9eedb3c12d0d0b113e4a9c6a74c9ba","user":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"repo":{"id":66025309,"name":"D2L.CodeStyle","full_name":"Brightspace/D2L.CodeStyle","owner":{"login":"Brightspace","id":5429170,"avatar_url":"https://avatars2.githubusercontent.com/u/5429170?v=4","gravatar_id":"","url":"https://api.github.com/users/Brightspace","html_url":"https://github.com/Brightspace","followers_url":"https://api.github.com/users/Brightspace/followers","following_url":"https://api.github.com/users/Brightspace/following{/other_user}","gists_url":"https://api.github.com/users/Brightspace/gists{/gist_id}","starred_url":"https://api.github.com/users/Brightspace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brightspace/subscriptions","organizations_url":"https://api.github.com/users/Brightspace/orgs","repos_url":"https://api.github.com/users/Brightspace/repos","events_url":"https://api.github.com/users/Brightspace/events{/privacy}","received_events_url":"https://api.github.com/users/Brightspace/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Brightspace/D2L.CodeStyle","description":"Annotations and analysis tools for D2L C# code style","fork":false,"url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle","forks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/forks","keys_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/teams","hooks_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/hooks","issue_events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/events{/number}","events_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/events","assignees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/assignees{/user}","branches_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/branches{/branch}","tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/tags","blobs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/{sha}","languages_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/languages","stargazers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/stargazers","contributors_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contributors","subscribers_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscribers","subscription_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/subscription","commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/contents/{+path}","compare_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/merges","archive_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/downloads","issues_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues{/number}","pulls_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls{/number}","milestones_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/milestones{/number}","notifications_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/labels{/name}","releases_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/releases{/id}","deployments_url":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/deployments","created_at":"2016-08-18T19:36:38Z","updated_at":"2018-03-05T21:00:53Z","pushed_at":"2018-03-08T15:14:29Z","git_url":"git://github.com/Brightspace/D2L.CodeStyle.git","ssh_url":"git@github.com:Brightspace/D2L.CodeStyle.git","clone_url":"https://github.com/Brightspace/D2L.CodeStyle.git","svn_url":"https://github.com/Brightspace/D2L.CodeStyle","homepage":"","size":945,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":15,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305"},"html":{"href":"https://github.com/Brightspace/D2L.CodeStyle/pull/305"},"issue":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/305"},"comments":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/issues/305/comments"},"review_comments":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305/comments"},"review_comment":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/pulls/305/commits"},"statuses":{"href":"https://api.github.com/repos/Brightspace/D2L.CodeStyle/statuses/373082efa9a505707602964ef2286da01ccb635b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"j3parker"}}