-
Notifications
You must be signed in to change notification settings - Fork 593
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
Improve JavaScript doc comments for generated code #2604
Conversation
} | ||
|
||
CommentPtr | ||
Slice::Contained::parseComment(const string& text, bool stripMarkup) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this overload to be able to preprocess the coment before parsing. This allow for language specific preprocessing.
@@ -252,7 +284,6 @@ namespace | |||
const OperationPtr& op, | |||
const CommentPtr& doc, | |||
OpDocParamType type, | |||
const StringList& preParams = StringList(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this param, we were always passing an empty list.
} | ||
out << nl << " * @throws " << name << " "; | ||
name = JsGenerator::fixId(name); | ||
out << nl << " * @throws {@link " << name << "} "; | ||
writeDocLines(out, p->second, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeDoc uses this syntax in throws see: https://typedoc.org/tags/throws/
@@ -315,8 +342,6 @@ namespace | |||
const OperationPtr& op, | |||
const CommentPtr& doc, | |||
OpDocParamType type, | |||
bool showExceptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed, we should always write the @throws clauses. We were passing "false" all the time and exceptions were ignored.
// JavaScript TypeDoc doc processor doesn't accept # at the beginning of a link | ||
// so we need to remove it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these generate valid links still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, with Slice and Java doc you can use {@link #foo}
to refer to a member of the class. With TypeDoc is just {@link foo}
This was causing warnings mentioned above when parasing
Lines 134 to 136 in 5d4f24b
/// The number of threads which are currently performing other activities. These are all other that are not | |
/// counted with {@link #inUseForUser} or {@link #inUseForIO}, such as DNS lookups, garbage collection). | |
int inUseForOther = 0; |
Fix #2409