[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-06 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @francisco.lopes, I've surely noticed there are a bunch of places where `signatureHelp` does not show up while I was playing around with this change. It would be great to have it available in more cases. Repository: rL LLVM https://reviews.llvm.org/D38048 __

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-06 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315055: [clangd] Add textDocument/signatureHelp (authored by ibiryukov). Changed prior to commit: https://reviews.llvm.org/D38048?vs=117580&id=117983#toc Repository: rL LLVM https://reviews.llvm.org

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-05 Thread Francisco Lopes da Silva via Phabricator via cfe-commits
francisco.lopes added a comment. In https://reviews.llvm.org/D38048#889568, @rwols wrote: > Since we're throwing around gifs for fun here's how signatureHelp looks in > practice for Sublime Text Very cool! https://reviews.llvm.org/D38048 ___ cfe

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-05 Thread Raoul Wols via Phabricator via cfe-commits
rwols added a comment. In https://reviews.llvm.org/D38048#887960, @ilya-biryukov wrote: > LGTM. Do you need my help in landing this? Yes, I don't have commit access, go ahead and merge. If you find any merge conflicts let me know I can probably fix that. Since we're throwing around gifs for fu

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-05 Thread Francisco Lopes da Silva via Phabricator via cfe-commits
francisco.lopes added a comment. In https://reviews.llvm.org/D38048#889176, @ilya-biryukov wrote: > @francisco.lopes, thanks for sharing your experience, I definitely like the > final UX you achieved, we should aim for something similar in clangd. > It also looks like @rwols's idea of how thin

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-05 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @francisco.lopes, thanks for sharing your experience, I definitely like the final UX you achieved, we should aim for something similar in clangd. It also looks like @rwols's idea of how things should look like is very close to your implementation. I do think that

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-04 Thread Francisco Lopes da Silva via Phabricator via cfe-commits
francisco.lopes added a comment. In https://reviews.llvm.org/D38048#887960, @ilya-biryukov wrote: > Another case where this might be bad is overloaded functions. I may choose > one overload in completion, but `signatureHelp` will initially point into a > different one. Hi, I'd just like to c

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-04 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. Do you need my help in landing this? > 1. If it finds a callable, provide the name of the callable, followed by an > opening parenthesis, followed by `$0`, followed by a cl

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-03 Thread Raoul Wols via Phabricator via cfe-commits
rwols marked an inline comment as done. rwols added a comment. Thinking ahead, it's probably best if we change the behavior of `SnippetCompletionItemCollector` as follows: 1. If it finds a callable, provide the name of the callable, followed by an opening parenthesis, followed by `$0`, followed

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-03 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 117580. rwols added a comment. Reword the documentation of the signature help structures in Protocol.h https://reviews.llvm.org/D38048 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/Cl

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-02 Thread Marc-Andre Laperle via Phabricator via cfe-commits
malaperle added inline comments. Comment at: clangd/Protocol.h:458 +/// +/// A parameter can have a label and a doc-comment. +struct ParameterInformation { rwols wrote: > @malaperle I copied the sentences from the protocol markdown file over > [here](https://git

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-02 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 117427. rwols added a comment. - Update `invokeCodeComplete` function to also take a `CodeCompleteOptions`, we assign it to the `CompilerInstance`'s `FrontendOpts.CodeCompleteOpts`. - Remove unused variable in `SignatureHelpCollector::ProcessOverloadCandidate`.

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-02 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdUnit.cpp:742 + Consumer->includeBriefComments(); + FrontendOpts.CodeCompleteOpts.IncludeBriefComments = + Consumer->includeBriefComments(); Duplicated line sneaked into commit. It looks like

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-01 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 117290. rwols added a comment. - Fix fillSortText: used the old version, now using new version from upstream - Fix initialize-params.test and initialize-params-invalid.test to account for signature help - All tests pass now https://reviews.llvm.org/D38048 Fi

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-10-01 Thread Raoul Wols via Phabricator via cfe-commits
rwols added inline comments. Comment at: clangd/ClangdUnit.cpp:442 static void FillSortText(const CodeCompletionString &CCS, CompletionItem &Item) { I seem to have inadvertently used the old fillSortText during the merge from ups

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-30 Thread Raoul Wols via Phabricator via cfe-commits
rwols added inline comments. Comment at: clangd/Protocol.h:458 +/// +/// A parameter can have a label and a doc-comment. +struct ParameterInformation { @malaperle I copied the sentences from the protocol markdown file over [here](https://github.com/Microsoft/lan

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-30 Thread Raoul Wols via Phabricator via cfe-commits
rwols marked 2 inline comments as done. rwols added a comment. I see now I have accidentally removed that new sortText logic during the merge from upstream, let me fix that. https://reviews.llvm.org/D38048 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-30 Thread Raoul Wols via Phabricator via cfe-commits
rwols marked 4 inline comments as done. rwols added a comment. There were some failing tests, probably because we use an extra digit for the `sortText` property now. I haven't touched those tests. Comment at: clangd/ClangdUnit.cpp:610 +ParameterInformation Info; +

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-30 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 117261. rwols added a comment. - Updated to latest upstream revision. - Fix optional/default parameter handling: each default parameter now has its own label (thanks, ilya!). - Remove the templated "invokeClangAction" function and use polymorphism with CodeCom

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Sorry for late response. Comment at: clangd/ClangdUnit.cpp:610 +ParameterInformation Info; +OptionalParameterLabel = getOptionalString(*Chunk.Optional); +Result.label += OptionalParameterLabel; Are we first

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-25 Thread Raoul Wols via Phabricator via cfe-commits
rwols marked 3 inline comments as done. rwols added inline comments. Comment at: clangd/ClangdLSPServer.cpp:92 "completionProvider": {"resolveProvider": false, "triggerCharacters": [".",">",":"]}, + "signatureHelpProvider": {"triggerCharacters": ["(", ","]},

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-25 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 116466. rwols added a comment. - Add signature-help.test - Modify formatting.test to make the test pass. The test failed because clangd's response to the initialize request was changed to advertise signature help trigger characters, so the expected content len

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-25 Thread Raoul Wols via Phabricator via cfe-commits
rwols updated this revision to Diff 116461. rwols added a comment. - Update doxygen comment to say "signature help" instead of "code complete", - Refactor: put the FillDocumentation member function outside of `CompletionItemsCollector` so that `SignatureHelpCollector` can also use it. - Refactor:

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-20 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov requested changes to this revision. ilya-biryukov added a comment. This revision now requires changes to proceed. Thanks for the patch. Overall looks good, just a few comments. Could you also add some tests? Comment at: clangd/ClangdServer.h:243 + /// Provide sig

[PATCH] D38048: [clangd] Add textDocument/signatureHelp

2017-09-19 Thread Raoul Wols via Phabricator via cfe-commits
rwols created this revision. Makes clangd respond to a client's "textDocument/signatureHelp" request by presenting function/method overloads. Still need to add tests. Also, there is duplicate code in clangd::codeComplete and clangd::signatureHelp now, maybe refactor this to a common function? ht