summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Fix DocumentOutline for conceptsKadir Cetinkaya2020-06-232-2/+14
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/256 Reviewers: kbobyrev Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73056 (cherry picked from commit fb3d9153c01b9a560680465190d6ecd804e4c486)
* [clangd] Use printf instead of `echo -e` to be compliant with dashKadir Cetinkaya2020-06-161-2/+2
| | | | (cherry picked from commit ca1c21d4b659bfa5edb38c4a54b3050e43c4b51a)
* [clangd] Disable dependency-output lit test on windowsKadir Cetinkaya2020-06-161-0/+1
| | | | (cherry picked from commit a940a246f5e14a8fd44586f609b8a675eb949469)
* [clangd] Preserve -nostdinc and --sysroot when calling query driverKadir Cetinkaya2020-06-102-13/+47
| | | | | | | | | | | | | | Solves this issue: https://github.com/clangd/clangd/issues/157 This is my first contribution to an llvm project, so I hope I'm doing it right! Patch by @topisani (Tobias Pisani)! Reviewers: kadircet, klimek Differential Revision: https://reviews.llvm.org/D73811 (cherry picked from commit 6e8d6bc9ec8739ec22b73a23f740f171f452e234)
* [clangd] Fix a crash for accessing a null template decl returned by ↵Haojian Wu2020-06-102-9/+37
| | | | | | | | | | | | | | | | | | | findExplicitReferences. Summary: Fixes https://github.com/clangd/clangd/issues/347. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78626 (cherry picked from commit 7d1ee639cb9efea364bec90afe4d1161ec624a7f) Includes some test-only changes from f651c402a221a20f3bc6ea43f70b29326a357010 to support the cherry-picked tests. Test tweaked slightly as it exhibits a separate bug that was fixed on master.
* [clangd] Increase stack size of the new threads on macOSSam McCall2020-06-102-10/+32
| | | | | | | | | | | | | | | | | | | | Summary: By default it's 512K, which is way to small for clang parser to run on. There is no way to do it via platform-independent API, so it's implemented via pthreads directly in clangd/Threading.cpp. Fixes https://github.com/clangd/clangd/issues/273 Patch by Dmitry Kozhevnikov! Reviewers: ilya-biryukov, sammccall, arphaman Reviewed By: ilya-biryukov, sammccall, arphaman Subscribers: dexonsmith, umanwizard, jfb, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50993 (cherry picked from commit 69a39dc1f0d08ea43bac03a87bb8bff3937ce2e7)
* [clangd] Make use of SourceOrder to find first initializer in DefineOutlineKadir Cetinkaya2020-06-102-11/+45
| | | | | | | | | | | | | | | | | | | | | Summary: Constructors can have implicit initializers, this was crashing define outline. Make sure we find the first "written" ctor initializer to figure out `:` location. Fixes https://github.com/clangd/clangd/issues/400 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80521 (cherry picked from commit eeedbd033612e105755156023bdeec2fba4eca21) Fixes https://github.com/clangd/clangd/issues/418
* [clangd] Filter pch related flags coming from the userKadir Cetinkaya2020-06-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: PCH format is unstable, hence using a preamble built with a different version of clang (or even worse, a different compiler) might result in unexpected behaviour. PCH creation on the other hand is something clangd wouldn't want to perform, as it doesn't generate any output files. This patch makes sure clangd drops any PCH related compile commands after parsing the command line args. Fixes https://github.com/clangd/clangd/issues/248 Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D79669 (cherry picked from commit 35d867a790c2bcf2008b2ee1895ae8af2793b797) Dropped the test as it depends on nontrivial changes from master. The code is very simple and identical to that tested on master. Fixes https://github.com/clangd/clangd/issues/419
* [clangd] Fix early selection for non-vardecl declaratorsKadir Cetinkaya2020-06-103-6/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: Selection tree was performing an early claim only for VarDecls, but there are other cases where we can have declarators, e.g. FieldDecls. This patch extends the early claim logic to all types of declarators. Fixes https://github.com/clangd/clangd/issues/292 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75106 (cherry picked from commit e6b8181895b96740dbe54aca036aa237e0a8363d) Modified the cherry-picked test as diagnostics differ on the branch. Fixes https://github.com/clangd/clangd/issues/421
* [clangd] Disable all dependency outputsKadir Cetinkaya2020-06-102-0/+21
| | | | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/322 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78833 (cherry picked from commit 294b9d43cae77ea15453ec82203368903db4f538) Fixes https://github.com/clangd/clangd/issues/422
* [clangd][Hover] Handle uninstantiated default argsKadir Cetinkaya2020-06-102-2/+32
| | | | | | | | | | | | | | | | | | | Summary: Default args might exist but be unparsed or uninstantiated. getDefaultArg asserts on those. This patch makes sure we don't crash in such scenarios. Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73723 (cherry-picked from commit 9c903d0373ff940f9143efab8d948edf776de9f1) Fixes https://github.com/clangd/clangd/issues/424
* [clangd] Don't assert when completing a lambda variable inside the lambda.Sam McCall2020-06-105-6/+45
| | | | | | | | | | | | | | | | | | | Summary: This is a fairly ugly hack - we back off several features for any variable whose type isn't deduced, to avoid computing/caching linkage. Better suggestions welcome. Fixes https://github.com/clangd/clangd/issues/274 Reviewers: kadircet, kbobyrev Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73960 (cherry picked from commit 2629035a009095f62f48413e175437261165ecd7)
* [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.Haojian Wu2020-06-101-0/+27
| | | | | | | | | | | | | | | | | Summary: this maybe not ideal, but it is trivial and does fix the crash. Fixes https://github.com/clangd/clangd/issues/156. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78715 (cherry picked from commit a466e4be3831848d7ff6ffbe4f57d99de8fb66af)
* [clangd] Add the missing elaborated types in FindTarget.Haojian Wu2020-06-102-0/+11
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74025 (cherry picked from commit eaf0c89ec5f866b6cef296c542c030bb2cf8481d)
* [clangd] Handle the missing injectedClassNameType in targetDecl.Haojian Wu2020-06-102-0/+13
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73102 (cherry picked from commit 5d4e89975714875a86cb8e62b60d93eebefa4029)
* [clangd] Fix null check in FindTarget.Sam McCall2020-06-101-1/+1
| | | | | | | I've hit this stack trace a few times but don't have a good reproducer. The code is unsafe by inspection, though. (cherry picked from commit 9a5c448a31bacc08e73fcae4636094f9b6e2be6a)
* [clangd] DefineOutline won't copy virtual specifiers on methodsNathan James2020-03-042-4/+224
| | | | | | | | | | | | | | | | | | Summary: The define out of line refactor tool previously would copy the `virtual`, `override` and `final` specifier into the out of line method definition. This results in malformed code as those specifiers aren't allowed outside the class definition. Reviewers: hokein, kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D75429 (cherry picked from commit b2666ccca0277371a09e43a0a5a0f78029ba81e5)
* [clangd] Make output order of allTargetDecls deterministicKadir Cetinkaya2020-02-191-32/+49
| | | | | | | | | | | | | | | | | Summary: Makes use of insertion order to stabilize output for multiple decls. Fixes https://bugs.llvm.org/show_bug.cgi?id=44564 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits, aemerson Tags: #clang Differential Revision: https://reviews.llvm.org/D72826 (cherry picked from commit d54d71b67e602674a255e299a22fe31dee1f3619)
* [clangd] Expose Code Completion score to the clientKirill Bobyrev2020-02-138-0/+21
| | | | | | | | | | | | | | | | Summary: Make it possible for the client to adjust the ranking by using the score Clangd calculates for the completion items. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74547 (cherry picked from commit ff7b5bac04fa4946935ea45214e29f267d6c1d7b)
* [clangd] Add workaround for GCC5 host compilers. NFC.Michael Liao2020-02-061-1/+7
| | | | (cherry picked from commit 40514a7d7a3b745ba43c2d014e54a0d78d65d957)
* [clangd] Don't mmap source files on all platforms --> don't crash on git ↵Sam McCall2020-01-292-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkout Summary: Previously we mmapped on unix and not on windows: on windows mmap takes an exclusive lock on the file and prevents the user saving changes! The failure mode on linux is a bit more subtle: if the file is changed on disk but the SourceManager sticks around, then subsequent operations on the SourceManager will fail as invariants are violated (e.g. null-termination). This commonly manifests as crashes after switching git branches with many files open in clangd. Nominally mmap is for performance here, and we should be willing to give some up to stop crashing. Measurements on my system (linux+desktop+SSD) at least show no measurable regression on an a fairly IO-heavy workload: drop disk caches, open SemaOverload.cpp, wait for first diagnostics. for i in `seq 100`; do for variant in mmap volatile; do echo 3 | sudo tee /proc/sys/vm/drop_caches /usr/bin/time --append --quiet -o ~/timings -f "%C %E" \ bin/clangd.$variant -sync -background-index=0 < /tmp/mirror > /dev/null done done bin/clangd.mmap -sync -background-index=0 0:07.60 bin/clangd.volatile -sync -background-index=0 0:07.89 bin/clangd.mmap -sync -background-index=0 0:07.44 bin/clangd.volatile -sync -background-index=0 0:07.89 bin/clangd.mmap -sync -background-index=0 0:07.42 bin/clangd.volatile -sync -background-index=0 0:07.50 bin/clangd.mmap -sync -background-index=0 0:07.90 bin/clangd.volatile -sync -background-index=0 0:07.53 bin/clangd.mmap -sync -background-index=0 0:07.64 bin/clangd.volatile -sync -background-index=0 0:07.55 bin/clangd.mmap -sync -background-index=0 0:07.75 bin/clangd.volatile -sync -background-index=0 0:07.47 bin/clangd.mmap -sync -background-index=0 0:07.90 bin/clangd.volatile -sync -background-index=0 0:07.50 bin/clangd.mmap -sync -background-index=0 0:07.81 bin/clangd.volatile -sync -background-index=0 0:07.95 bin/clangd.mmap -sync -background-index=0 0:07.55 bin/clangd.volatile -sync -background-index=0 0:07.65 bin/clangd.mmap -sync -background-index=0 0:08.15 bin/clangd.volatile -sync -background-index=0 0:07.54 bin/clangd.mmap -sync -background-index=0 0:07.78 bin/clangd.volatile -sync -background-index=0 0:07.61 bin/clangd.mmap -sync -background-index=0 0:07.78 bin/clangd.volatile -sync -background-index=0 0:07.55 bin/clangd.mmap -sync -background-index=0 0:07.41 bin/clangd.volatile -sync -background-index=0 0:07.40 bin/clangd.mmap -sync -background-index=0 0:07.54 bin/clangd.volatile -sync -background-index=0 0:07.42 bin/clangd.mmap -sync -background-index=0 0:07.45 bin/clangd.volatile -sync -background-index=0 0:07.49 bin/clangd.mmap -sync -background-index=0 0:07.95 bin/clangd.volatile -sync -background-index=0 0:07.66 bin/clangd.mmap -sync -background-index=0 0:08.04 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73617 (cherry picked from commit b500c49cd4f81f067cda721049cb1fd72a5e7bf5)
* [clangd][Hover] Make tests hermetic by setting target tripletKadir Cetinkaya2020-01-291-43/+28
| | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=44696 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73613 (cherry picked from commit 55b0e9c9d5de7c5d70552ac9ca9ffc14097e983b)
* [clangd][Hover] Handle uninstantiated templatesKadir Cetinkaya2020-01-282-9/+37
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/263 Reviewers: hokein, sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73344 (cherry picked from commit a31a61dafeaa9110687110fc127ea6f7c91dd3e6)
* [clangd][Hover] Change arrow in return type back to →Kadir Cetinkaya2020-01-273-4/+4
| | | | | | | | | | | | | | | | Summary: Currently 🡺 is used in hover response to represent return types, but it is not widely available. Changing this back to original to support more clients. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73336 (cherry picked from commit 1b996faa1575bda6b99e778aaabe14834c10d3ff)
* [clangd] Drop returntype/type when hovering over type-ish namesKadir Cetinkaya2020-01-272-15/+21
| | | | | | | | | | | | | | | | | | Summary: Some names, e.g. constructor/destructor/conversions, already contain the type info, no need to duplicate them in the hoverinfo. Fixes https://github.com/clangd/clangd/issues/252 Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73110 (cherry picked from commit 1fbb1d6df0113ca341f6d257bc72e07343dd861a)
* [clangd] Print underlying type for decltypes in hoverKadir Cetinkaya2020-01-272-15/+74
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/249 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72498 (cherry picked from commit 0474fe465d8feebcfd54a16d93ad8518b5625972)
* [clangd] Dont display `<unknown>` kinds in hover boardKadir Cetinkaya2020-01-272-2/+3
| | | | | | | | | | | | | | | | | | Summary: Currently when hovering over an `auto` or `decltype` that resolve to a builtin-type, clangd would display `<unknown>` as the kind of the symbol. Drop that to make rendering nicer. Reviewers: usaxena95 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72777 (cherry picked from commit b08e8353a89f682861ef947fdb6e229b3de2e37d)
* [clangd] Extract string literals in macro arguments to unbreak gcc buildbotsKadir Cetinkaya2020-01-271-4/+7
| | | | (cherry picked from commit 041650da67051266eb92b5bb07223394fe1bdab1)
* [clangd] Fix windows buildbotsKadir Cetinkaya2020-01-271-20/+43
| | | | (cherry picked from commit 60adfb83cda883d9fc1079c89d2feaa681a41b90)
* [clangd] Rearrange type, returntype and parameters in hover cardKadir Cetinkaya2020-01-273-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Moves type/returntype into its own line as it is more readable in cases where the type is long. Also gives parameter lists a heading, `Parameters:` to make them stand out. Leaves the `right arrow` instead of `Returns: ` before Return Type to make output more symmetric. ``` function foo Returns: ret_type Parameters: - int x ``` vs ``` function foo 🡺 ret_type Parameters: - int x ``` Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72623 (cherry picked from commit 44f9c7a820c1e5fb949f441214a46b13588ff51a)
* [clangd] Add a ruler after header in hoverKadir Cetinkaya2020-01-275-15/+103
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72622 (cherry picked from commit d74a3d470c316f8fade90fe231fc0a51361c01e6)
* [clangd] Show hower info for expressionsKadir Cetinkaya2020-01-272-2/+83
| | | | | | | | | | | | | | | | | | Summary: This currently populates only the Name with the expression's type and Value if expression is evaluatable. Fixes https://github.com/clangd/clangd/issues/56 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72500 (cherry picked from commit 4d14bfaa2cb1610104db6b0818fc7d74fad1bd8f)
* Include <cstdlib> for std::abort() in clangdDimitry Andric2020-01-271-0/+1
| | | | | | | This fixes a "not a member of 'std'" error with e.g. Fedora 32. Closes: #105 (cherry picked from commit 58592f6c49249293f79698cfcb31dba532e12603)
* [clangd] Include expression in DecltypeTypeLoc sourcerange while building ↵Kadir Cetinkaya2020-01-132-0/+19
| | | | | | | | | | | | | | | | | | | | | | | SelectionTree Summary: Currently AST only contains the location for `decltype` keyword, therefore we were skipping expressions inside decltype while building selection tree. This patch extends source range in such cases to contain the expression as well. A proper fix would require changes to Sema and DecltypeTypeLoc to contain these location information. Fixes https://github.com/clangd/clangd/issues/250. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72594
* [clangd] Render header of hover card as a headingKadir Cetinkaya2020-01-135-1/+48
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72625
* [clangd] Remove raw string literals in macrosOliver Stannard2020-01-131-12/+16
| | | | | Older (but still supported) versions of GCC don't handle C++11 raw string literals in macro parameters correctly.
* [clangd] Publish xref for macros from Index and AST.Utkarsh Saxena2020-01-132-42/+106
| | | | | | | | | | | | | | | | | | | Summary: With this patch the `findReferences` API will return Xref for macros. If the symbol under the cursor is a macro then we collect the references to it from: 1. Main file by looking at the ParsedAST. (These were added to the ParsedAST in https://reviews.llvm.org/D70008) 2. Files other than the mainfile by looking at the: * static index (Added in https://reviews.llvm.org/D70489) * file index (Added in https://reviews.llvm.org/D71406) This patch collects all the xref from the above places and outputs it in `findReferences` API. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72395
* [clangd] Show template arguments in type hierarchy when possibleNathan Ridge2020-01-122-12/+117
| | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/31 Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71533
* [clangd] Assert that the testcases in FindExplicitReferencesTest.All have no ↵Nathan Ridge2020-01-121-3/+7
| | | | | | | | | | | | diagnostics Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72355
* [clangd] Fix targetDecl() on certain usage of ObjC properties.Sam McCall2020-01-102-6/+12
| | | | | | | | | | | | | | | Summary: In particular there's a common chain: OpaqueValueExpr->PseudoObjectExpr->ObjCPropertyRefExpr->ObjCPropertyDecl and we weren't handling the first two edges Reviewers: dgoldman, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72494
* [clangd] Fix markdown rendering in VSCodeKadir Cetinkaya2020-01-102-11/+12
| | | | | | | | | | | | | | | Summary: Eventough it is OK to have a new line without any preceding spaces in some markdown specifications, VSCode requires two spaces before a new line to break a line inside a paragraph. Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72462
* [clangd] Improve type printing in hoverKadir Cetinkaya2020-01-102-15/+36
| | | | | | | | | | | | | | | | | | Summary: Do not include tag keywords when printing types for symbol names, as it will come from SymbolKind. Also suppress them while printing definitions to prevent them occuring in template arguments. Make use of `getAsString`, instead of `print` in all places to have a consistent style across the file. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72450
* [clangd] Handle DeducedTemplateSpecializationType in TargetFinderNathan Ridge2020-01-092-1/+40
| | | | | | | | | | | | | | Summary: This is a workaround for https://bugs.llvm.org/show_bug.cgi?id=42914. Once that is fixed, the handling in VisitDeducedTyped() should be sufficient. Fixes https://github.com/clangd/clangd/issues/242 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72119
* [clangd] Adjust diagnostic range to be inside main fileKadir Cetinkaya2020-01-092-8/+43
| | | | | | | | | | | | | | | | | | | | | | | Summary: LSP requires diagnostics to lay inside main file. In clangd we keep diagnostics in three different cases: - already in main file - adjusted to a header included in main file - has a note covering some range in main file In the last case, we were not adjusting the diagnostics range to be in main file, therefore these diagnostics ended up pointing some arbitrary locations. This patch fixes that issue by adjusting the range of diagnostics to be the first note inside main file when converting to LSP. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72458
* [clangd] Respect `--sysroot` argument if it is setDavid Goldman2020-01-091-1/+3
| | | | | | | | | | | | | | Summary: - Since `--sysroot` is a superset of the `-isysroot` argument, we shouldn't add the `-isysroot` if we detect a `--sysroot` flag. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72415
* [clangd] Refurbish HoverInfo::presentKadir Cetinkaya2020-01-093-32/+157
| | | | | | | | | | | | Summary: Improves basic hover presentation logic to include more info. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71555
* [clangd] Add xref for macros to FileIndex.Utkarsh Saxena2020-01-085-3/+70
| | | | | | | | | | | | | | | Summary: Adds macro references to the dynamic index. Tests added. Also exposed a new API to convert path to URI in URI.h Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71406
* Fix issues reported by -Wrange-loop-analysis when building with latest Clang ↵Alexandre Ganea2020-01-072-2/+2
| | | | | | (trunk). NFC. Fixes warning: loop variable 'E' of type 'const llvm::StringRef' creates a copy from type 'const llvm::StringRef' [-Wrange-loop-analysis]
* [clangd] Heuristically resolve dependent call through smart pointer typeNathan Ridge2020-01-072-17/+59
| | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/227 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71644
* [clangd] Assert that the testcases in LocateSymbol.All have no diagnosticsNathan Ridge2020-01-071-22/+62
| | | | | | | | | | Summary: Also fix some bugs in the testcases which this exposed. Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72066
OpenPOWER on IntegriCloud