Skip to content

Commit

Permalink
Merge pull request #649 from kkoomen/feature/cpp-fixes
Browse files Browse the repository at this point in the history
Handle unnamed function params for c++
  • Loading branch information
kkoomen authored Dec 29, 2023
2 parents 153cb14 + 8fce544 commit 7dc73a1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_cpp_comment_exclamation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
//! {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
//! {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_cpp_comment_slash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
/// {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
/// {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_cpp_comment_slash_banner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
/// {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
/// {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_javadoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
* {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
* {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_javadoc_banner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
* {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
* {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_javadoc_no_asterisk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
{{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
{{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_qt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
* {{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
* {{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
2 changes: 1 addition & 1 deletion helper/src/cpp/docs/doxygen_qt_no_asterisk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ templates:
{% endif %}
{% if params %}
{% for param in params %}
{{ char }}param[[TODO:direction]] {{ param.name }} [TODO:description]
{{ char }}param[[TODO:direction]] {{ param.name | default(value="[TODO:name]") }} [TODO:description]
{% endfor %}
{% endif %}
{% if return_type %}
Expand Down
17 changes: 17 additions & 0 deletions test/filetypes/cpp/functions.vader
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,20 @@ Expect cpp (generated comment with @brief and @param tag):
* @param[[TODO:direction]] x [TODO:description]
*/
void foo( int x = y );

# ==============================================================================
# Functions with unnamed parameters
# ==============================================================================
Given cpp (Functions with unnamed parameter):
Game(const Game &)=default;

Do (trigger doge):
\<C-d>

Expect cpp (generated comment with @brief and @param tag):
/**
* @brief [TODO:summary]
*
* @param[[TODO:direction]] [TODO:name] [TODO:description]
*/
Game(const Game &)=default;

0 comments on commit 7dc73a1

Please sign in to comment.