Re: [clang-tools-extra] r318287 - [clangd] Support returning a limited number of completion results.

2017-11-15 Thread Sam McCall via cfe-commits
Sorry about these - I've finally understood what's going on.
It looks like the PS4 has a different default --std, which probably doesn't
make sense for clangd. I'll override it.

On Wed, Nov 15, 2017 at 7:49 PM, Robinson, Paul 
wrote:

> Hi Sam,
> It looks like llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast has been
> failing a couple of clangd tests ever since this went in.
>
> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_
> 64-scei-ps4-windows10pro-fast/builds/13517
>
> Please fix or revert ASAP when bots go red.  Failures like this interfere
> with our CI process.
>
> Thanks,
> --paulr
> PS4 code owner
>
>
> > -Original Message-
> > From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf
> Of
> > Sam McCall via cfe-commits
> > Sent: Wednesday, November 15, 2017 1:16 AM
> > To: cfe-commits@lists.llvm.org
> > Subject: [clang-tools-extra] r318287 - [clangd] Support returning a
> > limited number of completion results.
> >
> > Author: sammccall
> > Date: Wed Nov 15 01:16:29 2017
> > New Revision: 318287
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=318287=rev
> > Log:
> > [clangd] Support returning a limited number of completion results.
> >
> > Summary:
> > All results are scored, we only process CodeCompletionStrings for the
> > winners.
> > We now return CompletionList rather than CompletionItem[] (both are
> > valid).
> > sortText is now based on CodeCompletionResult::orderedName (mostly the
> > same).
> >
> > This is the first clangd-only completion option, so plumbing changed.
> > It requires a small clangd patch (exposing
> > CodeCompletionResult::orderedName).
> >
> > (This can't usefully be enabled yet: we don't support server-side
> > filtering)
> >
> > Reviewers: ilya-biryukov
> >
> > Subscribers: cfe-commits
> >
> > Differential Revision: https://reviews.llvm.org/D39852
> >
> > Modified:
> > clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> > clang-tools-extra/trunk/clangd/ClangdServer.cpp
> > clang-tools-extra/trunk/clangd/ClangdServer.h
> > clang-tools-extra/trunk/clangd/ClangdUnit.cpp
> > clang-tools-extra/trunk/clangd/ClangdUnit.h
> > clang-tools-extra/trunk/clangd/Protocol.cpp
> > clang-tools-extra/trunk/clangd/Protocol.h
> > clang-tools-extra/trunk/test/clangd/authority-less-uri.test
> > clang-tools-extra/trunk/test/clangd/completion-items-kinds.test
> > clang-tools-extra/trunk/test/clangd/completion-priorities.test
> > clang-tools-extra/trunk/test/clangd/completion-qualifiers.test
> > clang-tools-extra/trunk/test/clangd/completion-snippet.test
> > clang-tools-extra/trunk/test/clangd/completion.test
> > clang-tools-extra/trunk/test/clangd/protocol.test
> > clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
> >
> > Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> > extra/trunk/clangd/ClangdLSPServer.cpp?rev=318287=318286=318287&
> view
> > =diff
> > 
> ==
> > 
> > --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
> > +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Wed Nov 15
> 01:16:29
> > 2017
> > @@ -195,15 +195,15 @@ void ClangdLSPServer::onCodeAction(Ctx C
> >  }
> >
> >  void ClangdLSPServer::onCompletion(Ctx C, TextDocumentPositionParams
> > ) {
> > -  auto Items = Server
> > -   .codeComplete(Params.textDocument.uri.file,
> > - Position{Params.position.line,
> > -  Params.position.character})
> > -   .get() // FIXME(ibiryukov): This could be made async
> > if we
> > -  // had an API that would allow to attach
> > callbacks to
> > -  // futures returned by ClangdServer.
> > -   .Value;
> > -  C.reply(json::ary(Items));
> > +  auto List = Server
> > +  .codeComplete(
> > +  Params.textDocument.uri.file,
> > +  Position{Params.position.line,
> > Params.position.character})
> > +  .get() // FIXME(ibiryukov): This could be made async
> if
> > we
> > + // had an API that would allow to attach
> > callbacks to
> > + // futures returned by ClangdServer.
> > +  .Value;
> > +  C.reply(List);
> >  }
> >
> >  void ClangdLSPServer::onSignatureHelp(Ctx C,
> >
> > Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> > extra/trunk/clangd/ClangdServer.cpp?rev=318287&
> r1=318286=318287=di
> > ff
> > 
> ==
> > 
> > --- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
> > +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Wed Nov 15 01:16:29
> > 2017
> > 

Re: [clang-tools-extra] r318287 - [clangd] Support returning a limited number of completion results.

2017-11-15 Thread Galina Kistanova via cfe-commits
Also at least one more builder is affected:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13517

Thanks

Galina

On Wed, Nov 15, 2017 at 10:54 AM, Galina Kistanova 
wrote:

> Hello Sam,
>
> One of tests is failing on
> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_
> 64-scei-ps4-ubuntu-fast/builds/20638
>
> Please have a look?
>
> Thanks
>
> Galina
>
> ...
>
> Failing Tests (1):
> Clang Tools :: clangd/completion.test
>
>
> On Wed, Nov 15, 2017 at 1:16 AM, Sam McCall via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: sammccall
>> Date: Wed Nov 15 01:16:29 2017
>> New Revision: 318287
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=318287=rev
>> Log:
>> [clangd] Support returning a limited number of completion results.
>>
>> Summary:
>> All results are scored, we only process CodeCompletionStrings for the
>> winners.
>> We now return CompletionList rather than CompletionItem[] (both are
>> valid).
>> sortText is now based on CodeCompletionResult::orderedName (mostly the
>> same).
>>
>> This is the first clangd-only completion option, so plumbing changed.
>> It requires a small clangd patch (exposing CodeCompletionResult::orderedN
>> ame).
>>
>> (This can't usefully be enabled yet: we don't support server-side
>> filtering)
>>
>> Reviewers: ilya-biryukov
>>
>> Subscribers: cfe-commits
>>
>> Differential Revision: https://reviews.llvm.org/D39852
>>
>> Modified:
>> clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
>> clang-tools-extra/trunk/clangd/ClangdServer.cpp
>> clang-tools-extra/trunk/clangd/ClangdServer.h
>> clang-tools-extra/trunk/clangd/ClangdUnit.cpp
>> clang-tools-extra/trunk/clangd/ClangdUnit.h
>> clang-tools-extra/trunk/clangd/Protocol.cpp
>> clang-tools-extra/trunk/clangd/Protocol.h
>> clang-tools-extra/trunk/test/clangd/authority-less-uri.test
>> clang-tools-extra/trunk/test/clangd/completion-items-kinds.test
>> clang-tools-extra/trunk/test/clangd/completion-priorities.test
>> clang-tools-extra/trunk/test/clangd/completion-qualifiers.test
>> clang-tools-extra/trunk/test/clangd/completion-snippet.test
>> clang-tools-extra/trunk/test/clangd/completion.test
>> clang-tools-extra/trunk/test/clangd/protocol.test
>> clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
>>
>> Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
>> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/
>> clangd/ClangdLSPServer.cpp?rev=318287=318286=318287=diff
>> 
>> ==
>> --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
>> +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Wed Nov 15
>> 01:16:29 2017
>> @@ -195,15 +195,15 @@ void ClangdLSPServer::onCodeAction(Ctx C
>>  }
>>
>>  void ClangdLSPServer::onCompletion(Ctx C, TextDocumentPositionParams
>> ) {
>> -  auto Items = Server
>> -   .codeComplete(Params.textDocument.uri.file,
>> - Position{Params.position.line,
>> -  Params.position.character})
>> -   .get() // FIXME(ibiryukov): This could be made async
>> if we
>> -  // had an API that would allow to attach
>> callbacks to
>> -  // futures returned by ClangdServer.
>> -   .Value;
>> -  C.reply(json::ary(Items));
>> +  auto List = Server
>> +  .codeComplete(
>> +  Params.textDocument.uri.file,
>> +  Position{Params.position.line,
>> Params.position.character})
>> +  .get() // FIXME(ibiryukov): This could be made async
>> if we
>> + // had an API that would allow to attach
>> callbacks to
>> + // futures returned by ClangdServer.
>> +  .Value;
>> +  C.reply(List);
>>  }
>>
>>  void ClangdLSPServer::onSignatureHelp(Ctx C,
>>
>> Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
>> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/
>> clangd/ClangdServer.cpp?rev=318287=318286=318287=diff
>> 
>> ==
>> --- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
>> +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Wed Nov 15 01:16:29
>> 2017
>> @@ -222,11 +222,11 @@ std::future ClangdServer::forceRep
>>   std::move(TaggedFS));
>>  }
>>
>> -std::future>
>> +std::future
>>  ClangdServer::codeComplete(PathRef File, Position Pos,
>> llvm::Optional OverridenContents,
>> IntrusiveRefCntPtr *UsedFS)
>> {
>> -  using ResultType = Tagged;
>> +  using ResultType = Tagged;
>>
>>std::promise ResultPromise;
>>
>> @@ -242,11 +242,10 

Re: [clang-tools-extra] r318287 - [clangd] Support returning a limited number of completion results.

2017-11-15 Thread Galina Kistanova via cfe-commits
Hello Sam,

One of tests is failing on
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/20638

Please have a look?

Thanks

Galina

...

Failing Tests (1):
Clang Tools :: clangd/completion.test


On Wed, Nov 15, 2017 at 1:16 AM, Sam McCall via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: sammccall
> Date: Wed Nov 15 01:16:29 2017
> New Revision: 318287
>
> URL: http://llvm.org/viewvc/llvm-project?rev=318287=rev
> Log:
> [clangd] Support returning a limited number of completion results.
>
> Summary:
> All results are scored, we only process CodeCompletionStrings for the
> winners.
> We now return CompletionList rather than CompletionItem[] (both are valid).
> sortText is now based on CodeCompletionResult::orderedName (mostly the
> same).
>
> This is the first clangd-only completion option, so plumbing changed.
> It requires a small clangd patch (exposing CodeCompletionResult::
> orderedName).
>
> (This can't usefully be enabled yet: we don't support server-side
> filtering)
>
> Reviewers: ilya-biryukov
>
> Subscribers: cfe-commits
>
> Differential Revision: https://reviews.llvm.org/D39852
>
> Modified:
> clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.h
> clang-tools-extra/trunk/clangd/ClangdUnit.cpp
> clang-tools-extra/trunk/clangd/ClangdUnit.h
> clang-tools-extra/trunk/clangd/Protocol.cpp
> clang-tools-extra/trunk/clangd/Protocol.h
> clang-tools-extra/trunk/test/clangd/authority-less-uri.test
> clang-tools-extra/trunk/test/clangd/completion-items-kinds.test
> clang-tools-extra/trunk/test/clangd/completion-priorities.test
> clang-tools-extra/trunk/test/clangd/completion-qualifiers.test
> clang-tools-extra/trunk/test/clangd/completion-snippet.test
> clang-tools-extra/trunk/test/clangd/completion.test
> clang-tools-extra/trunk/test/clangd/protocol.test
> clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
>
> Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clangd/ClangdLSPServer.cpp?rev=318287=318286=318287=diff
> 
> ==
> --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Wed Nov 15
> 01:16:29 2017
> @@ -195,15 +195,15 @@ void ClangdLSPServer::onCodeAction(Ctx C
>  }
>
>  void ClangdLSPServer::onCompletion(Ctx C, TextDocumentPositionParams
> ) {
> -  auto Items = Server
> -   .codeComplete(Params.textDocument.uri.file,
> - Position{Params.position.line,
> -  Params.position.character})
> -   .get() // FIXME(ibiryukov): This could be made async
> if we
> -  // had an API that would allow to attach
> callbacks to
> -  // futures returned by ClangdServer.
> -   .Value;
> -  C.reply(json::ary(Items));
> +  auto List = Server
> +  .codeComplete(
> +  Params.textDocument.uri.file,
> +  Position{Params.position.line,
> Params.position.character})
> +  .get() // FIXME(ibiryukov): This could be made async if
> we
> + // had an API that would allow to attach
> callbacks to
> + // futures returned by ClangdServer.
> +  .Value;
> +  C.reply(List);
>  }
>
>  void ClangdLSPServer::onSignatureHelp(Ctx C,
>
> Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clangd/ClangdServer.cpp?rev=318287=318286=318287=diff
> 
> ==
> --- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Wed Nov 15 01:16:29
> 2017
> @@ -222,11 +222,11 @@ std::future ClangdServer::forceRep
>   std::move(TaggedFS));
>  }
>
> -std::future>
> +std::future
>  ClangdServer::codeComplete(PathRef File, Position Pos,
> llvm::Optional OverridenContents,
> IntrusiveRefCntPtr *UsedFS) {
> -  using ResultType = Tagged;
> +  using ResultType = Tagged;
>
>std::promise ResultPromise;
>
> @@ -242,11 +242,10 @@ ClangdServer::codeComplete(PathRef File,
>  }
>
>  void ClangdServer::codeComplete(
> -UniqueFunction)> Callback,
> -PathRef File, Position Pos, llvm::Optional
> OverridenContents,
> +UniqueFunction Callback, PathRef File,
> +Position Pos, llvm::Optional OverridenContents,
>  IntrusiveRefCntPtr *UsedFS) {
> -  using 

RE: [clang-tools-extra] r318287 - [clangd] Support returning a limited number of completion results.

2017-11-15 Thread Robinson, Paul via cfe-commits
Hi Sam,
It looks like llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast has been
failing a couple of clangd tests ever since this went in.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/13517

Please fix or revert ASAP when bots go red.  Failures like this interfere
with our CI process.

Thanks,
--paulr
PS4 code owner


> -Original Message-
> From: cfe-commits [mailto:cfe-commits-boun...@lists.llvm.org] On Behalf Of
> Sam McCall via cfe-commits
> Sent: Wednesday, November 15, 2017 1:16 AM
> To: cfe-commits@lists.llvm.org
> Subject: [clang-tools-extra] r318287 - [clangd] Support returning a
> limited number of completion results.
> 
> Author: sammccall
> Date: Wed Nov 15 01:16:29 2017
> New Revision: 318287
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=318287=rev
> Log:
> [clangd] Support returning a limited number of completion results.
> 
> Summary:
> All results are scored, we only process CodeCompletionStrings for the
> winners.
> We now return CompletionList rather than CompletionItem[] (both are
> valid).
> sortText is now based on CodeCompletionResult::orderedName (mostly the
> same).
> 
> This is the first clangd-only completion option, so plumbing changed.
> It requires a small clangd patch (exposing
> CodeCompletionResult::orderedName).
> 
> (This can't usefully be enabled yet: we don't support server-side
> filtering)
> 
> Reviewers: ilya-biryukov
> 
> Subscribers: cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D39852
> 
> Modified:
> clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.cpp
> clang-tools-extra/trunk/clangd/ClangdServer.h
> clang-tools-extra/trunk/clangd/ClangdUnit.cpp
> clang-tools-extra/trunk/clangd/ClangdUnit.h
> clang-tools-extra/trunk/clangd/Protocol.cpp
> clang-tools-extra/trunk/clangd/Protocol.h
> clang-tools-extra/trunk/test/clangd/authority-less-uri.test
> clang-tools-extra/trunk/test/clangd/completion-items-kinds.test
> clang-tools-extra/trunk/test/clangd/completion-priorities.test
> clang-tools-extra/trunk/test/clangd/completion-qualifiers.test
> clang-tools-extra/trunk/test/clangd/completion-snippet.test
> clang-tools-extra/trunk/test/clangd/completion.test
> clang-tools-extra/trunk/test/clangd/protocol.test
> clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
> 
> Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/ClangdLSPServer.cpp?rev=318287=318286=318287
> =diff
> ==
> 
> --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Wed Nov 15 01:16:29
> 2017
> @@ -195,15 +195,15 @@ void ClangdLSPServer::onCodeAction(Ctx C
>  }
> 
>  void ClangdLSPServer::onCompletion(Ctx C, TextDocumentPositionParams
> ) {
> -  auto Items = Server
> -   .codeComplete(Params.textDocument.uri.file,
> - Position{Params.position.line,
> -  Params.position.character})
> -   .get() // FIXME(ibiryukov): This could be made async
> if we
> -  // had an API that would allow to attach
> callbacks to
> -  // futures returned by ClangdServer.
> -   .Value;
> -  C.reply(json::ary(Items));
> +  auto List = Server
> +  .codeComplete(
> +  Params.textDocument.uri.file,
> +  Position{Params.position.line,
> Params.position.character})
> +  .get() // FIXME(ibiryukov): This could be made async if
> we
> + // had an API that would allow to attach
> callbacks to
> + // futures returned by ClangdServer.
> +  .Value;
> +  C.reply(List);
>  }
> 
>  void ClangdLSPServer::onSignatureHelp(Ctx C,
> 
> Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-
> extra/trunk/clangd/ClangdServer.cpp?rev=318287=318286=318287=di
> ff
> ==
> 
> --- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
> +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Wed Nov 15 01:16:29
> 2017
> @@ -222,11 +222,11 @@ std::future ClangdServer::forceRep
>   std::move(TaggedFS));
>  }
> 
> -std::future>
> +std::future
>  ClangdServer::codeComplete(PathRef File, Position Pos,
> llvm::Optional OverridenContents,
> IntrusiveRefCntPtr *UsedFS) {
> -  using ResultType = Tagged;
> +  using ResultType = Tagged;
> 
>std::promise ResultPromise;
> 
> @@ -242,11 +242,10 @@