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

treeview #1527

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiaoniu-578fa6bff964d005

Similar to #1304 and #1137.

Copy link
Member

@yagebu yagebu left a 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[]) =>
Copy link
Member

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) =>
Copy link
Member

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("/"));
Copy link
Member

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...

Copy link
Member

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

@xiaoniu-578fa6bff964d005
Copy link
Author

Thanks for reviewing it and the comment. I hope I can take a look later this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants