[LLVMdev] clang and libclang: one more code-completion missing feature

Dmitry Frank dimon.frank at gmail.com
Fri Nov 30 00:48:41 PST 2012


Hello.

I guess I found one more missing feature in clang/libclang code-completion,
it relates to functions with defaulted arguments.

In the clang docs for clang API Documentation <http://goo.gl/UYOmL> there
is one example:

 void f(int x, float y = 3.14, double z = 2.71828);

The code-completion string for this function would contain:

   - a TypedText chunk for "f".
   - a LeftParen chunk for "(".
   - a Placeholder chunk for "int x"
   - an Optional chunk containing the remaining defaulted arguments, e.g.,
      - a Comma chunk for ","
      - a Placeholder chunk for "float y"
      - an Optional chunk containing the last defaulted argument:
         - a Comma chunk for ","
         - a Placeholder chunk for "double z"
       - a RightParen chunk for ")"


So, completion string does not contain actual default values for arguments.
But I'm pretty sure this is important information, and it should be
returned in completion string, and I would include it in the placeholder.

I.e. placeholder for y argument should actually contain "float y = 3.14" ,
instead of just "float y"

Please let me know if you agree or not.

--
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121130/645148ce/attachment.html>


More information about the llvm-dev mailing list