summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd
Commit message (Collapse)AuthorAgeFilesLines
...
* Moved Symbol into its own header and implementation fileDmitri Gribenko2019-02-2814-265/+318
| | | | | | | | | | | | 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-2812-36/+85
| | | | | | | | | | | | 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-2811-91/+136
| | | | | | | | | | | | 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] Improve global code completion when scope specifier is unresolved.Eric Liu2019-02-271-9/+9
| | | | | | | | | | | | | | | | | | | | | | | 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] Set thread priority on WindowsIlya Biryukov2019-02-271-0/+7
| | | | | | | | | | | | | | Reviewers: kadircet, gribozavr Reviewed By: kadircet, gribozavr Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58683 llvm-svn: 354957
* [clangd] Library dependencies in XPCJan Korous2019-02-271-2/+2
| | | | | | | | Patch by Nicholas Allegra Differential Revision: https://reviews.llvm.org/D58089 llvm-svn: 354949
* [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] Add thread priority lowering for MacOS as wellKadir Cetinkaya2019-02-251-0/+8
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58492 llvm-svn: 354765
* [clangd] Enhance macro hover to see full definitionMarc-Andre Laperle2019-02-241-7/+24
| | | | | | | | | | | | | | | | Summary: Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com> Reviewers: simark, ilya-biryukov, sammccall, ioeric, hokein Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D55250 llvm-svn: 354761
* [clangd] Don't attach FixIt to the source code in macro.Haojian Wu2019-02-221-0/+5
| | | | | | | | | | | | | | | | | | Summary: We are less certain it is the correct fix. Also, clang doesn't apply FixIt to the source code in macro. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58525 llvm-svn: 354664
* [clangd] Only report explicitly typed symbols during code navigationKadir Cetinkaya2019-02-211-51/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clangd was reporting implicit symbols, like results of implicit cast expressions during code navigation, which is not desired. For example: ``` struct Foo{ Foo(int); }; void bar(Foo); vod foo() { int x; bar(^x); } ``` Performing a GoTo on the point specified by ^ would give two results one pointing to line `int x` and the other for definition of `Foo(int);` Reviewers: ilya-biryukov, sammccall Subscribers: ioeric, MaskRay, jkorous, mgrang, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58495 llvm-svn: 354585
* [clangd] Enable indexing of template type parametersKadir Cetinkaya2019-02-211-1/+4
| | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=36285 Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58294 llvm-svn: 354561
* [clangd] Handle another incomplete-type diagnostic case in IncludeFixer.Eric Liu2019-02-211-0/+1
| | | | llvm-svn: 354558
* [clangd] Fix a crash in SelectionIlya Biryukov2019-02-201-2/+1
| | | | | | | | | | | | | | | | | | | Summary: The assertion checking that a range of a node is a token range does not hold in case of "split" tokens, e.g. between two closing template argument lists (`vector<vector<int>>`). Reviewers: kadircet, sammccall Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58447 llvm-svn: 354507
* [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] Fix a typo. NFCIlya Biryukov2019-02-201-1/+1
| | | | | | | The documentation for -index-file mentioned clang-index instead of clangd-indexer. llvm-svn: 354456
* [clangd] Add an option in the code to not display number of fixesIlya Biryukov2019-02-192-3/+7
| | | | | | | | | | | | | | | | | | Summary: Only to the APIs, which are used by our embedders. We do not plan to add a user-facing option for this. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58387 llvm-svn: 354349
* [clangd] Handle unresolved scope specifier when fixing includes.Eric Liu2019-02-191-37/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the following examples, "clangd" is unresolved, and the fixer will try to fix include for `clang::clangd`; however, clang::clangd::X is usually intended. So when handling a qualifier that is unresolved, we change the unresolved name and scopes so that the fixer will fix "clang::clangd::X" in the following example. ``` namespace clang { clangd::X ~~~~~~ } // or clang::clangd::X ~~~~~~ ``` Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58185 llvm-svn: 354330
* [clangd] Cache include fixes for diagnostics caused by the same unresolved ↵Eric Liu2019-02-182-21/+75
| | | | | | | | | | | | | | | | | | | | | | name or incomplete type. Summary: Multiple diagnostics can be caused by the same unresolved name or incomplete type, especially if the code is copy-pasted without #includes. The cache can avoid making repetitive index requests, and thus reduce latency and allow more diagnostics to be fixed (we limit the number of index requests for each parse). Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58239 llvm-svn: 354268
* [clangd] Unlink VFS working dir from OS working dir. Reland of r351051Sam McCall2019-02-151-2/+3
| | | | llvm-svn: 354116
* [clangd] Handle a few more diag kinds in include fixer.Eric Liu2019-02-131-0/+6
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58135 llvm-svn: 353926
* [clangd] Fix use-after-free in XRefsSam McCall2019-02-121-8/+8
| | | | llvm-svn: 353821
* [NFC][clangd] Remove unused lambda captureFrancis Visoiu Mistrih2019-02-111-1/+1
| | | | | | | | | | | | | Avoid this warning: llvm/clang-tools-extra/clangd/ClangdServer.cpp:365:23: warning: lambda capture 'this' is not used [-Wunused-lambda-capture] auto Action = [Sel, this](decltype(CB) CB, std::string File, ~~^~~~ 1 warning generated. llvm-svn: 353760
* Revamp the "[clangd] Format tweak's replacements"Haojian Wu2019-02-116-33/+19
| | | | | | | | | | | | | | | | | | | | Summary: This patch contains two parts: 1) reverts commit r353306. 2) move the format logic out from tweaks, keep tweaks API unchanged. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58051 llvm-svn: 353712
* [clangd] Prefer location from codegen files when merging symbols.Eric Liu2019-02-112-8/+67
| | | | | | | | | | | | | | | | | | | 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] Index parameters in function declsKadir Cetinkaya2019-02-111-0/+2
| | | | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57950 llvm-svn: 353696
* [clangd] Make system header mappings available for PreambleParsedCallbackKadir Cetinkaya2019-02-111-5/+4
| | | | | | | | | | | | | | | | | | Summary: SystemHeaderMappings were added only after takeIncludes call, which resulted in getting mapping on main file ast updates but not on preamble ast updates. Fixes https://github.com/clangd/clangd/issues/8 Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58029 llvm-svn: 353687
* [clangd] Fix an assertion in TypoCorrection.Eric Liu2019-02-081-6/+7
| | | | | | | | | | | | | | Summary: https://github.com/clangd/clangd/issues/7 Reviewers: sammccall, hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57944 llvm-svn: 353514
* [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] Fix an assertion failure in Selection.Haojian Wu2019-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The assertion is triggered when the Decl is null. Details for the assertion: F0207 09:55:09.069385 47308 logging.cc:84] assert.h assertion failed at llvm/include/llvm/Support/Casting.h:105 in static bool llvm::isa_impl_cl<clang::TranslationUnitDecl, const clang:: Decl *>::doit(const From *) [To = clang::TranslationUnitDecl, From = const clang::Decl *]: Val && "isa<> used on a null pointer" 15 *** Check failure stack trace: *** 19 @ 0x55615c1f7e06 __assert_fail 20 @ 0x55615a6297d8 clang::clangd::(anonymous namespace)::SelectionVisitor::TraverseDecl() 21 @ 0x55615a62f48d clang::RecursiveASTVisitor<>::TraverseTemplateTemplateParmDecl() 22 @ 0x55615a62b264 clang::RecursiveASTVisitor<>::TraverseDecl() 23 @ 0x55615a62979c clang::clangd::(anonymous namespace)::SelectionVisitor::TraverseDecl() 24 @ 0x55615a63060c clang::RecursiveASTVisitor<>::TraverseClassTemplatePartialSpecializationDecl() 25 @ 0x55615a62ae45 clang::RecursiveASTVisitor<>::TraverseDecl() Reviewers: sammccall Subscribers: javed.absar, kristof.beyls, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57879 llvm-svn: 353421
* [ELF] Format lines inadvertently indented by rCTE353380Fangrui Song2019-02-071-5/+5
| | | | llvm-svn: 353415
* [clangd] Use Dex for dynamic index by default.Eric Liu2019-02-071-1/+1
| | | | | | | | | | | | | | | | | Summary: Memory usage for a sample TU: Without Dex: 17.9M With Dex: 24.4M The memory increase is considerable but seems tolerable. Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57878 llvm-svn: 353413
* [clangd] Suggest adding missing includes for typos (like include-fixer).Eric Liu2019-02-074-25/+243
| | | | | | | | | | | | | | | | | | | Summary: This adds include-fixer feature into clangd based on D56903. Clangd now captures diagnostics caused by typos and attach include insertion fixes to potentially fix the typo. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, javed.absar, ilya-biryukov, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D57021 llvm-svn: 353380
* [clangd] Add type boost to fuzzy find in Dex.Eric Liu2019-02-066-50/+75
| | | | | | | | | | | | | | | | | | 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] Bump vscode-clangd v0.0.11Haojian Wu2019-02-061-1/+1
| | | | | | | CHANGELOG: - activate the extension on ObjC files. llvm-svn: 353309
* [clangd] Format tweak's replacements.Haojian Wu2019-02-068-9/+45
| | | | llvm-svn: 353306
* [clangd] Update dev dependencies of clangd-vscodeIlya Biryukov2019-02-063-5/+2031
| | | | | | | | | | | | | | | | | | | | | | Summary: The version bumps are a result of running `npm audit`, which found 3 security issues in previous versions of our dependencies. Also add 'package-lock.json' to the repo, it's a common practice to check in those files into the repository to get consistent versions of dependencies when running on different machines. Reviewers: hokein Reviewed By: hokein Subscribers: dschuff, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57814 llvm-svn: 353296
* [clangd] Enable clangd on Objective-C in VSCodeIlya Biryukov2019-02-061-1/+3
| | | | | | | | | | | | | | | | Summary: Thanks to Andreas Ostermeyer for raising this on the mailing list. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57813 llvm-svn: 353295
* [clangd] Add CLI flag "-clang-tidy" to enable/disable running clang-tidy checks.Haojian Wu2019-02-061-9/+18
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57746 llvm-svn: 353284
* [clangd] Some minor fixes.Haojian Wu2019-02-062-3/+3
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57755 llvm-svn: 353283
* [clangd] Enable include insertion for static indexKadir Cetinkaya2019-02-047-32/+77
| | | | | | | | | | | | | | 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] Bump vscode-clangd v0.0.10Haojian Wu2019-02-041-1/+1
| | | | | | | | CHANGELOG: - cleanup filestatus caches when clangd crashes - extension workwith LSP v3.14.0, support go-to-declaration feature llvm-svn: 353027
* [clangd] Update vscode dependenciesHaojian Wu2019-02-041-3/+3
| | | | | | This allows us to use latest LSP v3.14.0 (for go-to-declaration feature). llvm-svn: 353026
* Remove trailing semicolon. NFCI.Simon Pilgrim2019-02-031-1/+1
| | | | llvm-svn: 352991
* Remove trailing semicolon. NFCI.Simon Pilgrim2019-02-031-1/+1
| | | | llvm-svn: 352990
* [Clangd] textDocument/definition and textDocument/declaration "bounce" ↵Sam McCall2019-02-021-7/+33
| | | | | | | | | | | | | | | | | | between definition and declaration location when they are distinct. Summary: This helps minimize the disruption of not returning declarations as part of a find-definition response (r352864). Reviewers: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D57580 llvm-svn: 352953
* [clangd] Expose SelectionTree to code tweaks, and use it for swap if branches.Sam McCall2019-02-015-118/+43
| | | | | | | | | | | | | | | | | Summary: This reduces the per-check implementation burden and redundant work. It also makes checks range-aware by default (treating the commonAncestor as if it were a point selection should be good baseline behavior). Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet Tags: #clang Differential Revision: https://reviews.llvm.org/D57570 llvm-svn: 352876
* [clangd] Lib to compute and represent selection under cursor.Sam McCall2019-02-011-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The primary problem this solves is to expose the codeAction selection to AST-based refactorings in a way that makes it easy and efficient for them to bind to the right parts of the AST. It should also allow us to make XRefs based features (textDocument/definition) more robust, more easily implement textDocument/typeDefinition etc. As an example, template parameter references can be identified without special handling. There should be slight speedup too: we can prune most of the AST traversal in most cases. Elephant in the room: this is similar-but-different to Tooling/Refactoring/ASTSelection. That captures a smaller set of AST nodes, has a slightly different way of representing selections, and generally has mare features and does more work. The overall shape is pretty similar, and yet I can't quite get to behave as I expect. Reviewers: ilya-biryukov, kadircet Subscribers: mgorny, ioeric, MaskRay, jkorous, mgrang, arphaman Tags: #clang Differential Revision: https://reviews.llvm.org/D57562 llvm-svn: 352875
* [clangd] Lib to compute and represent selection under cursor.Sam McCall2019-02-013-0/+425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The primary problem this solves is to expose the codeAction selection to AST-based refactorings in a way that makes it easy and efficient for them to bind to the right parts of the AST. It should also allow us to make XRefs based features (textDocument/definition) more robust, more easily implement textDocument/typeDefinition etc. As an example, template parameter references can be identified without special handling. There should be slight speedup too: we can prune most of the AST traversal in most cases. Elephant in the room: this is similar-but-different to Tooling/Refactoring/ASTSelection. That captures a smaller set of AST nodes, has a slightly different way of representing selections, and generally has mare features and does more work. The overall shape is pretty similar, and yet I can't quite get to behave as I expect. Reviewers: ilya-biryukov, kadircet Subscribers: mgorny, ioeric, MaskRay, jkorous, mgrang, arphaman Tags: #clang Differential Revision: https://reviews.llvm.org/D57562 llvm-svn: 352874
OpenPOWER on IntegriCloud