While dumping the element under PostingList iterator cursor, indicate whether this element is followed by or preceded by any other elements.
Details
Diff Detail
Event Timeline
clang-tools-extra/clangd/index/dex/Iterator.h | ||
---|---|---|
96–97 | I'd probably print ... [ID] ... to indicate that there can be other elements in the list. |
clang-tools-extra/clangd/index/dex/PostingList.cpp | ||
---|---|---|
66 | nit: should we drop the trailing ... if Index is the last element? |
This change seems fine but...
This representation with the raw DocIDs and position dumped seems mostly useful for debugging buggy iterator implementations, but not really useful for understanding query structure and behavior.
I thought we might be replacing this soon. Of course there's no fundamental reason we can't keep both but I'm curious why this is an area of focus :-)
I agree; There is another issue that I was looking into: I think that it might be useful to understand the structure of fuzzy find query when using dexp tool and I thought that it would be great if we could dump the iterator tree structure along with the results (which is an extension of D52233). For dexp usecase, it would be great to dump the size and the origin of each piece of iterator tree (e.g. labels), but I also think that it might be useful to have "debugging" format so I couldn't figure out what's the best approach here.
I thought we might be replacing this soon. Of course there's no fundamental reason we can't keep both but I'm curious why this is an area of focus :-)
Yes, we are. Initially, this wasn't an area of focus: I just forgot to update the comment in Iterator.h when moving PostingList to a separate file and slightly changing the format, but then Eric had a good proposal and I thought that it's a good improvement. Also, even though the implementation will be different, the dumping format could be the same, so it's not really implementation-specific.
I think this one is addressed in the VByte patch, so I'm closing this revision in order to prevent conflicts between these two.
I'd probably print ... [ID] ... to indicate that there can be other elements in the list.