summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clangd/completion-snippet.test
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Convert lit code completion tests to unit-tests. NFCSam McCall2017-12-081-102/+0
| | | | | | | | | | | | Summary: This improves readability of tests and error messages. Reviewers: ioeric Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40952 llvm-svn: 320148
* [clangd] Make completion scores use 0-1 floats internally.Sam McCall2017-11-231-7/+7
| | | | | | | | | | | | | | | Summary: This scale is much easier to mix with other signals, such as fuzzy match strength. Mostly NFC, but it does reorder some low-priority items that get folded together at a score of 0 (see completion-qualifiers.test). Removed the exact sortText from the testcases, because it's the ranking that we want to test. Reviewers: hokein Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40089 llvm-svn: 318927
* [clangd] Loosen more brittle testsSam McCall2017-11-151-10/+0
| | | | llvm-svn: 318339
* [clangd] Support returning a limited number of completion results.Sam McCall2017-11-151-74/+79
| | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 318287
* [clangd] loosen tests for flag-dependence revealed by r317670Sam McCall2017-11-081-2/+3
| | | | llvm-svn: 317673
* [clangd] Sort completion results.Sam McCall2017-11-081-28/+79
| | | | | | | | | | | | | | Summary: This is (probably) not required by LSP, but at least one buggy client wants it. It also simplifies some tests - changed a few completion tests to use -pretty. Reviewers: hokein, malaperle Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D39738 llvm-svn: 317670
* Adds a json::Expr type to represent intermediate JSON expressions.Sam McCall2017-11-061-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This form can be created with a nice clang-format-friendly literal syntax, and gets escaping right. It knows how to call unparse() on our Protocol types. All the places where we pass around JSON internally now use this type. Object properties are sorted (stored as std::map) and so serialization is canonicalized, with optional prettyprinting (triggered by a -pretty flag). This makes the lit tests much nicer to read and somewhat nicer to debug. (Unfortunately the completion tests use CHECK-DAG, which only has line-granularity, so pretty-printing is disabled there. In future we could make completion ordering deterministic, or switch to unittests). Compared to the current approach, it has some efficiencies like avoiding copies of string literals used as object keys, but is probably slower overall. I think the code/test quality benefits are worth it. This patch doesn't attempt to do anything about JSON *parsing*. It takes direction from the proposal in this doc[1], but is limited in scope and visibility, for now. I am of half a mind just to use Expr as the target of a parser, and maybe do a little string deduplication, but not bother with clever memory allocation. That would be simple, and fast enough for clangd... [1] https://docs.google.com/document/d/1OEF9IauWwNuSigZzvvbjc1cVS1uGHRyGTXaoy3DjqM4/edit +cc d0k so he can tell me not to use std::map. Reviewers: ioeric, malaperle Subscribers: bkramer, ilya-biryukov, mgorny, klimek Differential Revision: https://reviews.llvm.org/D39435 llvm-svn: 317486
* [clangd] Handle exit notification (proper shutdown)Ilya Biryukov2017-10-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This changes the onShutdown handler to do essentially nothing (for now), and instead exits the runloop when we receive the exit notification from the client. Some clients may wait on the reply from the shutdown request before sending an exit notification. If we exit the runloop already in the shutdown request, a client might block forever. This also gives us the opportunity to do any global cleanups and/or serializations of PCH preambles to disk, but I've left that out for now. See the LSP protocol documentation for details. Reviewers: malaperle, krasimir, bkramer, sammccall, ilya-biryukov Reviewed By: malaperle, sammccall, ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38939 llvm-svn: 316564
* [clangd] Updated gold for completion tests after cfe changes.Ilya Biryukov2017-09-221-4/+4
| | | | llvm-svn: 314020
* [clangd] Put inacessible items to the end of completion list.Ilya Biryukov2017-09-201-13/+13
| | | | | | | | | | | | Reviewers: bkramer, krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D38077 llvm-svn: 313759
* [clangd] Add support for snippet completionsIlya Biryukov2017-09-121-0/+54
Enhances CompletionItemsCollector in such a way that snippet completions can be presented to the client. Enable snippet completion items by specifying -enable-snippets while invoking the clangd executable. See: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#completion-request See: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/browser/snippet.md Patch by Raoul Wols. llvm-svn: 313029
OpenPOWER on IntegriCloud