-
Notifications
You must be signed in to change notification settings - Fork 293
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
treeview #1527
base: main
Are you sure you want to change the base?
treeview #1527
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for having another go at this.
I've left some small comments but haven't had an in-depth look at the code yet. Could you add documentation and tests for the main logic in treeview.ts ?
subfiles: FileNode[]; | ||
} | ||
|
||
const zip: <A, B>(a: A[], b: B[]) => [A, B][] = <A, B>(a: A[], b: B[]) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zip from d3-array could probably be used here instead
paths: string[][], | ||
filenodes: FileNode[] | ||
): [FileNode[], FolderNode[]] { | ||
const groupBy = <T>(arr: T[], key: (i: T) => string) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
group from d3-array could probably be used here instead
goToFileAndLine: (filename: string, line?: number) => void | ||
): [FileNode[], FolderNode[]] { | ||
files.sort(); | ||
const paths = files.map((file) => file.split("/")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work for paths on Windows...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess just splitting by forward and backward slashes might be good enough for our use case here
Thanks for reviewing it and the comment. I hope I can take a look later this month. |
Similar to #1304 and #1137.