rust-analyzer/crates/span/src
Chayim Refael Friedman b275f37db6 Fix a bug in span map merge, and add explanations of how span maps are stored
Because it took me hours to figure out that contrary to common sense, the offset stored is the *end* of the node, and we search by the *start*. Which is why we need a convoluted `partition_point()` instead of a simple `binary_search()`. And this was not documented at all. Which made me make mistakes with my implementation of `SpanMap::merge()`.

The other bug fixed about span map merging is correctly keeping track of the current offset in presence of multiple sibling macro invocations. Unrelated, but because of the previous issue it took me hours to debug, so I figured out I'll put them together for posterity.
2024-09-23 01:54:40 +03:00
..
ast_id.rs Newtype ErasedFileAstId 2024-08-05 13:46:47 +02:00
hygiene.rs chore: fix some comments 2024-09-02 18:33:23 +08:00
lib.rs Newtype ErasedFileAstId 2024-08-05 13:46:47 +02:00
map.rs Fix a bug in span map merge, and add explanations of how span maps are stored 2024-09-23 01:54:40 +03:00