llvm-project/clang-tools-extra/test
Sam McCall 866ba2c924 [clangd] Implement textDocument/declaration from LSP 3.14
Summary:
LSP now reflects the declaration/definition distinction.

Language server changes:
 - textDocument/definition now returns a definition if one is found, otherwise
   the declaration. It no longer returns declaration + definition if they are
   distinct.
 - textDocument/declaration returns the best declaration we can find.
 - For macros, the active macro definition is returned for both methods.
 - For include directive, the top of the target file is returned for both.
There doesn't appear to be a discovery mechanism (we can't return everything to
clients that only know about definition), so this changes existing behavior.
In practice, it should greatly reduce the fraction of the time we need to show
the user a menu of options.

C++ API changes:
 - findDefinitions is replaced by locateSymbolAt, which returns a
   vector<LocatedSymbol> - one for each symbol under the cursor.
 - this contains the preferred declaration, the definition (if found), and
   the symbol name
This API enables some potentially-neat extensions, like swapping between decl
and def, and exposing the symbol name to the UI in the case of multiple symbols.

Reviewers: hokein

Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D57388

llvm-svn: 352864
2019-02-01 11:26:13 +00:00
..
Unit Assume the shared library path variable is LD_LIBRARY_PATH on systems 2018-01-20 14:34:33 +00:00
change-namespace [change-namepsace] make it possible to whitelist symbols so they don't get updated. 2017-02-24 11:54:45 +00:00
clang-apply-replacements Deduplicate replacements from diagnostics. 2018-09-25 08:24:07 +00:00
clang-doc [clang-doc] Switch to default to all-TUs executor 2018-10-26 19:11:34 +00:00
clang-move Re-enable a clang-move test on windows. 2018-05-18 09:25:36 +00:00
clang-query
clang-reorder-fields [clang-reorder-fields] Emit warning when reordering breaks member init list dependencies 2017-07-30 06:43:03 +00:00
clang-tidy [clang-tidy] Add the abseil-duration-addition check 2019-01-28 14:03:09 +00:00
clangd [clangd] Implement textDocument/declaration from LSP 3.14 2019-02-01 11:26:13 +00:00
include-fixer Remove the optional dependency from libclang to clang-tidy/include-fixer 2018-11-23 15:02:33 +00:00
modularize Revert r351208 (which was a revert of r350892). 2019-01-17 20:21:44 +00:00
pp-trace Revert r351208 (which was a revert of r350892). 2019-01-17 20:21:44 +00:00
.clang-format
CMakeLists.txt [clangd] XPC transport layer 2019-01-16 00:24:22 +00:00
lit.cfg [extra] unit tests enable crash-recovery cases on FreeBSD 2019-01-24 07:58:42 +00:00
lit.site.cfg.in [clangd] XPC transport layer 2019-01-16 00:24:22 +00:00