diff options
author | Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> | 2024-05-17 20:55:37 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 20:55:37 +0400 |
commit | 874f511ae779a38bd9ad9d80db63c0a10252e526 (patch) | |
tree | 162406577a5a902784fe650ef821b553812e9133 /clang/lib/Parse/ParseInit.cpp | |
parent | e3686755eab66604335e246ed7b30033ab71dbbc (diff) | |
download | llvm-874f511ae779a38bd9ad9d80db63c0a10252e526.zip llvm-874f511ae779a38bd9ad9d80db63c0a10252e526.tar.gz llvm-874f511ae779a38bd9ad9d80db63c0a10252e526.tar.bz2 |
[clang] Introduce `SemaCodeCompletion` (#92311)
This patch continues previous efforts to split `Sema` up, this time
covering code completion.
Context can be found in #84184.
Dropping `Code` prefix from function names in `SemaCodeCompletion` would
make sense, but I think this PR has enough changes already.
As usual, formatting changes are done as a separate commit. Hopefully
this helps with the review.
Diffstat (limited to 'clang/lib/Parse/ParseInit.cpp')
-rw-r--r-- | clang/lib/Parse/ParseInit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseInit.cpp b/clang/lib/Parse/ParseInit.cpp index 04e4419..432ddc7 100644 --- a/clang/lib/Parse/ParseInit.cpp +++ b/clang/lib/Parse/ParseInit.cpp @@ -18,6 +18,7 @@ #include "clang/Sema/EnterExpressionEvaluationContext.h" #include "clang/Sema/Ownership.h" #include "clang/Sema/Scope.h" +#include "clang/Sema/SemaCodeCompletion.h" #include "clang/Sema/SemaObjC.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" @@ -204,8 +205,9 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator( if (Tok.is(tok::code_completion)) { cutOffParsing(); - Actions.CodeCompleteDesignator(DesignatorCompletion.PreferredBaseType, - DesignatorCompletion.InitExprs, Desig); + Actions.CodeCompletion().CodeCompleteDesignator( + DesignatorCompletion.PreferredBaseType, + DesignatorCompletion.InitExprs, Desig); return ExprError(); } if (Tok.isNot(tok::identifier)) { @@ -471,7 +473,7 @@ ExprResult Parser::ParseBraceInitializer() { auto RunSignatureHelp = [&] { QualType PreferredType; if (!LikelyType.isNull()) - PreferredType = Actions.ProduceConstructorSignatureHelp( + PreferredType = Actions.CodeCompletion().ProduceConstructorSignatureHelp( LikelyType->getCanonicalTypeInternal(), T.getOpenLocation(), InitExprs, T.getOpenLocation(), /*Braced=*/true); CalledSignatureHelp = true; |