From 7f0387de4c600af185b2db8d748f530444fe03cd Mon Sep 17 00:00:00 2001 From: Daniel Grumberg Date: Tue, 26 Jul 2022 17:28:43 +0100 Subject: [PATCH] [clang][ExtractAPI] Add a space between type and name in property declaration fragments Differential Revision: https://reviews.llvm.org/D130583 --- clang/lib/ExtractAPI/DeclarationFragments.cpp | 1 + clang/test/ExtractAPI/objc_category.m | 4 ++++ clang/test/ExtractAPI/objc_interface.m | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp index 75d360a..40ba124 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 946f01e..56bac43 100644 --- a/clang/test/ExtractAPI/objc_category.m +++ b/clang/test/ExtractAPI/objc_category.m @@ -318,6 +318,10 @@ "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 bd1f23e..740a215 100644 --- a/clang/test/ExtractAPI/objc_interface.m +++ b/clang/test/ExtractAPI/objc_interface.m @@ -463,6 +463,10 @@ "spelling": "unsigned int" }, { + "kind": "text", + "spelling": " " + }, + { "kind": "identifier", "spelling": "Property" } -- 2.7.4