See https://reviews.llvm.org/D13599, I cannot update that because it has a different author.
Added a very simplistic auto test for the use case that motivated addition of the feature.
I'll add some more, just wanted to post this to see if people think it's the right way to go.
Since the location is added at the end, all the other tests still pass, FileCheck just looks for the string and doesn't care about the extra suffix.
I added a few more tests and found two issues:
Oh, one thing: I would like to remove the CursorKind member of the CXCompletionResult struct now since it is obsolete (same as clang_getCursorKind(Result->Cursor)). But, is that compatible with your API stability guarantees?
I don't think this upholds the ABI guarantee, but maybe I'm wrong? Can someone else chime in please? @klimek ?
can you add context to the patch please? i.e. re-upload via arc?
I think what you are doing here breaks the ABI though, and that was the reason for why I used a separate vector the last time, afaik.
I'm pretty sure this is not ABI compatible. You change the size of CXCompletionResult, so when anyone is iterating over the array in CXCompletionResults it will break. If you don't want to, I can try to find some time to take this over again ;-)
I know it breaks ABI compatiblity, I just don't know whether it needs to be kept (e.g. for clang-6.0). The alternative requires sorting by a separate index list which is a bit ugly (and slower). If you feel like working on it in the next few days that would of course be great, otherwise if it is clear that this solution doesn't work, I will pick it up again later. Thanks!