diff options
| author | Jan Korous <jkorous@apple.com> | 2018-11-27 16:40:46 +0000 |
|---|---|---|
| committer | Jan Korous <jkorous@apple.com> | 2018-11-27 16:40:46 +0000 |
| commit | b406701f66b242c8878b3f2ada7ec1327c05cacf (patch) | |
| tree | 21c7e4bacb66dc5640a9a1cb6450adf46d531825 /clang-tools-extra/clangd/ClangdLSPServer.cpp | |
| parent | 6089b6192ef9fad95e4bcd2c1071815367e74595 (diff) | |
| download | bcm5719-llvm-b406701f66b242c8878b3f2ada7ec1327c05cacf.tar.gz bcm5719-llvm-b406701f66b242c8878b3f2ada7ec1327c05cacf.zip | |
[clangd] textDocument/SymbolInfo extension
New method returning symbol info for given source position.
Differential Revision: https://reviews.llvm.org/D54799
rdar://problem/46050281
llvm-svn: 347675
Diffstat (limited to 'clang-tools-extra/clangd/ClangdLSPServer.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/ClangdLSPServer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index 9ed22fd5e90..d1fdb657d42 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -698,6 +698,12 @@ void ClangdLSPServer::onReference(const ReferenceParams &Params, std::move(Reply)); } +void ClangdLSPServer::onSymbolInfo(const TextDocumentPositionParams &Params, + Callback<std::vector<SymbolDetails>> Reply) { + Server->symbolInfo(Params.textDocument.uri.file(), Params.position, + std::move(Reply)); +} + ClangdLSPServer::ClangdLSPServer(class Transport &Transp, const clangd::CodeCompleteOptions &CCOpts, Optional<Path> CompileCommandsDir, @@ -733,6 +739,7 @@ ClangdLSPServer::ClangdLSPServer(class Transport &Transp, MsgHandler->bind("textDocument/didChange", &ClangdLSPServer::onDocumentDidChange); MsgHandler->bind("workspace/didChangeWatchedFiles", &ClangdLSPServer::onFileEvent); MsgHandler->bind("workspace/didChangeConfiguration", &ClangdLSPServer::onChangeConfiguration); + MsgHandler->bind("textDocument/symbolInfo", &ClangdLSPServer::onSymbolInfo); // clang-format on } |

