clang and libclang: one more code-completion missing feature

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 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.