Skip to content

Commit 604fc9d

Browse files
committed
fantomas
1 parent 18cf167 commit 604fc9d

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

src/Ionide.ProjInfo/InspectSln.fs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ module InspectSln =
109109
// If this item is a subfolder, map it recursively
110110
// if it's a project, map it if it's in the 'projectsWeCareAbout' collection
111111
// for anything else, just use a generic item
112-
match p with
112+
match p with
113113
| :? Model.SolutionFolderModel as childFolder -> Some(parseFolder childFolder)
114114
| :? Model.SolutionProjectModel as childProject -> Some(parseProject childProject)
115115
| _ -> Some(parseItem p)
@@ -132,22 +132,41 @@ module InspectSln =
132132
// Projects at solution level get returned directly
133133
yield!
134134
projectsWeCareAbout
135-
|> Seq.filter (_.Parent >> isNull)
135+
|> Seq.filter (
136+
_.Parent
137+
>> isNull
138+
)
136139
|> Seq.map parseProject
137140

138141
// parseFolder will parse any projects or folders within the specified folder itself, so just process the root folders here
139142
yield!
140143
sln.SolutionFolders
141-
|> Seq.filter (_.Parent >> isNull)
144+
|> Seq.filter (
145+
_.Parent
146+
>> isNull
147+
)
142148
|> Seq.map parseFolder
143149

144150
// 'SolutionItems' contains all of SolutionFolders and SolutionProjects, so only include things that aren't in those to avoid duplication
145151
yield!
146152
sln.SolutionItems
147153
|> Seq.filter (fun item ->
148-
isNull item.Parent &&
149-
not(sln.SolutionFolders |> Seq.exists (_.Id >> (=) item.Id)) &&
150-
not(sln.SolutionProjects |> Seq.exists (_.Id >> (=) item.Id)))
154+
isNull item.Parent
155+
&& not (
156+
sln.SolutionFolders
157+
|> Seq.exists (
158+
_.Id
159+
>> (=) item.Id
160+
)
161+
)
162+
&& not (
163+
sln.SolutionProjects
164+
|> Seq.exists (
165+
_.Id
166+
>> (=) item.Id
167+
)
168+
)
169+
)
151170
|> Seq.map parseItem
152171
]
153172

test/Ionide.ProjInfo.Tests/TestAssets.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ let ``sample 15 nuget analyzers`` = {
377377
ProjectReferences = []
378378
}
379379

380-
/// A test for a solution with projects
380+
/// A test for a solution with projects
381381
let ``sample 16 solution folders`` = {
382382
ProjDir = "sample16-solution-with-solution-folders"
383383
AssemblyName = ""

test/Ionide.ProjInfo.Tests/Tests.fs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,9 +2429,12 @@ let sample16SolutionFoldersTest toolsPath loaderType workspaceFactory =
24292429
Expect.equal secondItem.Name "src" "Should have the src folder"
24302430

24312431
match secondItem.Kind with
2432-
| InspectSln.Folder (solutionItems, _) ->
2432+
| InspectSln.Folder(solutionItems, _) ->
24332433
match solutionItems with
2434-
| [ { Name = folderName; Kind = InspectSln.MSBuildFormat [] } ] ->
2434+
| [ {
2435+
Name = folderName
2436+
Kind = InspectSln.MSBuildFormat []
2437+
} ] ->
24352438
let expectedProjectPath = Path.Combine(slnDir, "src", "proj1", "proj1.fsproj")
24362439
Expect.equal folderName expectedProjectPath "Should have the expected project path"
24372440
| _ -> failtestf "Expected one folder item, but got %A" solutionItems
@@ -2442,9 +2445,12 @@ let sample16SolutionFoldersTest toolsPath loaderType workspaceFactory =
24422445
Expect.equal thirdItem.Name "tests" "Should have the tests folder"
24432446

24442447
match thirdItem.Kind with
2445-
| InspectSln.Folder (solutionItems, _) ->
2448+
| InspectSln.Folder(solutionItems, _) ->
24462449
match solutionItems with
2447-
| [ { Name = folderName; Kind = InspectSln.MSBuildFormat [] } ] ->
2450+
| [ {
2451+
Name = folderName
2452+
Kind = InspectSln.MSBuildFormat []
2453+
} ] ->
24482454
let expectedProjectPath = Path.Combine(slnDir, "test", "proj1.tests", "proj1.tests.fsproj")
24492455
Expect.equal folderName expectedProjectPath "Should have the expected test project path"
24502456
| _ -> failtestf "Expected one folder item, but got %A" solutionItems

0 commit comments

Comments
 (0)