Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Out/Error streams chunking in Fsi tool window #998

Merged
merged 2 commits into from
Mar 7, 2016
Merged
Changes from 1 commit
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 rec chunkKeyValues allEntries =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it rec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinRansom no. Refactoring miss. I'll change it now. Thanks for noticing.

allEntries
|> List.groupBy(fun (responseType, line) -> responseType)
|> List.map(fun (responseType, entries) -> (responseType, entries |> List.map(fun (_, line) -> line)))


open Util
Expand Down