Commit Graph

4 Commits

Author SHA1 Message Date
Ivan Donchevskii
80fb0178fd ClangFormat: Introduce check to format code instead of indenting
Ctrl+I with the new check will reformat the selected code or
the current line instead.

Change-Id: Ia5a72c4a09621034d0dfe463f669fe1ca36b0b5f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-01-31 10:25:05 +00:00
Orgad Shaneh
2781c2a900 ClangFormat: Remove #pragma once from source file
Detected by GCC8.

Amends commit d7058e1afe.

Change-Id: I06c6f23dc69ab729a45f3bf9a8aff53e41b35cfa
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-23 06:22:54 +00:00
Ivan Donchevskii
def5248db2 ClangFormat: Reduce the amount of electric characters
Adding '.' or ',' very ofter makes the statement invalid.
Do not force the formatting in such cases.

Change-Id: I7e58e5af6eed065a3bc0df29698aececa579feed
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-01-22 14:18:10 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +00:00