Skip to content

Commit

Permalink
Keep Objective-C categories of non-modular classes apart
Browse files Browse the repository at this point in the history
  • Loading branch information
1ec5 committed Jan 6, 2017
1 parent 558803e commit 2b8f665
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
[Minh Nguyễn](https://github.com/1ec5)
[#706](https://github.com/realm/jazzy/issues/706)

* Fix issue where multiple Objective-C categories of the same external class
in different files were merged into one and named after the first category
found.
[Minh Nguyễn](https://github.com/1ec5)
[#539](https://github.com/realm/jazzy/issues/539)

## 0.7.3

##### Breaking
Expand Down
7 changes: 4 additions & 3 deletions lib/jazzy/sourcekitten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def self.doc_coverage
# Merges redundant declarations when documenting podspecs.
def self.deduplicate_declarations(declarations)
duplicate_groups = declarations
.group_by { |d| deduplication_key(d) }
.group_by { |d| deduplication_key(d, declarations) }
.values

duplicate_groups.map do |group|
Expand All @@ -400,10 +400,11 @@ def self.deduplicate_declarations(declarations)
end

# Two declarations get merged if they have the same deduplication key.
def self.deduplication_key(decl)
def self.deduplication_key(decl, root_decls)
if decl.type.swift_extensible? || decl.type.swift_extension?
[decl.usr, decl.name]
elsif decl.type.objc_class? || decl.type.objc_category?
elsif decl.type.objc_class? || \
(decl.type.objc_category? && name_match(decl.objc_category_name[0], root_decls))
name, _ = decl.objc_category_name || decl.name
[name, :objc_class_and_categories]
else
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 25 files
+183 −0 misc_jazzy_objc_features/after/docs/Categories/NSValue(SomeAdditions).html
+183 −0 misc_jazzy_objc_features/after/docs/Categories/NSValue(SomeMoreAdditions).html
+12 −1 misc_jazzy_objc_features/after/docs/Classes/ObjCMidLevelClass.html
+12 −1 misc_jazzy_objc_features/after/docs/Classes/ObjCTopLevelClass.html
+12 −1 misc_jazzy_objc_features/after/docs/Enums/SomeEnum.html
+168 −0 misc_jazzy_objc_features/after/docs/Other Categories.html
+12 −1 misc_jazzy_objc_features/after/docs/Other Classes.html
+12 −1 misc_jazzy_objc_features/after/docs/Other Constants.html
+12 −1 misc_jazzy_objc_features/after/docs/Other Enums.html
+12 −1 misc_jazzy_objc_features/after/docs/Ying.html
+183 −0 ...ures/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Categories/NSValue(SomeAdditions).html
+183 −0 .../after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Categories/NSValue(SomeMoreAdditions).html
+12 −1 ...bjc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Classes/ObjCMidLevelClass.html
+12 −1 ...bjc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Classes/ObjCTopLevelClass.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Enums/SomeEnum.html
+168 −0 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Other Categories.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Other Classes.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Other Constants.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Other Enums.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/Ying.html
+12 −1 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/Documents/index.html
+15 −8 misc_jazzy_objc_features/after/docs/docsets/JazzyKit.docset/Contents/Resources/docSet.dsidx.csv
+12 −1 misc_jazzy_objc_features/after/docs/index.html
+22 −0 misc_jazzy_objc_features/before/MiscJazzyObjcFeatures/ObjCTopLevelClass.h
+28 −0 misc_jazzy_objc_features/before/MiscJazzyObjcFeatures/ObjCTopLevelClass.m

0 comments on commit 2b8f665

Please sign in to comment.