vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Incorrect Doxygen comments generated

Open narutozxp opened this issue 1 year ago • 4 comments

Environment

  • OS and Version: Win10
  • VS Code Version: 1.91.0
  • C/C++ Extension Version: 1.20.5
  • If using SSH remote, specify OS of remote machine: Ubuntu 22.04.4 LTS

Bug Summary and Steps to Reproduce

Bug Summary:

Steps to reproduce:

  1. create a cpp file with the following content
int foo(int in1, int in2){
    return in1+in2;
}
  1. type /** and enter
/**
 * 
 */
int foo(int in1, int in2){
    return in1+in2;
}
}

Expected behavior:

/**
 * @brief 
 * @param in1 
 * @param in2 
 * @return 
 */
int foo(int in1, int in2){
    return in1+in2;
}

As I had tested, ///,/*! and //! will all create the doxygen comment, but /** will not.

Configuration and Logs

{
"C_Cpp.clang_format_style": "LLVM",
"C_Cpp.formatting": "clangFormat",
"C_Cpp.autocompleteAddParentheses": true,
"[cpp]": {
        "editor.defaultFormatter": "ms-vscode.cpptools"
    },
"C_Cpp.default.cppStandard": "c++23",
"C_Cpp.default.cStandard": "c23",
"C_Cpp.clang_format_fallbackStyle": "LLVM",
"C_Cpp.doxygen.generatedStyle": "/**",
}

Other Extensions

No response

Additional context

No response

narutozxp avatar Jul 11 '24 08:07 narutozxp

@narutozxp I believe this is fixed with 1.21.0 (pre-release), as part of issue https://github.com/microsoft/vscode-cpptools/issues/12316 (the case where /** */ is generated).

sean-mcmanus avatar Jul 12 '24 00:07 sean-mcmanus

@narutozxp And FYI, you don't need to type the "enter" for the doxygen generation to kick in.

sean-mcmanus avatar Jul 12 '24 00:07 sean-mcmanus

@narutozxp Oh, I think our doxygen generation code may not handle the Enter properly and it just expects to run when it sees the /** */. Are you okay with not typing the unnecessary Enter or did you want to this issue to track fixing the case where Enter is used?

But I don't repro the issue in a small file -- only a large enough file where stuff is slowed down such that the processing of the /** isn't handled by the time the Enter is used.

sean-mcmanus avatar Jul 12 '24 00:07 sean-mcmanus

@narutozxp Oh, I think our doxygen generation code may not handle the Enter properly and it just expects to run when it sees the /** */. Are you okay with not typing the unnecessary Enter or did you want to this issue to track fixing the case where Enter is used?

But I don't repro the issue in a small file -- only a large enough file where stuff is slowed down such that the processing of the /** isn't handled by the time the Enter is used.

Yes you are right, it can be triggered without entering Enter

narutozxp avatar Jul 12 '24 01:07 narutozxp

It looks like this has been addressed as this can be triggered without pressing enter. I will now close the issue unless there are further concerns.

browntarik avatar Sep 19 '24 20:09 browntarik