[clangd] Switch to incomplete translation units
authorKrasimir Georgiev <krasimir@google.com>
Mon, 22 May 2017 12:49:08 +0000 (12:49 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Mon, 22 May 2017 12:49:08 +0000 (12:49 +0000)
Summary: This speeds up code completion. All the cool kids (ycmd) are doing it.

Reviewers: bkramer, ilya-biryukov

Reviewed By: bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D33350

llvm-svn: 303547

clang-tools-extra/clangd/ClangdUnit.cpp

index ff1ce9b..6fe90e8 100644 (file)
@@ -45,7 +45,7 @@ ClangdUnit::ClangdUnit(PathRef FileName, StringRef Contents,
       ArgP, ArgP + ArgStrs.size(), PCHs, Diags, ResourceDir,
       /*OnlyLocalDecls=*/false, /*CaptureDiagnostics=*/true, RemappedSource,
       /*RemappedFilesKeepOriginalName=*/true,
-      /*PrecompilePreambleAfterNParses=*/1, /*TUKind=*/TU_Complete,
+      /*PrecompilePreambleAfterNParses=*/1, /*TUKind=*/TU_Prefix,
       /*CacheCodeCompletionResults=*/true,
       /*IncludeBriefCommentsInCodeCompletion=*/true,
       /*AllowPCHWithCompilerErrors=*/true));