{"action":"created","comment":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/40493363","id":40493363,"diff_hunk":"@@ -0,0 +1,87 @@\n+﻿namespace FSharpVSPowerTools.Linting\n+\n+open FSharpVSPowerTools\n+open Microsoft.VisualStudio.Shell\n+open System.ComponentModel\n+open System.Diagnostics\n+open System.IO\n+open System.Runtime.InteropServices\n+open System.Windows\n+open System.ComponentModel.Composition\n+open Microsoft.VisualStudio.OLE.Interop\n+open System.Collections.Generic\n+open FSharpLint.Framework.Configuration\n+open Management\n+open LintUtils\n+\n+[<Guid(\"f0bb4785-e75a-485f-86e8-e382dd5934a4\")>]\n+type LintOptionsPage private (dte:EnvDTE.DTE option) =\n+    inherit UIElementDialogPage()\n+\n+    let mutable loadedConfigs = LoadedConfigs.Empty\n+\n+    let lintOptionsPageControl = lazy LintOptionsControlProvider()\n+\n+    let saveViewModel (viewModel:LintViewModel) =\n+        match viewModel.ViewModel with\n+        | Some(optionsViewModel) -> \n+            loadedConfigs <- saveViewModelToLoadedConfigs loadedConfigs optionsViewModel\n+            saveViewModel loadedConfigs optionsViewModel\n+        | None -> ()\n+\n+    new (dte) = new LintOptionsPage(Some dte)\n+\n+    new () = new LintOptionsPage(None)\n+\n+    interface ILintOptions with\n+        member this.UpdateDirectories() =\n+            loadedConfigs <- updateLoadedConfigs (this.GetDte()) loadedConfigs\n+\n+        member this.GetConfigurationForDirectory(dir) =\n+            getConfigForDirectory loadedConfigs dir\n+\n+    member private this.GetDte() =\n+        match dte with\n+        | Some(dte) -> dte\n+        | None -> this.GetService(typeof<EnvDTE.DTE>) :?> EnvDTE.DTE\n+            \n+    override this.OnApply(_) = \n+        match lintOptionsPageControl.Value.DataContext with\n+        | :? LintViewModel as viewModel -> saveViewModel viewModel\n+        | _ -> ()\n+\n+    override this.OnActivate(_) = \n+        let dte = this.GetDte()\n+\n+        loadedConfigs <- updateLoadedConfigs dte loadedConfigs\n+        loadedConfigs <- refresh tryLoadConfig loadedConfigs\n+\n+        let lintOptions =\n+            match getInitialPath dte loadedConfigs with\n+            | Some(path) ->\n+                let files = getFileHierarchy loadedConfigs\n+\n+                let rec getFileViewModel (files:FileViewModel seq) =\n+                    let getFile (file:FileViewModel) =\n+                        if file.Path = path then Some(file) \n+                        else getFileViewModel file.Files\n+\n+                    Seq.tryPick getFile files\n+\n+                match getFileViewModel files with\n+                | Some(file) ->\n+                    OptionsViewModel(\n+                        (fun dir -> getConfigForDirectory loadedConfigs dir),\n+                        files,\n+                        file) |> Some\n+                | None -> \n+                    Debug.Assert(false, \"No file view model for the initial file found.\")\n+                    None\n+            | None -> \n+                None\n+\n+        lintOptionsPageControl.Value.DataContext <- LintViewModel(lintOptions, saveViewModel)\n+            \n+    override this.Child = ","path":"src/FSharpVSPowerTools.Logic/Linting/LintOptionsPage.fs","position":85,"original_position":85,"commit_id":"15f674b75303ea0b58098f88127e0581e71a3c83","original_commit_id":"15f674b75303ea0b58098f88127e0581e71a3c83","user":{"login":"vasily-kirichenko","id":873919,"avatar_url":"https://avatars.githubusercontent.com/u/873919?v=3","gravatar_id":"","url":"https://api.github.com/users/vasily-kirichenko","html_url":"https://github.com/vasily-kirichenko","followers_url":"https://api.github.com/users/vasily-kirichenko/followers","following_url":"https://api.github.com/users/vasily-kirichenko/following{/other_user}","gists_url":"https://api.github.com/users/vasily-kirichenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vasily-kirichenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasily-kirichenko/subscriptions","organizations_url":"https://api.github.com/users/vasily-kirichenko/orgs","repos_url":"https://api.github.com/users/vasily-kirichenko/repos","events_url":"https://api.github.com/users/vasily-kirichenko/events{/privacy}","received_events_url":"https://api.github.com/users/vasily-kirichenko/received_events","type":"User","site_admin":false},"body":"as above.","created_at":"2015-09-26T12:58:07Z","updated_at":"2015-09-26T12:58:07Z","html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097#discussion_r40493363","pull_request_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097","_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments/40493363"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097#discussion_r40493363"},"pull_request":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097"}}},"pull_request":{"url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097","id":43345552,"html_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097","diff_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097.diff","patch_url":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097.patch","issue_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1097","number":1097,"state":"open","locked":false,"title":"[WIP] Integration of FSharpLint","user":{"login":"duckmatt","id":3247369,"avatar_url":"https://avatars.githubusercontent.com/u/3247369?v=3","gravatar_id":"","url":"https://api.github.com/users/duckmatt","html_url":"https://github.com/duckmatt","followers_url":"https://api.github.com/users/duckmatt/followers","following_url":"https://api.github.com/users/duckmatt/following{/other_user}","gists_url":"https://api.github.com/users/duckmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/duckmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckmatt/subscriptions","organizations_url":"https://api.github.com/users/duckmatt/orgs","repos_url":"https://api.github.com/users/duckmatt/repos","events_url":"https://api.github.com/users/duckmatt/events{/privacy}","received_events_url":"https://api.github.com/users/duckmatt/received_events","type":"User","site_admin":false},"body":"This pull request is to finish up the intgeration of FSharpLint by providing a configuration pane in the power tools options. #1094 \r\n\r\nThe work here so far is mostly to display an existing (default) configuration file in the options. Going forwards I'm looking to integrate it with the configuration management functionality I've been adding to FSharpLint so that any updates made by the user are saved back to disk, and then cleaned up into a state where it can be merged.","created_at":"2015-08-25T22:41:11Z","updated_at":"2015-09-26T12:58:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"412798833e1b2d750ec96d75f2567e97992830ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097/commits","review_comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097/comments","review_comment_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1097/comments","statuses_url":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/15f674b75303ea0b58098f88127e0581e71a3c83","head":{"label":"duckmatt:master","ref":"master","sha":"15f674b75303ea0b58098f88127e0581e71a3c83","user":{"login":"duckmatt","id":3247369,"avatar_url":"https://avatars.githubusercontent.com/u/3247369?v=3","gravatar_id":"","url":"https://api.github.com/users/duckmatt","html_url":"https://github.com/duckmatt","followers_url":"https://api.github.com/users/duckmatt/followers","following_url":"https://api.github.com/users/duckmatt/following{/other_user}","gists_url":"https://api.github.com/users/duckmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/duckmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckmatt/subscriptions","organizations_url":"https://api.github.com/users/duckmatt/orgs","repos_url":"https://api.github.com/users/duckmatt/repos","events_url":"https://api.github.com/users/duckmatt/events{/privacy}","received_events_url":"https://api.github.com/users/duckmatt/received_events","type":"User","site_admin":false},"repo":{"id":40058412,"name":"VisualFSharpPowerTools","full_name":"duckmatt/VisualFSharpPowerTools","owner":{"login":"duckmatt","id":3247369,"avatar_url":"https://avatars.githubusercontent.com/u/3247369?v=3","gravatar_id":"","url":"https://api.github.com/users/duckmatt","html_url":"https://github.com/duckmatt","followers_url":"https://api.github.com/users/duckmatt/followers","following_url":"https://api.github.com/users/duckmatt/following{/other_user}","gists_url":"https://api.github.com/users/duckmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/duckmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duckmatt/subscriptions","organizations_url":"https://api.github.com/users/duckmatt/orgs","repos_url":"https://api.github.com/users/duckmatt/repos","events_url":"https://api.github.com/users/duckmatt/events{/privacy}","received_events_url":"https://api.github.com/users/duckmatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/duckmatt/VisualFSharpPowerTools","description":"Power commands for F# in Visual Studio","fork":true,"url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools","forks_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/forks","keys_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/teams","hooks_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/hooks","issue_events_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/issues/events{/number}","events_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/events","assignees_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/assignees{/user}","branches_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/branches{/branch}","tags_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/tags","blobs_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/statuses/{sha}","languages_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/languages","stargazers_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/stargazers","contributors_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/contributors","subscribers_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/subscribers","subscription_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/subscription","commits_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/contents/{+path}","compare_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/merges","archive_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/downloads","issues_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/issues{/number}","pulls_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/pulls{/number}","milestones_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/milestones{/number}","notifications_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/labels{/name}","releases_url":"https://api.github.com/repos/duckmatt/VisualFSharpPowerTools/releases{/id}","created_at":"2015-08-01T19:57:05Z","updated_at":"2015-08-01T19:57:06Z","pushed_at":"2015-09-17T21:25:11Z","git_url":"git://github.com/duckmatt/VisualFSharpPowerTools.git","ssh_url":"git@github.com:duckmatt/VisualFSharpPowerTools.git","clone_url":"https://github.com/duckmatt/VisualFSharpPowerTools.git","svn_url":"https://github.com/duckmatt/VisualFSharpPowerTools","homepage":"http://fsprojects.github.io/VisualFSharpPowerTools/","size":20491,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"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":"3c35fb09329e344a79f8cc42661465ee51cd67a4","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}","created_at":"2014-01-28T13:45:30Z","updated_at":"2015-09-22T02:47:11Z","pushed_at":"2015-09-21T00:47:23Z","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":27792,"stargazers_count":196,"watchers_count":196,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":60,"mirror_url":null,"open_issues_count":40,"forks":60,"open_issues":40,"watchers":196,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097"},"html":{"href":"https://github.com/fsprojects/VisualFSharpPowerTools/pull/1097"},"issue":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1097"},"comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/issues/1097/comments"},"review_comments":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097/comments"},"review_comment":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/pulls/1097/commits"},"statuses":{"href":"https://api.github.com/repos/fsprojects/VisualFSharpPowerTools/statuses/15f674b75303ea0b58098f88127e0581e71a3c83"}}}}