<div dir="ltr">Here I have a very small .m file where I have typed "NSL" and would expect the top code completion suggestion to be "NSLog()":<div><br></div><div><a href="https://gist.github.com/bolinfest/11236613">https://gist.github.com/bolinfest/11236613</a><br>
</div><div><br></div><div>Here is my C code that calls libclang and uses it to get suggested code completions:</div><div><br></div><div><a href="https://gist.github.com/bolinfest/11236626">https://gist.github.com/bolinfest/11236626</a><br>
</div><div><br></div><div>Here are the suggestions I get when I run my C code (the command that I ran is `<span style="color:rgb(102,102,102);font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:14px;line-height:19.600000381469727px">./main.o Hello.m 5 6`)</span>:</div>
<div><br></div><div><a href="https://gist.github.com/bolinfest/11236652">https://gist.github.com/bolinfest/11236652</a><br></div><div><br></div><div>Some surprising results:</div><div><br></div><div>(1) libclang gives me over 5000 suggestions.</div>
<div>(2) NSLog() is in the list, but its priority is 50. There are all sorts of other suggestions that seem less relevant, but have a lower priority (counterintuitively, this means higher probability of being clicked on: <a href="http://clang.llvm.org/doxygen/group__CINDEX__CODE__COMPLET.html#ga46e843acdf63d9a7a0c7341a2d222c49">http://clang.llvm.org/doxygen/group__CINDEX__CODE__COMPLET.html#ga46e843acdf63d9a7a0c7341a2d222c49</a>). Search for "priority=40" in the gist to see examples of results with a lower priority that seem less relevant.</div>
<div>(3) The order in which things appear in the results appears to be random. I see that clang has a convenience function to sort results alphabetically, but not by priority.</div><div><br></div><div>Are there additional arguments that I need to pass to libclang to tune things so that the results I get from clang_codeCompleteAt() are more in line with what I expect?</div>
<div><br></div><div>Thank you,</div><div>Michael</div><div><br></div></div>