{"action":"closed","number":27389,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/27389","id":192224229,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjI0MjI5","html_url":"https://github.com/dotnet/roslyn/pull/27389","diff_url":"https://github.com/dotnet/roslyn/pull/27389.diff","patch_url":"https://github.com/dotnet/roslyn/pull/27389.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/27389","number":27389,"state":"closed","locked":false,"title":"[Razor FAR]: PROTOTYPE: connect generated documents to editor","user":{"login":"rynowak","id":1430011,"node_id":"MDQ6VXNlcjE0MzAwMTE=","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":"/cc @jasonmalinowski @heejaechang \r\n\r\nThis is a prototype of how the contained language support could open and\r\nattach to one of the new generated Razor documents.\r\n\r\nThere are surely many features that aren't working in this example, my\r\ngoal here is just to share an idea and continue the discussion. I think if we end up doing FAR for Razor in 15.8 we will not need this change, but here's an idea of a direction that seems promising to me looking forward at features like refactoring.\r\n\r\n-----\r\n\r\n**Summary**\r\nThe big idea here is that the contained language implementation in Roslyn can bind to an existing document rather than creating an ephemeral one.\r\n\r\nWe can use an existing project system API to inform the contained language implementation to use the project context created by Razor.\r\n\r\nThere are a few big issues with this approach that I haven't tried to solve in a prototype... I thought I got far enough with it to trigger a fruitful discussion 😆 \r\n\r\n**Timing**\r\nThere are timing issues with initialization. The contained language code path is synchronous, and WTE calls it in a loop, waiting for the buffer to be successfully created. This works OK today because if the workspace/project hasn't been initialized yet from Roslyn's point of view, you can just say NO, and WTE will try again.\r\n\r\nThese changes introduce an inherent race between the current (old) code path, and the new one that gets taken only when the document is already known because there are two different success paths. I don't think anything in the contained language subsystem today has the ability to migrate to a new context if a document is registered for something open in the editor.\r\n\r\n**Feature Divergence**\r\n\r\nI didn't attempt to unify the `ContainedDocument` and `SimpleContainedDocument` into a single class. There are lots of places where code does a downcast to `ContainedDocument` to implement some kind of feature. I think a real implementation would need to extract an interface, or unify these types. I'll bet some features are currently broken in the features/razorFar branch due to this and we will probably need to address that independent of this idea.\r\n\r\nI spot fixed a few of these places that were trivial, before looking a bit deeper and deciding that I didn't want to try and solve these in a prototype.\r\n\r\n**Editing Support**\r\n\r\nMost of the support for Roslyn editing the underlying C# buffer lives in `ContainedDocument`. Introducing another document implementation like `SimpleContainedDocument` means that we don't reuse this code, so if we don't unify these types, we need to solve that somehow.\r\n","created_at":"2018-06-03T00:33:20Z","updated_at":"2018-12-28T01:31:30Z","closed_at":"2018-12-28T01:31:29Z","merged_at":null,"merge_commit_sha":"93d63ed8545008f22532b9599fcda574d08f41dd","assignee":{"login":"jasonmalinowski","id":201340,"node_id":"MDQ6VXNlcjIwMTM0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false},"assignees":[{"login":"jasonmalinowski","id":201340,"node_id":"MDQ6VXNlcjIwMTM0MA==","avatar_url":"https://avatars3.githubusercontent.com/u/201340?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonmalinowski","html_url":"https://github.com/jasonmalinowski","followers_url":"https://api.github.com/users/jasonmalinowski/followers","following_url":"https://api.github.com/users/jasonmalinowski/following{/other_user}","gists_url":"https://api.github.com/users/jasonmalinowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmalinowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmalinowski/subscriptions","organizations_url":"https://api.github.com/users/jasonmalinowski/orgs","repos_url":"https://api.github.com/users/jasonmalinowski/repos","events_url":"https://api.github.com/users/jasonmalinowski/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmalinowski/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[{"name":"roslyn-ide","id":1781706,"node_id":"MDQ6VGVhbTE3ODE3MDY=","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":[{"id":166377917,"node_id":"MDU6TGFiZWwxNjYzNzc5MTc=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7","default":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/18","html_url":"https://github.com/dotnet/roslyn/milestone/18","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/18/labels","id":1675130,"node_id":"MDk6TWlsZXN0b25lMTY3NTEzMA==","number":18,"title":"16.0","description":"The next major version.","creator":{"login":"gafter","id":3804346,"node_id":"MDQ6VXNlcjM4MDQzNDY=","avatar_url":"https://avatars3.githubusercontent.com/u/3804346?v=4","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"open_issues":1372,"closed_issues":923,"state":"open","created_at":"2016-03-31T00:06:25Z","updated_at":"2018-12-28T01:31:30Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/27389/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/27389/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/27389/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/b5efd8547ce6c1b9683f10af3736b7aab262e821","head":{"label":"rynowak:features/razorFar","ref":"features/razorFar","sha":"b5efd8547ce6c1b9683f10af3736b7aab262e821","user":{"login":"rynowak","id":1430011,"node_id":"MDQ6VXNlcjE0MzAwMTE=","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},"repo":{"id":75009001,"node_id":"MDEwOlJlcG9zaXRvcnk3NTAwOTAwMQ==","name":"roslyn","full_name":"rynowak/roslyn","private":false,"owner":{"login":"rynowak","id":1430011,"node_id":"MDQ6VXNlcjE0MzAwMTE=","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},"html_url":"https://github.com/rynowak/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/rynowak/roslyn","forks_url":"https://api.github.com/repos/rynowak/roslyn/forks","keys_url":"https://api.github.com/repos/rynowak/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rynowak/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rynowak/roslyn/teams","hooks_url":"https://api.github.com/repos/rynowak/roslyn/hooks","issue_events_url":"https://api.github.com/repos/rynowak/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/rynowak/roslyn/events","assignees_url":"https://api.github.com/repos/rynowak/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/rynowak/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/rynowak/roslyn/tags","blobs_url":"https://api.github.com/repos/rynowak/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rynowak/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rynowak/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/rynowak/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rynowak/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/rynowak/roslyn/languages","stargazers_url":"https://api.github.com/repos/rynowak/roslyn/stargazers","contributors_url":"https://api.github.com/repos/rynowak/roslyn/contributors","subscribers_url":"https://api.github.com/repos/rynowak/roslyn/subscribers","subscription_url":"https://api.github.com/repos/rynowak/roslyn/subscription","commits_url":"https://api.github.com/repos/rynowak/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/rynowak/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/rynowak/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/rynowak/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/rynowak/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/rynowak/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rynowak/roslyn/merges","archive_url":"https://api.github.com/repos/rynowak/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rynowak/roslyn/downloads","issues_url":"https://api.github.com/repos/rynowak/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/rynowak/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/rynowak/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/rynowak/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rynowak/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/rynowak/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/rynowak/roslyn/deployments","created_at":"2016-11-28T19:55:08Z","updated_at":"2018-05-19T02:52:00Z","pushed_at":"2018-10-20T02:09:47Z","git_url":"git://github.com/rynowak/roslyn.git","ssh_url":"git@github.com:rynowak/roslyn.git","clone_url":"https://github.com/rynowak/roslyn.git","svn_url":"https://github.com/rynowak/roslyn","homepage":"","size":430595,"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","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:features/razorFar","ref":"features/razorFar","sha":"278ea4ed21eccb7a2391baabd3a7ccdcb7dc2feb","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","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,"node_id":"MDEwOlJlcG9zaXRvcnkyOTA3ODk5Nw==","name":"roslyn","full_name":"dotnet/roslyn","private":false,"owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","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},"html_url":"https://github.com/dotnet/roslyn","description":"The Roslyn .NET compiler provides C# and Visual Basic languages 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-12-28T01:01:11Z","pushed_at":"2018-12-28T01:29:28Z","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":"https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/","size":513023,"stargazers_count":10567,"watchers_count":10567,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2504,"mirror_url":null,"archived":false,"open_issues_count":5585,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2504,"open_issues":5585,"watchers":10567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27389"},"html":{"href":"https://github.com/dotnet/roslyn/pull/27389"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/27389"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/27389/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27389/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/27389/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/b5efd8547ce6c1b9683f10af3736b7aab262e821"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":2,"review_comments":7,"maintainer_can_modify":false,"commits":1,"additions":125,"deletions":25,"changed_files":8}}
{"actor":{"display_login":"rynowak"}}