Commit Graph

83 Commits

Author SHA1 Message Date
Xi Ge
c84f667676 [Serialization] Serialize the source order of Decls appearing in their original source file.
We used to think the source order is preserved after de-serialization; however, this seems to be
not the case.
2016-03-08 12:18:10 -08:00
Xi Ge
7a3276738b Re-apply "ModulePrinter: Print decls from the same source file near each other."
This reverts commit 1db83907e3.
2016-03-08 12:18:10 -08:00
Xi Ge
1db83907e3 Revert "ModulePrinter: Print decls from the same source file near each other."
This reverts commit a5c9072344 for mysterious bot test failure.
2016-03-07 23:33:23 -08:00
Xi Ge
a5c9072344 ModulePrinter: Print decls from the same source file near each other. 2016-03-07 22:51:50 -08:00
Xi Ge
9aa3d01101 [Serialization] Avoid serializing source orders, trust deserialized decls in preserving such order. rdar://24610992
Thank Jordan for suggesting this.
2016-02-11 12:24:38 -08:00
Xi Ge
767fba9c92 Rename BriefAndRawComment to CommentInfo. NFC 2016-02-10 19:27:21 -08:00
Xi Ge
98734f588a [Serialization] Serialize and deserialize source order in module doc files. 2016-02-10 17:46:49 -08:00
Xi Ge
a25551e54d [SourceKit] Surface group names via cursor info query. 2016-02-05 16:56:41 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Argyrios Kyrtzidis
7dd3046a4b [ASTPrint] Print documentation comments for extensions and subscripts. 2015-12-03 00:17:32 -08:00
Michael Gottesman
0606d5843a Remove calls to raw_svector_ostream::flush()
This function is deleted since LLVM r244928.

Swift SVN r31798
2015-09-09 04:37:13 +00:00
Dmitri Hrybenko
028c920779 Comment parsing: skip gyb line markers in comments
Gyb started emitting more line markers, which are sometimes inserted in
the middle of doc comments, and I can't find a trick to prevent that.
Skip these comments in the source code for now.

rdar://21882721

Swift SVN r30337
2015-07-17 22:48:38 +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
Dave Abrahams
4f9e7b3c15 Add a ReST hacks mode that pretties up headlines
Swift SVN r25458
2015-02-21 04:02:53 +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
Argyrios Kyrtzidis
a5eeb9617a [Parser] Create ParamDecls even for unnamed parameters.
This preserves more of source info (e.g. API name location) and simplifies things since
we don't have to construct ParamDecls for the unnamed parameters later on.

Swift SVN r17828
2014-05-10 18:23:47 +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
9928be1030 Comment parsing: keep the column number of the first character to strip ASCII
art correctly when indentation is present


Swift SVN r16656
2014-04-22 16:34:00 +00:00
Dmitri Hrybenko
f82c7cd092 Comment parsing: move the virtual comment attribute to DeclAttribute
infrastructure


Swift SVN r16653
2014-04-22 14:58:23 +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
Dmitri Hrybenko
c68fe1a5d7 Comment parsing / PrintAsObjC: translate Swift comments to Doxygen syntax when
printing a header file


Swift SVN r15871
2014-04-03 16:06:01 +00:00
Dmitri Hrybenko
f370da96b1 ReST: make data in a LineList be owned by ReSTContext, so that users don't have
to carry all LineLists along with a ReSTContext.


Swift SVN r15863
2014-04-03 11:03:09 +00:00
Dmitri Hrybenko
1d6c76c352 Module interface printing: pass through documentation comments for imported
declarations

rdar://16408910


Swift SVN r15576
2014-03-28 10:54:06 +00:00
Dmitri Hrybenko
92b29ef045 Revert "Module interface printing: pass through documentation comments for
imported declarations"

rdar://16408910


Swift SVN r15527
2014-03-26 21:28:42 +00:00
Dmitri Hrybenko
30c6eeff16 Module interface printing: pass through documentation comments for imported
declarations

rdar://16408910


Swift SVN r15511
2014-03-26 16:16:02 +00:00
Dmitri Hrybenko
c1d96e579e Comment parsing: allow parsing comments with invalid source locations -- these
come from serialized modules


Swift SVN r15104
2014-03-15 14:58:29 +00:00
Dmitri Hrybenko
35aee17942 Comment parsing: extract brief comments
Now Decl::getBriefComment() returns the real brief comment, instead of
placeholder text.


Swift SVN r15048
2014-03-14 13:44:27 +00:00
Dmitri Hrybenko
e50b52fa02 Serializer/Driver: serialize comments to separate .swiftdoc files
The driver infers the filename from the module file by replacing the extension,
and passes the explicit path to the swiftdoc file to the frontend.  But there
is no option in the driver to control emission of swiftdoc (it is always
emitted, and name is always inferred from the swiftmodule name).

The swiftdoc file consists of a single table that maps USRs to {brief comment,
raw comment}.  In order to look up a comment for decl we generate the USR
first.  We hope that the performance hit will not be that bad, because most
declarations come from Clang.  The advantage of this design is that the
swiftdoc file is not locked to the swiftmodule file, and can be updated,
replaced, and even localized.


Swift SVN r14914
2014-03-11 10:42:26 +00:00
Dmitri Hrybenko
c0cb085870 Comment parsing: add APIs to get brief comments
These return placeholder text at the moment, but this enables us to can build
infrastructure that passes them around before the ReST parser is working.


Swift SVN r14650
2014-03-04 18:18:43 +00:00
Dmitri Hrybenko
13b1d9823e Don't mention BCPL in CommentKind enumerators
Swift SVN r14147
2014-02-20 12:46:02 +00:00
Dmitri Hrybenko
34df7b494e Comment parsing: recognize documentation and non-documentation comments, merge
consecutive documentation comments and form 'RawComment's.


Swift SVN r14084
2014-02-19 16:20:38 +00:00