{"action":"created","comment":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/71089650","id":71089650,"diff_hunk":"@@ -213,36 +213,39 @@ type GoToDefinitionFilter\n     }\n \n     let gotoDefinition continueCommandChain =\n+        let uiContext = SynchronizationContext.Current\n+        let doFallbackContinuation () = async {\n+              // Run the operation on UI thread since continueCommandChain may access UI components.\n+              do! Async.SwitchToContext uiContext\n+              // Declaration location might exist so let Visual F# Tools handle it. \n+              return continueCommandChain()\n+          }\n+\n         let cancelToken = new CancellationTokenSource() \n         cancellationToken.Swap (fun _ -> Some (cancelToken))\n         |> Option.iter (fun oldToken -> \n             oldToken.Cancel()\n             oldToken.Dispose())\n-        let uiContext = SynchronizationContext.Current\n+\n         let worker =\n             async {\n                 let getLexerState = vsLanguageService.GetQueryLexState textBuffer\n-                match textBuffer.GetSnapshotPoint view.Caret.Position, vsLanguageService.GetCompleteTextForDocument doc.FilePath with\n-                | Some snapshotPoint, Some source ->\n-                    let pointInDocument = snapshotPoint.MakePointInDocument doc.FilePath source\n-                    let! symbolResult = getDocumentState pointInDocument getLexerState\n-                    match symbolResult with\n-                    | Some FoundInternal\n-                    | None ->\n-                        // Run the operation on UI thread since continueCommandChain may access UI components.\n-                        do! Async.SwitchToContext uiContext\n-                        // Declaration location might exist so let Visual F# Tools handle it. \n-                        return continueCommandChain()\n-                    | Some (FoundLoadDirective fileToOpen) -> \n-                        // directive found, navigate to the file at first line\n-                        serviceProvider.NavigateTo(fileToOpen, startRow=0, startCol=0, endRow=0, endCol=0)\n-                    | Some (FoundExternal (project, parseTree, symbol, fsSymbolUse)) ->\n-                        return! handleFoundExternal project parseTree symbol fsSymbolUse snapshotPoint\n-                | _ -> \n-                    // Run the operation on UI thread since continueCommandChain may access UI components.\n-                    do! Async.SwitchToContext uiContext\n-                    // Declaration location might exist so let Visual F# Tools handle it. \n-                    return continueCommandChain()\n+                let snapshotPoint = view.SnapshotPointAtCaret","path":"src/FSharp.Editing.VisualStudio/Navigation/GoToDefinitionFilter.fs","position":43,"original_position":43,"commit_id":"af031cbaaa9a782f9a092c005296939bc5004b84","original_commit_id":"af031cbaaa9a782f9a092c005296939bc5004b84","user":{"login":"smoothdeveloper","id":87944,"avatar_url":"https://avatars.githubusercontent.com/u/87944?v=3","gravatar_id":"","url":"https://api.github.com/users/smoothdeveloper","html_url":"https://github.com/smoothdeveloper","followers_url":"https://api.github.com/users/smoothdeveloper/followers","following_url":"https://api.github.com/users/smoothdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/smoothdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/smoothdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoothdeveloper/subscriptions","organizations_url":"https://api.github.com/users/smoothdeveloper/orgs","repos_url":"https://api.github.com/users/smoothdeveloper/repos","events_url":"https://api.github.com/users/smoothdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/smoothdeveloper/received_events","type":"User","site_admin":false},"body":"Sorry figured out after pushing, kept for next chance to improve that code :)","created_at":"2016-07-17T21:12:07Z","updated_at":"2016-07-17T21:12:07Z","html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442#discussion_r71089650","pull_request_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442","_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/71089650"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442#discussion_r71089650"},"pull_request":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442"}}},"pull_request":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442","id":77742401,"html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442","diff_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442.diff","patch_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442.patch","issue_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1442","number":1442,"state":"closed","locked":false,"title":"minor clean up to build PointInDocument from Visual Studio side","user":{"login":"smoothdeveloper","id":87944,"avatar_url":"https://avatars.githubusercontent.com/u/87944?v=3","gravatar_id":"","url":"https://api.github.com/users/smoothdeveloper","html_url":"https://github.com/smoothdeveloper","followers_url":"https://api.github.com/users/smoothdeveloper/followers","following_url":"https://api.github.com/users/smoothdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/smoothdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/smoothdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoothdeveloper/subscriptions","organizations_url":"https://api.github.com/users/smoothdeveloper/orgs","repos_url":"https://api.github.com/users/smoothdeveloper/repos","events_url":"https://api.github.com/users/smoothdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/smoothdeveloper/received_events","type":"User","site_admin":false},"body":"* ITextView.SnapshotPointAtCaret helper extension member\r\n* expose VSLanguageService.MakePointInDocument to better encapsulate obtaining PointInDocument from VS editor\r\n* GoToDefinitionFilter:\r\n  * factorized fallback continuation code (now needing it three times)\r\n  * simplify making PointInDocument, although since we need SnapshotPoint (to be simplified later hopefully) I'm using two steps (get snapshotpoint, then get pointindocument)","created_at":"2016-07-17T18:33:34Z","updated_at":"2016-07-17T21:12:07Z","closed_at":"2016-07-17T20:27:35Z","merged_at":"2016-07-17T20:27:35Z","merge_commit_sha":"db3617bd2cf2babafa8c404c5c403c545e65c39c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442/commits","review_comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442/comments","review_comment_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1442/comments","statuses_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/af031cbaaa9a782f9a092c005296939bc5004b84","head":{"label":"smoothdeveloper:pointindocument-from-visualstudio","ref":"pointindocument-from-visualstudio","sha":"af031cbaaa9a782f9a092c005296939bc5004b84","user":{"login":"smoothdeveloper","id":87944,"avatar_url":"https://avatars.githubusercontent.com/u/87944?v=3","gravatar_id":"","url":"https://api.github.com/users/smoothdeveloper","html_url":"https://github.com/smoothdeveloper","followers_url":"https://api.github.com/users/smoothdeveloper/followers","following_url":"https://api.github.com/users/smoothdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/smoothdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/smoothdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoothdeveloper/subscriptions","organizations_url":"https://api.github.com/users/smoothdeveloper/orgs","repos_url":"https://api.github.com/users/smoothdeveloper/repos","events_url":"https://api.github.com/users/smoothdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/smoothdeveloper/received_events","type":"User","site_admin":false},"repo":{"id":42415318,"name":"VisualFSharpPowerTools","full_name":"smoothdeveloper/VisualFSharpPowerTools","owner":{"login":"smoothdeveloper","id":87944,"avatar_url":"https://avatars.githubusercontent.com/u/87944?v=3","gravatar_id":"","url":"https://api.github.com/users/smoothdeveloper","html_url":"https://github.com/smoothdeveloper","followers_url":"https://api.github.com/users/smoothdeveloper/followers","following_url":"https://api.github.com/users/smoothdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/smoothdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/smoothdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smoothdeveloper/subscriptions","organizations_url":"https://api.github.com/users/smoothdeveloper/orgs","repos_url":"https://api.github.com/users/smoothdeveloper/repos","events_url":"https://api.github.com/users/smoothdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/smoothdeveloper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/smoothdeveloper/VisualFSharpPowerTools","description":"Power commands for F# in Visual Studio","fork":true,"url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools","forks_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/forks","keys_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/teams","hooks_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/hooks","issue_events_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/issues/events{/number}","events_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/events","assignees_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/assignees{/user}","branches_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/branches{/branch}","tags_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/tags","blobs_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/statuses/{sha}","languages_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/languages","stargazers_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/stargazers","contributors_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/contributors","subscribers_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/subscribers","subscription_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/subscription","commits_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/contents/{+path}","compare_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/merges","archive_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/downloads","issues_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/issues{/number}","pulls_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/pulls{/number}","milestones_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/milestones{/number}","notifications_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/labels{/name}","releases_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/releases{/id}","deployments_url":"https://api.github.com/repos/smoothdeveloper/VisualFSharpPowerTools/deployments","created_at":"2015-09-13T22:26:47Z","updated_at":"2016-04-24T16:21:44Z","pushed_at":"2016-07-17T18:31:52Z","git_url":"git://github.com/smoothdeveloper/VisualFSharpPowerTools.git","ssh_url":"git@github.com:smoothdeveloper/VisualFSharpPowerTools.git","clone_url":"https://github.com/smoothdeveloper/VisualFSharpPowerTools.git","svn_url":"https://github.com/smoothdeveloper/VisualFSharpPowerTools","homepage":"http://fsprojects.github.io/VisualFSharpPowerTools/","size":25443,"stargazers_count":0,"watchers_count":0,"language":"F#","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":"fsprojects:master","ref":"master","sha":"e30d18e61a2379257b686d545ac9efd01a3238a0","user":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?v=3","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"repo":{"id":16312934,"name":"VisualFSharpPowerTools","full_name":"fsprojects/VisualFSharpPowerTools","owner":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?v=3","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsprojects/VisualFSharpPowerTools","description":"Power commands for F# in Visual Studio","fork":false,"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools","forks_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/forks","keys_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/teams","hooks_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/hooks","issue_events_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/events{/number}","events_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/events","assignees_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/assignees{/user}","branches_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/branches{/branch}","tags_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/tags","blobs_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/{sha}","languages_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/languages","stargazers_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/stargazers","contributors_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/contributors","subscribers_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/subscribers","subscription_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/subscription","commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/contents/{+path}","compare_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/merges","archive_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/downloads","issues_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues{/number}","pulls_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls{/number}","milestones_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/milestones{/number}","notifications_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/labels{/name}","releases_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/releases{/id}","deployments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/deployments","created_at":"2014-01-28T13:45:30Z","updated_at":"2016-07-17T17:13:12Z","pushed_at":"2016-07-17T20:33:40Z","git_url":"git://github.com/fsprojects/VisualFSharpPowerTools.git","ssh_url":"git@github.com:fsprojects/VisualFSharpPowerTools.git","clone_url":"https://github.com/fsprojects/VisualFSharpPowerTools.git","svn_url":"https://github.com/fsprojects/VisualFSharpPowerTools","homepage":"http://fsprojects.github.io/VisualFSharpPowerTools/","size":30653,"stargazers_count":263,"watchers_count":263,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":83,"mirror_url":null,"open_issues_count":71,"forks":83,"open_issues":71,"watchers":263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1442"},"issue":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1442"},"comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1442/comments"},"review_comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442/comments"},"review_comment":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1442/commits"},"statuses":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/af031cbaaa9a782f9a092c005296939bc5004b84"}}}}
{"actor":{"display_login":"smoothdeveloper"}}