summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Move clangd tests to clangd directory. check-clangd is no longer ↵Sam McCall2019-04-291-2523/+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] Query index in code completion no-compile mode.Sam McCall2019-04-261-0/+66
| | | | | | | | | | | | | | Summary: We scrape the enclosing scopes from the source file, and use them in the query. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61077 llvm-svn: 359284
* [clangd] Fix handling of include paths in windows testsKadir Cetinkaya2019-04-241-5/+8
| | | | llvm-svn: 359079
* [clangd] Include insertion: require header guards, drop other heuristics, ↵Sam McCall2019-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | treat .def like .inc. Summary: We do have some reports of include insertion behaving badly in some codebases. Requiring header guards both makes sense in principle, and is likely to disable this "nice-to-have" feature in codebases where headers don't follow the expected pattern. With this we can drop some other heuristics, such as looking at file extensions to detect known non-headers - implementation files have no guards. One wrinkle here is #import - objc headers may not have guards because they're intended to be used via #import. If the header is the main file or is #included, we won't collect locations - merge should take care of this if we see the file #imported somewhere. Seems likely to be OK. Headers which have a canonicalization (stdlib, IWYU) are exempt from this check. *.inc files continue to be handled by looking up to the including file. This patch also adds *.def here - tablegen wants this pattern too. In terms of code structure, the division between SymbolCollector and CanonicalIncludes has shifted: SymbolCollector is responsible for more. This is because SymbolCollector has all the SourceManager/HeaderSearch access needed for checking for guards, and we interleave these checks with the *.def checks in a loop (potentially). We could hand all the info into CanonicalIncludes and put the logic there if that's preferable. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60316 llvm-svn: 358571
* [clangd] Wait for compile command in ASTWorker instead of ClangdServerEric Liu2019-04-151-1/+1
| | | | | | | | | | | | | | | | | | Summary: This makes addDocument non-blocking and would also allow code completion (in fallback mode) to run when worker waits for the compile command. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: javed.absar, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60607 llvm-svn: 358400
* [clangd] Use identifiers in file as completion candidates when build is not ↵Eric Liu2019-04-111-0/+47
| | | | | | | | | | | | | | | | | | | | | | ready. Summary: o Lex the code to get the identifiers and put them into a "symbol" index. o Adds a new completion mode without compilation/sema into code completion workflow. o Make IncludeInserter work even when no compile command is present, by avoiding inserting non-verbatim headers. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60126 llvm-svn: 358159
* [clangd] Don't insert extra namespace qualifiers when Sema gets lost.Sam McCall2019-04-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: There are cases where Sema can't tell that "foo" in foo::Bar is a namespace qualifier, like in incomplete macro expansions. After this patch, if sema reports no specifier but it looks like there's one in the source code, then we take it into account. Reworked structure and comments in getQueryScopes to try to fight creeping complexity - unsure if I succeeded. I made the test harder (the original version also passes). Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60503 llvm-svn: 358091
* [clangd] Add -header-insertion=never flag to disable include insertion in ↵Sam McCall2019-04-101-0/+10
| | | | | | | | | | | | | | | | code completion Summary: One clear use case: use with an editor that reacts poorly to edits above the cursor. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60409 llvm-svn: 358075
* [clangd] Refactor speculateCompletionFilter and also extract scope.Sam McCall2019-04-101-23/+48
| | | | | | | | | | | | | | | | | | | Summary: Intent is to use the heuristically-parsed scope in cases where we get bogus results from sema, such as in complex macro expansions. Added a motivating testcase we currently get wrong. Name changed because we (already) use this for things other than speculation. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60500 llvm-svn: 358074
* [clangd] Improve global code completion when scope specifier is unresolved.Eric Liu2019-02-271-2/+33
| | | | | | | | | | | | | | | | | | | | | | | Summary: Suppose `clangd::` is unresolved in the following example. Currently, we simply use "clangd::" as the query scope. We can do better by combining with accessible scopes in the context. The query scopes can be `{clangd::, clang::clangd::}`. ``` namespace clang { clangd::^ } ``` Reviewers: ilya-biryukov, sammccall, hokein, kadircet Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58448 llvm-svn: 354963
* [clangd] Index UsingDeclsKadir Cetinkaya2019-02-261-0/+21
| | | | | | | | | | | | | | | | Summary: D58340 enables indexing of USRs, this makes sure test in clangd are aligned with the change Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58341 llvm-svn: 354879
* [clangd] Enable include insertion for static indexKadir Cetinkaya2019-02-041-0/+30
| | | | | | | | | | | | | | Summary: This enables include insertion by adding canonical includes into preambledata. Reviewers: ioeric, ilya-biryukov Subscribers: javed.absar, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57508 llvm-svn: 353054
* [clangd] Suggest adding missing includes for incomplete type diagnostics.Eric Liu2019-01-281-47/+1
| | | | | | | | | | | | | | | | | | | Summary: This enables clangd to intercept compiler diagnostics and attach fixes (e.g. by querying index). This patch adds missing includes for incomplete types e.g. member access into class with only forward declaration. This would allow adding missing includes for user-typed symbol names that are missing declarations (e.g. typos) in the future. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56903 llvm-svn: 352361
* [CodeComplete] [clangd] Fix crash on ValueDecl with a null typeIlya Biryukov2019-01-241-0/+11
| | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57093 llvm-svn: 352040
* 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 a test for SignatureHelp on dynamic index.Haojian Wu2019-01-091-0/+31
| | | | | | | | | | | | Summary: This would catch regressions caused by future changes of the index. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56483 llvm-svn: 350720
* [clangd] Remove 'using namespace llvm' from .cpp files. NFCIlya Biryukov2019-01-071-24/+28
| | | | | | | | The new guideline is to qualify with 'llvm::' explicitly both in '.h' and '.cpp' files. This simplifies moving the code between header and source files and is easier to keep consistent. llvm-svn: 350531
* [clangd] clang-format everything. NFCIlya Biryukov2019-01-031-31/+25
| | | | llvm-svn: 350303
* [clangd] Cleanup syntax errors in the test, NFC.Haojian Wu2018-12-211-4/+4
| | | | llvm-svn: 349893
* [clangd] Drop injected class name when class scope is not explicitly specified.Eric Liu2018-11-301-0/+5
| | | | | | | | | | | | Summary: E.g. allow injected "A::A" in `using A::A^` but not in "A^". Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55065 llvm-svn: 347982
* [clangd] Cleanup: stop passing around list of supported URI schemes.Eric Liu2018-11-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Instead of passing around a list of supported URI schemes in clangd, we expose an interface to convert a path to URI using any compatible scheme that has been registered. It favors customized schemes and falls back to "file" when no other scheme works. Changes in this patch are: - URI::create(AbsPath, URISchemes) -> URI::create(AbsPath). The new API finds a compatible scheme from the registry. - Remove URISchemes option everywhere (ClangdServer, SymbolCollecter, FileIndex etc). - Unit tests will use "unittest" by default. - Move "test" scheme from ClangdLSPServer to ClangdMain.cpp, and only register the test scheme when lit-test or enable-lit-scheme is set. (The new flag is added to make lit protocol.test work; I wonder if there is alternative here.) Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54800 llvm-svn: 347467
* [clangd] Replace StringRef in SymbolLocation with a char pointer.Haojian Wu2018-11-141-6/+6
| | | | | | | | | | | | | | | | | Summary: This would save us 8 bytes per ref, and buy us ~40MB in total for llvm index (from ~300MB to ~260 MB). The char pointer must be null-terminated, and llvm::StringSaver guarantees it. Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53427 llvm-svn: 346852
* [clangd] Improve code completion for ObjC methodsSam McCall2018-11-141-4/+86
| | | | | | | | | | | | | | | | | | | | | Summary: Previously code completion did not work well for Objective-C methods which contained multiple arguments as clangd did not expect to see multiple typed-text chunks when handling code completion. Note that even with this change, we do not consider selector fragments from previous arguments to be part of the signature (although we could in the future). Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53934 llvm-svn: 346836
* [clangd] Deduplicate query scopes.Eric Liu2018-11-061-0/+17
| | | | | | | | | | | | | | Summary: For example, when anonymous namespace is present, duplicated namespaces might be generated for the enclosing namespace. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54105 llvm-svn: 346224
* [clangd] Do not query index for new name completions.Kadir Cetinkaya2018-10-241-0/+9
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53192 llvm-svn: 345153
* [clangd] Don't show base class versions of members as completions.Sam McCall2018-10-241-3/+6
| | | | | | | | | | | | | | Summary: These are available via qualifiers, but signal to noise level is low. Keep required quailifier machinery around though, for cross-ns completion. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53571 llvm-svn: 345141
* [clangd] Namespace style cleanup in cpp files. NFC.Sam McCall2018-10-201-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standardize on the most common namespace setup in our *.cpp files: using namespace llvm; namespace clang { namespace clangd { void foo(StringRef) { ... } And remove redundant llvm:: qualifiers. (Except for cases like make_unique where this causes problems with std:: and ADL). This choice is pretty arbitrary, but some broad consistency is nice. This is going to conflict with everything. Sorry :-/ Squash the other configurations: A) using namespace llvm; using namespace clang; using namespace clangd; void clangd::foo(StringRef); This is in some of the older files. (It prevents accidentally defining a new function instead of one in the header file, for what that's worth). B) namespace clang { namespace clangd { void foo(llvm::StringRef) { ... } This is fine, but in practice the using directive often gets added over time. C) namespace clang { namespace clangd { using namespace llvm; // inside the namespace This was pretty common, but is a bit misleading: name lookup preferrs clang::clangd::foo > clang::foo > llvm:: foo (no matter where the using directive is). llvm-svn: 344850
* [clangd] Support scope proximity in code completion.Eric Liu2018-10-171-0/+22
| | | | | | | | | | | | | | | | Summary: This should make all-scope completion more usable. Scope proximity for indexes will be added in followup patch. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D53131 llvm-svn: 344688
* [clangd] Add a #include completion test that triggers an assertion.Haojian Wu2018-10-021-0/+9
| | | | | | | | | | | | | | Summary: Test for https://reviews.llvm.org/D52774. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52775 llvm-svn: 343593
* [clangd] Initial supoprt for cross-namespace global code completion.Eric Liu2018-09-271-0/+51
| | | | | | | | | | | | | | | | | | | | | Summary: When no scope qualifier is specified, allow completing index symbols from any scope and insert proper automatically. This is still experimental and hidden behind a flag. Things missing: - Scope proximity based scoring. - FuzzyFind supports weighted scopes. Reviewers: sammccall Reviewed By: sammccall Subscribers: kbobyrev, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52364 llvm-svn: 343248
* Tell whether file/folder for include completions.Kadir Cetinkaya2018-09-271-0/+21
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52547 llvm-svn: 343221
* [clangd] Handle template args for disabled function arg snippetsIlya Biryukov2018-09-261-9/+42
| | | | | | | | | | | | Reviewers: kadircet, ioeric, sammccall Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D52422 llvm-svn: 343066
* [clangd] Store preamble macros in dynamic index.Eric Liu2018-09-191-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Pros: o Loading macros from preamble for every completion is slow (see profile). o Calculating macro USR is also slow (see profile). o Sema can provide a lot of macro completion results (e.g. when filter is empty, 60k for some large TUs!). Cons: o Slight memory increase in dynamic index (~1%). o Some extra work during preamble build (should be fine as preamble build and indexAST is way slower). Before: {F7195645} After: {F7195646} Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52078 llvm-svn: 342529
* [NFC][clangd] silence pedantic extra ';' warningJonas Toth2018-09-141-1/+1
| | | | llvm-svn: 342267
* [clangd] Work around compiler macro expansion bugs(?) in completion testsSam McCall2018-09-141-3/+3
| | | | llvm-svn: 342261
* [clangd] Don't override the preamble while completing inside it, it doesn't ↵Sam McCall2018-09-141-0/+16
| | | | | | | | | | | | | | | | | | | | work. Summary: To stay fast, enable single-file-mode instead. This is fine since completions in the preamble are simple. The net effect for now is to suppress the spurious TopLevel completions when completing inside the preamble. Once Sema has include directive completion, this will be more important. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52071 llvm-svn: 342230
* [clangd] Add unittests for D51917Kadir Cetinkaya2018-09-111-0/+39
| | | | | | | | | | | | Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51924 llvm-svn: 341950
* [clangd] Add unittests for D51038Kadir Cetinkaya2018-09-101-0/+50
| | | | | | | | | | | | Reviewers: ilya-biryukov, ioeric, hokein Reviewed By: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51039 llvm-svn: 341830
* [clangd] Add "Deprecated" field to Symbol and CodeCompletion.Eric Liu2018-09-061-4/+24
| | | | | | | | | | | | | | Summary: Also set "deprecated" field in LSP CompletionItem. Reviewers: sammccall, kadircet Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51724 llvm-svn: 341576
* [clangd] Fix data race in async fuzzyFind tests.Ilya Biryukov2018-09-061-0/+4
| | | | llvm-svn: 341538
* [clangd] Set SymbolID for sema macros so that they can be merged with index ↵Eric Liu2018-09-061-0/+11
| | | | | | | | | | | | macros. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51688 llvm-svn: 341534
* [clangd] SymbolOccurrences -> Refs and cleanupSam McCall2018-09-041-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A few things that I noticed while merging the SwapIndex patch: - SymbolOccurrences and particularly SymbolOccurrenceSlab are unwieldy names, and these names appear *a lot*. Ref, RefSlab, etc seem clear enough and read/format much better. - The asymmetry between SymbolSlab and RefSlab (build() vs freeze()) is confusing and irritating, and doesn't even save much code. Avoiding RefSlab::Builder was my idea, but it was a bad one; add it. - DenseMap<SymbolID, ArrayRef<Ref>> seems like a reasonable compromise for constructing MemIndex - and means many less wasted allocations than the current DenseMap<SymbolID, vector<Ref*>> for FileIndex, and none for slabs. - RefSlab::find() is not actually used for anything, so we can throw away the DenseMap and keep the representation much more compact. - A few naming/consistency fixes: e.g. Slabs,Refs -> Symbols,Refs. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51605 llvm-svn: 341368
* [clangd] Avoid crashes in override completionsIlya Biryukov2018-09-031-0/+15
| | | | | | | | | | | | | | Summary: NamedDecl::getName cannot be called on non-identifier names. Reviewers: kadircet, ioeric, hokein, sammccall Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51598 llvm-svn: 341322
* [clangd] Support multiple #include headers in one symbol.Eric Liu2018-09-031-8/+51
| | | | | | | | | | | | | | | | | | | | Summary: Currently, a symbol can have only one #include header attached, which might not work well if the symbol can be imported via different #includes depending on where it's used. This patch stores multiple #include headers (with # references) for each symbol, so that CodeCompletion can decide which include to insert. In this patch, code completion simply picks the most popular include as the default inserted header. We also return all possible includes and their edits in the `CodeCompletion` results. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgrang, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51291 llvm-svn: 341304
* [clangd] Implement findOccurrences interface in dynamic index.Haojian Wu2018-08-311-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: Implement the interface in - FileIndex - MemIndex - MergeIndex Depends on https://reviews.llvm.org/D50385. Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: mgrang, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51279 llvm-svn: 341242
* [clangd] Flatten out Symbol::Details. It was ill-conceived, sorry.Sam McCall2018-08-311-15/+6
| | | | | | | | | | Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51504 llvm-svn: 341211
* [clangd] Report position of opening paren in singature helpIlya Biryukov2018-08-301-4/+56
| | | | | | | | | | | | | | Summary: Only accessible via the C++ API at the moment. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51437 llvm-svn: 341065
* [clangd] Speculative code completion index request before Sema is run.Eric Liu2018-08-241-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | Summary: For index-based code completion, send an asynchronous speculative index request, based on the index request for the last code completion on the same file and the filter text typed before the cursor, before sema code completion is invoked. This can reduce the code completion latency (by roughly latency of sema code completion) if the speculative request is the same as the one generated for the ongoing code completion from sema. As a sequence of code completions often have the same scopes and proximity paths etc, this should be effective for a number of code completions. Trace with speculative index request:{F6997544} Reviewers: hokein, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: javed.absar, jfb, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D50962 llvm-svn: 340604
* [clangd] Log memory usage of DexIndex and MemIndexKirill Bobyrev2018-08-241-0/+4
| | | | | | | | | | | | This patch prints information about built index size estimation to verbose logs. This is useful for optimizing memory usage of DexIndex and comparisons with MemIndex. Reviewed by: sammccall Differential Revision: https://reviews.llvm.org/D51154 llvm-svn: 340601
* [clangd] Suggest code-completions for overriding base class virtual methods.Kadir Cetinkaya2018-08-231-0/+25
| | | | | | | | | | | | | | | | | Summary: Whenever a code-completion is triggered within a class/struct/union looks at base classes and figures out non-overriden virtual functions. Than suggests completions for those. Reviewers: ilya-biryukov, hokein, ioeric Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50898 llvm-svn: 340530
OpenPOWER on IntegriCloud