Code completion: remove type scopes?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code completion: remove type scopes?

Alex Denisov via cfe-dev
I'm experimenting with how completions are displayed in clangd, and trying to reduce the noise, particularly for templates.

e.g. this example
  std::vector<int> X;
  X.push_back|
currently produces
  void push_back(std::vector<int, std::allocator<int> >::value_type &&__x)
and i'd prefer
  void push_back(value_type &&__x)

I can get this by enabling PrintingPolicy.SuppressScope in SemaCodeComplete.
My initial thought was just to do this locally in clangd, but maybe:
 - there are known cases where this falls down terribly
 - this is just better and we should turn it on for other users (xcode?) too

The global change only breaks a few tests, in the obvious way: either a return type or parameter of a completion is no longer qualified.

(There are other things that are noisy here -- int would be better than value_type -- but that's a different question)

Cheers, Sam

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Code completion: remove type scopes?

Alex Denisov via cfe-dev

Hi Sam,

I believe that was already fixed in r317677 (https://reviews.llvm.org/D38538).

Cheers,
Alex

On 8 November 2017 at 10:15, Sam McCall <[hidden email]> wrote:
I'm experimenting with how completions are displayed in clangd, and trying to reduce the noise, particularly for templates.

e.g. this example
  std::vector<int> X;
  X.push_back|
currently produces
  void push_back(std::vector<int, std::allocator<int> >::value_type &&__x)
and i'd prefer
  void push_back(value_type &&__x)

I can get this by enabling PrintingPolicy.SuppressScope in SemaCodeComplete.
My initial thought was just to do this locally in clangd, but maybe:
 - there are known cases where this falls down terribly
 - this is just better and we should turn it on for other users (xcode?) too

The global change only breaks a few tests, in the obvious way: either a return type or parameter of a completion is no longer qualified.

(There are other things that are noisy here -- int would be better than value_type -- but that's a different question)

Cheers, Sam


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Code completion: remove type scopes?

Alex Denisov via cfe-dev
Indeed, sorry I missed that. Thanks!

On Nov 8, 2017 19:26, "Alex L" <[hidden email]> wrote:

Hi Sam,

I believe that was already fixed in r317677 (https://reviews.llvm.org/D38538).

Cheers,
Alex

On 8 November 2017 at 10:15, Sam McCall <[hidden email]> wrote:
I'm experimenting with how completions are displayed in clangd, and trying to reduce the noise, particularly for templates.

e.g. this example
  std::vector<int> X;
  X.push_back|
currently produces
  void push_back(std::vector<int, std::allocator<int> >::value_type &&__x)
and i'd prefer
  void push_back(value_type &&__x)

I can get this by enabling PrintingPolicy.SuppressScope in SemaCodeComplete.
My initial thought was just to do this locally in clangd, but maybe:
 - there are known cases where this falls down terribly
 - this is just better and we should turn it on for other users (xcode?) too

The global change only breaks a few tests, in the obvious way: either a return type or parameter of a completion is no longer qualified.

(There are other things that are noisy here -- int would be better than value_type -- but that's a different question)

Cheers, Sam


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