Skip to content

Commit

Permalink
Merge pull request dotnet#998 from otawfik-ms/bug864
Browse files Browse the repository at this point in the history
Fix Out/Error streams chunking in Fsi tool window
  • Loading branch information
Omar Tawfik committed Mar 7, 2016
2 parents f7503c2 + ec6c79c commit 22ba027
Showing 1 changed file with 4 additions and 10 deletions.
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

0 comments on commit 22ba027

Please sign in to comment.