This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix various extensions bugs to improve the basic-code-intel experience #1240
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 tasks
Codecov Report
|
lguychard
suggested changes
Dec 5, 2018
| GROUPS.map( | ||
| ({ name, defaultSize }, i) => | ||
| ((groupByFile && name === 'file') || groups[i].length > 1) && ( | ||
| ({ name, defaultSize, key }, i) => |
Contributor
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 is getting pretty hard to parse, and the reasoning behind all the cases you're checking for isn't clear. I suggest extracting this logic and making it more explicit, eg:
const groupsToDisplay = GROUPS.filter(({ name, key }, i) => {
// No locations were returned for this group - don't display it
if (!groups[i]) {
return false
}
// Always display file groups
else if (groupByFile && name === 'file') {
return true
}
...
})
return (
<div className={`hierarchical-locations-view ${this.props.className || ''}`}>
{selectedGroups && groupsToDisplay.map(({ name, defaultSize }, i) => {
...
})}
Member
Author
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.
Good call. I will make this code much clearer.
…vider from breaking all others
sqs
commented
Dec 6, 2018
Member
Author
|
@lguychard Thanks for the review! Updated, PTAL. |
lguychard
approved these changes
Dec 6, 2018
Contributor
lguychard
left a comment
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.
LGTM
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I made these fixes while working on sourcegraph/code-intel-extensions#8.
Fixes #838