Skip to content

Commit

Permalink
Include declarations for undocumented symbols
Browse files Browse the repository at this point in the history
Always show the declaration if we know it.
If we don't have a declaration then make sure mustache
knows we don't want the one belonging to the parent.
  • Loading branch information
johnfairh committed Oct 25, 2017
1 parent ba81b1f commit 0bde760
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
[John Fairhurst](https://github.com/johnfairh)
[#894](https://github.com/realm/jazzy/issues/894)

* Always display correct declaration for undocumented symbols.
[John Fairhurst](https://github.com/johnfairh)
[#864](https://github.com/realm/jazzy/issues/864)

## 0.8.4

##### Breaking
Expand Down
3 changes: 1 addition & 2 deletions lib/jazzy/doc_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def self.gh_token_url(item, source_module)
def self.render_item(item, source_module)
# Combine abstract and discussion into abstract
abstract = (item.abstract || '') + (item.discussion || '')
item_render = {
{
name: item.name,
abstract: abstract,
declaration: item.declaration,
Expand All @@ -323,7 +323,6 @@ def self.render_item(item, source_module)
start_line: item.start_line,
end_line: item.end_line,
}
item_render.reject { |_, v| v.nil? }
end

def self.make_task(mark, uid, items)
Expand Down
8 changes: 4 additions & 4 deletions lib/jazzy/sourcekitten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@ def self.parameters(doc, discovered)
def self.make_doc_info(doc, declaration)
return unless should_document?(doc)

unless doc['key.doc.full_as_xml']
return process_undocumented_token(doc, declaration)
end

declaration.declaration = Highlighter.highlight(
doc['key.parsed_declaration'] || doc['key.doc.declaration'],
Config.instance.objc_mode ? 'objc' : 'swift',
Expand All @@ -320,6 +316,10 @@ def self.make_doc_info(doc, declaration)
)
end

unless doc['key.doc.full_as_xml']
return process_undocumented_token(doc, declaration)
end

declaration.abstract = Markdown.render(doc['key.doc.comment'] || '')
declaration.discussion = ''
declaration.return = Markdown.rendered_returns
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 104 files

0 comments on commit 0bde760

Please sign in to comment.