summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/index
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable warnings when indexing as a standalone action.Sam McCall2019-03-281-0/+5
| | | | | | | | | | | | | | | | | | | Summary: - we don't record the warnings at all - we don't want to stop indexing if we hit error-limit due to warnings - this allows some analyses to be skipped which can save some CPU https://github.com/clangd/clangd/issues/24 Reviewers: hokein Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59935 llvm-svn: 357186
* [clangd] Support utf-8 offsets (rather than utf-16) as a protocol extensionSam McCall2019-03-272-3/+8
| | | | | | | | | | | | | | | | Summary: Still some pieces to go here: unit tests for new SourceCode functionality and a command-line flag to force utf-8 mode. But wanted to get early feedback. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58275 llvm-svn: 357102
* Revert "[clangd] Print arguments in template specializations"Jordan Rupprecht2019-03-202-0/+18
| | | | | | This reverts commit 44a63f6a150dec72dea43730d2a89d292e58bd6f. It segfaults on an internal test case (will follow up off thread). llvm-svn: 356623
* [clangd] Print arguments in template specializationsKadir Cetinkaya2019-03-202-18/+0
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59354 llvm-svn: 356541
* [clangd] Add support for type hierarchy (super types only for now)Kadir Cetinkaya2019-03-192-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Patch by Nathan Ridge(@nridge)! This is an LSP extension proposed here: https://github.com/Microsoft/vscode-languageserver-node/pull/426 An example client implementation can be found here: https://github.com/theia-ide/theia/pull/3802 Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet Tags: #clang Differential Revision: https://reviews.llvm.org/D56370 llvm-svn: 356445
* [clangd] Using symbol name to map includes for STL symbols.Haojian Wu2019-03-141-35/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Using suffix path mapping relies on the STL implementations, and it is not portable. This patch is using symbol name mapping, which should work with different STL implementations, fix clangd/clangd#9. To generate the symbol mapping, we parse the cppreference symbol index page to build a lookup table. The mapping is not completed, a few TODOs: - support symbols from different headers (e.g. std::move) - support STL macros - support symbols from std's sub-namespaces (e.g. chrono) Reviewers: ioeric, jfb, serge-sans-paille Reviewed By: ioeric Subscribers: sammccall, klimek, ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, kadircet, jfb, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D58345 llvm-svn: 356134
* [clangd] Fix an out-of-date FIXME, NFC.Haojian Wu2019-03-141-3/+0
| | | | llvm-svn: 356127
* [clangd] Build Dex index after loading all shards in BackgroundIndex.Haojian Wu2019-03-141-3/+7
| | | | | | | | | | | | | | | | Summary: Currently after loadding all shards, we use MemIndex which has poor query performance, we should use Dex. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59350 llvm-svn: 356126
* [clangd] Store explicit template specializations in index for code ↵Kadir Cetinkaya2019-03-143-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | navigation purposes Summary: This introduces ~4k new symbols, and ~10k refs for LLVM. We need that information for providing better code navigation support: - When references for a class template is requested, we should return these specializations as well. - When children of a specialization is requested, we should be able to query for those symbols(instead of just class template) Number of symbols: 378574 -> 382784 Number of refs: 5098857 -> 5110689 Reviewers: hokein, gribozavr Reviewed By: gribozavr Subscribers: nridge, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59083 llvm-svn: 356125
* [clangd] Default initialize SymInfoKadir Cetinkaya2019-03-131-1/+1
| | | | llvm-svn: 356032
* [clangd] Respect Origin option in createStaticIndexingActionKadir Cetinkaya2019-03-112-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Currently createStaticIndexingAction always set Origin to Static, which makes it hard to change it later on by different indexers(One needs to go over each symbol making a new copy). This patch changes that behavior to rather respect it if set by user. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59205 llvm-svn: 355820
* [clangd] Remove ./ and ../ in the file pathsKadir Cetinkaya2019-03-081-0/+1
| | | | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59084 llvm-svn: 355681
* [clangd] Make sure constructors do not reference classKadir Cetinkaya2019-03-081-1/+5
| | | | | | | | | | | | Reviewers: gribozavr Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58815 llvm-svn: 355679
* [clangd] Deduplicate Refs on the fly.Haojian Wu2019-03-082-9/+10
| | | | | | | | | | | | | | | | | | | | Summary: Currently, we only do deduplication when we flush final results. We may have huge duplications (refs from headers) during the indexing period (running clangd-indexer on Chromium). With this change, clangd-indexer can index the whole chromium projects (48 threads, 40 GB peak memory usage). Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59092 llvm-svn: 355676
* Fix file headers. NFCFangrui Song2019-03-011-1/+1
| | | | llvm-svn: 355188
* Added missing license headersDmitri Gribenko2019-02-281-1/+8
| | | | | | | | | | | | Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58781 llvm-svn: 355092
* Use ArrayRef::copy, instead of copying data manuallyDmitri Gribenko2019-02-281-3/+1
| | | | | | | | | | | | Reviewers: ioeric Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58782 llvm-svn: 355091
* Moved Ref into its own header and implementation fileDmitri Gribenko2019-02-285-145/+184
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58778 llvm-svn: 355090
* Moved Symbol into its own header and implementation fileDmitri Gribenko2019-02-288-264/+312
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58774 llvm-svn: 355088
* Moved SymbolOrigin into its own header and implementation fileDmitri Gribenko2019-02-2810-34/+81
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58773 llvm-svn: 355086
* Moved SymbolLocation into its own header and implementation fileDmitri Gribenko2019-02-289-90/+134
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58768 llvm-svn: 355082
* Moved DenseMap support for SymbolID into SymbolID.hDmitri Gribenko2019-02-282-25/+22
| | | | llvm-svn: 355081
* [clangd] Drop documentation in static index if symbols are not indexed for ↵Haojian Wu2019-02-254-8/+12
| | | | | | | | | | | | | | | | | | | completion. Summary: This is a further optimization of r350803, we drop docs in static index for symbols not being indexed for completion, while keeping the docs in dynamic index (we rely on dynamic index to get docs for class members). Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56539 llvm-svn: 354792
* [clangd] Store index in '.clangd/index' instead of '.clangd-index'Ilya Biryukov2019-02-202-5/+5
| | | | | | | | | | | | | | | | Summary: To take up the .clangd folder for other potential uses in the future. Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58440 llvm-svn: 354505
* [clangd] Prefer location from codegen files when merging symbols.Eric Liu2019-02-111-5/+25
| | | | | | | | | | | | | | | | | | | Summary: For example, if an index symbol has location in a .proto file and an AST symbol has location in a generated .proto.h file, then we prefer location in .proto which is more meaningful to users. Also use `mergeSymbols` to get the preferred location between AST location and index location in go-to-def. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58037 llvm-svn: 353708
* [clangd] Reduce number of threads used by BackgroundIndex to number of ↵Kadir Cetinkaya2019-02-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | physical cores. Summary: clangd is using as many threads as logical cores for BackgroundIndex by default. We observed that it increases latency of foreground tasks. This patch aims to change that default to number of physical cores to get rid of that extra latency. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57819 llvm-svn: 353422
* [clangd] Add type boost to fuzzy find in Dex.Eric Liu2019-02-065-50/+73
| | | | | | | | | | | | | | | | | | Summary: No noticeable impact on code completions overall except some improvement on cross-namespace completion. Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57815 llvm-svn: 353310
* [clangd] Enable include insertion for static indexKadir Cetinkaya2019-02-042-17/+18
| | | | | | | | | | | | | | 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] Index main-file macros (bug 39761)Haojian Wu2019-01-281-3/+14
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55739 llvm-svn: 352367
* [clangd] NFC: fix clang-tidy warnings.Haojian Wu2019-01-253-8/+9
| | | | | | | Most are about llvm code style violation (found via readability-identifier-naming check). llvm-svn: 352205
* [clangd] Fix crash due to ObjCPropertyDeclIlya Biryukov2019-01-231-4/+10
| | | | | | | | | | | | With ObjCPropertyDecl, ASTNode.OrigD can be a ObjCPropertyImplDecl which is not a NamedDecl, leading to a crash since the code incorrectly assumes ASTNode.OrigD will always be a NamedDecl. Change by dgoldman (David Goldman)! Differential Revision: https://reviews.llvm.org/D56916 llvm-svn: 351941
* [clangd] Fix the `-Wtype-limits` warning, NFCHaojian Wu2019-01-221-1/+0
| | | | | | The assertion is always true, and triggers a compiler warning, so remove it. llvm-svn: 351809
* [clangd] Filter out plugin related flags and move all commandline ↵Kadir Cetinkaya2019-01-222-10/+5
| | | | | | | | | | | | | | | | | | | | manipulations into OverlayCDB. Summary: Some projects make use of clang plugins when building, but clangd is not aware of those plugins therefore can't work with the same compile command arguments. There were multiple places clangd performed commandline manipulations, this one also moves them all into OverlayCDB. Reviewers: ilya-biryukov Subscribers: klimek, sammccall, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56841 llvm-svn: 351788
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1931-124/+93
| | | | | | | | | | | | | | | | | 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] Make background index less chattyIlya Biryukov2019-01-181-1/+1
| | | | | | | | | | | | | | | | Summary: It is producing too much input in non-verbose mode, i.e. a message per indexed file Reviewers: sammccall, kadircet Reviewed By: sammccall Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56915 llvm-svn: 351563
* [clangd] Fix updated file detection logic in indexingKadir Cetinkaya2019-01-152-32/+38
| | | | | | | | | | | | | | | | | Summary: Files without any symbols were never marked as updated during indexing, which resulted in failure while writing shards for these files. This patch fixes the logic to mark files that are seen for the first time but don't contain any symbols as updated. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56592 llvm-svn: 351170
* [clangd] Add Limit parameter for xref.Haojian Wu2019-01-144-5/+29
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56597 llvm-svn: 351081
* [clangd] Fix a reference invalidationKadir Cetinkaya2019-01-141-15/+19
| | | | | | | | | | Summary: Fix for the breakage in http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52811/consoleFull#-42777206a1ca8a51-895e-46c6-af87-ce24fa4cd561 Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56656 llvm-svn: 351052
* [clangd] Index main-file symbols (bug 39761)Sam McCall2019-01-143-24/+34
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55185 llvm-svn: 351041
* [clangd] Introduce loading of shards within auto-indexKadir Cetinkaya2019-01-102-67/+217
| | | | | | | | | | | | | | | | Summary: Whenever a change happens on a CDB, load shards associated with that CDB before issuing re-index actions. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55224 llvm-svn: 350847
* [clangd] Don't store completion info if the symbol is not used for code ↵Haojian Wu2019-01-102-10/+29
| | | | | | | | | | | | | | | | | | | | | completion. Summary: This would save us some memory and disk space: - Dex usage (261 MB vs 266 MB) - Disk (75 MB vs 76 MB) It would save more when we index the main file symbol D55185. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: nridge, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56314 llvm-svn: 350803
* [clangd] Fix a crash when reading an empty index file.Haojian Wu2019-01-081-3/+6
| | | | | | | | | | | | | | | Summary: Unfortunately, yaml::Input::setCurrentDocument() and yaml::Input::nextDocument() are internal APIs, the way we use them may cause a nullptr accessing when processing an empty YAML file. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56442 llvm-svn: 350633
* [clangd] Remove 'using namespace llvm' from .cpp files. NFCIlya Biryukov2019-01-0716-332/+352
| | | | | | | | 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] Don't miss the expected type in merge.Haojian Wu2018-12-201-0/+2
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55918 llvm-svn: 349750
* [clangd] Unify path canonicalizations in the codebaseKadir Cetinkaya2018-12-192-51/+21
| | | | | | | | | | | | | | Summary: There were a few different places where we canonicalized paths, each one had its own flavor. This patch tries to unify them all under one place. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55818 llvm-svn: 349618
* [clangd] BackgroundIndex rebuilds symbol index periodically.Eric Liu2018-12-182-7/+55
| | | | | | | | | | | | | | | | | | Summary: Currently, background index rebuilds symbol index on every indexed file, which can be inefficient. This patch makes it only rebuild symbol index periodically. As the rebuild no longer happens too often, we could also build more efficient dex index. Reviewers: ilya-biryukov, kadircet Reviewed By: kadircet Subscribers: dblaikie, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55770 llvm-svn: 349496
* [clangd] Change diskbackedstorage to be atomicKadir Cetinkaya2018-12-171-8/+33
| | | | | | | | | | | | | | | | Summary: There was a chance that multiple clangd instances could try to write same shard, in which case we would get a malformed file most likely. This patch changes the writing mechanism to first write to a temporary file and then rename it to fit real destination. Which is guaranteed to be atomic by POSIX. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55417 llvm-svn: 349348
* [clangd] Only reduce priority of a thread for indexing.Kadir Cetinkaya2018-12-172-36/+55
| | | | | | | | | | | | | | | | | | Summary: We'll soon have tasks pending for reading shards from disk, we want them to have normal priority. Because: - They are not CPU intensive, mostly IO bound. - Give a good coverage for the project at startup, therefore it is worth spending some cycles. - We have only one task per whole CDB rather than one task per file. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55315 llvm-svn: 349345
* [dexp] Change FuzzyFind to also print scope of symbolsKadir Cetinkaya2018-12-141-1/+2
| | | | | | | | | | | | | | | | Summary: When there are multiple symbols in the result of a fuzzy find with the same name, one has to perform an additional query to figure out which of those symbols are coming from the "interesting" scope. This patch prints the scope in fuzzy find results to get rid of the second symbol. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55705 llvm-svn: 349152
* [clangd] Fix an assertion failure in background index.Haojian Wu2018-12-141-0/+8
| | | | | | | | | | | | | | | Summary: When indexing a file which contains an uncompilable error, we will trigger an assertion failure -- the IndexFileIn data is not set, but we access them in the backgound index. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55650 llvm-svn: 349144
OpenPOWER on IntegriCloud