{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/dnx/pulls/comments/26979494","id":26979494,"diff_hunk":"@@ -1,39 +1,65 @@\n-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\n+﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.\n // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n \n using System.Collections.Generic;\n using System.Linq;\n+using Microsoft.Framework.Internal;\n using Microsoft.Framework.Runtime;\n using Newtonsoft.Json;\n+using Newtonsoft.Json.Linq;\n \n namespace Microsoft.Framework.DesignTimeHost.Models.OutgoingMessages\n {\n     public class DiagnosticsMessage\n     {\n-        public FrameworkData Framework { get; set; }\n+        public DiagnosticsMessage([NotNull] IList<ICompilationMessage> compilationMessages, FrameworkData frameworkData)\n+        {\n+            CompilationDiagnostics = compilationMessages;\n+            Errors = compilationMessages.Where(msg => msg.Severity == CompilationMessageSeverity.Error).ToList();\n+            Warnings = compilationMessages.Where(msg => msg.Severity == CompilationMessageSeverity.Warning).ToList();\n+            Framework = frameworkData;\n+        }\n+\n+        public FrameworkData Framework { get; }\n \n         [JsonIgnore]\n-        public IList<ICompilationMessage> Diagnostics { get; set; }\n+        public IList<ICompilationMessage> CompilationDiagnostics { get; }\n+\n+        public IList<ICompilationMessage> Errors { get; }\n \n-        public IEnumerable<string> Errors => Diagnostics.Where(d => d.Severity == CompilationMessageSeverity.Error)\n-                                                        .Select(d => d.FormattedMessage);\n+        public IList<ICompilationMessage> Warnings { get; }\n \n-        public IEnumerable<string> Warnings => Diagnostics.Where(d => d.Severity == CompilationMessageSeverity.Warning)\n-                                                        .Select(d => d.FormattedMessage);\n+        public virtual JToken ConvertToJson(int protocolVersion)\n+        {\n+            if (protocolVersion <= 1)\n+            {\n+                var payload = new\n+                {\n+                    Framework = Framework,\n+                    Errors = Errors.Select(e => e.FormattedMessage).ToList(),","path":"src/Microsoft.Framework.DesignTimeHost/Models/OutgoingMessages/DiagnosticsMessage.cs","position":46,"original_position":46,"commit_id":"a51ae06c50662504f31a0207d3eb3eaed3cebe67","original_commit_id":"a51ae06c50662504f31a0207d3eb3eaed3cebe67","user":{"login":"troydai","id":1329240,"avatar_url":"https://avatars.githubusercontent.com/u/1329240?v=3","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"body":"Yes.","created_at":"2015-03-23T21:00:57Z","updated_at":"2015-03-23T21:00:57Z","html_url":"https://github.com/aspnet/dnx/pull/1440#discussion_r26979494","pull_request_url":"https://api.github.com/repos/aspnet/dnx/pulls/1440","_links":{"self":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/comments/26979494"},"html":{"href":"https://github.com/aspnet/dnx/pull/1440#discussion_r26979494"},"pull_request":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/1440"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/dnx/pulls/1440","id":31477293,"html_url":"https://github.com/aspnet/dnx/pull/1440","diff_url":"https://github.com/aspnet/dnx/pull/1440.diff","patch_url":"https://github.com/aspnet/dnx/pull/1440.patch","issue_url":"https://api.github.com/repos/aspnet/dnx/issues/1440","number":1440,"state":"open","locked":false,"title":"Send project format warnings & update diagnostics message","user":{"login":"troydai","id":1329240,"avatar_url":"https://avatars.githubusercontent.com/u/1329240?v=3","gravatar_id":"","url":"https://api.github.com/users/troydai","html_url":"https://github.com/troydai","followers_url":"https://api.github.com/users/troydai/followers","following_url":"https://api.github.com/users/troydai/following{/other_user}","gists_url":"https://api.github.com/users/troydai/gists{/gist_id}","starred_url":"https://api.github.com/users/troydai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troydai/subscriptions","organizations_url":"https://api.github.com/users/troydai/orgs","repos_url":"https://api.github.com/users/troydai/repos","events_url":"https://api.github.com/users/troydai/events{/privacy}","received_events_url":"https://api.github.com/users/troydai/received_events","type":"User","site_admin":false},"body":"Also support DTH protocol versioning.\r\n\r\nThis is minimal change to support gradually iterating to new version of diagnostics message.\r\n\r\n@davidfowl ","created_at":"2015-03-18T22:05:00Z","updated_at":"2015-03-23T21:00:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"605a9ea80eae52858c75b60761bc0e6ef3bb0473","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/dnx/pulls/1440/commits","review_comments_url":"https://api.github.com/repos/aspnet/dnx/pulls/1440/comments","review_comment_url":"https://api.github.com/repos/aspnet/dnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/dnx/issues/1440/comments","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/a51ae06c50662504f31a0207d3eb3eaed3cebe67","head":{"label":"aspnet:trdai/issue1330","ref":"trdai/issue1330","sha":"a51ae06c50662504f31a0207d3eb3eaed3cebe67","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":14225208,"name":"dnx","full_name":"aspnet/dnx","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/dnx","description":"The DNX (a .NET Execution Environment) contains the code required to bootstrap and run an application, including the compilation system, SDK tools, and the native CLR hosts.","fork":false,"url":"https://api.github.com/repos/aspnet/dnx","forks_url":"https://api.github.com/repos/aspnet/dnx/forks","keys_url":"https://api.github.com/repos/aspnet/dnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/dnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/dnx/teams","hooks_url":"https://api.github.com/repos/aspnet/dnx/hooks","issue_events_url":"https://api.github.com/repos/aspnet/dnx/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/dnx/events","assignees_url":"https://api.github.com/repos/aspnet/dnx/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/dnx/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/dnx/tags","blobs_url":"https://api.github.com/repos/aspnet/dnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/dnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/dnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/dnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/dnx/languages","stargazers_url":"https://api.github.com/repos/aspnet/dnx/stargazers","contributors_url":"https://api.github.com/repos/aspnet/dnx/contributors","subscribers_url":"https://api.github.com/repos/aspnet/dnx/subscribers","subscription_url":"https://api.github.com/repos/aspnet/dnx/subscription","commits_url":"https://api.github.com/repos/aspnet/dnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/dnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/dnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/dnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/dnx/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/dnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/dnx/merges","archive_url":"https://api.github.com/repos/aspnet/dnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/dnx/downloads","issues_url":"https://api.github.com/repos/aspnet/dnx/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/dnx/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/dnx/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/dnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/dnx/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/dnx/releases{/id}","created_at":"2013-11-08T06:01:29Z","updated_at":"2015-03-23T19:15:13Z","pushed_at":"2015-03-23T18:45:00Z","git_url":"git://github.com/aspnet/dnx.git","ssh_url":"git@github.com:aspnet/dnx.git","clone_url":"https://github.com/aspnet/dnx.git","svn_url":"https://github.com/aspnet/dnx","homepage":"","size":37220,"stargazers_count":558,"watchers_count":558,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":237,"forks":130,"open_issues":237,"watchers":558,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"d3ceb96b4e642a36da450a6b633f0133d1e6e4b9","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":14225208,"name":"dnx","full_name":"aspnet/dnx","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/dnx","description":"The DNX (a .NET Execution Environment) contains the code required to bootstrap and run an application, including the compilation system, SDK tools, and the native CLR hosts.","fork":false,"url":"https://api.github.com/repos/aspnet/dnx","forks_url":"https://api.github.com/repos/aspnet/dnx/forks","keys_url":"https://api.github.com/repos/aspnet/dnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/dnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/dnx/teams","hooks_url":"https://api.github.com/repos/aspnet/dnx/hooks","issue_events_url":"https://api.github.com/repos/aspnet/dnx/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/dnx/events","assignees_url":"https://api.github.com/repos/aspnet/dnx/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/dnx/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/dnx/tags","blobs_url":"https://api.github.com/repos/aspnet/dnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/dnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/dnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/dnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/dnx/languages","stargazers_url":"https://api.github.com/repos/aspnet/dnx/stargazers","contributors_url":"https://api.github.com/repos/aspnet/dnx/contributors","subscribers_url":"https://api.github.com/repos/aspnet/dnx/subscribers","subscription_url":"https://api.github.com/repos/aspnet/dnx/subscription","commits_url":"https://api.github.com/repos/aspnet/dnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/dnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/dnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/dnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/dnx/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/dnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/dnx/merges","archive_url":"https://api.github.com/repos/aspnet/dnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/dnx/downloads","issues_url":"https://api.github.com/repos/aspnet/dnx/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/dnx/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/dnx/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/dnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/dnx/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/dnx/releases{/id}","created_at":"2013-11-08T06:01:29Z","updated_at":"2015-03-23T19:15:13Z","pushed_at":"2015-03-23T18:45:00Z","git_url":"git://github.com/aspnet/dnx.git","ssh_url":"git@github.com:aspnet/dnx.git","clone_url":"https://github.com/aspnet/dnx.git","svn_url":"https://github.com/aspnet/dnx","homepage":"","size":37220,"stargazers_count":558,"watchers_count":558,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":237,"forks":130,"open_issues":237,"watchers":558,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/1440"},"html":{"href":"https://github.com/aspnet/dnx/pull/1440"},"issue":{"href":"https://api.github.com/repos/aspnet/dnx/issues/1440"},"comments":{"href":"https://api.github.com/repos/aspnet/dnx/issues/1440/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/1440/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/1440/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/dnx/statuses/a51ae06c50662504f31a0207d3eb3eaed3cebe67"}}}}