{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/189446734","pull_request_review_id":121631442,"id":189446734,"diff_hunk":"@@ -959,7 +960,19 @@ private static void OnAdditionalDocumentUpdatedOnDisk(object sender, EventArgs e\n             string filename,\n             SourceCodeKind sourceCodeKind,\n             Func<IVisualStudioHostDocument, bool> getIsCurrentContext,\n-            Func<uint, IReadOnlyList<string>> getFolderNames)\n+            Func<uint, IReadOnlyList<string>> getFolderNames,\n+            IDocumentServiceFactory documentServiceFactory)\n+        {\n+            AddFile(filename, sourceTextContainer: null, sourceCodeKind, getIsCurrentContext, getFolderNames, documentServiceFactory);\n+        }\n+\n+        protected void AddFile(\n+            string filename,\n+            SourceTextContainer sourceTextContainer,\n+            SourceCodeKind sourceCodeKind,\n+            Func<IVisualStudioHostDocument, bool> getIsCurrentContext,\n+            Func<uint, IReadOnlyList<string>> getFolderNames,\n+            IDocumentServiceFactory documentServiceFactory)","path":"src/VisualStudio/Core/Def/Implementation/ProjectSystem/AbstractProject.cs","position":61,"original_position":61,"commit_id":"23134d703b637cac89d72e53c126b9750d4da18e","original_commit_id":"23134d703b637cac89d72e53c126b9750d4da18e","user":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars1.githubusercontent.com/u/1430011?v=4","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"body":"Same with the `SourceTextContainer` they are ignored.","created_at":"2018-05-19T22:58:06Z","updated_at":"2018-05-19T22:58:06Z","html_url":"https://github.com/dotnet/roslyn/pull/26939#discussion_r189446734","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/26939","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/189446734"},"html":{"href":"https://github.com/dotnet/roslyn/pull/26939#discussion_r189446734"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/26939"}},"in_reply_to_id":189446727},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/26939","id":188797829,"html_url":"https://github.com/dotnet/roslyn/pull/26939","diff_url":"https://github.com/dotnet/roslyn/pull/26939.diff","patch_url":"https://github.com/dotnet/roslyn/pull/26939.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/26939","number":26939,"state":"open","locked":false,"title":"First Draft towards Razor FAR Support","user":{"login":"heejaechang","id":1333179,"avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"body":"this is first draft.\r\n\r\n...\r\n\r\nbasically, one can add new project/document through this\r\n\r\nfirst, MEF import this service\r\nIWorkspaceProjectContextFactory (http://source.roslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/ProjectSystem/CPS/IWorkspaceProjectContextFactory.cs,13)\r\n\r\nand then call this method to add new project\r\nIWorkspaceProjectContextFactory.CreateProjectContext (there are 2. only difference is whether you are going to control error reporting or not)\r\nhttp://source.roslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/ProjectSystem/CPS/IWorkspaceProjectContextFactory.cs,26 \r\n\r\nand then use this to add new document\r\nIWorkspaceProjectContext.AddSourceFile\r\nhttp://source.roslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs,33\r\n\r\nexamples are here.\r\nhttps://github.com/dotnet/project-system/blob/6a0fb122a8682d5d8b9ca4b26013bf7ad20b5800/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/LanguageServices/UnconfiguredProjectContextProvider.cs#L34\r\n\r\n...\r\n\r\nif you want to add file to existing project, you need to import VisualStudioWorkspaceImp and then do\r\nIWorkspaceProjectContext context = VSWorkspaceImpl.GetHostProject(ProjectId);\r\n\r\nand do the same. (all these require IVT by the way)\r\n\r\n...\r\n\r\nthere is big \"Catch\" here though. since venus/razor has existing implemention on open file, I wasn't sure how to do transition between closed/open files of razor/venus file. so basically I gave up that part. and leave responsibility to you guys.\r\n\r\nbasically what that means is that, you can add closed razor, secondary buffer equivalent, code to us through the code path above, but when user tries to open that file (ex, cshtml), razor/venus MUST first remove that document from us through the same API above (http://source.roslyn.io/#Microsoft.VisualStudio.LanguageServices/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs,34) \r\n\r\nand then go through the old ContainedLanguage API to open the file so that it gets hooked up to right code for open files.\r\n\r\n...\r\n\r\nI think after this experiement/prototype, it would be nice if we remove the old ContainedLanguage code path and merge everything (open/closed file) to same code path.\r\n\r\nI didn't read through whole thing but most of code in old code path is about modifying secondary buffer, so if we do make change of design where we never modify buffer but just let you know how we want to change, \r\n\r\nI think we can do much more in much simpler way... such as supporting code fix in razor/venus file but we don't have any special code (or very little) for razor/venus in our side. \r\n\r\n\r\n\r\n\r\n\r\n","created_at":"2018-05-17T16:44:02Z","updated_at":"2018-05-19T22:58:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91197ce42a498e2ab534aba30ba385ddba937df6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"slug":"roslyn-ide","description":"Roslyn IDE Team","privacy":"closed","url":"https://api.github.com/teams/1781706","members_url":"https://api.github.com/teams/1781706/members{/member}","repositories_url":"https://api.github.com/teams/1781706/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/26939/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/26939/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/26939/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/23134d703b637cac89d72e53c126b9750d4da18e","head":{"label":"heejaechang:addSpanMapper","ref":"addSpanMapper","sha":"23134d703b637cac89d72e53c126b9750d4da18e","user":{"login":"heejaechang","id":1333179,"avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"repo":{"id":30170221,"name":"roslyn","full_name":"heejaechang/roslyn","owner":{"login":"heejaechang","id":1333179,"avatar_url":"https://avatars3.githubusercontent.com/u/1333179?v=4","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/heejaechang/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/heejaechang/roslyn","forks_url":"https://api.github.com/repos/heejaechang/roslyn/forks","keys_url":"https://api.github.com/repos/heejaechang/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heejaechang/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heejaechang/roslyn/teams","hooks_url":"https://api.github.com/repos/heejaechang/roslyn/hooks","issue_events_url":"https://api.github.com/repos/heejaechang/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/heejaechang/roslyn/events","assignees_url":"https://api.github.com/repos/heejaechang/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/heejaechang/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/heejaechang/roslyn/tags","blobs_url":"https://api.github.com/repos/heejaechang/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heejaechang/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heejaechang/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/heejaechang/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heejaechang/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/heejaechang/roslyn/languages","stargazers_url":"https://api.github.com/repos/heejaechang/roslyn/stargazers","contributors_url":"https://api.github.com/repos/heejaechang/roslyn/contributors","subscribers_url":"https://api.github.com/repos/heejaechang/roslyn/subscribers","subscription_url":"https://api.github.com/repos/heejaechang/roslyn/subscription","commits_url":"https://api.github.com/repos/heejaechang/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/heejaechang/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/heejaechang/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/heejaechang/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/heejaechang/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/heejaechang/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heejaechang/roslyn/merges","archive_url":"https://api.github.com/repos/heejaechang/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heejaechang/roslyn/downloads","issues_url":"https://api.github.com/repos/heejaechang/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/heejaechang/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/heejaechang/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/heejaechang/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heejaechang/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/heejaechang/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/heejaechang/roslyn/deployments","created_at":"2015-02-02T03:54:43Z","updated_at":"2018-05-07T22:00:51Z","pushed_at":"2018-05-19T00:49:07Z","git_url":"git://github.com/heejaechang/roslyn.git","ssh_url":"git@github.com:heejaechang/roslyn.git","clone_url":"https://github.com/heejaechang/roslyn.git","svn_url":"https://github.com/heejaechang/roslyn","homepage":"","size":323911,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"dotnet:features/razorFar","ref":"features/razorFar","sha":"6baa7d670d9ae9878fa284d456e972100b459928","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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://avatars0.githubusercontent.com/u/9141961?v=4","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":"2018-05-19T19:41:52Z","pushed_at":"2018-05-19T22:00:39Z","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":372800,"stargazers_count":9317,"watchers_count":9317,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2228,"mirror_url":null,"archived":false,"open_issues_count":4732,"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":2228,"open_issues":4732,"watchers":9317,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/26939"},"html":{"href":"https://github.com/dotnet/roslyn/pull/26939"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/26939"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/26939/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/26939/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/26939/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/23134d703b637cac89d72e53c126b9750d4da18e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rynowak"}}