@@ -90,27 +90,39 @@ using namespace std;
90
90
91
91
std::string TSComment::toString (std::string linePrefix)
92
92
{
93
- if (description.length () == 0 && params.size () == 0 ) {
93
+ if (description.length () == 0 && params.size () == 0 && deprecatedIn. isUnknown () && introducedIn. isUnknown () ) {
94
94
return std::string ();
95
95
}
96
96
97
97
std::stringstream result;
98
98
result << linePrefix << " /**" << std::endl;
99
99
std::string processedDesc = description;
100
100
findAndReplaceIn (processedDesc, " \n " , " " );
101
- result << linePrefix << " * " << processedDesc << std::endl;
101
+ if (processedDesc.length () > 0 ) {
102
+ result << linePrefix << " * " << processedDesc << std::endl;
103
+ }
102
104
for (std::pair<std::string, std::string>& param : params) {
103
105
// @param paramName - paramDesc
104
106
result << linePrefix << " * "
105
107
<< " @param " + param.first + " - " + param.second << std::endl;
106
108
}
109
+ if (!introducedIn.isUnknown ()) {
110
+ result << linePrefix << " * " << " @since " << introducedIn.toString () << std::endl;
111
+ }
112
+ if (!deprecatedIn.isUnknown ()) {
113
+ result << linePrefix << " * " << " @deprecated " << deprecatedIn.toString () << std::endl;
114
+ }
107
115
result << linePrefix << " */" << std::endl;
108
116
return result.str ();
109
117
}
110
118
111
119
TSComment DocSetManager::getCommentFor (Meta::Meta* meta, Meta::Meta* parent)
112
120
{
113
- return (parent == nullptr ) ? getCommentFor (meta->name , meta->type ) : getCommentFor (meta->name , meta->type , parent->name , parent->type );
121
+ auto comment = (parent == nullptr ) ? getCommentFor (meta->name , meta->type ) : getCommentFor (meta->name , meta->type , parent->name , parent->type );
122
+ comment.deprecatedIn = meta->deprecatedIn ;
123
+ comment.introducedIn = meta->introducedIn ;
124
+ comment.obsoletedIn = meta->obsoletedIn ;
125
+ return comment;
114
126
}
115
127
116
128
TSComment DocSetManager::getCommentFor (std::string name, Meta::MetaType type, std::string parentName, Meta::MetaType parentType)
0 commit comments