simark added a comment.
I think I managed to make some tests by using the `MockCompilationDatabase`.
Basically with some code like:
#ifndef MACRO
static void func () {} // 1
#else
static void func () {} // 2
#endif
and these steps:
1. Server.addDocument(...)
2. Server.findDefinitions (assert that it returns definition 1)
3. CDB.ExtraClangFlags.push_back("-DMACRO=1")
4. Server.reparseOpenedFiles()
5. Server.findDefinitions (assert that it returns definition 2)
Right now that test fails, but it's not clear to me whether it's because the
test is wrong or there's really a bug in there. I'll upload a work-in-progress
version.
================
Comment at: clangd/ClangdServer.cpp:541
+std::vector<std::future<void>>
+ClangdServer::reparseOpenedFiles() {
----------------
ilya-biryukov wrote:
> We're not returning futures from `forceReparse` anymore, this function has to
> be updated accordingly.
Indeed, I found this by rebasing.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D39571
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits