microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Doxygen comments generated

narutozxp opened this issue · 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 I believe this is fixed with 1.21.0 (pre-release), as part of issue #12316 (the case where /** */ is generated).

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

@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.

@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