hanchenye-llvm-project/clang-tools-extra/test/clangd
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
..
Inputs [clangd] Recommit the "AnyScope" changes in requests.json by rCTE347753 (reverted by rCTE347792) 2018-12-01 01:57:15 +00:00
xpc [clangd] XPC transport layer 2019-01-16 00:24:22 +00:00
background-index.test [clangd] Introduce loading of shards within auto-index 2019-01-10 17:03:04 +00:00
compile-commands-path-in-initialize.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
completion-auto-trigger.test [clangd] Check preceding char when completion triggers on ':' or '>' 2019-01-03 13:37:12 +00:00
completion-snippets.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
completion.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
crash-non-added-files.test [clangd] Lay JSONRPCDispatcher to rest. 2018-10-18 12:32:04 +00:00
delimited-input-comment-at-the-end.test [clangd] Lay JSONRPCDispatcher to rest. 2018-10-18 12:32:04 +00:00
diagnostic-category.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
diagnostics.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
did-change-configuration-params.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
execute-command.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
exit-with-shutdown.test [clangd] Enforce rules around "initialize" request, and create ClangdServer lazily. 2018-10-18 14:41:50 +00:00
exit-without-shutdown.test [clangd] Enforce rules around "initialize" request, and create ClangdServer lazily. 2018-10-18 14:41:50 +00:00
filestatus.test [clangd] Expose FileStatus to LSP. 2018-12-20 15:39:12 +00:00
fixits-codeaction.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
fixits-command.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
fixits-embed-in-diagnostic.test [clangd] Append "(fix available)" to diagnostic message when fixes are present. 2019-01-31 16:09:25 +00:00
formatting.test [clangd][tests] Fix typo in tests - invalid LSP exit message 2018-08-15 15:50:45 +00:00
hover.test
index-tools.test Revert "[clang-tools-extra] r347753 - [clangd] Build and test IndexBenchmark in check-clangd" 2018-11-28 18:48:32 +00:00
initialize-params-invalid.test [clangd] Add xrefs LSP boilerplate implementation. 2018-09-05 11:53:07 +00:00
initialize-params.test [clangd] Implement textDocument/declaration from LSP 3.14 2019-02-01 11:26:13 +00:00
initialize-sequence.test [clangd] Enforce rules around "initialize" request, and create ClangdServer lazily. 2018-10-18 14:41:50 +00:00
input-mirror.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
lit.local.cfg
protocol.test [clangd] Cleanup: stop passing around list of supported URI schemes. 2018-11-22 15:02:05 +00:00
references.test [clangd] Fix references.test assertions 2018-09-05 13:17:51 +00:00
rename.test [clangd] Lay JSONRPCDispatcher to rest. 2018-10-18 12:32:04 +00:00
signature-help.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
spaces-in-delimited-input.test [clangd] Lay JSONRPCDispatcher to rest. 2018-10-18 12:32:04 +00:00
symbol-info.test [clangd] textDocument/SymbolInfo extension 2018-11-27 16:40:46 +00:00
symbols.test [clangd] Cleanup: use index file instead of header in workspace symbols lit test. 2018-11-22 14:59:22 +00:00
test-uri-posix.test [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
test-uri-windows.test [CMake] Use normalized Windows target triples 2018-08-09 02:16:18 +00:00
textdocument-didchange-fail.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
too_large.test
trace.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00
unsupported-method.test [clangd][tests] Fix typo in tests - invalid LSP exit message 2018-08-15 15:50:45 +00:00
xrefs.test [clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620) 2018-10-17 07:32:05 +00:00