summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/ClangdUnit.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/ClangdUnit.h')
-rw-r--r--clang-tools-extra/clangd/ClangdUnit.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang-tools-extra/clangd/ClangdUnit.h b/clang-tools-extra/clangd/ClangdUnit.h
index 36bf8c86e05..ad200c285ae 100644
--- a/clang-tools-extra/clangd/ClangdUnit.h
+++ b/clang-tools-extra/clangd/ClangdUnit.h
@@ -10,6 +10,7 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_CLANGDUNIT_H
+#include "Function.h"
#include "Path.h"
#include "Protocol.h"
#include "clang/Frontend/FrontendAction.h"
@@ -157,12 +158,11 @@ public:
void cancelRebuild();
/// Similar to deferRebuild, but sets both Preamble and AST to nulls instead
- /// of doing an actual parsing. Returned future is a deferred computation that
- /// will wait for any ongoing rebuilds to finish and actually set the AST and
- /// Preamble to nulls. It can be run on a different thread.
- /// This function is useful to cancel ongoing rebuilds, if any, before
- /// removing CppFile.
- std::future<void> deferCancelRebuild();
+ /// of doing an actual parsing. Returned function is a deferred computation
+ /// that will wait for any ongoing rebuilds to finish and actually set the AST
+ /// and Preamble to nulls. It can be run on a different thread. This function
+ /// is useful to cancel ongoing rebuilds, if any, before removing CppFile.
+ UniqueFunction<void()> deferCancelRebuild();
/// Rebuild AST and Preamble synchronously on the calling thread.
/// Returns a list of diagnostics or a llvm::None, if another rebuild was
@@ -175,8 +175,8 @@ public:
/// rebuild, that can be called on a different thread.
/// After calling this method, resources, available via futures returned by
/// getPreamble() and getAST(), will be waiting for rebuild to finish. A
- /// future fininshing rebuild, returned by this function, must be
- /// computed(i.e. get() should be called on it) in order to make those
+ /// continuation fininshing rebuild, returned by this function, must be
+ /// computed(i.e., operator() must be called on it) in order to make those
/// resources ready. If deferRebuild is called again before the rebuild is
/// finished (either because returned future had not been called or because it
/// had not returned yet), the previous rebuild request is cancelled and the
@@ -185,7 +185,7 @@ public:
/// The future to finish rebuild returns a list of diagnostics built during
/// reparse, or None, if another deferRebuild was called before this
/// rebuild was finished.
- std::future<llvm::Optional<std::vector<DiagWithFixIts>>>
+ UniqueFunction<llvm::Optional<std::vector<DiagWithFixIts>>()>
deferRebuild(StringRef NewContents, IntrusiveRefCntPtr<vfs::FileSystem> VFS);
/// Returns a future to get the most fresh PreambleData for a file. The
OpenPOWER on IntegriCloud