Skip to content

Commit 04db368

Browse files
committedJul 21, 2017
[clangd] Replace ASTUnit with manual AST management.
Summary: This refactoring does not aim to introduce any significant changes to the behaviour of clangd to keep the change as simple as possible. Reviewers: klimek, krasimir, bkramer Reviewed By: krasimir Subscribers: malaperle, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D35406 llvm-svn: 308738
1 parent 04184a6 commit 04db368

File tree

3 files changed

+577
-145
lines changed

3 files changed

+577
-145
lines changed
 

‎clang-tools-extra/clangd/ClangdServer.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,11 @@ ClangdServer::codeComplete(PathRef File, Position Pos,
205205

206206
std::vector<CompletionItem> Result;
207207
auto TaggedFS = FSProvider.getTaggedFileSystem(File);
208-
// It would be nice to use runOnUnitWithoutReparse here, but we can't
209-
// guarantee the correctness of code completion cache here if we don't do the
210-
// reparse.
211-
Units.runOnUnit(File, *OverridenContents, ResourceDir, CDB, PCHs,
212-
TaggedFS.Value, [&](ClangdUnit &Unit) {
213-
Result = Unit.codeComplete(*OverridenContents, Pos,
214-
TaggedFS.Value);
215-
});
208+
Units.runOnUnitWithoutReparse(File, *OverridenContents, ResourceDir, CDB,
209+
PCHs, TaggedFS.Value, [&](ClangdUnit &Unit) {
210+
Result = Unit.codeComplete(
211+
*OverridenContents, Pos, TaggedFS.Value);
212+
});
216213
return make_tagged(std::move(Result), TaggedFS.Tag);
217214
}
218215

0 commit comments

Comments
 (0)
Please sign in to comment.