aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlformat/commentastvisitor.h
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-03-18 12:16:12 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2020-03-25 09:01:14 +0100
commit20370505b3b38a5eaa73692557cd80a0ecc60bff (patch)
treebaaf2c0ec8635e0724babf74a8d267c1249066eb /tools/qmlformat/commentastvisitor.h
parent4faf242d1a18e206ddd9c567649a9dddbf6217df (diff)
qmlformat: Improve comment attachment
- Fixes UiPublicMember nodes having a newline between comment and first node - Implements a Front_Inline type so comments at the beginning of object definitions are handled properly Fixes: QTBUG-82259 Change-Id: I0b40290037ce88a9ffe16390d72cbf3d704db41a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmlformat/commentastvisitor.h')
-rw-r--r--tools/qmlformat/commentastvisitor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/qmlformat/commentastvisitor.h b/tools/qmlformat/commentastvisitor.h
index d3de0a9b9d..21c7eb6416 100644
--- a/tools/qmlformat/commentastvisitor.h
+++ b/tools/qmlformat/commentastvisitor.h
@@ -45,10 +45,11 @@ struct Comment
enum Location : int
{
Front = 1,
- Back = Front << 1,
+ Front_Inline = Front << 1,
+ Back = Front_Inline << 1,
Back_Inline = Back << 1,
DefaultLocations = Front | Back_Inline,
- AllLocations = Front | Back | Back_Inline
+ AllLocations = Front | Back | Front_Inline | Back_Inline
} m_location = Front;
Comment() = default;