From f852cfe284e9a7c48277d85bdbbcb10a7b33a136 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 20 Aug 2020 17:43:48 +0200 Subject: CppEditor: Skip over access specifier when inserting a doxygen comment That is, also do function-specific magic on typing "/**" in front of a function if there is an access specifier such as "public:" in between. This use case is rather weird, but it's also pretty easy to support and it should not hurt anyone. Note that depending on the indentation of the access specifier, the indentation of the inserted comment will probably not be what the user expects, but this is not easily fixable. Fixes: QTCREATORBUG-20311 Change-Id: Ie32a71eede91ef64a19381c8e379a183a91fd27d Reviewed-by: Christian Stenger --- src/plugins/cppeditor/cppdoxygen_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/plugins/cppeditor/cppdoxygen_test.cpp') diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp index 639e0d5b8a..79e4e9f2d9 100644 --- a/src/plugins/cppeditor/cppdoxygen_test.cpp +++ b/src/plugins/cppeditor/cppdoxygen_test.cpp @@ -295,6 +295,20 @@ void DoxygenTest::testBasic_data() " */\n" "API void f();\n" ); + + QTest::newRow("withAccessSpecifierBeforeFunction") << _( + "class C {\n" + " /**|\n" + " public: void f();\n" + "};\n" + ) << _( + "class C {\n" + " /**\n" + " * @brief f\n" + " */\n" + " public: void f();\n" + "};\n" + ); } void DoxygenTest::testBasic() -- cgit v1.2.1