summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Move the expandAuto tweak from global namespace into annoymous ↵Haojian Wu2019-07-121-1/+1
| | | | | | namespace. llvm-svn: 365885
* [clangd] Implement typeHierarchy/resolve for subtypesNathan Ridge2019-07-121-2/+61
| | | | | | | | | | | | | | | | | | Summary: This allows the client to resolve subtypes one level at a time. For supertypes, this is not necessary, because we eagerly compute supertypes and return all levels. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64308 llvm-svn: 365867
* [clangd] Implementation of auto type expansion.Sam McCall2019-07-111-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a tweak for clangd to replace an auto keyword to the deduced type. This way a user can declare something with auto and then have the IDE/clangd replace auto with whatever type clangd thinks it is. In case of long/complext types this makes is reduces writing effort for the user. The functionality is similar to the hover over the auto keyword. Example (from the header): ``` /// Before: /// auto x = Something(); /// ^^^^ /// After: /// MyClass x = Something(); /// ^^^^^^^ ``` Patch by kuhnel! (Christian Kühnel) Differential Revision: https://reviews.llvm.org/D62855 llvm-svn: 365792
* [clangd] Added highlightings for namespace specifiers.Johan Vikstrom2019-07-111-1/+4
| | | | | | | | | | | | | | Summary: Added highlightings for namespace specifiers. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64492 llvm-svn: 365745
* [clangd] Added highlighting for class and enum types.Johan Vikstrom2019-07-101-0/+6
| | | | | | | | | | | | | | Summary: Added highlighting for non-builtin types using VisitTypeLoc. Ignoring namespace qualifiers as for now. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64257 llvm-svn: 365602
* [clangd] Rewrite of logic to rebuild the background index serving structures.Sam McCall2019-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously it was rebuilding every 5s by default, which was much too frequent in the long run - the goal was to provide an early build. There were also some bugs. There were also some bugs, and a dedicated thread was used in production but not tested. - rebuilds are triggered by #TUs built, rather than time. This should scale more sensibly to fast vs slow machines. - there are two separate indexed-TU thresholds to trigger index build: 5 TUs for the first build, 100 for subsequent rebuilds. - rebuild is always done on the regular indexing threads, and is affected by blockUntilIdle. This means unit/lit tests run the production configuration. - fixed a bug where we'd rebuild after attempting to load shards, even if there were no shards. - the BackgroundIndexTests don't really test the subtleties of the rebuild policy (for determinism, we call blockUntilIdle, so rebuild-on-idle is enough to pass the tests). Instead, we expose the rebuilder as a separate class and have fine-grained tests for it. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64291 llvm-svn: 365531
* [clangd] Deduplicate clang-tidy diagnostic messages.Haojian Wu2019-07-051-221/+0
| | | | | | | | | | | | | | | | | | | | Summary: Clang-tidy checks may emit duplicated messages (clang-tidy tool deduplicate them in its custom diagnostic consumer), and we may show multiple duplicated diagnostics in the UI, which is really bad. This patch makes clangd do the deduplication, and revert the change rL363889. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64127 llvm-svn: 365204
* [clangd] Query driver reads stderr and passes driver as first argumentKadir Cetinkaya2019-07-041-5/+6
| | | | | | | | | | | | | | | | | Summary: gcc invokes cc1 through a path deduced from argv[0] therefore it must be correctly set. Also it prints the search path to stderr not stdout, this also applies to clang. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64196 llvm-svn: 365132
* [clangd] Add missing changes for 365111Johan Vikstrom2019-07-041-43/+1
| | | | llvm-svn: 365112
* [clangd] Emit publishSemanticHighlighting in LSP if enabledJohan Vikstrom2019-07-041-0/+75
| | | | | | | | | | | | | | Summary: Emit publishSemanticHighlighting in LSP if enabled Reviewers: hokein, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63919 llvm-svn: 365111
* Summary: [Clangd] Added hidden command line option -tweaks to specify which ↵Shaurya Gupta2019-07-011-1/+1
| | | | | | | | | | | | | | | | tweaks to enable - Only for development purposes - Disabled tweaks in fixits-duplications test Reviewers: sammccall, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63989 llvm-svn: 364809
* [clangd] Disable failing unittest on non-x86 platformsKadir Cetinkaya2019-06-261-0/+1
| | | | llvm-svn: 364413
* [clangd] Enable extraction of system includes from custom toolchainsKadir Cetinkaya2019-06-261-0/+50
| | | | | | | | | | | | | | | | | | Summary: Some custom toolchains come with their own header files and compiler drivers. Those compiler drivers implicitly know about include search path for those headers. This patch aims to extract that information from drivers and add it to the command line when invoking clang frontend. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62804 llvm-svn: 364389
* [clangd] Link and initialize target infosKadir Cetinkaya2019-06-261-0/+34
| | | | llvm-svn: 364387
* [clangd] Include the diagnostics's code when comparing diagnosticsNathan Ridge2019-06-191-0/+221
| | | | | | | | | | | | | | | | Summary: This fixes https://github.com/clangd/clangd/issues/60 Reviewers: kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63316 llvm-svn: 363889
* [clangd] Type hierarchy subtypesNathan Ridge2019-06-161-2/+29
| | | | | | | | | | | | | | | | | Summary: This builds on the relations support added in D59407, D62459, D62471, and D62839 to implement type hierarchy subtypes. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58880 llvm-svn: 363506
* [clangd] Revamp textDocument/onTypeFormatting.Sam McCall2019-06-102-23/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The existing implementation (which triggers on }) is fairly simple and has flaws: - doesn't trigger frequently/regularly enough (particularly in editors that type the } for you) - often reformats too much code around the edit - has jarring cases that I don't have clear ideas for fixing This implementation is designed to trigger on newline, which feels to me more intuitive than } or ;. It does have allow for reformatting after other characters - it has a basic behavior and a model for adding specialized behavior for particular characters. But at least initially I'd stick to advertising \n in the capabilities. This also handles comment splitting: when you insert a line break inside a line comment, it will make the new line into an aligned line comment. Working on tests, but want people to patch it in and try it - it's hard to see if "feel" is right purely by looking at a test. Reviewers: ilya-biryukov, hokein Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60605 llvm-svn: 362939
* [clangd] Stop marshalling/requiring FormattingOptions. We never did anything ↵Sam McCall2019-06-101-5/+5
| | | | | | with them. llvm-svn: 362934
* [clangd] Return empty results on spurious completion triggersIlya Biryukov2019-06-071-10/+12
| | | | | | | | | | | | | | | | | | | | | Summary: We currently return an error, this causes `coc.nvim` and VSCode to show an error message in the logs. Returning empty list of completions allows to avod the error message without altering other user-visible behavior. Reviewers: sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62999 llvm-svn: 362811
* [clangd] Support offsets for parameters in signatureHelpIlya Biryukov2019-06-041-0/+50
| | | | | | | | | | | | | | | | Summary: Added to LSP in version 3.14 Reviewers: hokein Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62476 llvm-svn: 362481
* [clangd] Fix a crash when clang-tidy is disabledIlya Biryukov2019-06-041-0/+39
| | | | llvm-svn: 362469
* [clangd] Introduce a structured hover responseKadir Cetinkaya2019-05-281-0/+33
| | | | | | | | | | | | | | | | Summary: Change ClangdServer layer to output a structured response for Hover, which can be rendered by client according to their needs. Reviewers: sammccall, ilya-biryukov Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61497 llvm-svn: 361803
* [clangd] Rename -run-synchronously to -syncIlya Biryukov2019-05-285-7/+7
| | | | llvm-svn: 361798
* [clangd] Boost code completion results that were named in the last few lines.Sam McCall2019-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The hope is this will catch a few patterns with repetition: SomeClass* S = ^SomeClass::Create() int getFrobnicator() { return ^frobnicator_; } // discard the factory, it's no longer valid. ^MyFactory.reset(); Without triggering antipatterns too often: return Point(x.first, x.^second); I'm going to gather some data on whether this turns out to be a win overall. Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61537 llvm-svn: 360030
* [clangd] Restore conventional names for lit configs, and .in/.py split. Fix ↵Sam McCall2019-05-024-32/+59
| | | | | | build_mode indirection. llvm-svn: 359763
* [clangd][xpc] Fix XPC unittestsJan Korous2019-04-291-0/+1
| | | | | | | | | Fix build after recent changes in clangd tests & add xpc unittests to check-clangd target. Differential Revision: https://reviews.llvm.org/D61271 llvm-svn: 359489
* [clangd] Fix unittests CMake rulesSam McCall2019-04-291-4/+1
| | | | llvm-svn: 359442
* [clangd] Fix windows buildbot, remove stray file after r359424. NFCSam McCall2019-04-291-0/+1
| | | | llvm-svn: 359434
* [clangd] Move clangd tests to clangd directory. check-clangd is no longer ↵Sam McCall2019-04-2954-0/+2240
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
OpenPOWER on IntegriCloud