Commit Graph

73 Commits

Author SHA1 Message Date
Xi Ge
09c1d8f308 [DocCommentPrint] For quick help, print objc declarations in Swift. rdar://21097812
Swift SVN r29949
2015-07-08 00:05:52 +00:00
David Farler
dd44dad017 Add 'throws' keyword to doc comments
Adding the following to a doc comment:

- throws: ...

Will create a description about what/when the function will throw.
This should be a peer to "- returns:" and "- parameter:" and not appear
inline in the description.

rdar://problem/21621679

Swift SVN r29831
2015-07-01 02:03:25 +00:00
Xi Ge
04e01973d2 Address Argyrios' comments; use interface print option when printing document comment.
Swift SVN r29314
2015-06-05 01:33:57 +00:00
Xi Ge
768b4c7f0e [DocCommentPrint] avoid printing private standard lib decls. rdar://20858548
Swift SVN r29313
2015-06-05 00:20:30 +00:00
David Farler
09b486dbcd ObjC Header missing comment markers for some newline cases
Printing Doxygen isn't inside an XML tag, so we can't just print
code block content, which may have new lines without a doc comment
marker. Also, be more robust with indentation.

+ Tests.

rdar://problem/20703026

Swift SVN r27851
2015-04-28 01:32:54 +00:00
David Farler
0ee38ba4aa ASan build fix: overlapping memcpy and compiler flags in swift-ide-test
- Pass EnableObjCAttrRequiresFoundation to CompilerInvocation in
  swift-ide-test when printing comments.
- Use separate streams for printing HTML <h> tags

Swift SVN r27771
2015-04-26 20:02:00 +00:00
David Farler
ca5876a866 swiftMarkup Library
Replace ReST-flavored documentation comments with Markdown.

rdar://problem/20180412

In addition to full Markdown support, the following extensions are
supported. These appear as lists at the top level of the comment's
"document". All of these extensions are matched without regard to
case.

Parameter Outlines
------------------

- Parameters:
  - x: ...
  - y: ...

Separate Parameters
-------------------

- parameter x: ...
- parameter y: ...

- Note:
Parameter documentation may be broken up across the entire comment,
with a mix of parameter documentation kinds - they'll be consolidated
in the end.

Returns
-------

- returns: ...

The following extensions are also list items at the top level, which
will also appear in Xcode QuickHelp as first-class citizens:

- Attention: ...
- Author: ...
- Authors: ...
- Bug: ...
- Complexity: ...
- Copyright: ...
- Date: ...
- Experiment: ...
- Important: ...
- Invariant: ...
- Note: ...
- Postcondition: ...
- Precondition: ...
- Remark: ...
- Remarks: ...
- See: ...
- Since: ...
- Todo: ...
- Version: ...
- Warning: ...

These match most of the extra fields in Doxygen, plus a few more per request.

Other changes
-------------
- Remove use of rawHTML for all markup AST nodes except for those
not representable by the Xcode QuickHelp XSLT - <h>, <hr/>, and of
course inline/block HTML itself.

- Update the doc comment RNG schema to more accurately reflect Xcode
QuickHelp.

- Clean up cmark CMake configuration.

- Rename "FullComment" to "DocComment"

- Update the Swift Standard Documentation (in a follow-up commit)

- Update SourceKit for minor changes and link against cmark
  (in a follow-up commit).

Swift SVN r27727
2015-04-26 00:07:15 +00:00
Argyrios Kyrtzidis
b9ad28550e [IDE] When getting documentation comments XML, don't forget to escape the decl name as well.
rdar://20646650

Swift SVN r27580
2015-04-22 17:02:33 +00:00
Dave Abrahams
4411b01732 ReST hacks: "handle" backslash-space
Backslash+space acts like a token-breaking non-breaking-space in ReST

Swift SVN r25460
2015-02-21 04:35:48 +00:00
Dave Abrahams
1bc5f0eb29 ReST hacks: "handle" code blocks
This is at the expense of blockquotes, which we don't actually need at
the moment.  All blockquotes get interpreted as preformatted code.

Swift SVN r25459
2015-02-21 04:02:54 +00:00
Dmitri Hrybenko
e9f06eee68 Comment parsing: implement basic parsing of inline markup
This change adds infrastructure to represent inline markup in the AST,
implements parsing of some of the inline markup (*emphasis*, **strong
emphasis**, `interpreted text`, ``inline literal``), and XML generation
for these constructs for SourceKit clients to consume.

The parsing itself is incomplete for constructs not mentioned above.
Most notably, we don't parse hyperlinks, and we don't parse the
double-colon that changes the next paragraph into a literal block.

Swift SVN r22752
2014-10-15 13:50:48 +00:00
Dmitri Hrybenko
45963a413e Revert "comment parsing wip"
Revert something I committed accidentally.

Swift SVN r22699
2014-10-13 14:48:07 +00:00
Dmitri Hrybenko
3dac00f60f comment parsing wip
comment parsing: more wip

comment parsing: more wip

comment parsing: even more wip

Swift SVN r22697
2014-10-13 14:27:22 +00:00
Sonny Falk
f7b883f6dd [IDE] Make sure to XML-escape the pretty printed declaration in Comment to XML conversion.
Update test accordingly. Additional regression test added on SourceKit side.

This addresses <rdar://problem/17239097>.

Swift SVN r20343
2014-07-22 22:36:49 +00:00
Jordan Rose
574054b8fd Distance SourceManager from llvm::SourceMgr.
...in preparation for non-source locations, i.e. locations that don't come
frome source buffers.

No functionality change, but a fair bit of SourceManager API and idioms have
changed.

Swift SVN r18942
2014-06-17 01:15:47 +00:00
Ted Kremenek
0b2c23ffec Remove special printing of ImplicitlyUnwrappedOptional<T>.
Part of <rdar://problem/16836463>

Swift SVN r17610
2014-05-07 06:59:52 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Dmitri Hrybenko
c4ef6bd032 Comment to XML conversion: adjust to upstream XML schema change
Swift SVN r17148
2014-05-01 08:51:32 +00:00
Dmitri Hrybenko
00722d4c2e Comment parsing: extract parameter name from the text in :param: field
Swift SVN r16750
2014-04-24 09:13:42 +00:00
Dmitri Hrybenko
cfb3d287de Comment to XML conversion: add pretty-printed declaration
Swift SVN r16698
2014-04-23 11:57:12 +00:00
Dmitri Hrybenko
021b5b4561 Comment to XML conversion: pass through block markup as HTML tags, for the lack
of better markup in current XML schema

I know this XML is probably as bad as XML can get, but at least it allows
clients to render some block markup.  I expect to replace this with some real
tags soon.


Swift SVN r16657
2014-04-22 17:15:46 +00:00
Dmitri Hrybenko
6680ed3956 Comment parsing: for now, treat classes, protocols and structs as "class-like"
things


Swift SVN r16453
2014-04-17 16:13:47 +00:00
Dmitri Hrybenko
68e8fee5fc Comment parsing: put more information into the generated XML documents
This commit adds infrastructure for conversion and testing it.

The conversion is still incomplete, pending discussion about which tags should
we use in the XML documents.  I copied the RelaxNG schema from Clang, and will
edit it accordingly.


Swift SVN r16451
2014-04-17 15:42:51 +00:00