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.
Paths
| Differential D37650
[continued] Add a way to get the CXCursor that corresponds to a completion result Needs RevisionPublic Authored by svenbrauch on Sep 8 2017, 4:16 PM.
Details Summary 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 ?
This revision now requires changes to proceed.Sep 21 2017, 6:43 AM svenbrauch edited edge metadata. Comment ActionsSorry 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 ;-) This revision now requires changes to proceed.Jan 9 2018, 4:52 AM 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!
Revision Contents
Diff 119123 include/clang-c/Index.h
test/CodeCompletion/member-access.cpp
test/CodeCompletion/operator.cpp
test/CodeCompletion/templates.cpp
tools/c-index-test/c-index-test.c
tools/libclang/CIndexCodeCompletion.cpp
tools/libclang/libclang.exports
|
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.