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.
Differential D37650
[continued] Add a way to get the CXCursor that corresponds to a completion result svenbrauch on Sep 8 2017, 4:16 PM. Authored by
Details 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.
Diff Detail Event TimelineComment Actions lgtm, but could we get some more tests rather than only this one for templates?
Comment Actions 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. Comment Actions I added a few more tests and found two issues:
Comment Actions 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? Comment Actions I don't think this upholds the ABI guarantee, but maybe I'm wrong? Can someone else chime in please? @klimek ?
Comment Actions Sorry for the wait. Any opinions on whether this compatibility promises? If it does, I can also fix Milian's variant with the extra list but it will be a bit slower. Comment Actions 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 ;-) Comment Actions 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! |
isn't the source location going to be printed everywhere now? are really no other test files affected by this?