aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cppdoxygen_test.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-20 17:43:48 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-21 12:23:18 +0000
commitf852cfe284e9a7c48277d85bdbbcb10a7b33a136 (patch)
tree295aac728c0162873222ccd613ecb45d61733340 /src/plugins/cppeditor/cppdoxygen_test.cpp
parent2a05186194a949eb7efb4d7f917014dc1887b4b1 (diff)
CppEditor: Skip over access specifier when inserting a doxygen comment
That is, also do function-specific magic on typing "/**<return>" 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 <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppdoxygen_test.cpp')
-rw-r--r--src/plugins/cppeditor/cppdoxygen_test.cpp14
1 files changed, 14 insertions, 0 deletions
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()