summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/ClangdServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/ClangdServer.cpp')
-rw-r--r--clang-tools-extra/clangd/ClangdServer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index e9e03dbc374..a858680d406 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -611,6 +611,17 @@ void ClangdServer::semanticRanges(PathRef File, Position Pos,
WorkScheduler.runWithAST("SemanticRanges", File, std::move(Action));
}
+void ClangdServer::documentLinks(PathRef File,
+ Callback<std::vector<DocumentLink>> CB) {
+ auto Action =
+ [CB = std::move(CB)](llvm::Expected<InputsAndAST> InpAST) mutable {
+ if (!InpAST)
+ return CB(InpAST.takeError());
+ CB(clangd::getDocumentLinks(InpAST->AST));
+ };
+ WorkScheduler.runWithAST("DocumentLinks", File, std::move(Action));
+}
+
std::vector<std::pair<Path, std::size_t>>
ClangdServer::getUsedBytesPerFile() const {
return WorkScheduler.getUsedBytesPerFile();
OpenPOWER on IntegriCloud