{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/56839149","id":56839149,"diff_hunk":"@@ -23,5 +24,57 @@ public static class RSessionExtensions {\n                 await function(evaluation);\n             } \n         }\n+\n+        public static async Task<string> GetRWorkingDirectoryAsync(this IRSession session) {\n+            if (session.IsHostRunning) {\n+                await TaskUtilities.SwitchToBackgroundThread();\n+                try {\n+                    using (var evaluation = await session.BeginEvaluationAsync(false)) {\n+                        return await evaluation.GetWorkingDirectory();\n+                    }\n+                } catch (OperationCanceledException) { }\n+            }\n+            return null;\n+        }\n+\n+        public static async Task<string> GetRUserDirectoryAsync(this IRSession session) {\n+            if (session.IsHostRunning) {\n+                await TaskUtilities.SwitchToBackgroundThread();\n+                try {\n+                    using (var evaluation = await session.BeginEvaluationAsync(false)) {\n+                        return await evaluation.GetRUserDirectory();\n+                    }\n+                } catch (OperationCanceledException) { }\n+            }\n+            return null;\n+        }\n+\n+        public static async Task<string> GetRShortenedPathNameAsync(this IRSession session, string name) {\n+            var userDirectory = await session.GetRUserDirectoryAsync();\n+            return GetRShortenedPathName(name, userDirectory);\n+        }\n+\n+        public static async Task<IEnumerable<string>> GetRShortenedPathNamesAsync(this IRSession session, IEnumerable<string> names) {\n+            var userDirectory = await session.GetRUserDirectoryAsync();\n+            var list = new List<string>();","path":"src/Host/Client/Impl/Session/RSessionExtensions.cs","position":44,"original_position":44,"commit_id":"6d1035cb583d2c19df33b7487e7f78b1ebb80920","original_commit_id":"6d1035cb583d2c19df33b7487e7f78b1ebb80920","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"body":"```{csharp}\r\nreturn names.Select(n => GetRShortenedPathName(n, userDirectory));\r\n```","created_at":"2016-03-21T15:16:18Z","updated_at":"2016-03-21T15:16:18Z","html_url":"https://github.com/Microsoft/RTVS/pull/1293#discussion_r56839149","pull_request_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/56839149"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1293#discussion_r56839149"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293","id":63320390,"html_url":"https://github.com/Microsoft/RTVS/pull/1293","diff_url":"https://github.com/Microsoft/RTVS/pull/1293.diff","patch_url":"https://github.com/Microsoft/RTVS/pull/1293.patch","issue_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1293","number":1293,"state":"open","locked":false,"title":"Improve project menu","user":{"login":"MikhailArkhipov","id":12820357,"avatar_url":"https://avatars.githubusercontent.com/u/12820357?v=3","gravatar_id":"","url":"https://api.github.com/users/MikhailArkhipov","html_url":"https://github.com/MikhailArkhipov","followers_url":"https://api.github.com/users/MikhailArkhipov/followers","following_url":"https://api.github.com/users/MikhailArkhipov/following{/other_user}","gists_url":"https://api.github.com/users/MikhailArkhipov/gists{/gist_id}","starred_url":"https://api.github.com/users/MikhailArkhipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikhailArkhipov/subscriptions","organizations_url":"https://api.github.com/users/MikhailArkhipov/orgs","repos_url":"https://api.github.com/users/MikhailArkhipov/repos","events_url":"https://api.github.com/users/MikhailArkhipov/events{/privacy}","received_events_url":"https://api.github.com/users/MikhailArkhipov/received_events","type":"User","site_admin":false},"body":"Includes fix for #829","created_at":"2016-03-18T02:32:09Z","updated_at":"2016-03-21T15:16:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70f557412de44867160b6b28188c7682569a5307","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293/commits","review_comments_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293/comments","review_comment_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1293/comments","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/6d1035cb583d2c19df33b7487e7f78b1ebb80920","head":{"label":"MikhailArkhipov:master","ref":"master","sha":"6d1035cb583d2c19df33b7487e7f78b1ebb80920","user":{"login":"MikhailArkhipov","id":12820357,"avatar_url":"https://avatars.githubusercontent.com/u/12820357?v=3","gravatar_id":"","url":"https://api.github.com/users/MikhailArkhipov","html_url":"https://github.com/MikhailArkhipov","followers_url":"https://api.github.com/users/MikhailArkhipov/followers","following_url":"https://api.github.com/users/MikhailArkhipov/following{/other_user}","gists_url":"https://api.github.com/users/MikhailArkhipov/gists{/gist_id}","starred_url":"https://api.github.com/users/MikhailArkhipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikhailArkhipov/subscriptions","organizations_url":"https://api.github.com/users/MikhailArkhipov/orgs","repos_url":"https://api.github.com/users/MikhailArkhipov/repos","events_url":"https://api.github.com/users/MikhailArkhipov/events{/privacy}","received_events_url":"https://api.github.com/users/MikhailArkhipov/received_events","type":"User","site_admin":false},"repo":{"id":53517720,"name":"RTVS","full_name":"MikhailArkhipov/RTVS","owner":{"login":"MikhailArkhipov","id":12820357,"avatar_url":"https://avatars.githubusercontent.com/u/12820357?v=3","gravatar_id":"","url":"https://api.github.com/users/MikhailArkhipov","html_url":"https://github.com/MikhailArkhipov","followers_url":"https://api.github.com/users/MikhailArkhipov/followers","following_url":"https://api.github.com/users/MikhailArkhipov/following{/other_user}","gists_url":"https://api.github.com/users/MikhailArkhipov/gists{/gist_id}","starred_url":"https://api.github.com/users/MikhailArkhipov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikhailArkhipov/subscriptions","organizations_url":"https://api.github.com/users/MikhailArkhipov/orgs","repos_url":"https://api.github.com/users/MikhailArkhipov/repos","events_url":"https://api.github.com/users/MikhailArkhipov/events{/privacy}","received_events_url":"https://api.github.com/users/MikhailArkhipov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MikhailArkhipov/RTVS","description":"R Tools for Visual Studio.","fork":true,"url":"https://api.github.com/repos/MikhailArkhipov/RTVS","forks_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/forks","keys_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/teams","hooks_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/hooks","issue_events_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/events","assignees_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/tags","blobs_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/languages","stargazers_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/stargazers","contributors_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/contributors","subscribers_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/subscribers","subscription_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/subscription","commits_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/merges","archive_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/downloads","issues_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/MikhailArkhipov/RTVS/deployments","created_at":"2016-03-09T17:33:45Z","updated_at":"2016-03-09T17:33:51Z","pushed_at":"2016-03-21T14:46:25Z","git_url":"git://github.com/MikhailArkhipov/RTVS.git","ssh_url":"git@github.com:MikhailArkhipov/RTVS.git","clone_url":"https://github.com/MikhailArkhipov/RTVS.git","svn_url":"https://github.com/MikhailArkhipov/RTVS","homepage":null,"size":43683,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"Microsoft:master","ref":"master","sha":"3b38cd1924c19a25ccded3a5d6e0f2dab179736d","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":38640473,"name":"RTVS","full_name":"Microsoft/RTVS","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/RTVS","description":"R Tools for Visual Studio.","fork":false,"url":"https://api.github.com/repos/Microsoft/RTVS","forks_url":"https://api.github.com/repos/Microsoft/RTVS/forks","keys_url":"https://api.github.com/repos/Microsoft/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/RTVS/teams","hooks_url":"https://api.github.com/repos/Microsoft/RTVS/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/RTVS/events","assignees_url":"https://api.github.com/repos/Microsoft/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/RTVS/tags","blobs_url":"https://api.github.com/repos/Microsoft/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/RTVS/languages","stargazers_url":"https://api.github.com/repos/Microsoft/RTVS/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/RTVS/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/RTVS/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/RTVS/subscription","commits_url":"https://api.github.com/repos/Microsoft/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/RTVS/merges","archive_url":"https://api.github.com/repos/Microsoft/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/RTVS/downloads","issues_url":"https://api.github.com/repos/Microsoft/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/RTVS/deployments","created_at":"2015-07-06T19:14:09Z","updated_at":"2016-03-21T12:45:43Z","pushed_at":"2016-03-21T14:45:13Z","git_url":"git://github.com/Microsoft/RTVS.git","ssh_url":"git@github.com:Microsoft/RTVS.git","clone_url":"https://github.com/Microsoft/RTVS.git","svn_url":"https://github.com/Microsoft/RTVS","homepage":null,"size":43759,"stargazers_count":100,"watchers_count":100,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":212,"forks":21,"open_issues":212,"watchers":100,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1293"},"issue":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1293"},"comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1293/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1293/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/RTVS/statuses/6d1035cb583d2c19df33b7487e7f78b1ebb80920"}}}}