hanchenye-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
change-namespace
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
clang-query
clang-reorder-fields
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