[clang] 7f0387d - [clang][ExtractAPI] Add a space between type and name in property declaration fragments

Daniel Grumberg via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 03:02:30 PDT 2022


Author: Daniel Grumberg
Date: 2022-07-27T11:02:21+01:00
New Revision: 7f0387de4c600af185b2db8d748f530444fe03cd

URL: https://github.com/llvm/llvm-project/commit/7f0387de4c600af185b2db8d748f530444fe03cd
DIFF: https://github.com/llvm/llvm-project/commit/7f0387de4c600af185b2db8d748f530444fe03cd.diff

LOG: [clang][ExtractAPI] Add a space between type and name in property declaration fragments

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

Added: 
    

Modified: 
    clang/lib/ExtractAPI/DeclarationFragments.cpp
    clang/test/ExtractAPI/objc_category.m
    clang/test/ExtractAPI/objc_interface.m

Removed: 
    


################################################################################
diff  --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp
index 75d360a3ba167..40ba124bc4d81 100644
--- a/clang/lib/ExtractAPI/DeclarationFragments.cpp
+++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp
@@ -692,6 +692,7 @@ DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForObjCProperty(
   return Fragments.appendSpace()
       .append(getFragmentsForType(Property->getType(),
                                   Property->getASTContext(), After))
+      .appendSpace()
       .append(Property->getName(),
               DeclarationFragments::FragmentKind::Identifier)
       .append(std::move(After));

diff  --git a/clang/test/ExtractAPI/objc_category.m b/clang/test/ExtractAPI/objc_category.m
index 946f01eaeb334..56bac43a11cdc 100644
--- a/clang/test/ExtractAPI/objc_category.m
+++ b/clang/test/ExtractAPI/objc_category.m
@@ -317,6 +317,10 @@ + (void)ClassMethod;
           "preciseIdentifier": "c:I",
           "spelling": "int"
         },
+        {
+          "kind": "text",
+          "spelling": " "
+        },
         {
           "kind": "identifier",
           "spelling": "Property"

diff  --git a/clang/test/ExtractAPI/objc_interface.m b/clang/test/ExtractAPI/objc_interface.m
index bd1f23ed1f095..740a215400d9c 100644
--- a/clang/test/ExtractAPI/objc_interface.m
+++ b/clang/test/ExtractAPI/objc_interface.m
@@ -462,6 +462,10 @@ - (char)getIvar;
           "preciseIdentifier": "c:i",
           "spelling": "unsigned int"
         },
+        {
+          "kind": "text",
+          "spelling": " "
+        },
         {
           "kind": "identifier",
           "spelling": "Property"


        


More information about the cfe-commits mailing list