summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/test
Commit message (Collapse)AuthorAgeFilesLines
* [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-101-2/+6
| | | | | | | | | | | | | | 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] Disable all dependency outputsKadir Cetinkaya2020-06-101-0/+12
| | | | | | | | | | | | | | | | 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] Expose Code Completion score to the clientKirill Bobyrev2020-02-134-0/+9
| | | | | | | | | | | | | | | | 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][Hover] Change arrow in return type back to →Kadir Cetinkaya2020-01-271-1/+1
| | | | | | | | | | | | | | | | 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] Rearrange type, returntype and parameters in hover cardKadir Cetinkaya2020-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Refurbish HoverInfo::presentKadir Cetinkaya2020-01-091-2/+2
| | | | | | | | | | | | 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 path mappings functionalitySam McCall2020-01-072-0/+68
| | | | | | | | | | | | | | | | Summary: Add path mappings to clangd which translate file URIs on inbound and outbound LSP messages. This mapping allows clangd to run in a remote environment (e.g. docker), where the source files and dependencies may be at different locations than the host. See http://lists.llvm.org/pipermail/clangd-dev/2019-January/000231.htm for more. Patch by William Wagner! Reviewers: sammccall, ilya-biryukov Reviewed By: sammccall Subscribers: usaxena95, ormris, mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64305
* Revert "Revert "[clangd] Implement "textDocument/documentLink" protocol ↵Sam McCall2020-01-022-0/+45
| | | | | | | | | | support"" This reverts commit 079ef783dd5530b5f87beefe624b9179547ded7e. The revert describes a test failure without details, after offline discussion this in in a private/unsupported build system and doesn't seem to reflect a real upstream bug.
* Revert "[clangd] Implement "textDocument/documentLink" protocol support"Dmitri Gribenko2019-12-162-45/+0
| | | | | | This reverts commit d6417f5584aa7673fa0212029a96cc9cacb1aad5. The tests depend on builtin headers, which is not intentionally supported in clangd tests; these tests are broken in some build environments.
* [clangd] Implement "textDocument/documentLink" protocol supportMichael Forster2019-12-122-0/+45
| | | | | | | | | | | | | | | | | | | Summary: This adds an implementation for the "textDocument/documentLink" LSP request. It returns links for all `#include` directives to the resolved target files. Fixes https://github.com/clangd/clangd/issues/217. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70872
* [clangd] Remove the hanging lit exit-signal.test.Haojian Wu2019-12-041-32/+0
| | | | | | | | The test was introduced in https://github.com/llvm/llvm-project/commit/19ac0eaf07e60173baa7ee77fa11568c30b87455. The test keeps hanging after running "check-clangd", remove it now and will add it back later after investigations.
* [clangd] Shutdown cleanly on signals.Sam McCall2019-11-272-0/+39
| | | | | | | | | | | | | | | | Summary: This avoids leaking PCH files if editors don't use the LSP shutdown protocol. This is one fix for https://github.com/clangd/clangd/issues/209 (Though I think we should *also* be unlinking the files) Reviewers: kadircet, jfb Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70684
* [clangd] Inactive regions support as an extension to semantic highlightingNathan Ridge2019-11-211-0/+8
| | | | Differential Revision: https://reviews.llvm.org/D67536
* [clangd] Do not highlight keywords in semantic highlightingIlya Biryukov2019-10-281-4/+4
| | | | | | | | | | | | | | | | | | Summary: Editors are good at highlightings the keywords themselves. Note that this only affects highlightings of builtin types spelled out as keywords in the source code. Highlightings of typedefs to builtin types are unchanged. Reviewers: hokein Reviewed By: hokein Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69431
* [clangd] Improve semantic highlighting in dependent contexts (fixes #154)Nathan Ridge2019-10-141-4/+10
| | | | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67901 llvm-svn: 374799
* clangd tests: use extended regex with sedNico Weber2019-10-143-3/+3
| | | | | | | | | The escaped parens seem to confuse the combination of lit, cygwin quoting, and cygwin's sed. unxutils sed in cmd.exe is fine with both forms, so use the extended regex form that doesn't need an escaped paren. llvm-svn: 374753
* convert another test to unix line endingsNico Weber2019-10-141-14/+14
| | | | llvm-svn: 374752
* convert a test to unix line endingsNico Weber2019-10-141-84/+84
| | | | llvm-svn: 374751
* fix typo in 374747Nico Weber2019-10-141-1/+1
| | | | llvm-svn: 374750
* Prefer 'env not' over 'not env' in tests.Nico Weber2019-10-141-1/+1
| | | | | | | | | That way, lit's builtin 'env' command can be used for the 'env' bit. Also it's clearer that way that the 'not' shouldn't cover 'env' failures. llvm-svn: 374749
* Make symbols.test pass on Windows.Nico Weber2019-10-142-2/+2
| | | | | | | | See commit message of r374746 for details. Hopefully final bit of PR43592. llvm-svn: 374747
* Make code-action-request.test and request-reply.test pass on Windows.Nico Weber2019-10-142-5/+5
| | | | | | | | | | | | clangd's test:// scheme expands to /clangd-test on non-Win and to C:/clang-test on Win, so it can't be mixed freely with file:///clangd-test since that's wrong on Windows. This makes both tests consistenly use the test:// scheme. (Alternatively, we could use the //INPUT_DIR pattern used in a few other tests.) Part of PR43592. llvm-svn: 374746
* Don't run background-index.test on Windows.Nico Weber2019-10-141-1/+1
| | | | | | | | | The test had a "UNSUPPORTED: win32" line, but the spelling of that changed in r339307 a year ago. Finally update this test too. Part of PR43592. llvm-svn: 374745
* Add missing "REQUIRES: shell" to system-include-extractor.testNico Weber2019-10-131-0/+3
| | | | | | Part of PR43592. llvm-svn: 374730
* Try to get clangd tests passing on Windows.Nico Weber2019-10-072-10/+10
| | | | | | Part of PR43592. See also r328645. llvm-svn: 373932
* [clangd] Add semantic selection to ClangdLSPServer.Utkarsh Saxena2019-09-242-0/+40
| | | | | | | | | | | | | | | | | | | | | | Summary: This adds semantic selection to the LSP Server. Adds support for serialization of input request and the output reply. Also adds regression tests for the feature. Currently we do not support multi cursor.The LSP Server only accepts single position in the request as opposed to many position in the spec. Spec: https://github.com/microsoft/language-server-protocol/blob/dbaeumer/3.15/specification.md#textDocument_selectionRange Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67720 llvm-svn: 372753
* [clangd] Add a new highlighting kind for typedefsIlya Biryukov2019-09-091-4/+7
| | | | | | | | | | | | | | | | | | | Summary: We still attempt to highlight them as underlying types, but fallback to the generic 'typedef' highlighting kind if the underlying type is too complicated. Reviewers: hokein Reviewed By: hokein Subscribers: nridge, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67290 llvm-svn: 371402
* [clangd] Add highlighting for macro expansions.Johan Vikstrom2019-08-301-0/+3
| | | | | | | | | | | | | | Summary: https://github.com/clangd/clangd/issues/134 Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66995 llvm-svn: 370482
* [clangd] Add distinct highlightings for static fields and methodsNathan Ridge2019-08-301-4/+10
| | | | | | | | | | | | | | Reviewers: hokein, ilya-biryukov, jvikstrom Reviewed By: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66828 llvm-svn: 370429
* [clangd] Add a distinct highlighting for local variablesNathan Ridge2019-08-271-4/+7
| | | | | | | | | | | | | | | | | | Summary: It's useful to be able to distinguish local variables from namespace scope variables. Reviewers: hokein, jvikstrom Reviewed By: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66723 llvm-svn: 370103
* [clangd] Send highlighting diff beyond the end of the file.Haojian Wu2019-08-261-1/+6
| | | | | | | | | | | | | | Summary: This would make the client life (tracking the changes) easier. Reviewers: jvikstrom Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66541 llvm-svn: 369884
* [clangd] Added special HighlightingKind for function parameters.Johan Vikstrom2019-08-191-4/+7
| | | | | | | | | | | | | | Summary: This means that function parameters are no longer highlighted as variable.other.cpp but instead as variable.parameter.cpp which is the more "correct" TextMate scope for them. Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66335 llvm-svn: 369238
* [clangd] Use raw rename functions to implement the rename.Haojian Wu2019-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Summary: The API provided by refactoring lib doesn't provide enough flexibility to get clangd's rename to behave as we expect. Instead, we replace it with the low-level rename functions, which give us more control. Bonus: - performance, previously we visit the TU to find all occurrences, now we just visit top-level decls from main file; - fix a bug where we wrongly filter out the main file replacement due to the different relative/absolute file path; Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65936 llvm-svn: 368429
* [clangd] Added semantic highlighting support for primitives.Johan Vikstrom2019-08-081-4/+7
| | | | | | | | | | | | | | | | Summary: Adds a new HighlightingKind "Primitive". Adds a special case for TypeLocs that have an underlying TypePtr that is are builtin types, adding them as primitives. The primary reason for this change is because otherwise typedefs that typedef primitives `typedef int A` would not get highlighted (so in the example `A` would not get any highlightings.) Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65943 llvm-svn: 368291
* [clangd] Add a callback mechanism for handling responses from client.Haojian Wu2019-08-052-4/+48
| | | | | | | | | | | | | | | | | | | Summary: The callback will be invoked in clangd when we receive a reply from the client. This is a prerequisite of implementing a generic mechanism for chainable refactorings (e.g. extract variable and rename), this would allow server to trigger a new request to the LSP client after receiving a reply from the client. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65387 llvm-svn: 367845
* [clangd] Duplicate lines of semantic highlightings sent removed.Johan Vikstrom2019-08-011-0/+44
| | | | | | | | | | | | | | Summary: Added a class for diffing highlightings and removing duplicate lines. Integrated into the highlighting generation flow. Only works correctly if all tokens are on a single line. Also returns empty lines if the IDE should remove previous highlightings on a line. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64475 llvm-svn: 367521
* [clangd] Also accept flags from CLANGD_FLAGS variable.Sam McCall2019-07-251-0/+9
| | | | | | | | | | | | | | | | This simplifies various workflows, particularly in debugging/development. e.g. editors will tend to propagate flags, so you can run `env CLANGD_FLAGS=-input-mirror-file=/tmp/mirror vim foo.cc` rather than change the configuration in a persistent way. (This also gives us a generic lever when we don't know how to customize the flags in some particular LSP client). While here, add a test for this and other startup logging, and fix a couple of direct writes to errs() that should have been logs. Differential Revision: https://reviews.llvm.org/D65153 llvm-svn: 366991
* [clangd] Implement "prepareRename"Haojian Wu2019-07-241-11/+36
| | | | | | | | | | | | | | | | | | Summary: - "prepareRename" request is added in LSP v3.12.0 - also update the vscode-client dependency to pick-up the rename bug fix[1] [1]: https://github.com/microsoft/vscode-languageserver-node/issues/447 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63126 llvm-svn: 366873
* Revert "Revert r366458, r366467 and r366468"Kadir Cetinkaya2019-07-195-3/+5
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 9c377105da0be7c2c9a3c70035ce674c71b846af. [clangd][BackgroundIndexLoader] Directly store DependentTU while loading shard Summary: We were deferring the population of DependentTU field in LoadedShard until BackgroundIndexLoader was consumed. This actually triggers a use after free since the shards FileToTU was pointing at could've been moved while consuming the Loader. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64980 llvm-svn: 366559
* Revert r366458, r366467 and r366468Azharuddin Mohammed2019-07-195-5/+3
| | | | | | | | | | | r366458 is causing test failures. r366467 and r366468 had to be reverted as they were casuing conflict while reverting r366458. r366468 [clangd] Remove dead code from BackgroundIndex r366467 [clangd] BackgroundIndex stores shards to the closest project r366458 [clangd] Refactor background-index shard loading llvm-svn: 366551
* [clangd] Handle windows line endings in QueryDriverKadir Cetinkaya2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: The previous patch did not fix the end mark. D64789 fixes second case of https://github.com/clangd/clangd/issues/93 Patch by @lh123 ! Reviewers: sammccall, kadircet Reviewed By: kadircet Subscribers: MaskRay, ilya-biryukov, jkorous, arphaman, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D64970 llvm-svn: 366545
* [clangd] BackgroundIndex stores shards to the closest projectKadir Cetinkaya2019-07-185-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Changes persistance logic to store shards at the directory of closest CDB. Previously we were storing all shards to directory of the CDB that triggered indexing, it had its downsides. For example, if you had two TUs coming from a different CDB but depending on the same header foo.h, we will store the foo.h only for the first CDB, and it would be missing for the second and we would never persist it since it was actually present in the memory and persisted before. This patch still stores only a single copy of a shard, but makes the directory a function of the file name. So that the shard place will be unique even with multiple CDBs accessing the file. This directory is determined as the first directory containing a CDB in the file's parent directories, if no such directory exists we make use of the home directory. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64745 llvm-svn: 366467
* [clangd] Added highlightings for template parameters and specializations.Johan Vikstrom2019-07-181-0/+3
| | | | | | | | | | | | | | Summary: Template parameters and specializations were not being highlighted before. This adds highlightings to those types of tokens by adding two Visit* methods. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64855 llvm-svn: 366420
* [clangd] Handle windows line endings in QueryDriverKadir Cetinkaya2019-07-171-1/+1
| | | | | | | | | | | | | | Summary: fixes second case of https://github.com/clangd/clangd/issues/93 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64789 llvm-svn: 366320
* [clangd] Added highlighting for members and methods.Johan Vikstrom2019-07-151-1/+7
| | | | | | | | | | | | | | Summary: Added highlighting for members and methods. Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64617 llvm-svn: 366047
* [clangd] Added highlighting to enum constants.Johan Vikstrom2019-07-151-0/+3
| | | | | | | | | | | | | | Summary: VSCode does not have a scope for enum constants. So they were placed under "constant.other.enum" as that seems to be the most correct scope for enum constants. However, this makes theia color them blue (the same color it uses for keywords). Reviewers: hokein, sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64624 llvm-svn: 366045
* [clangd] Implement typeHierarchy/resolve for subtypesNathan Ridge2019-07-131-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: 365986
* Revert "[clangd] Implement typeHierarchy/resolve for subtypes"Russell Gallop2019-07-121-61/+2
| | | | | | | | Causing test failure on Windows bot This reverts commit 5b9484e559d44bd923fc290e335891b1dd2e17c4. llvm-svn: 365899
OpenPOWER on IntegriCloud