{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments/53518036","id":53518036,"diff_hunk":"@@ -0,0 +1,98 @@\n+// Copyright (c) Microsoft Corporation.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+namespace Microsoft.VisualStudio.FSharp.LanguageService\n+\n+open Microsoft.VisualStudio\n+open Microsoft.VisualStudio.TextManager.Interop\n+open Microsoft.VisualStudio.Shell\n+open Microsoft.VisualStudio.Shell.Interop\n+open Microsoft.VisualStudio.FSharp.LanguageService\n+open Microsoft.FSharp.Compiler.SourceCodeServices\n+open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics \n+open Internal.Utilities.Collections\n+open Internal.Utilities.Debug\n+open System\n+open System.IO\n+open System.Diagnostics\n+open System.Collections.Generic\n+open Microsoft.CodeAnalysis\n+open Microsoft.VisualStudio.LanguageServices.Implementation\n+open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem\n+\n+type internal FSharpProjectSite(hierarchy: IVsHierarchy, serviceProvider: System.IServiceProvider, visualStudioWorkspace: VisualStudioWorkspaceImpl, projectName: string) =\n+    inherit AbstractProject(visualStudioWorkspace.ProjectTracker, null, projectName, hierarchy, \"F#\", serviceProvider, null, visualStudioWorkspace, null)\n+\n+    let mutable checkOptions : FSharpProjectOptions option = None\n+\n+    member internal this.CheckOptions = \n+            match checkOptions with \n+            | Some options -> options\n+            | None -> failwith \"Options haven't been computed yet.\"\n+\n+    member internal this.Initialize(hier: IVsHierarchy, site : IProjectSite) =\n+        this.ProjectTracker.AddProject(this)\n+\n+        site.AdviseProjectSiteChanges(FSharpCommonConstants.FSharpLanguageServiceCallbackName,\n+                                        new AdviseProjectSiteChanges(fun () -> this.OnProjectSettingsChanged(hier, site)))\n+\n+        site.AdviseProjectSiteClosed(FSharpCommonConstants.FSharpLanguageServiceCallbackName, \n+                                        new AdviseProjectSiteChanges(fun () -> this.Disconnect()))\n+\n+        // Add files and references.\n+        site.SourceFilesOnDisk() |> \n+            Seq.iter(fun file -> this.AddDocument(hier, file))\n+        \n+        this.GetReferences(site.CompilerFlags()) |> \n+            Seq.iter(fun ref -> this.AddReference(ref) |> ignore)\n+        \n+        // Capture the F# specific options that we'll pass to the type checker.\n+        checkOptions <- Some(ProjectSitesAndFiles.GetProjectOptionsForProjectSite(site, site.ProjectFileName()))\n+\n+    member this.GetReferences(flags : string[]) =\n+        let (|Reference|_|) (f : string) = if f.StartsWith(\"-r:\") then Some (f.Replace(\"-r:\", \"\")) else None\n+\n+        let references = flags |> \n+                         Seq.map(fun flag -> match flag with \n+                                             | Reference ref -> ref\n+                                             | _ -> \"\") |>\n+                         Seq.where(fun s -> s <> \"\")\n+        references\n+\n+    member this.AddReference(filePath : string) = \n+        this.AddMetadataReferenceAndTryConvertingToProjectReferenceIfPossible(filePath, new MetadataReferenceProperties(), VSConstants.S_FALSE)\n+\n+    member this.RemoveReference(filePath: string) =\n+        this.RemoveMetadataReference(filePath)\n+\n+    member internal this.AddDocument(hier: IVsHierarchy, file : string) = \n+        let itemid = \n+            match hier.ParseCanonicalName(file) with\n+            | (VSConstants.S_OK, id) -> id\n+            | _ -> uint32 VSConstants.VSITEMID.Nil\n+\n+        let document = this.ProjectTracker.DocumentProvider.TryGetDocumentForFile(this, itemid, file, SourceCodeKind.Regular, fun x -> true)\n+        this.AddDocument(document, true)\n+\n+    member internal this.OnProjectSettingsChanged(hier: IVsHierarchy, site : IProjectSite) = \n+        let sourceFiles = site.SourceFilesOnDisk()\n+        // Added files.\n+        sourceFiles |> \n+            Seq.where(fun file -> not(this.ContainsFile(file))) |> \n+            Seq.iter(fun file -> this.AddDocument(hier, file))\n+        // Removed files.\n+        this.GetCurrentDocuments() |> \n+            Seq.where(fun doc -> not(sourceFiles |> Seq.contains(doc.FilePath))) |>\n+            Seq.iter(fun doc -> this.RemoveDocument(doc))\n+\n+        let references = this.GetReferences(site.CompilerFlags())\n+        // Added references\n+        references |> ","path":"vsintegration/src/FSharp.LanguageService/FSharpProjectSite.fs","position":89,"original_position":89,"commit_id":"08be5d62a4e639b236d9bd685ee3ebf76e9639a6","original_commit_id":"08be5d62a4e639b236d9bd685ee3ebf76e9639a6","user":{"login":"vladima","id":8052307,"avatar_url":"https://avatars.githubusercontent.com/u/8052307?v=3","gravatar_id":"","url":"https://api.github.com/users/vladima","html_url":"https://github.com/vladima","followers_url":"https://api.github.com/users/vladima/followers","following_url":"https://api.github.com/users/vladima/following{/other_user}","gists_url":"https://api.github.com/users/vladima/gists{/gist_id}","starred_url":"https://api.github.com/users/vladima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladima/subscriptions","organizations_url":"https://api.github.com/users/vladima/orgs","repos_url":"https://api.github.com/users/vladima/repos","events_url":"https://api.github.com/users/vladima/events{/privacy}","received_events_url":"https://api.github.com/users/vladima/received_events","type":"User","site_admin":false},"body":"first traversal","created_at":"2016-02-19T21:05:37Z","updated_at":"2016-02-19T21:05:37Z","html_url":"https://github.com/Microsoft/visualfsharp/pull/974#discussion_r53518036","pull_request_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments/53518036"},"html":{"href":"https://github.com/Microsoft/visualfsharp/pull/974#discussion_r53518036"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974","id":59884850,"html_url":"https://github.com/Microsoft/visualfsharp/pull/974","diff_url":"https://github.com/Microsoft/visualfsharp/pull/974.diff","patch_url":"https://github.com/Microsoft/visualfsharp/pull/974.patch","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/974","number":974,"state":"open","locked":false,"title":"Replaced old language service with Roslyn-based one","user":{"login":"otawfik-ms","id":15987992,"avatar_url":"https://avatars.githubusercontent.com/u/15987992?v=3","gravatar_id":"","url":"https://api.github.com/users/otawfik-ms","html_url":"https://github.com/otawfik-ms","followers_url":"https://api.github.com/users/otawfik-ms/followers","following_url":"https://api.github.com/users/otawfik-ms/following{/other_user}","gists_url":"https://api.github.com/users/otawfik-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/otawfik-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otawfik-ms/subscriptions","organizations_url":"https://api.github.com/users/otawfik-ms/orgs","repos_url":"https://api.github.com/users/otawfik-ms/repos","events_url":"https://api.github.com/users/otawfik-ms/events{/privacy}","received_events_url":"https://api.github.com/users/otawfik-ms/received_events","type":"User","site_admin":false},"body":"@Microsoft/fsharp-compiler \r\nThis will stay in the new branch (roslyn), and users can try it by installing the vsix produced from the CI build there.\r\nThe current version just loads the new language service, and has no UI features (bare text editor).","created_at":"2016-02-19T00:05:30Z","updated_at":"2016-02-19T21:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2724dec87cf73c377a27a3c6e961feded6d3d498","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974/commits","review_comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974/comments","review_comment_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/974/comments","statuses_url":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/08be5d62a4e639b236d9bd685ee3ebf76e9639a6","head":{"label":"otawfik-ms:newlanguageservice","ref":"newlanguageservice","sha":"08be5d62a4e639b236d9bd685ee3ebf76e9639a6","user":{"login":"otawfik-ms","id":15987992,"avatar_url":"https://avatars.githubusercontent.com/u/15987992?v=3","gravatar_id":"","url":"https://api.github.com/users/otawfik-ms","html_url":"https://github.com/otawfik-ms","followers_url":"https://api.github.com/users/otawfik-ms/followers","following_url":"https://api.github.com/users/otawfik-ms/following{/other_user}","gists_url":"https://api.github.com/users/otawfik-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/otawfik-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otawfik-ms/subscriptions","organizations_url":"https://api.github.com/users/otawfik-ms/orgs","repos_url":"https://api.github.com/users/otawfik-ms/repos","events_url":"https://api.github.com/users/otawfik-ms/events{/privacy}","received_events_url":"https://api.github.com/users/otawfik-ms/received_events","type":"User","site_admin":false},"repo":{"id":46747885,"name":"visualfsharp","full_name":"otawfik-ms/visualfsharp","owner":{"login":"otawfik-ms","id":15987992,"avatar_url":"https://avatars.githubusercontent.com/u/15987992?v=3","gravatar_id":"","url":"https://api.github.com/users/otawfik-ms","html_url":"https://github.com/otawfik-ms","followers_url":"https://api.github.com/users/otawfik-ms/followers","following_url":"https://api.github.com/users/otawfik-ms/following{/other_user}","gists_url":"https://api.github.com/users/otawfik-ms/gists{/gist_id}","starred_url":"https://api.github.com/users/otawfik-ms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otawfik-ms/subscriptions","organizations_url":"https://api.github.com/users/otawfik-ms/orgs","repos_url":"https://api.github.com/users/otawfik-ms/repos","events_url":"https://api.github.com/users/otawfik-ms/events{/privacy}","received_events_url":"https://api.github.com/users/otawfik-ms/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/otawfik-ms/visualfsharp","description":"The Visual F# compiler and tools","fork":true,"url":"https://api.github.com/repos/otawfik-ms/visualfsharp","forks_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/forks","keys_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/teams","hooks_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/hooks","issue_events_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/issues/events{/number}","events_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/events","assignees_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/assignees{/user}","branches_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/branches{/branch}","tags_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/tags","blobs_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/statuses/{sha}","languages_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/languages","stargazers_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/stargazers","contributors_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/contributors","subscribers_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/subscribers","subscription_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/subscription","commits_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/contents/{+path}","compare_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/merges","archive_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/downloads","issues_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/issues{/number}","pulls_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/pulls{/number}","milestones_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/milestones{/number}","notifications_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/labels{/name}","releases_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/releases{/id}","deployments_url":"https://api.github.com/repos/otawfik-ms/visualfsharp/deployments","created_at":"2015-11-23T21:04:43Z","updated_at":"2016-01-11T18:04:50Z","pushed_at":"2016-02-18T23:53:22Z","git_url":"git://github.com/otawfik-ms/visualfsharp.git","ssh_url":"git@github.com:otawfik-ms/visualfsharp.git","clone_url":"https://github.com/otawfik-ms/visualfsharp.git","svn_url":"https://github.com/otawfik-ms/visualfsharp","homepage":null,"size":59909,"stargazers_count":0,"watchers_count":0,"language":"F#","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:roslyn","ref":"roslyn","sha":"077051f359d844d9cd50834a78fed5364130909b","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":29048891,"name":"visualfsharp","full_name":"Microsoft/visualfsharp","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/visualfsharp","description":"The Visual F# compiler and tools","fork":false,"url":"https://api.github.com/repos/Microsoft/visualfsharp","forks_url":"https://api.github.com/repos/Microsoft/visualfsharp/forks","keys_url":"https://api.github.com/repos/Microsoft/visualfsharp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/visualfsharp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/visualfsharp/teams","hooks_url":"https://api.github.com/repos/Microsoft/visualfsharp/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/events","assignees_url":"https://api.github.com/repos/Microsoft/visualfsharp/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/visualfsharp/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/visualfsharp/tags","blobs_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/visualfsharp/languages","stargazers_url":"https://api.github.com/repos/Microsoft/visualfsharp/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/visualfsharp/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/visualfsharp/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/visualfsharp/subscription","commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/visualfsharp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/visualfsharp/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/visualfsharp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/visualfsharp/merges","archive_url":"https://api.github.com/repos/Microsoft/visualfsharp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/visualfsharp/downloads","issues_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/visualfsharp/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/visualfsharp/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/visualfsharp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/visualfsharp/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/visualfsharp/deployments","created_at":"2015-01-10T05:58:43Z","updated_at":"2016-02-19T12:40:04Z","pushed_at":"2016-02-19T00:05:30Z","git_url":"git://github.com/Microsoft/visualfsharp.git","ssh_url":"git@github.com:Microsoft/visualfsharp.git","clone_url":"https://github.com/Microsoft/visualfsharp.git","svn_url":"https://github.com/Microsoft/visualfsharp","homepage":null,"size":220368,"stargazers_count":660,"watchers_count":660,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":160,"mirror_url":null,"open_issues_count":255,"forks":160,"open_issues":255,"watchers":660,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974"},"html":{"href":"https://github.com/Microsoft/visualfsharp/pull/974"},"issue":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/issues/974"},"comments":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/issues/974/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/pulls/974/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/visualfsharp/statuses/08be5d62a4e639b236d9bd685ee3ebf76e9639a6"}}}}