summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/SyncAPI.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Move clangd tests to clangd directory. check-clangd is no longer ↵Sam McCall2019-04-291-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | part of check-clang-tools. Summary: Motivation: - this layout is a pain to work with - without a common root, it's painful to express things like "disable clangd" (D61122) - CMake/lit configs are a maintenance hazard, and the more the one-off hacks for various tools are entangled, the more we see apathy and non-ownership. This attempts to use the bare-minimum configuration needed (while still supporting the difficult cases: windows, standalone clang build, dynamic libs). In particular the lit.cfg.py and lit.site.cfg.py.in are merged into lit.cfg.in. The logic in these files is now minimal. (Much of clang-tools-extra's lit configs can probably be cleaned up by reusing lit.llvm.llvm_config.use_clang(), and every llvm project does its own version of LDPATH mangling. I haven't attempted to fix any of those). Docs are still in clang-tools-extra/docs, I don't have any plans to touch those. Reviewers: gribozavr Subscribers: mgorny, javed.absar, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits, ilya-biryukov, thakis Tags: #clang Differential Revision: https://reviews.llvm.org/D61187 llvm-svn: 359424
* [clangd] Return clangd::TextEdit in ClangdServer::rename. NFCIlya Biryukov2019-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Instead of tooling::Replacement. To avoid the need to have contents of the file at the caller site. This also aligns better with other methods in ClangdServer, majority of those already return LSP-specific data types. Reviewers: hokein, ioeric, sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60179 llvm-svn: 357561
* [clangd] Implement textDocument/declaration from LSP 3.14Sam McCall2019-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LSP now reflects the declaration/definition distinction. Language server changes: - textDocument/definition now returns a definition if one is found, otherwise the declaration. It no longer returns declaration + definition if they are distinct. - textDocument/declaration returns the best declaration we can find. - For macros, the active macro definition is returned for both methods. - For include directive, the top of the target file is returned for both. There doesn't appear to be a discovery mechanism (we can't return everything to clients that only know about definition), so this changes existing behavior. In practice, it should greatly reduce the fraction of the time we need to show the user a menu of options. C++ API changes: - findDefinitions is replaced by locateSymbolAt, which returns a vector<LocatedSymbol> - one for each symbol under the cursor. - this contains the preferred declaration, the definition (if found), and the symbol name This API enables some potentially-neat extensions, like swapping between decl and def, and exposing the symbol name to the UI in the case of multiple symbols. Reviewers: hokein Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57388 llvm-svn: 352864
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clangd] Add support for hierarchical documentSymbolIlya Biryukov2018-11-231-2/+2
| | | | | | | | | | | | Reviewers: ioeric, sammccall, simark Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52311 llvm-svn: 347498
* [clangd] auto-index stores symbols per-file instead of per-TU.Eric Liu2018-11-061-0/+1
| | | | | | | | | | | | | | | | | Summary: This allows us to deduplicate header symbols across TUs. File digests are collects when collecting symbols/refs. And the index store deduplicates file symbols based on the file digest. Reviewers: sammccall, hokein Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53433 llvm-svn: 346221
* [clangd] Minimal implementation of automatic static index (not enabled).Sam McCall2018-10-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: See tinyurl.com/clangd-automatic-index for design and goals. Lots of limitations to keep this patch smallish, TODOs everywhere: - no serialization to disk - no changes to dynamic index, which now has a much simpler job - no partitioning of symbols by file to avoid duplication of header symbols - no reindexing of edited files - only a single worker thread - compilation database is slurped synchronously (doesn't scale) - uses memindex, rebuilds after every file (should be dex, periodically) It's not hooked up to ClangdServer/ClangdLSPServer yet: the layering isn't clear (it should really be in ClangdServer, but ClangdLSPServer has all the CDB interactions). Reviewers: ioeric Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D53032 llvm-svn: 344513
* NFC: Enforce good formatting across multiple clang-tools-extra filesKirill Bobyrev2018-08-141-2/+6
| | | | | | | | | | | This patch improves readability of multiple files in clang-tools-extra and enforces LLVM Coding Guidelines. Reviewed by: ioeric Differential Revision: https://reviews.llvm.org/D50707 llvm-svn: 339687
* [clangd] Implementation of textDocument/documentSymbolMarc-Andre Laperle2018-07-051-0/+3
| | | | | | | | | | | | | | | | | Summary: An AST-based approach is used to retrieve the document symbols rather than an in-memory index query. The index is not an ideal fit to achieve this because of the file-centric query being done here whereas the index is suited for project-wide queries. Document symbols also includes more symbols and need to keep the order as seen in the file. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Subscribers: tomgr, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D47846 llvm-svn: 336386
* [clangd] ClangdServer::codeComplete return CodeCompleteResult, not LSP struct.Sam McCall2018-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: This provides more structured information that embedders can use for rendering. ClangdLSPServer continues to call render(), so NFC. The patch is: - trivial changes to ClangdServer/ClangdLSPServer - mostly-mechanical updates to CodeCompleteTests etc for the new API - new direct tests of render() in CodeCompleteTests - tiny cleanups to CodeCompletionItem (operator<< and missing initializers) Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48821 llvm-svn: 336094
* [clangd] Move caching of compile args out of ClangdServer.Ilya Biryukov2018-06-131-2/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Caching is now handled by ClangdLSPServer and hidden behind the GlobalCompilationDatabase interface. This simplifies ClangdServer. This change also removes the SkipCache flag from addDocument, which is now obsolete. No behavioral changes are intended, the clangd binary still caches the compile commands on the first read. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ioeric, MaskRay, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D48068 llvm-svn: 334585
* [clangd] Implementation of workspace/symbol requestMarc-Andre Laperle2018-04-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is a basic implementation of the "workspace/symbol" request which is used to find symbols by a string query. Since this is similar to code completion in terms of result, this implementation reuses the "fuzzyFind" in order to get matches. For now, the scoring algorithm is the same as code completion and improvements could be done in the future. The index model doesn't contain quite enough symbols for this to cover common symbols like methods, enum class enumerators, functions in unamed namespaces, etc. The index model will be augmented separately to achieve this. Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: jkorous, hokein, simark, sammccall, klimek, mgorny, ilya-biryukov, mgrang, jkorous-apple, ioeric, MaskRay, cfe-commits Differential Revision: https://reviews.llvm.org/D44882 llvm-svn: 330637
* [clangd] Remove forceReparse, add a flag to addDocument insteadIlya Biryukov2018-03-141-1/+3
| | | | | | | | | | | | | | Summary: To make the removal of DraftMgr from ClangdServer easier (D44408). Reviewers: sammccall, simark Reviewed By: sammccall, simark Subscribers: simark, klimek, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44462 llvm-svn: 327532
* [clangd] Remove Tagged and some related APIs from ClangdServer.Sam McCall2018-03-121-7/+7
| | | | | | | | | | | | Context can do what Tagged was intended to support (snapshot filesystems), and less intrusively. getTaggedFileSystem() no longer needs a filename. Cleanups while here: - code-complete now returns errors as Expected, like other functions - added an alias Callback<T> for the usual callback function type llvm-svn: 327344
* [clangd] Extract ClangdServer::Options struct.Sam McCall2018-03-051-0/+3
| | | | | | | | | | | | | | | | | | Summary: This subsumes most of the params to ClangdServer and ClangdLSPServer. Adjacent changes: - tests use a consistent set of options, except when testing specific options - tests that previously used synchronous mode for convenience no longer do - added a runAddDocument helper to SyncAPIs to mitigate the extra code - rearranged main a bit to follow the structure of the options Reviewers: ilya-biryukov Subscribers: klimek, jkorous-apple, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D44088 llvm-svn: 326719
* [clangd] Remove codecomplete override content API. Long live addDocument!Sam McCall2018-02-271-6/+4
| | | | llvm-svn: 326211
* [clangd] Make functions of ClangdServer callback-basedIlya Biryukov2018-02-151-0/+16
| | | | | | | | | | | | | | | | | | Summary: As a consequence, all LSP operations are now handled asynchronously, i.e. they never block the main processing thread. However, if -run-synchronously flag is specified, clangd still runs everything on the main thread. Reviewers: sammccall, ioeric, hokein Reviewed By: sammccall, ioeric Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43227 llvm-svn: 325233
* [clangd] Remove codeComplete that returns std::future<>Ilya Biryukov2018-02-121-0/+28
Summary: It was deprecated and callback version and is used everywhere. Only changes to the testing code were needed. Reviewers: hokein, ioeric, sammccall Reviewed By: sammccall Subscribers: mgorny, klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43068 llvm-svn: 324883
OpenPOWER on IntegriCloud