Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display doc comments for all swift extensions #819

Merged
merged 4 commits into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

##### Bug Fixes

* None.
* Fix missing doc comments on some extensions.
[John Fairhurst](https://github.com/johnfairh)
[#454](https://github.com/realm/jazzy/issues/454)

## 0.8.2

Expand Down
13 changes: 10 additions & 3 deletions lib/jazzy/sourcekitten.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def autolink_block(doc_url, middle_regex, after_highlight)
module Jazzy
# This module interacts with the sourcekitten command-line executable
module SourceKitten
@default_abstract = Markdown.render('Undocumented').freeze
@undocumented_abstract = Markdown.render('Undocumented').freeze

# Group root-level docs by custom categories (if any) and type
def self.group_docs(docs)
Expand Down Expand Up @@ -222,7 +222,7 @@ def self.make_default_doc_info(declaration)
# @todo: Fix these
declaration.line = nil
declaration.column = nil
declaration.abstract = @default_abstract
declaration.abstract = ''
declaration.parameters = []
declaration.children = []
end
Expand Down Expand Up @@ -276,13 +276,20 @@ def self.should_mark_undocumented(kind, filepath)
end

def self.process_undocumented_token(doc, declaration)
make_default_doc_info(declaration)

filepath = doc['key.filepath']
objc = Config.instance.objc_mode
if objc || should_mark_undocumented(doc['key.kind'], filepath)
@stats.add_undocumented(declaration)
declaration.abstract = @undocumented_abstract
else
comment = doc['key.doc.comment']
declaration.abstract = Markdown.render(comment) if comment
end

return nil if !documented_child?(doc) && @skip_undocumented
make_default_doc_info(declaration)
declaration
end

def self.parameters(doc, discovered)
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 19 files
+2 −2 document_moya_podspec/after/execution_output.txt
+1 −1 document_realm_swift/after/docs/Classes/Object.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/Object.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/search.json
+1 −1 document_realm_swift/after/docs/search.json
+1 −1 document_siesta/after/api-docs/Extensions/NSRegularExpression.html
+1 −2 document_siesta/after/api-docs/Extensions/URLSession.html
+1 −2 document_siesta/after/api-docs/Extensions/URLSessionConfiguration.html
+3 −5 document_siesta/after/api-docs/Other Extensions.html
+1 −1 ...iesta/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/Extensions/NSRegularExpression.html
+1 −2 document_siesta/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/Extensions/URLSession.html
+1 −2 ...a/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/Extensions/URLSessionConfiguration.html
+3 −5 document_siesta/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/Other Extensions.html
+1 −1 document_siesta/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/search.json
+1 −1 document_siesta/after/api-docs/search.json
+1 −2 misc_jazzy_features/after/docs/Functions/_2F_28_5F_3A_5F_3A_29.html
+1 −2 ...ter/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/Functions/_2F_28_5F_3A_5F_3A_29.html
+1 −1 misc_jazzy_features/after/docs/docsets/MiscJazzyFeatures.docset/Contents/Resources/Documents/search.json
+1 −1 misc_jazzy_features/after/docs/search.json