diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-19 11:20:12 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-19 14:06:03 +0200 |
commit | e82c56e86a5848dbaaa59ab1c47c15236657b197 (patch) | |
tree | 4f100e7a9890fa7fa2a414c497b45966536446af /sources/shiboken2/ApiExtractor/typesystemparser.cpp | |
parent | edafc6353a2b03eab3ee67735727a9e95c5b29af (diff) |
shiboken2: Improve whitespaces formatting in injected code
- Trim newlines and dedent all snippets from XML
- Move the trailing newlines into the code snippet function.
- Do not indent preprocessor directives
Change-Id: Ic8c3745f0b88ee4ed27ac9cbaf376d71a50d9188
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystemparser.cpp')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typesystemparser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp index 9fdf81821..0ba94d94e 100644 --- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp @@ -149,7 +149,7 @@ static QString extractSnippet(const QString &code, const QString &snippetLabel) } else if (useLine) result += line.toString() + QLatin1Char('\n'); } - return result; + return CodeSnipAbstract::fixSpaces(result); } template <class EnumType, Qt::CaseSensitivity cs = Qt::CaseInsensitive> @@ -2475,7 +2475,7 @@ bool TypeSystemParser::readFileSnippet(QXmlStreamAttributes *attributes, CodeSni "// START of custom code block [file: " << source << "]\n" << extractSnippet(QString::fromUtf8(codeFile.readAll()), snippetLabel) - << "\n// END of custom code block [file: " << source + << "// END of custom code block [file: " << source << "]\n// ========================================================================\n"; snip->addCode(content); return true; |