{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/comments/71807380","id":71807380,"diff_hunk":"@@ -0,0 +1,127 @@\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 System;\n+using System.Collections.Generic;\n+using System.ComponentModel.Composition;\n+using Microsoft.VisualStudio.ProjectSystem.VS.Extensibility;\n+using Microsoft.VisualStudio.ProjectSystem.VS.Utilities;\n+using Microsoft.VisualStudio.Shell;\n+\n+namespace Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies\n+{\n+    /// <summary>\n+    /// Global scope contract that provides information about project level \n+    /// dependencies graph contexts.\n+    /// </summary>\n+    [Export(typeof(IDependenciesGraphProjectContextProvider))]\n+    [AppliesTo(ProjectCapability.AlwaysAvailable)]\n+    public class DependenciesGraphProjectContextProvider : IDependenciesGraphProjectContextProvider\n+    {\n+        private IProjectExportProvider ProjectExportProvider { get; set; }\n+\n+        private SVsServiceProvider ServiceProvider { get; set; }\n+\n+        private Dictionary<string, IDependenciesGraphProjectContext> ProjectContexts { get; } \n+                            = new Dictionary<string, IDependenciesGraphProjectContext>(StringComparer.OrdinalIgnoreCase);\n+\n+        private object _projectContextsLock = new object();\n+\n+        [ImportingConstructor]\n+        public DependenciesGraphProjectContextProvider(IProjectExportProvider projectExportProvider, \n+                                                       SVsServiceProvider serviceProvider)\n+        {\n+            ServiceProvider = serviceProvider;\n+            ProjectExportProvider = projectExportProvider;\n+        }\n+\n+        /// <summary>\n+        /// When project context changed event received from any context, send a global level\n+        /// \"context changed\" event, to notify  <see cref=\"DependenciesGraphProvider\"/>.\n+        /// </summary>\n+        internal void OnProjectContextChanged(object sender, ProjectContextEventArgs e)\n+        {\n+            var context = e.Context;\n+            if (context == null)\n+            {\n+                return;\n+            }\n+\n+            ProjectContextChanged?.Invoke(this, new ProjectContextEventArgs(context));\n+        }\n+\n+        /// <summary>\n+        /// When a given project context is unloaded, remove it form the cache and unregister event handlers\n+        /// </summary>\n+        internal void OnProjectContextUnloaded(object sender, ProjectContextEventArgs e)\n+        {\n+            lock (_projectContextsLock)\n+            {\n+                var context = e.Context;\n+                if (context != null && ProjectContexts.ContainsKey(context.ProjectFilePath))\n+                {\n+                    // Remove context for the unloaded project from the cache\n+                    ProjectContexts.Remove(context.ProjectFilePath);\n+\n+                    context.ProjectContextChanged -= OnProjectContextChanged;\n+                    context.ProjectContextUnloaded -= OnProjectContextUnloaded;\n+                }\n+            }\n+        }\n+\n+        #region IDependenciesGraphProjectContextProvider\n+\n+        /// <summary>\n+        /// Returns an unconfigured project level contexts for given project file path.\n+        /// </summary>\n+        /// <param name=\"projectFilePath\">Full path to project path.</param>\n+        /// <returns>\n+        /// Instance of <see cref=\"IDependenciesGraphProjectContext\"/> or null if context was not found for given project file.\n+        /// </returns>\n+        public IDependenciesGraphProjectContext GetProjectContext(string projectFilePath)\n+        {\n+            if (string.IsNullOrEmpty(projectFilePath))","path":"src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Tree/Dependencies/DependenciesGraphProjectContextProvider.cs","position":82,"original_position":82,"commit_id":"bcf4de7e05f43fdfbda040450715ae2feed86b80","original_commit_id":"bcf4de7e05f43fdfbda040450715ae2feed86b80","user":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"body":"Why would this ever be valid or pass a null or empty project file?","created_at":"2016-07-21T23:44:53Z","updated_at":"2016-07-21T23:44:53Z","html_url":"https://github.com/dotnet/roslyn-project-system/pull/309#discussion_r71807380","pull_request_url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/comments/71807380"},"html":{"href":"https://github.com/dotnet/roslyn-project-system/pull/309#discussion_r71807380"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309","id":78188326,"html_url":"https://github.com/dotnet/roslyn-project-system/pull/309","diff_url":"https://github.com/dotnet/roslyn-project-system/pull/309.diff","patch_url":"https://github.com/dotnet/roslyn-project-system/pull/309.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/309","number":309,"state":"open","locked":false,"title":"First version if dependencies node ","user":{"login":"abpiskunov","id":1592091,"avatar_url":"https://avatars.githubusercontent.com/u/1592091?v=3","gravatar_id":"","url":"https://api.github.com/users/abpiskunov","html_url":"https://github.com/abpiskunov","followers_url":"https://api.github.com/users/abpiskunov/followers","following_url":"https://api.github.com/users/abpiskunov/following{/other_user}","gists_url":"https://api.github.com/users/abpiskunov/gists{/gist_id}","starred_url":"https://api.github.com/users/abpiskunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abpiskunov/subscriptions","organizations_url":"https://api.github.com/users/abpiskunov/orgs","repos_url":"https://api.github.com/users/abpiskunov/repos","events_url":"https://api.github.com/users/abpiskunov/events{/privacy}","received_events_url":"https://api.github.com/users/abpiskunov/received_events","type":"User","site_admin":false},"body":"What is in this change:\r\n\r\n- disabled CPS References node and ported their implementation to our new DependenciesProjectTreeProvider\r\n- DependenciesProjectTreeProvider puts all old known references under Dependencies/Assemblies sub node (assemblies, projects, com, sdk)\r\n- DependenciesProjectTreeProvider has an ImportMany for IProjectDependenciesSubTreeProvider which allows inject another Dependencies/[sub node] for other types of dependencies. \r\n- So far there is only NuGetDependenciesSubTreeProvider which takes top level packages form ResolveNuGetPackageAssets and displays them.\r\n- Added rules for missing references types (Assembly, SDK etc) and added rules for NuGet packages. Also added support for showing properties for nodes generated by IProjectDependenciesSubTreeProviders.\r\n- IProjectDependenciesSubTreeProvider  provides nodes data, i.e. it is independent from IProjectTree or graph nodes. DependenciesProjectTreeProvider takes those data nodes (IDependencyNode) from providers and generates Dependencies/[Sub node]/[Top level dependencies]. If there more layers, they would already be displayed by DependenciesGraphProvider dynamically. \r\n\r\nStill TODO:\r\n\r\n- ResolveNuGetPackageAssets changes to get hierarchy of all package dependencies and consume it in DependenciesGraphProvider \r\n- Split Projects to separate IProjectDependenciesSubTreeProvider  (and other refernce type slike sdk, com etc)\r\n- Display properties for lower level nodes (graph nodes) - now only for top level we display properties\r\n- refactor all xaml files for all references and make sure valid properties are there and info is actually filled (at this moment many properties just stay empty)\r\n","created_at":"2016-07-20T17:37:57Z","updated_at":"2016-07-21T23:44:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"782bf00fb21cbf9a3583583f3e873bf06bd68522","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/309/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn-project-system/statuses/bcf4de7e05f43fdfbda040450715ae2feed86b80","head":{"label":"abpiskunov:antonpis/dependencies","ref":"antonpis/dependencies","sha":"bcf4de7e05f43fdfbda040450715ae2feed86b80","user":{"login":"abpiskunov","id":1592091,"avatar_url":"https://avatars.githubusercontent.com/u/1592091?v=3","gravatar_id":"","url":"https://api.github.com/users/abpiskunov","html_url":"https://github.com/abpiskunov","followers_url":"https://api.github.com/users/abpiskunov/followers","following_url":"https://api.github.com/users/abpiskunov/following{/other_user}","gists_url":"https://api.github.com/users/abpiskunov/gists{/gist_id}","starred_url":"https://api.github.com/users/abpiskunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abpiskunov/subscriptions","organizations_url":"https://api.github.com/users/abpiskunov/orgs","repos_url":"https://api.github.com/users/abpiskunov/repos","events_url":"https://api.github.com/users/abpiskunov/events{/privacy}","received_events_url":"https://api.github.com/users/abpiskunov/received_events","type":"User","site_admin":false},"repo":{"id":62175613,"name":"roslyn-project-system","full_name":"abpiskunov/roslyn-project-system","owner":{"login":"abpiskunov","id":1592091,"avatar_url":"https://avatars.githubusercontent.com/u/1592091?v=3","gravatar_id":"","url":"https://api.github.com/users/abpiskunov","html_url":"https://github.com/abpiskunov","followers_url":"https://api.github.com/users/abpiskunov/followers","following_url":"https://api.github.com/users/abpiskunov/following{/other_user}","gists_url":"https://api.github.com/users/abpiskunov/gists{/gist_id}","starred_url":"https://api.github.com/users/abpiskunov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abpiskunov/subscriptions","organizations_url":"https://api.github.com/users/abpiskunov/orgs","repos_url":"https://api.github.com/users/abpiskunov/repos","events_url":"https://api.github.com/users/abpiskunov/events{/privacy}","received_events_url":"https://api.github.com/users/abpiskunov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abpiskunov/roslyn-project-system","description":"The C# and Visual Basic project system for Visual Studio \"15\"","fork":true,"url":"https://api.github.com/repos/abpiskunov/roslyn-project-system","forks_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/forks","keys_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/teams","hooks_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/hooks","issue_events_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/issues/events{/number}","events_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/events","assignees_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/assignees{/user}","branches_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/branches{/branch}","tags_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/tags","blobs_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/statuses/{sha}","languages_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/languages","stargazers_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/stargazers","contributors_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/contributors","subscribers_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/subscribers","subscription_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/subscription","commits_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/contents/{+path}","compare_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/merges","archive_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/downloads","issues_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/issues{/number}","pulls_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/pulls{/number}","milestones_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/milestones{/number}","notifications_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/labels{/name}","releases_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/releases{/id}","deployments_url":"https://api.github.com/repos/abpiskunov/roslyn-project-system/deployments","created_at":"2016-06-28T21:31:09Z","updated_at":"2016-06-28T21:31:10Z","pushed_at":"2016-07-20T17:25:10Z","git_url":"git://github.com/abpiskunov/roslyn-project-system.git","ssh_url":"git@github.com:abpiskunov/roslyn-project-system.git","clone_url":"https://github.com/abpiskunov/roslyn-project-system.git","svn_url":"https://github.com/abpiskunov/roslyn-project-system","homepage":null,"size":5286,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"e66397ecbef25786deb99b563bc21850763a26da","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":56740275,"name":"roslyn-project-system","full_name":"dotnet/roslyn-project-system","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-project-system","description":"The C# and Visual Basic project system for Visual Studio \"15\"","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn-project-system","forks_url":"https://api.github.com/repos/dotnet/roslyn-project-system/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn-project-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn-project-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn-project-system/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn-project-system/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn-project-system/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn-project-system/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn-project-system/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn-project-system/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn-project-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn-project-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn-project-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn-project-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn-project-system/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn-project-system/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn-project-system/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn-project-system/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn-project-system/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn-project-system/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn-project-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn-project-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn-project-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn-project-system/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn-project-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn-project-system/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn-project-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn-project-system/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn-project-system/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn-project-system/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn-project-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn-project-system/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn-project-system/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn-project-system/deployments","created_at":"2016-04-21T03:40:18Z","updated_at":"2016-07-21T18:59:51Z","pushed_at":"2016-07-21T21:58:31Z","git_url":"git://github.com/dotnet/roslyn-project-system.git","ssh_url":"git@github.com:dotnet/roslyn-project-system.git","clone_url":"https://github.com/dotnet/roslyn-project-system.git","svn_url":"https://github.com/dotnet/roslyn-project-system","homepage":null,"size":5314,"stargazers_count":125,"watchers_count":125,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":166,"forks":25,"open_issues":166,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309"},"html":{"href":"https://github.com/dotnet/roslyn-project-system/pull/309"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/309"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn-project-system/statuses/bcf4de7e05f43fdfbda040450715ae2feed86b80"}}}}
{"actor":{"display_login":"davkean"}}