[cfe-dev] Clang code complete walk-around?

Anton Smirnov dev at antonsmirnov.name
Fri Dec 13 20:22:01 PST 2013


Hello.

I'm working on adding code complete via Clang to text editor to make it IDE.

The source code:

"struct s {
  int a;
  float b;
};

void main() {
 s var;
 var."

the problem is that code complete for the position after dot returns
nothing and if i add "}" at the end and retry code complete for the
position after dot it shows the correct list.

I understand that the main function definition should be closed, but users
frequently type chars one-by-one and don't want to close function first and
then return back to variable and then get code complete. How can that be
walked-around to avoid go back/return?

My idea was to get diagnostics and add "}" if i get according diagnostics,
but it's unwished walk-around. Can Clang be smart enough to make it itself?

Thanks and regards,
Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131214/74a5acaa/attachment.html>


More information about the cfe-dev mailing list