Get last mapping if line matches but column is way bigger#17
Conversation
| if int(match.genLine) > genLine || int(match.genColumn) > genColumn { | ||
| if i == 0 { | ||
| // lets see if the line is correct but the column is bigger | ||
| match = &m.mappings[i-1] |
There was a problem hiding this comment.
This does not look right. It looks like you want to change
Lines 187 to 193 in 73a0ee2
There was a problem hiding this comment.
well, I guess we can move it there as well.
The thing is that sort.Search actually correctly search and finds that the place where this should be is at the end of the slice. In general sort.Search just finds where a thing is supposed to be not exactly if it's there, it's more answering the question where an element should be added in that regard.
This is a kin to the fuzzy search below where if what it was asked for isn't exactly there it will get the previous one if possible
There was a problem hiding this comment.
You are right. Probably I should not have used sort.Search here, because there are too many corner cases.
|
Thanks for the PR 👍 |
No description provided.