[RFC][CodeCompletion] Pre-expanding parameter placeholders in out-of-line method completion results

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[RFC][CodeCompletion] Pre-expanding parameter placeholders in out-of-line method completion results

David Chisnall via cfe-dev
Hi all,

Consider the following snippet of C++ code:

  class Const {
  public:
      void foo(int x, int y) const;
      void foo(Const &x) const;
  };

  void Const::

If we invoke Clang's code-completion after '::', Clang will produce the following results for the out-of-line method declarations:

  COMPLETION: foo : [#void#]foo(<#int x#>, <#int y#>)[# const#] 
  COMPLETION: foo : [#void#]foo(<#Const &x#>)[# const#]

The weird <##> tokens mean that currently method parameters are specified as completion placeholders. This means that a user might have to expand them manually (e.g. when their IDE treats those placeholders differently from the rest of the completion result).

I would like to change these completion results. Instead of having placeholders for parameters Clang should just specify the parameters directly. The example above would then produce the following completion results:

  COMPLETION: foo : [#void#]foo(int x, int y)[# const#]
  COMPLETION: foo : [#void#]foo(Const &x)[# const#]

Do you have any comments/suggestions/objections for this proposal?
Cheers,
Alex 

PS: Please note that this change is not going to affect completions for the method calls, but just for the out-of-line method definitions.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev