{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments/26882247","id":26882247,"diff_hunk":"@@ -110,25 +120,115 @@ public void ExecuteDebuggingCommand(string debuggingCommand)\n         /// <param name=\"bp\">Breakpoint to set</param>\r\n         public void SetBreakpoint(PowershellBreakpoint bp)\r\n         {\r\n+            IEnumerable<PSObject> lbp;\r\n+\r\n             ServiceCommon.Log(\"Setting breakpoint ...\");\r\n+            try\r\n+            {\r\n+                using (var pipeline = (_runspace.CreatePipeline()))\r\n+                {\r\n+                    var command = new Command(\"Set-PSBreakpoint\");\r\n \r\n-            using (var pipeline = (_runspace.CreatePipeline()))\r\n+                    string file = bp.ScriptFullPath;\r\n+                    if (_runspace.ConnectionInfo != null && _mapLocalToRemote.ContainsKey(bp.ScriptFullPath))\r\n+                    {\r\n+                        file = _mapLocalToRemote[bp.ScriptFullPath];\r\n+                    }\r\n+\r\n+                    command.Parameters.Add(\"Script\", file);\r\n+\r\n+                    command.Parameters.Add(\"Line\", bp.Line);\r\n+\r\n+                    pipeline.Commands.Add(command);\r\n+\r\n+                    lbp = pipeline.Invoke();\r\n+                }\r\n+\r\n+                var pobj = lbp.FirstOrDefault();\r\n+                if (pobj != null)\r\n+                {\r\n+                    _psBreakpointTable.Add(\r\n+                        new PowershellBreakpointRecord(\r\n+                            bp,\r\n+                            ((LineBreakpoint)pobj.BaseObject).Id));\r\n+                }\r\n+            }\r\n+            catch (InvalidOperationException)\r\n             {\r\n-                var command = new Command(\"Set-PSBreakpoint\");\r\n+                ServiceCommon.Log(\"Invalid breakpoint location!\");\r\n+            }\r\n+        }\r\n \r\n-                string file = bp.ScriptFullPath;\r\n-                if (_runspace.ConnectionInfo != null && _mapLocalToRemote.ContainsKey(bp.ScriptFullPath))\r\n+        /// <summary>\r\n+        /// Remove breakpoint for the current runspace.\r\n+        /// </summary>\r\n+        /// <param name=\"bp\">Breakpoint to set</param>\r\n+        public void RemoveBreakpoint(PowershellBreakpoint bp)\r\n+        {\r\n+            int id = GetPSBreakpointId(bp);\r\n+\r\n+            if (id >= 0)\r\n+            {\r\n+                ServiceCommon.Log(\"Removing breakpoint ...\");\r\n+\r\n+                using (var pipeline = (_runspace.CreatePipeline()))\r\n                 {\r\n-                    file = _mapLocalToRemote[bp.ScriptFullPath];\r\n+                    var command = new Command(\"Remove-PSBreakpoint\");\r","path":"PowershellTools.HostService/ServiceManagement/Debugging/PowershellDebuggingService.cs","position":100,"original_position":100,"commit_id":"ce257ea80f509589bcd210cb6acda2d00378652c","original_commit_id":"ce257ea80f509589bcd210cb6acda2d00378652c","user":{"login":"AndreSayreMSFT","id":10080679,"avatar_url":"https://avatars.githubusercontent.com/u/10080679?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreSayreMSFT","html_url":"https://github.com/AndreSayreMSFT","followers_url":"https://api.github.com/users/AndreSayreMSFT/followers","following_url":"https://api.github.com/users/AndreSayreMSFT/following{/other_user}","gists_url":"https://api.github.com/users/AndreSayreMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreSayreMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreSayreMSFT/subscriptions","organizations_url":"https://api.github.com/users/AndreSayreMSFT/orgs","repos_url":"https://api.github.com/users/AndreSayreMSFT/repos","events_url":"https://api.github.com/users/AndreSayreMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/AndreSayreMSFT/received_events","type":"User","site_admin":false},"body":"Const string?","created_at":"2015-03-20T22:42:00Z","updated_at":"2015-03-20T22:42:00Z","html_url":"https://github.com/Microsoft/poshtools/pull/271#discussion_r26882247","pull_request_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/271","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments/26882247"},"html":{"href":"https://github.com/Microsoft/poshtools/pull/271#discussion_r26882247"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/271"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/poshtools/pulls/271","id":31657200,"html_url":"https://github.com/Microsoft/poshtools/pull/271","diff_url":"https://github.com/Microsoft/poshtools/pull/271.diff","patch_url":"https://github.com/Microsoft/poshtools/pull/271.patch","issue_url":"https://api.github.com/repos/Microsoft/poshtools/issues/271","number":271,"state":"open","locked":false,"title":"Add/Remove/Enable/Disable Breakpoint during debugging support","user":{"login":"EricMSFT","id":10081101,"avatar_url":"https://avatars.githubusercontent.com/u/10081101?v=3","gravatar_id":"","url":"https://api.github.com/users/EricMSFT","html_url":"https://github.com/EricMSFT","followers_url":"https://api.github.com/users/EricMSFT/followers","following_url":"https://api.github.com/users/EricMSFT/following{/other_user}","gists_url":"https://api.github.com/users/EricMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/EricMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricMSFT/subscriptions","organizations_url":"https://api.github.com/users/EricMSFT/orgs","repos_url":"https://api.github.com/users/EricMSFT/repos","events_url":"https://api.github.com/users/EricMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/EricMSFT/received_events","type":"User","site_admin":false},"body":"#253 #167 #270\r\nAlso refactored the way of setting original breakpoints.\r\n\r\n@AndreSayreMSFT @adamdriscoll @HuanhuanSunMSFT ","created_at":"2015-03-20T22:27:18Z","updated_at":"2015-03-20T22:42:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd8221ca6e3a07417e301b4277504ec7b0ecd96c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/271/commits","review_comments_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/271/comments","review_comment_url":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/issues/271/comments","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/ce257ea80f509589bcd210cb6acda2d00378652c","head":{"label":"Microsoft:bp","ref":"bp","sha":"ce257ea80f509589bcd210cb6acda2d00378652c","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":27854486,"name":"poshtools","full_name":"Microsoft/poshtools","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/poshtools","description":"PowerShell integration for Visual Studio","fork":true,"url":"https://api.github.com/repos/Microsoft/poshtools","forks_url":"https://api.github.com/repos/Microsoft/poshtools/forks","keys_url":"https://api.github.com/repos/Microsoft/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/poshtools/teams","hooks_url":"https://api.github.com/repos/Microsoft/poshtools/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/poshtools/events","assignees_url":"https://api.github.com/repos/Microsoft/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/poshtools/tags","blobs_url":"https://api.github.com/repos/Microsoft/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/poshtools/languages","stargazers_url":"https://api.github.com/repos/Microsoft/poshtools/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/poshtools/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/poshtools/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/poshtools/subscription","commits_url":"https://api.github.com/repos/Microsoft/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/poshtools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/poshtools/merges","archive_url":"https://api.github.com/repos/Microsoft/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/poshtools/downloads","issues_url":"https://api.github.com/repos/Microsoft/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/poshtools/releases{/id}","created_at":"2014-12-11T04:44:03Z","updated_at":"2015-03-20T19:01:55Z","pushed_at":"2015-03-20T22:27:18Z","git_url":"git://github.com/Microsoft/poshtools.git","ssh_url":"git@github.com:Microsoft/poshtools.git","clone_url":"https://github.com/Microsoft/poshtools.git","svn_url":"https://github.com/Microsoft/poshtools","homepage":"http://www.visualstudio.com/","size":11075,"stargazers_count":54,"watchers_count":54,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":91,"forks":8,"open_issues":91,"watchers":54,"default_branch":"dev"}},"base":{"label":"Microsoft:dev","ref":"dev","sha":"d566774ca72b9ac35860ed17b4d7a3b421ff76e9","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":27854486,"name":"poshtools","full_name":"Microsoft/poshtools","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/poshtools","description":"PowerShell integration for Visual Studio","fork":true,"url":"https://api.github.com/repos/Microsoft/poshtools","forks_url":"https://api.github.com/repos/Microsoft/poshtools/forks","keys_url":"https://api.github.com/repos/Microsoft/poshtools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/poshtools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/poshtools/teams","hooks_url":"https://api.github.com/repos/Microsoft/poshtools/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/poshtools/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/poshtools/events","assignees_url":"https://api.github.com/repos/Microsoft/poshtools/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/poshtools/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/poshtools/tags","blobs_url":"https://api.github.com/repos/Microsoft/poshtools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/poshtools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/poshtools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/poshtools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/poshtools/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/poshtools/languages","stargazers_url":"https://api.github.com/repos/Microsoft/poshtools/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/poshtools/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/poshtools/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/poshtools/subscription","commits_url":"https://api.github.com/repos/Microsoft/poshtools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/poshtools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/poshtools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/poshtools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/poshtools/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/poshtools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/poshtools/merges","archive_url":"https://api.github.com/repos/Microsoft/poshtools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/poshtools/downloads","issues_url":"https://api.github.com/repos/Microsoft/poshtools/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/poshtools/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/poshtools/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/poshtools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/poshtools/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/poshtools/releases{/id}","created_at":"2014-12-11T04:44:03Z","updated_at":"2015-03-20T19:01:55Z","pushed_at":"2015-03-20T22:27:18Z","git_url":"git://github.com/Microsoft/poshtools.git","ssh_url":"git@github.com:Microsoft/poshtools.git","clone_url":"https://github.com/Microsoft/poshtools.git","svn_url":"https://github.com/Microsoft/poshtools","homepage":"http://www.visualstudio.com/","size":11075,"stargazers_count":54,"watchers_count":54,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":91,"forks":8,"open_issues":91,"watchers":54,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/271"},"html":{"href":"https://github.com/Microsoft/poshtools/pull/271"},"issue":{"href":"https://api.github.com/repos/Microsoft/poshtools/issues/271"},"comments":{"href":"https://api.github.com/repos/Microsoft/poshtools/issues/271/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/271/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/poshtools/pulls/271/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/poshtools/statuses/ce257ea80f509589bcd210cb6acda2d00378652c"}}}}