Skip to content

Commit bc47153

Browse files
authored
Suppress a bad duplicate-usr warning (#1426)
1 parent 43a8855 commit bc47153

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
[John Fairhurst](https://github.com/johnfairh)
2828
[#1420](https://github.com/realm/jazzy/issues/1420)
2929

30+
* Suppress warning on extensions providing default implementations.
31+
[John Fairhurst](https://github.com/johnfairh)
32+
[#1396](https://github.com/realm/jazzy/issues/1396)
33+
3034
## 0.15.3
3135

3236
##### Breaking

lib/jazzy/sourcekitten.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -739,18 +739,19 @@ def self.deduplication_key(decl, root_decls)
739739
mod_key = module_deduplication_key(decl)
740740
# Swift extension of objc class
741741
if decl.swift_objc_extension?
742-
[decl.swift_extension_objc_name, :objc_class_and_categories, mod_key]
742+
[decl.swift_extension_objc_name, nil, :objc_class_and_categories, mod_key]
743743
# Swift type or Swift extension of Swift type
744744
elsif mergeable_swift?(decl)
745-
[decl.usr, decl.name, mod_key]
745+
[decl.usr, nil, decl.name, mod_key]
746746
# Objc categories and classes
747747
elsif mergeable_objc?(decl, root_decls)
748748
# Using the ObjC name to match swift_objc_extension.
749749
name, _ = decl.objc_category_name || decl.objc_name
750-
[name, :objc_class_and_categories, mod_key]
750+
[name, nil, :objc_class_and_categories, mod_key]
751751
# Non-mergable declarations (funcs, typedefs etc...)
752752
else
753-
[decl.usr, decl.name, decl.type.kind, '']
753+
# The typename part works around a Swift bug, jazzy#1396
754+
[decl.usr, decl.typename, decl.name, decl.type.kind, '']
754755
end
755756
end
756757

0 commit comments

Comments
 (0)