summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/ClangdServer.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-12-06 09:41:04 +0000
committerHaojian Wu <hokein@google.com>2018-12-06 09:41:04 +0000
commitec3d02013fcd398720300d3d3ef235135287a055 (patch)
tree0883cf726249f1c20880fbaaf7155b5a316a69ef /clang-tools-extra/clangd/ClangdServer.cpp
parent46b421e5e3f2d2e4fe0d64265e048deeb2362879 (diff)
downloadbcm5719-llvm-ec3d02013fcd398720300d3d3ef235135287a055.tar.gz
bcm5719-llvm-ec3d02013fcd398720300d3d3ef235135287a055.zip
[clangd] C++ API for emitting file status.
Introduce clangd C++ API to emit the current status of file. llvm-svn: 348475
Diffstat (limited to 'clang-tools-extra/clangd/ClangdServer.cpp')
-rw-r--r--clang-tools-extra/clangd/ClangdServer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 4a8c7c2587d..79223f2ab85 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -86,6 +86,10 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
DiagConsumer.onDiagnosticsReady(File, std::move(Diags));
}
+ void onFileUpdated(PathRef File, const TUStatus &Status) override {
+ DiagConsumer.onFileUpdated(File, Status);
+ }
+
private:
FileIndex *FIndex;
DiagnosticsConsumer &DiagConsumer;
@@ -144,6 +148,10 @@ ClangdServer::ClangdServer(const GlobalCompilationDatabase &CDB,
void ClangdServer::addDocument(PathRef File, StringRef Contents,
WantDiagnostics WantDiags) {
+ // FIXME: some build systems like Bazel will take time to preparing
+ // environment to build the file, it would be nice if we could emit a
+ // "PreparingBuild" status to inform users, it is non-trivial given the
+ // current implementation.
WorkScheduler.update(File,
ParseInputs{getCompileCommand(File),
FSProvider.getFileSystem(), Contents.str()},
OpenPOWER on IntegriCloud