Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions vsintegration/src/FSharp.VS.FSI/fsiSessionToolWindow.fs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,10 @@ module internal Locals =
/// Given a list of (key,value)
/// Chunk into (key,values) where the values are keys of (key,value) with the same key.
/// Complexity: this code is linear in (length kxs).
let rec chunkKeyValues kxs =
let rec loop kxs acc =
match kxs with
| [] -> List.rev acc
| (key, v)::rest -> accumulate key [v] rest acc
and accumulate k chunk rest acc =
match rest with
| (key, v)::rest when equal key k -> accumulate k (v::chunk) rest acc
| rest -> loop rest ((k, (List.rev chunk))::acc)
loop kxs []
let chunkKeyValues allEntries =
allEntries
|> List.groupBy(fun (responseType, line) -> responseType)
|> List.map(fun (responseType, entries) -> (responseType, entries |> List.map(fun (_, line) -> line)))


open Util
Expand Down