Skip to content

Commit

Permalink
Implemented heuristic to make a sensible preselection for the autocom…
Browse files Browse the repository at this point in the history
…pletion of the parameters of the @param and @tparam commands.

People typically document one function parameter after the next. So if one types "@param" to document the second function parameter after having documented the first function parameter, it is convenient if the autocomplete box already has the second function parameter preselected. The user then just has to hit the tab key to insert the function parameter. This heuristic is implemented in this commit, both for @param and for @tparam, for functions, classes and macros.
  • Loading branch information
Sedeniono committed May 4, 2024
1 parent 3458119 commit bd0c097
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 94 deletions.
19 changes: 13 additions & 6 deletions Tests/InputFiles/ManualTests_ParameterCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ void funcDeclarationWithUnnamedParams(int, double);
/// @param
void funcDeclWithDefaultArgs(const int i = 42, double d = 43.0);

/// @param someInt
/// @param
/// @tparam
void funcDefWithDefaultArgs(const int i = 42, double d = 43.0) { }
void funcDefWithDefaultArgs(const int someInt = 42, double someDouble = 43.0) { }

/// @param
void funcDeclWithInlineClassDecl(class InlClassDecl param);
Expand All @@ -46,10 +47,14 @@ int templateFunctionDefinition(double var, int iiiii, int arr[], double volatile
template <int iTempl>
void templateFunctionDeclaration(int d);

/// @tparam
/// @param[in]
/// @param[out]
/// @param[in,out]
/// @tparam tParam2 some description
/// @tparam tParam3 more description
/// @param[in] param2 desc
/// test
/// test @p
/// @param[out] param3
///
/// @param[in,out] param10
/// @a
/// @p
///
Expand Down Expand Up @@ -133,7 +138,9 @@ struct TemplateStructDecl;


/// @tparam
/// @param
/// @param y
/// @param zzzzz
/// @param x
#define SOME_MACRO(x, y, zzzzz) x

/// @param
Expand Down
Loading

0 comments on commit bd0c097

Please sign in to comment.