diff options
| author | Sam McCall <sam.mccall@gmail.com> | 2019-05-21 13:40:31 +0000 |
|---|---|---|
| committer | Sam McCall <sam.mccall@gmail.com> | 2019-05-21 13:40:31 +0000 |
| commit | 0321b370f2db205b0a67c4881c2413d5cb2d41c4 (patch) | |
| tree | 3bd0acd4e1de9e2444cff01b4ba198042d20ca4c /clang-tools-extra/clangd/CodeComplete.h | |
| parent | 8fa970c2d871881d7c1594ecd526907942153d7a (diff) | |
| download | bcm5719-llvm-0321b370f2db205b0a67c4881c2413d5cb2d41c4.tar.gz bcm5719-llvm-0321b370f2db205b0a67c4881c2413d5cb2d41c4.zip | |
[clangd] Turn no-parse-completion on by when preamble isn't ready. Add flag to force it.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62135
llvm-svn: 361258
Diffstat (limited to 'clang-tools-extra/clangd/CodeComplete.h')
| -rw-r--r-- | clang-tools-extra/clangd/CodeComplete.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.h b/clang-tools-extra/clangd/CodeComplete.h index 2dc7f22c14d..58728285d96 100644 --- a/clang-tools-extra/clangd/CodeComplete.h +++ b/clang-tools-extra/clangd/CodeComplete.h @@ -115,11 +115,18 @@ struct CodeCompleteOptions { /// Such completions can insert scope qualifiers. bool AllScopes = false; - /// Whether to allow falling back to code completion without compiling files - /// (using identifiers in the current file and symbol indexes), when file - /// cannot be built (e.g. missing compile command), or the build is not ready - /// (e.g. preamble is still being built). - bool AllowFallback = false; + /// Whether to use the clang parser, or fallback to text-based completion + /// (using identifiers in the current file and symbol indexes). + enum CodeCompletionParse { + /// Block until we can run the parser (e.g. preamble is built). + /// Return an error if this fails. + AlwaysParse, + /// Run the parser if inputs (preamble) are ready. + /// Otherwise, use text-based completion. + ParseIfReady, + /// Always use text-based completion. + NeverParse, + } RunParser = ParseIfReady; }; // Semi-structured representation of a code-complete suggestion for our C++ API. |

