summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/ClangdTests.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Split code-completion tests out of ClangdTests. NFC.Sam McCall2017-12-051-552/+1
| | | | | | | | | | | | | | Summary: Common parts are mostly FS related, so pulled out TestFS.h for the common stuff. Deliberately resisted cleaning up much here, so this is pretty mechanical. Reviewers: hokein Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40784 llvm-svn: 319741
* [clangd] GlobalCompilationDatabase interface changesSam McCall2017-12-041-11/+7
| | | | | | | | | | | | | | | | | | Summary: - GlobalCompilationDatabase now returns a single command (that's all we use) - fallback flags are now part of the GlobalCompilationDatabase. There's a default implementation that they can optionally customize. - this allows us to avoid invoking the fallback logic on two separate codepaths - race on extra flags fixed by locking the mutex - made GCD const-correct (DBGCD does have mutating methods) Reviewers: hokein Subscribers: klimek, cfe-commits, ilya-biryukov Differential Revision: https://reviews.llvm.org/D40733 llvm-svn: 319647
* [clangd] Filter completion results by fuzzy-matching identifiers.Sam McCall2017-12-011-0/+55
| | | | | | | | | | | | | | | | | | Summary: This allows us to limit the number of results we return and still allow them to be surfaced by refining a query (D39852). The initial algorithm is very conservative - it accepts a completion if the filter is any case-insensitive sub-sequence. It does not attempt to rank items based on match quality. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39882 llvm-svn: 319552
* [clangd] Drop impossible completions (unavailable or inaccessible)Sam McCall2017-11-231-10/+23
| | | | | | | | | | | | Summary: (There must be some reason why D38077 didn't just do this, but I don't get it!) Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39836 llvm-svn: 318925
* [clangd] Use in-memory preambles in clangd.Ilya Biryukov2017-11-161-6/+21
| | | | | | | | | | | | Reviewers: klimek, bkramer, sammccall Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39843 llvm-svn: 318412
* [clangd] Support returning a limited number of completion results.Sam McCall2017-11-151-4/+41
| | | | | | | | | | | | | | | | | | | | 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] Report an error on findDefinitions/signatureHelp on an unopened ↵Benjamin Kramer2017-10-261-1/+1
| | | | | | | | file instead of crashing. Found by clangd-fuzzer. llvm-svn: 316659
* [clangd] Allow to pass code completion opts to ClangdServer.Ilya Biryukov2017-10-231-12/+212
| | | | | | | | | | | | Reviewers: bkramer, krasimir, sammccall Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D38731 llvm-svn: 316327
* [clangd] Added async API to run code completion.Ilya Biryukov2017-10-051-5/+12
| | | | | | | | | | | | | | | | | | Summary: ClangdServer now provides async code completion API. It is still used synchronously by ClangdLSPServer, more work is needed to allow processing other requests in parallel while completion (or any other request) is running. Reviewers: klimek, bkramer, krasimir Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38583 llvm-svn: 314989
* [clangd] LSP extension to switch between source/header fileMarc-Andre Laperle2017-09-281-0/+79
| | | | | | | | | | | | | | | | | | Summary: Small extension to LSP to allow clients to use clangd to switch between C header files and source files. Final version will use the completed clangd indexer to use the index of symbols to be able to switch from header to source file when the file names don't match. Reviewers: malaperle, krasimir, bkramer, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, cfe-commits, arphaman Patch by: William Enright Differential Revision: https://reviews.llvm.org/D36150 llvm-svn: 314377
* [clangd] Serialize onDiagnosticsReady callbacks for the same file.Ilya Biryukov2017-09-201-0/+63
| | | | | | | | | | | | | | | | | Summary: Calls to onDiagnosticsReady were done concurrently before. This sometimes led to older versions of diagnostics being reported to the user after the newer versions. Reviewers: klimek, bkramer, krasimir Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38032 llvm-svn: 313754
* [clangd] Introduced Logger interface.Ilya Biryukov2017-09-201-8/+14
| | | | | | | | | | | | | | Summary: This fixes a bunch of logging-related FIXMEs. Reviewers: bkramer, krasimir, malaperle Reviewed By: malaperle Subscribers: malaperle, klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37972 llvm-svn: 313730
* [clangd] Add support for snippet completionsIlya Biryukov2017-09-121-8/+13
| | | | | | | | | | | | | | 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
* Add braces to silence gcc dangling-else warnings. NFCI.Simon Pilgrim2017-08-141-2/+4
| | | | llvm-svn: 310830
* [clangd] Use multiple working threads in clangd.Ilya Biryukov2017-08-141-36/+306
| | | | | | | | | | | | Reviewers: bkramer, krasimir, klimek Reviewed By: klimek Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D36261 llvm-svn: 310821
* [clangd] Check if CompileCommand has changed on forceReparse.Ilya Biryukov2017-08-141-0/+47
| | | | | | | | | | | | Reviewers: krasimir, bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36398 llvm-svn: 310819
* ClangdTests: Try to unbreak the case CLANG_DEFAULT_CXX_STDLIB=libc++.NAKAMURA Takumi2017-08-031-1/+2
| | | | llvm-svn: 309936
* [clangd] Rewrote AST and Preamble management.Ilya Biryukov2017-08-011-13/+48
| | | | | | | | | | | | | | Summary: The new implementation allows code completion that never waits for AST. Reviewers: bkramer, krasimir, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36133 llvm-svn: 309696
* [clangd] Specified --gcc-toolchain explicitly in VFS test.Ilya Biryukov2017-07-211-5/+5
| | | | | | | In order to avoid platform-specific configuration quirks. (Possible fix for https://bugs.llvm.org/show_bug.cgi?id=33842) llvm-svn: 308721
* [clangd] Add -ffreestanding on VFS tests.Ilya Biryukov2017-07-031-7/+16
| | | | | | | | | | | | | | | | | | Summary: They don't provide proper gcc installations and may fail on implicit <stdc-predef.h> include. Reviewers: klimek, krasimir, bkramer Reviewed By: krasimir Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34936 llvm-svn: 307025
* [clangd] Run a test, searching for gcc install, only on Unix.Ilya Biryukov2017-06-291-0/+3
| | | | | | This should fix windows buildbots. llvm-svn: 306656
* [clangd] Added a test, checking that gcc install is searched via VFS.Ilya Biryukov2017-06-291-1/+62
| | | | | | | | | | | | Reviewers: bkramer, krasimir, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34755 llvm-svn: 306652
* [clangd] Add a filename parameter to FileSystemProvider.Ilya Biryukov2017-06-141-2/+14
| | | | | | | | | | | | | | Reviewers: krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34151 llvm-svn: 305376
* [clangd] Store references instead of unique_ptrs in ClangdServer.Ilya Biryukov2017-06-131-61/+46
| | | | | | | | | | | | | | | | Summary: ClangdServer owned objects passed to it in constructor for no good reason. Lots of stuff was moved from the heap to the stack thanks to this change. Reviewers: krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34148 llvm-svn: 305298
* [clangd] Allow to override contents of the file during completion.Ilya Biryukov2017-06-131-0/+64
| | | | | | | | | | | | | | | | Summary: This is a reapplied r305280 with a fix to the crash found by build bots (StringRef to an out-of-scope local std::string). Reviewers: krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34146 llvm-svn: 305291
* Revert "[clangd] Allow to override contents of the file during completion."Ilya Biryukov2017-06-131-64/+0
| | | | | | | This caused buildbots failures, reverting until we'll find out what's wrong. llvm-svn: 305283
* [clangd] Allow to override contents of the file during completion.Ilya Biryukov2017-06-131-0/+64
| | | | | | | | | | | | Reviewers: krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34107 llvm-svn: 305280
* [clangd] Use 'std::string' for VFSTag instead of 'int'Ilya Biryukov2017-06-131-2/+2
| | | | | | | | | | | | | | Reviewers: krasimir Reviewed By: krasimir Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D34106 llvm-svn: 305279
* [clangd] Mark results of clangd requests with a tag provided by the ↵Ilya Biryukov2017-05-301-4/+36
| | | | | | | | | | | | | | | | | | | | FileSystemProvider. Summary: This allows an implementation of FileSystemProvider that can track which vfs::FileSystem were used for each of the requests. Reviewers: bkramer, krasimir Reviewed By: bkramer Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D33678 llvm-svn: 304214
* ClangdTests.cpp: Use "clang/Config/config.h" instead of "llvm/Config/config.h".NAKAMURA Takumi2017-05-271-1/+1
| | | | llvm-svn: 304082
* ClangdTests.cpp: Fix a possible typo, it was "if (TmpDir2 != TmpDir2)"NAKAMURA Takumi2017-05-271-1/+1
| | | | | | It caused failures in unittests if TmpDir2 is not "/tmp" . llvm-svn: 304067
* [clangd] Attempt to fix tests failing on WindowsIlya Biryukov2017-05-261-8/+14
| | | | llvm-svn: 303993
* [clangd] Allow to use vfs::FileSystem for file accesses.Ilya Biryukov2017-05-261-0/+364
Summary: Custom vfs::FileSystem is currently used for unit tests. This revision depends on https://reviews.llvm.org/D33397. Reviewers: bkramer, krasimir Reviewed By: bkramer, krasimir Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D33416 llvm-svn: 303977
OpenPOWER on IntegriCloud