From 14834e6b0a4e7c1272ec3a1838b0634dd66e72ea Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 8 Nov 2018 11:39:48 +0100 Subject: [PATCH] TextEditor: replace generic highlighter with ksyntaxhighlighting Fixes: QTCREATORBUG-21029 Change-Id: I9894c4384e0e47da6bf030b7b8e07c3ad4737ff3 Reviewed-by: Orgad Shaneh --- .../overview/creator-acknowledgements.qdoc | 39 + qtcreator.pri | 1 + .../3rdparty/syntax-highlighting/.arcconfig | 3 + .../3rdparty/syntax-highlighting/.gitignore | 9 + .../3rdparty/syntax-highlighting/.kateconfig | 1 + src/libs/3rdparty/syntax-highlighting/.krazy | 2 + .../syntax-highlighting/CMakeLists.txt | 134 + src/libs/3rdparty/syntax-highlighting/COPYING | 20 + .../KF5SyntaxHighlightingConfig.cmake.in | 6 + .../syntax-highlighting/QC_README.txt | 0 .../3rdparty/syntax-highlighting/README.md | 32 + .../autogenerated/autogenerated.pri | 9 + .../ksyntaxhighlighting_version.h | 12 + .../autogenerated/src/lib/AbstractHighlighter | 1 + .../autogenerated/src/lib/Definition | 1 + .../autogenerated/src/lib/FoldingRegion | 1 + .../autogenerated/src/lib/Format | 1 + .../autogenerated/src/lib/Repository | 1 + .../autogenerated/src/lib/State | 1 + .../autogenerated/src/lib/SyntaxHighlighter | 1 + .../autogenerated/src/lib/Theme | 1 + .../src/lib/ksyntaxhighlighting_logging.cpp | 11 + .../src/lib/ksyntaxhighlighting_logging.h | 11 + .../syntax-highlighting/data/CMakeLists.txt | 61 + .../syntax-highlighting/data/data.pro | 11 + .../data/generators/cmake.xml.tpl | 323 +++ .../data/generators/cmake.yaml | 2446 +++++++++++++++++ .../data/generators/generate-cmake-syntax.py | 151 + .../data/generators/generate-php.pl | 58 + .../data/generators/get-Qt-classes.sh | 40 + .../data/generators/get-Qt-macros.sh | 33 + .../data/generators/nsis-gen.py | 23 + .../data/generators/qmake-gen.py | 57 + .../data/schema/language.xsd | 668 +++++ .../data/schema/validatehl.sh | 2 + .../data/syntax-data.qrc.in | 7 + .../data/syntax}/alert.xml | 0 .../syntax-highlighting/data/syntax}/bash.xml | 0 .../data/syntax}/cmake.xml | 0 .../syntax-highlighting/data/syntax}/css.xml | 0 .../data/syntax}/doxygen.xml | 0 .../syntax-highlighting/data/syntax}/dtd.xml | 0 .../syntax-highlighting/data/syntax}/html.xml | 0 .../syntax-highlighting/data/syntax}/ini.xml | 0 .../syntax-highlighting/data/syntax}/java.xml | 0 .../data/syntax}/javadoc.xml | 0 .../syntax-highlighting/data/syntax}/json.xml | 0 .../data/syntax}/makefile.xml | 0 .../data/syntax/markdown.xml | 148 + .../syntax-highlighting/data/syntax}/perl.xml | 0 .../data/syntax/powershell.xml | 934 +++++++ .../data/syntax/python.xml | 688 +++++ .../data/syntax/qdocconf.xml | 136 + .../syntax-highlighting/data/syntax}/ruby.xml | 0 .../data/syntax}/valgrind-suppression.xml | 0 .../syntax-highlighting/data/syntax}/xml.xml | 0 .../syntax-highlighting/data/syntax}/yacc.xml | 0 .../data/themes/breeze-dark.theme | 174 ++ .../data/themes/default.theme | 174 ++ .../data/themes/printing.theme | 173 ++ .../data/themes/solarized-dark.theme | 175 ++ .../data/themes/solarized-light.theme | 175 ++ .../data/themes/theme-data.qrc | 10 + .../examples/CMakeLists.txt | 4 + .../examples/codeeditor.cpp | 358 +++ .../syntax-highlighting/examples/codeeditor.h | 69 + .../syntax-highlighting/examples/main.cpp | 46 + .../syntax-highlighting/metainfo.yaml | 21 + .../org_kde_ksyntaxhighlighting.categories | 1 + .../syntax-highlighting/src/CMakeLists.txt | 5 + .../syntax-highlighting/src/Messages.sh | 11 + .../src/cli/CMakeLists.txt | 5 + .../src/cli/kate-syntax-highlighter.cpp | 164 ++ .../src/indexer/CMakeLists.txt | 36 + .../src/indexer/katehighlightingindexer.cpp | 589 ++++ .../src/lib/CMakeLists.txt | 86 + .../src/lib/abstracthighlighter.cpp | 328 +++ .../src/lib/abstracthighlighter.h | 195 ++ .../src/lib/abstracthighlighter_p.h | 54 + .../syntax-highlighting/src/lib/context.cpp | 206 ++ .../syntax-highlighting/src/lib/context_p.h | 139 + .../src/lib/contextswitch.cpp | 90 + .../src/lib/contextswitch_p.h | 56 + .../src/lib/definition.cpp | 798 ++++++ .../syntax-highlighting/src/lib/definition.h | 400 +++ .../src/lib/definition_p.h | 111 + .../src/lib/definitiondownloader.cpp | 193 ++ .../src/lib/definitiondownloader.h | 113 + .../src/lib/definitionref_p.h | 74 + .../src/lib/foldingregion.cpp | 60 + .../src/lib/foldingregion.h | 108 + .../syntax-highlighting/src/lib/format.cpp | 264 ++ .../syntax-highlighting/src/lib/format.h | 152 + .../syntax-highlighting/src/lib/format_p.h | 55 + .../src/lib/htmlhighlighter.cpp | 161 ++ .../src/lib/htmlhighlighter.h | 64 + .../src/lib/keywordlist.cpp | 104 + .../src/lib/keywordlist_p.h | 101 + .../src/lib/ksyntaxhighlighting_export.h | 20 +- .../src/lib/matchresult_p.h | 113 + .../src/lib/repository.cpp | 325 +++ .../syntax-highlighting/src/lib/repository.h | 257 ++ .../src/lib/repository_p.h | 72 + .../syntax-highlighting/src/lib/rule.cpp | 663 +++++ .../syntax-highlighting/src/lib/rule_p.h | 291 ++ .../syntax-highlighting/src/lib/state.cpp | 123 + .../syntax-highlighting/src/lib/state.h | 86 + .../syntax-highlighting/src/lib/state_p.h | 81 + .../src/lib/syntaxhighlighter.cpp | 198 ++ .../src/lib/syntaxhighlighter.h | 85 + .../src/lib/textstyledata_p.h | 63 + .../syntax-highlighting/src/lib/theme.cpp | 124 + .../syntax-highlighting/src/lib/theme.h | 378 +++ .../syntax-highlighting/src/lib/themedata.cpp | 255 ++ .../syntax-highlighting/src/lib/themedata_p.h | 170 ++ .../src/lib/wildcardmatcher.cpp | 83 + .../src/lib/wildcardmatcher_p.h | 51 + .../syntax-highlighting/src/lib/xml_p.h | 42 + .../syntax-highlighting.pro | 55 + .../syntax-highlighting.qbs | 88 + .../syntax-highlighting_dependencies.pri | 3 + src/libs/libs.pro | 4 +- src/libs/libs.qbs | 1 + .../cmakeprojectmanager/cmakeeditor.cpp | 1 - .../texteditor/codeassist/codeassistant.cpp | 2 +- .../texteditor/generichighlighter/context.cpp | 159 -- .../texteditor/generichighlighter/context.h | 107 - .../definitiondownloader.cpp | 106 - .../generichighlighter/definitiondownloader.h | 67 - .../generichighlighter/dynamicrule.cpp | 62 - .../generichighlighter/dynamicrule.h | 57 - .../highlightdefinition.cpp | 203 -- .../generichighlighter/highlightdefinition.h | 108 - .../highlightdefinitionhandler.cpp | 502 ---- .../highlightdefinitionhandler.h | 101 - .../highlightdefinitionmetadata.h | 54 - .../generichighlighter/highlighter.cpp | 740 ----- .../generichighlighter/highlighter.h | 199 -- .../generichighlighter/highlighterexception.h | 42 - .../highlightersettingspage.cpp | 243 -- .../includerulesinstruction.cpp | 46 - .../includerulesinstruction.h | 49 - .../generichighlighter/itemdata.cpp | 133 - .../texteditor/generichighlighter/itemdata.h | 82 - .../generichighlighter/keywordlist.cpp | 57 - .../generichighlighter/keywordlist.h | 46 - .../managedefinitionsdialog.cpp | 135 - .../managedefinitionsdialog.h | 55 - .../managedefinitionsdialog.ui | 158 -- .../texteditor/generichighlighter/manager.cpp | 507 ---- .../texteditor/generichighlighter/manager.h | 118 - .../generichighlighter/progressdata.cpp | 130 - .../generichighlighter/progressdata.h | 86 - .../texteditor/generichighlighter/reuse.h | 93 - .../texteditor/generichighlighter/rule.cpp | 292 -- .../texteditor/generichighlighter/rule.h | 157 -- .../generichighlighter/specificrules.cpp | 542 ---- .../generichighlighter/specificrules.h | 265 -- src/plugins/texteditor/highlighter.cpp | 158 ++ .../plugins/texteditor/highlighter.h | 34 +- .../highlightersettings.cpp | 26 +- .../highlightersettings.h | 10 +- .../texteditor/highlightersettingspage.cpp | 164 ++ .../highlightersettingspage.h | 13 +- .../highlightersettingspage.ui | 87 +- src/plugins/texteditor/highlighterutils.cpp | 50 - src/plugins/texteditor/highlighterutils.h | 45 - .../texteditor/snippets/snippetprovider.cpp | 2 +- .../snippets/snippetssettingspage.cpp | 2 +- src/plugins/texteditor/textdocument.cpp | 4 - src/plugins/texteditor/textdocumentlayout.h | 6 + src/plugins/texteditor/texteditor.cpp | 75 +- src/plugins/texteditor/texteditor.pro | 50 +- src/plugins/texteditor/texteditor.qbs | 61 +- .../texteditor/texteditor_dependencies.pri | 3 +- src/plugins/texteditor/texteditorplugin.cpp | 13 +- src/plugins/texteditor/texteditorplugin.h | 2 + src/plugins/texteditor/texteditorsettings.cpp | 19 +- src/share/3rdparty/data.pro | 1 - .../3rdparty/generic-highlighter/autoconf.xml | 396 --- tests/auto/auto.pro | 1 - tests/auto/auto.qbs | 1 - .../generichighlighter/generichighlighter.pro | 2 - .../generichighlighter/generichighlighter.qbs | 11 - .../highlighterengine/formats.cpp | 85 - .../highlighterengine/formats.h | 68 - .../highlighterengine/highlighterengine.pro | 39 - .../highlighterengine/highlighterengine.qbs | 45 - .../highlighterengine/highlightermock.cpp | 123 - .../highlighterengine/highlightermock.h | 77 - .../highlighterengine/syntaxhighlighter.cpp | 58 - .../highlighterengine/textdocumentlayout.cpp | 40 - .../highlighterengine/textdocumentlayout.h | 67 - .../tst_highlighterengine.cpp | 1105 -------- .../specificrules/specificrules.pro | 14 - .../specificrules/specificrules.qbs | 26 - .../specificrules/tst_specificrules.cpp | 781 ------ .../qmlcodeformatter/qmlcodeformatter.qbs | 1 + 198 files changed, 16280 insertions(+), 9006 deletions(-) create mode 100644 src/libs/3rdparty/syntax-highlighting/.arcconfig create mode 100644 src/libs/3rdparty/syntax-highlighting/.gitignore create mode 100644 src/libs/3rdparty/syntax-highlighting/.kateconfig create mode 100644 src/libs/3rdparty/syntax-highlighting/.krazy create mode 100644 src/libs/3rdparty/syntax-highlighting/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/COPYING create mode 100644 src/libs/3rdparty/syntax-highlighting/KF5SyntaxHighlightingConfig.cmake.in create mode 100644 src/libs/3rdparty/syntax-highlighting/QC_README.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/README.md create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.h create mode 100644 src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/data/data.pro create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-classes.sh create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-macros.sh create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/nsis-gen.py create mode 100644 src/libs/3rdparty/syntax-highlighting/data/generators/qmake-gen.py create mode 100644 src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd create mode 100644 src/libs/3rdparty/syntax-highlighting/data/schema/validatehl.sh create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax-data.qrc.in rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/alert.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/bash.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/cmake.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/css.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/doxygen.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/dtd.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/html.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/ini.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/java.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/javadoc.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/json.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/makefile.xml (100%) create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/perl.xml (100%) create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml create mode 100644 src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/ruby.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/valgrind-suppression.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/xml.xml (100%) rename src/{share/3rdparty/generic-highlighter => libs/3rdparty/syntax-highlighting/data/syntax}/yacc.xml (100%) create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/default.theme create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme create mode 100644 src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc create mode 100644 src/libs/3rdparty/syntax-highlighting/examples/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/examples/codeeditor.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/examples/codeeditor.h create mode 100644 src/libs/3rdparty/syntax-highlighting/examples/main.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/metainfo.yaml create mode 100644 src/libs/3rdparty/syntax-highlighting/org_kde_ksyntaxhighlighting.categories create mode 100644 src/libs/3rdparty/syntax-highlighting/src/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/src/Messages.sh create mode 100644 src/libs/3rdparty/syntax-highlighting/src/cli/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/context_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definition.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/format.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/format_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h rename tests/auto/generichighlighter/highlighterengine/tabsettings.h => src/libs/3rdparty/syntax-highlighting/src/lib/ksyntaxhighlighting_export.h (83%) create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/matchresult_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/repository.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/state.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/theme.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/themedata_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h create mode 100644 src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro create mode 100644 src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs create mode 100644 src/libs/3rdparty/syntax-highlighting/syntax-highlighting_dependencies.pri delete mode 100644 src/plugins/texteditor/generichighlighter/context.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/context.h delete mode 100644 src/plugins/texteditor/generichighlighter/definitiondownloader.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/definitiondownloader.h delete mode 100644 src/plugins/texteditor/generichighlighter/dynamicrule.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/dynamicrule.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlightdefinition.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/highlightdefinition.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/highlightdefinitionhandler.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlightdefinitionmetadata.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlighter.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/highlighter.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlighterexception.h delete mode 100644 src/plugins/texteditor/generichighlighter/highlightersettingspage.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/includerulesinstruction.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/includerulesinstruction.h delete mode 100644 src/plugins/texteditor/generichighlighter/itemdata.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/itemdata.h delete mode 100644 src/plugins/texteditor/generichighlighter/keywordlist.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/keywordlist.h delete mode 100644 src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/managedefinitionsdialog.h delete mode 100644 src/plugins/texteditor/generichighlighter/managedefinitionsdialog.ui delete mode 100644 src/plugins/texteditor/generichighlighter/manager.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/manager.h delete mode 100644 src/plugins/texteditor/generichighlighter/progressdata.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/progressdata.h delete mode 100644 src/plugins/texteditor/generichighlighter/reuse.h delete mode 100644 src/plugins/texteditor/generichighlighter/rule.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/rule.h delete mode 100644 src/plugins/texteditor/generichighlighter/specificrules.cpp delete mode 100644 src/plugins/texteditor/generichighlighter/specificrules.h create mode 100644 src/plugins/texteditor/highlighter.cpp rename tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.h => src/plugins/texteditor/highlighter.h (62%) rename src/plugins/texteditor/{generichighlighter => }/highlightersettings.cpp (85%) rename src/plugins/texteditor/{generichighlighter => }/highlightersettings.h (84%) create mode 100644 src/plugins/texteditor/highlightersettingspage.cpp rename src/plugins/texteditor/{generichighlighter => }/highlightersettingspage.h (80%) rename src/plugins/texteditor/{generichighlighter => }/highlightersettingspage.ui (72%) delete mode 100644 src/plugins/texteditor/highlighterutils.cpp delete mode 100644 src/plugins/texteditor/highlighterutils.h delete mode 100644 src/share/3rdparty/generic-highlighter/autoconf.xml delete mode 100644 tests/auto/generichighlighter/generichighlighter.pro delete mode 100644 tests/auto/generichighlighter/generichighlighter.qbs delete mode 100644 tests/auto/generichighlighter/highlighterengine/formats.cpp delete mode 100644 tests/auto/generichighlighter/highlighterengine/formats.h delete mode 100644 tests/auto/generichighlighter/highlighterengine/highlighterengine.pro delete mode 100644 tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs delete mode 100644 tests/auto/generichighlighter/highlighterengine/highlightermock.cpp delete mode 100644 tests/auto/generichighlighter/highlighterengine/highlightermock.h delete mode 100644 tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp delete mode 100644 tests/auto/generichighlighter/highlighterengine/textdocumentlayout.cpp delete mode 100644 tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h delete mode 100644 tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp delete mode 100644 tests/auto/generichighlighter/specificrules/specificrules.pro delete mode 100644 tests/auto/generichighlighter/specificrules/specificrules.qbs delete mode 100644 tests/auto/generichighlighter/specificrules/tst_specificrules.cpp diff --git a/doc/src/overview/creator-acknowledgements.qdoc b/doc/src/overview/creator-acknowledgements.qdoc index 82ab47280e5..e12926398fb 100644 --- a/doc/src/overview/creator-acknowledgements.qdoc +++ b/doc/src/overview/creator-acknowledgements.qdoc @@ -51,6 +51,45 @@ \QC contains the following third-party components: \list + \li \b{Syntax highlighting engine for Kate syntax definitions} + + This is a stand-alone implementation of the Kate syntax highlighting engine. + It's meant as a building block for text editors as well as for simple highlighted + text rendering (e.g. as HTML), supporting both integration with a custom editor + as well as a ready-to-use QSyntaxHighlighter sub-class. + + Distributed under the: + \code + MIT License + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + \endcode + + The source code of KSyntaxHighlighting can be found + here: + \list + \li \l{https://cgit.kde.org/syntax-highlighting.git} + \li QtCreator/src/libs/3rdparty/syntax-highlighting + \li \l{https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/libs/3rdparty/syntax-highlighting} + \endlist + \li \b{Reference implementation for std::experimental::optional} Copyright (C) 2011-2012 Andrzej Krzemienski diff --git a/qtcreator.pri b/qtcreator.pri index 10d6dc3bef3..3b77cc86a78 100644 --- a/qtcreator.pri +++ b/qtcreator.pri @@ -196,6 +196,7 @@ for(dir, QTC_PLUGIN_DIRS) { QTC_LIB_DIRS_FROM_ENVIRONMENT = $$(QTC_LIB_DIRS) QTC_LIB_DIRS += $$split(QTC_LIB_DIRS_FROM_ENVIRONMENT, $$QMAKE_DIRLIST_SEP) QTC_LIB_DIRS += $$IDE_SOURCE_TREE/src/libs +QTC_LIB_DIRS += $$IDE_SOURCE_TREE/src/libs/3rdparty for(dir, QTC_LIB_DIRS) { INCLUDEPATH += $$dir } diff --git a/src/libs/3rdparty/syntax-highlighting/.arcconfig b/src/libs/3rdparty/syntax-highlighting/.arcconfig new file mode 100644 index 00000000000..b9b60c853e5 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.arcconfig @@ -0,0 +1,3 @@ +{ + "phabricator.uri" : "https://phabricator.kde.org/project/profile/152/" +} diff --git a/src/libs/3rdparty/syntax-highlighting/.gitignore b/src/libs/3rdparty/syntax-highlighting/.gitignore new file mode 100644 index 00000000000..02ba11c78ac --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.gitignore @@ -0,0 +1,9 @@ +*.kdev4 +*.orig +*.out +*.rej +*~ +/compile.pl +CMakeLists.txt.user +callgrind.* +heaptrack.* diff --git a/src/libs/3rdparty/syntax-highlighting/.kateconfig b/src/libs/3rdparty/syntax-highlighting/.kateconfig new file mode 100644 index 00000000000..444208643c2 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.kateconfig @@ -0,0 +1 @@ +// kate: space-indent on; indent-width 4; remove-trailing-spaces modified; diff --git a/src/libs/3rdparty/syntax-highlighting/.krazy b/src/libs/3rdparty/syntax-highlighting/.krazy new file mode 100644 index 00000000000..02e434cc0f9 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.krazy @@ -0,0 +1,2 @@ +CHECKSETS kde5 +SKIP /autotests/input/ diff --git a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt new file mode 100644 index 00000000000..49923fb26e5 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt @@ -0,0 +1,134 @@ +cmake_minimum_required(VERSION 3.0) + +set(KF5_VERSION "5.52.0") +project(KSyntaxHighlighting VERSION ${KF5_VERSION}) + +find_package(ECM 5.51.0 REQUIRED NO_MODULE) +set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) +if(POLICY CMP0063) + cmake_policy(SET CMP0063 NEW) +endif() + +include(FeatureSummary) +include(GenerateExportHeader) +include(ECMSetupVersion) +include(ECMGenerateHeaders) +include(ECMGeneratePriFile) +include(CMakePackageConfigHelpers) +include(ECMPoQmTools) +include(ECMQtDeclareLoggingCategory) +include(KDEInstallDirs) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) +include(KDECMakeSettings) +include(ECMMarkNonGuiExecutable) +include(ECMAddQch) + + +ecm_setup_version(PROJECT + VARIABLE_PREFIX SyntaxHighlighting + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5SyntaxHighlightingConfigVersion.cmake" +) + +# +# Dependencies +# +set(REQUIRED_QT_VERSION 5.8.0) +find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS Core Network Test) +option(KSYNTAXHIGHLIGHTING_USE_GUI "Build components depending on Qt5Gui" ON) +if(KSYNTAXHIGHLIGHTING_USE_GUI) + find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED COMPONENTS Gui) +endif() +find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE QUIET OPTIONAL_COMPONENTS Widgets XmlPatterns) +set_package_properties(Qt5 PROPERTIES URL "http://qt-project.org/") +set_package_properties(Qt5Widgets PROPERTIES PURPOSE "Example application.") +set_package_properties(Qt5XmlPatterns PROPERTIES PURPOSE "Compile-time validation of syntax definition files.") + +find_package(Perl REQUIRED) +set_package_properties(Perl PROPERTIES PURPOSE "Auto-generate PHP syntax definition files.") + +# +# allow to install the "differently" licensed syntax xml files instead of putting them in a QRC and link them in +# +option(QRC_SYNTAX "Bundle the syntax definition files inside the library as resources" ON) +add_feature_info(SYNTAX_RESOURCE ${QRC_SYNTAX} "Bundle the syntax definition files inside the library as resources") + +# +# allow to turn of lookup for syntax files and themes via QStandardPaths +# +option(NO_STANDARD_PATHS "Skip lookup of syntax and theme definitions in QStandardPaths locations" OFF) +add_feature_info(FEATURE_NO_STANDARD_PATHS ${NO_STANDARD_PATHS} "Skip lookup of syntax and theme definitions in QStandardPaths locations") + +# +# API documentation +# +option(BUILD_QCH "Build API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)" OFF) +add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt Assistant, Qt Creator & KDevelop)") + +# +# Translations +# +if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") + ecm_install_po_files_as_qm(po) +endif() + +# tell the framework if it shall use the syntax files from the resource +if (QRC_SYNTAX) + add_definitions(-DHAS_SYNTAX_RESOURCE) +endif() + +# skip standard paths? +if (NO_STANDARD_PATHS) + add_definitions(-DNO_STANDARD_PATHS) +endif() + +# +# Actually build the stuff +# +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_subdirectory(data) +add_subdirectory(src) +if(TARGET Qt5::Gui) + add_subdirectory(examples) +endif() + +# +# CMake package config file generation +# +set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5SyntaxHighlighting") + +if (BUILD_QCH) + ecm_install_qch_export( + TARGETS KF5SyntaxHighlighting_QCH + FILE KF5SyntaxHighlightingQchTargets.cmake + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel + ) + set(PACKAGE_INCLUDE_QCHTARGETS "include(\"\${CMAKE_CURRENT_LIST_DIR}/KF5SyntaxHighlightingQchTargets.cmake\")") +endif() + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/KF5SyntaxHighlightingConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/KF5SyntaxHighlightingConfig.cmake" + INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}" +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/KF5SyntaxHighlightingConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/KF5SyntaxHighlightingConfigVersion.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel) + +if(TARGET KF5SyntaxHighlighting) + install(EXPORT KF5SyntaxHighlightingTargets + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + FILE KF5SyntaxHighlightingTargets.cmake + NAMESPACE KF5::) +endif() + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_version.h" + DESTINATION "${KDE_INSTALL_INCLUDEDIR_KF5}" + COMPONENT Devel) +install(FILES org_kde_ksyntaxhighlighting.categories DESTINATION ${KDE_INSTALL_CONFDIR}) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/libs/3rdparty/syntax-highlighting/COPYING b/src/libs/3rdparty/syntax-highlighting/COPYING new file mode 100644 index 00000000000..6b96fea18bd --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/COPYING @@ -0,0 +1,20 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/libs/3rdparty/syntax-highlighting/KF5SyntaxHighlightingConfig.cmake.in b/src/libs/3rdparty/syntax-highlighting/KF5SyntaxHighlightingConfig.cmake.in new file mode 100644 index 00000000000..0fd1778fb86 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/KF5SyntaxHighlightingConfig.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +find_package(Qt5 @Qt5Core_VERSION_MAJOR@.@Qt5Core_VERSION_MINOR@ NO_MODULE REQUIRED COMPONENTS Core Gui) + +include("${CMAKE_CURRENT_LIST_DIR}/KF5SyntaxHighlightingTargets.cmake") +@PACKAGE_INCLUDE_QCHTARGETS@ diff --git a/src/libs/3rdparty/syntax-highlighting/QC_README.txt b/src/libs/3rdparty/syntax-highlighting/QC_README.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/libs/3rdparty/syntax-highlighting/README.md b/src/libs/3rdparty/syntax-highlighting/README.md new file mode 100644 index 00000000000..1eedc0af7fb --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/README.md @@ -0,0 +1,32 @@ +# Syntax Highlighting + +Syntax highlighting engine for Kate syntax definitions + +## Introduction + +This is a stand-alone implementation of the Kate syntax highlighting engine. +It's meant as a building block for text editors as well as for simple highlighted +text rendering (e.g. as HTML), supporting both integration with a custom editor +as well as a ready-to-use QSyntaxHighlighter sub-class. + +## Syntax Definition Files + +This library uses Kate syntax definition files for the actual highlighting, +the file format is documented [here](https://docs.kde.org/stable5/en/applications/katepart/highlight.html). + +More than 250 syntax definition files are included, additional ones are +picked up from the file system if present, so you can easily extend this +by application-specific syntax definitions for example. + +## Out of scope + +To not turn this into yet another text editor, the following things are considered +out of scope: + +* code folding, beyond providing folding range information +* auto completion +* spell checking +* user interface for configuration +* management of text buffers or documents + +If you need any of this, check out [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/). diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri b/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri new file mode 100644 index 00000000000..aee620add95 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri @@ -0,0 +1,9 @@ +INCLUDEPATH *= $$PWD/src/lib +INCLUDEPATH *= $$PWD + +SOURCES += \ + $$PWD/src/lib/ksyntaxhighlighting_logging.cpp + +HEADERS += \ + $$PWD/ksyntaxhighlighting_version.h \ + $$PWD/src/lib/ksyntaxhighlighting_logging.h diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h new file mode 100644 index 00000000000..bd31a4d407a --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h @@ -0,0 +1,12 @@ +// This file was generated by ecm_setup_version(): DO NOT EDIT! + +#ifndef SyntaxHighlighting_VERSION_H +#define SyntaxHighlighting_VERSION_H + +#define SyntaxHighlighting_VERSION_STRING "5.52.0" +#define SyntaxHighlighting_VERSION_MAJOR 5 +#define SyntaxHighlighting_VERSION_MINOR 52 +#define SyntaxHighlighting_VERSION_PATCH 0 +#define SyntaxHighlighting_VERSION ((5<<16)|(52<<8)|(0)) + +#endif diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter new file mode 100644 index 00000000000..b7878737718 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/AbstractHighlighter @@ -0,0 +1 @@ +#include "abstracthighlighter.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition new file mode 100644 index 00000000000..2c3241f8416 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Definition @@ -0,0 +1 @@ +#include "definition.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion new file mode 100644 index 00000000000..005b829d539 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/FoldingRegion @@ -0,0 +1 @@ +#include "foldingregion.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format new file mode 100644 index 00000000000..b0d6a102468 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Format @@ -0,0 +1 @@ +#include "format.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository new file mode 100644 index 00000000000..189dbc2f699 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Repository @@ -0,0 +1 @@ +#include "repository.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State new file mode 100644 index 00000000000..e148d70391a --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/State @@ -0,0 +1 @@ +#include "state.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter new file mode 100644 index 00000000000..b42982473b0 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/SyntaxHighlighter @@ -0,0 +1 @@ +#include "syntaxhighlighter.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme new file mode 100644 index 00000000000..34a3e98e604 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/Theme @@ -0,0 +1 @@ +#include "theme.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp new file mode 100644 index 00000000000..4082ac4affa --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.cpp @@ -0,0 +1,11 @@ +// This file was generated by ecm_qt_declare_logging_category(): DO NOT EDIT! + +#include "ksyntaxhighlighting_logging.h" + + namespace KSyntaxHighlighting { +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) +Q_LOGGING_CATEGORY(Log, "org.kde.ksyntaxhighlighting", QtInfoMsg) +#else +Q_LOGGING_CATEGORY(Log, "org.kde.ksyntaxhighlighting") +#endif +} diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.h new file mode 100644 index 00000000000..c351b2cb926 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_logging.h @@ -0,0 +1,11 @@ +// This file was generated by ecm_qt_declare_logging_category(): DO NOT EDIT! + +#ifndef ECM_QLOGGINGCATEGORY_KSYNTAXHIGHLIGHTING_LOG_KSYNTAXHIGHLIGHTING_LOGGING_H +#define ECM_QLOGGINGCATEGORY_KSYNTAXHIGHLIGHTING_LOG_KSYNTAXHIGHLIGHTING_LOGGING_H + +#include + namespace KSyntaxHighlighting { +Q_DECLARE_LOGGING_CATEGORY(Log) +} + +#endif diff --git a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt new file mode 100644 index 00000000000..73adbe6d20b --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt @@ -0,0 +1,61 @@ +# generate PHP definitions +macro(generate_php_syntax_definition targetFile srcFile) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/syntax) + execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl + INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile} + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/syntax/${targetFile}) +endmacro() + +generate_php_syntax_definition(javascript-php.xml javascript.xml) +generate_php_syntax_definition(css-php.xml css.xml) +generate_php_syntax_definition(html-php.xml html.xml) + +# find all definitions +file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml") +set(defs + ${src_defs} + ${CMAKE_CURRENT_BINARY_DIR}/syntax/html-php.xml + ${CMAKE_CURRENT_BINARY_DIR}/syntax/css-php.xml + ${CMAKE_CURRENT_BINARY_DIR}/syntax/javascript-php.xml +) + +# theme data resource +qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc) + +# do we want syntax files bundled in the library? +if (QRC_SYNTAX) + # generate the resource file + set(qrc_file ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc) + set(qrc_body "") + foreach(def ${defs}) + get_filename_component(def_name ${def} NAME) + string(APPEND qrc_body "${def}\n") + endforeach() + set(SYNTAX_DATA_QRC_FILES_STRING ${qrc_body}) + configure_file(syntax-data.qrc.in ${qrc_file} @ONLY) + + # generate the index file + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" + COMMAND katehighlightingindexer "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" "${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc" + DEPENDS ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc + ) + + # generate the qrc file manually, to make dependencies on generated files work... + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" + COMMAND ${Qt5Core_RCC_EXECUTABLE} --name syntax_data -o "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc" + DEPENDS ${defs} ${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax + ) + set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" PROPERTIES SKIP_AUTOMOC ON) + + # object library to make cross-folder dependencies work, themes + syntax files + add_library(SyntaxHighlightingData OBJECT ${themes_QRC} ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp) +else() + # install the syntax files as normal files into the prefix + install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax) + + # object library to make cross-folder dependencies work, only themes + add_library(SyntaxHighlightingData OBJECT ${themes_QRC}) +endif() + +# set PIC to allow use in static and shared libs +set_property(TARGET SyntaxHighlightingData PROPERTY POSITION_INDEPENDENT_CODE 1) diff --git a/src/libs/3rdparty/syntax-highlighting/data/data.pro b/src/libs/3rdparty/syntax-highlighting/data/data.pro new file mode 100644 index 00000000000..1028ea1579e --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/data.pro @@ -0,0 +1,11 @@ +TEMPLATE = aux + +include(../../../../../qtcreator.pri) + +STATIC_BASE = $$PWD +STATIC_OUTPUT_BASE = $$IDE_DATA_PATH/generic-highlighter +STATIC_INSTALL_BASE = $$INSTALL_DATA_PATH/generic-highlighter + +STATIC_FILES += $$files($$PWD/syntax/*, true) + +include(../../../../../qtcreatordata.pri) diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl new file mode 100644 index 00000000000..33cc7511aa8 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl @@ -0,0 +1,323 @@ + + +]> + + + + + + + {%- for command in commands %} + {{command.name}} + {%- endfor %} + + {% for command in commands -%} + {%- if command.named_args and command.named_args.kw %} + + {%- for arg in command.named_args.kw %} + {{arg}} + {%- endfor %} + + {%- endif %} + {%- if command.special_args and command.special_args.kw %} + + {%- for arg in command.special_args.kw %} + {{arg}} + {%- endfor %} + + {%- endif %} + {%- endfor %} + + + {%- for var in variables.kw %} + {{var}} + {%- endfor %} + + + {%- for kind in properties.kinds %} + + {%- for prop in properties[kind].kw %} + {{prop}} + {%- endfor %} + + {%- endfor %} + + + {%- for expr in generator_expressions %} + {{ expr }} + {%- endfor %} + + + + + + + {% for command in commands -%} + + {% endfor -%} + + + + + + + + + + {% for command in commands -%} + {# + + -#} + + + + + {%- if command.nested_parentheses %} + + {%- endif %} + + {%- if command.named_args and command.named_args.kw %} + + {%- endif %} + {%- if command.special_args and command.special_args.kw %} + + {%- endif %} + {%- if command.property_args and command.property_args.kw %} + {%- for kind in command.property_args.kw %} + + {%- if properties[kind|replace('-', '_')].re %} + + {%- endif %} + {%- endfor %} + {%- endif %} + {%- if command is not nulary %} + + {%- if command.name == 'cmake_policy' %} + + + {%- endif %} + {%- endif %} + + {%- if command.nested_parentheses %} + + + {%- if command.named_args and command.named_args.kw %} + + {%- endif %} + {%- if command.special_args and command.special_args.kw %} + + {%- endif %} + {%- if command.property_args and command.property_args.kw %} + {%- for kind in command.property_args.kw %} + + {%- if properties[kind|replace('-', '_')].re %} + + {%- endif %} + {%- endfor %} + {%- endif %} + + + {%- endif %} + {% endfor -%} + + {% for kind in properties.kinds if properties[kind].re -%} + + {%- for prop in properties[kind].re %} + + {%- endfor %} + {{ '\n' }} + {% endfor -%} + + + + + + + + + + + + + + + + + + + + + + + + + + + {%- for var in variables.re %} + + {%- endfor %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml new file mode 100644 index 00000000000..1174c35215d --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml @@ -0,0 +1,2446 @@ +global-properties: + - ALLOW_DUPLICATE_CUSTOM_TARGETS + - AUTOGEN_SOURCE_GROUP + - AUTOGEN_TARGETS_FOLDER + - AUTOMOC_SOURCE_GROUP + - AUTOMOC_TARGETS_FOLDER + - AUTORCC_SOURCE_GROUP + - CMAKE_C_KNOWN_FEATURES + - CMAKE_CXX_KNOWN_FEATURES + - DEBUG_CONFIGURATIONS + - DISABLED_FEATURES + - ENABLED_FEATURES + - ENABLED_LANGUAGES + - FIND_LIBRARY_USE_LIB32_PATHS + - FIND_LIBRARY_USE_LIB64_PATHS + - FIND_LIBRARY_USE_LIBX32_PATHS + - FIND_LIBRARY_USE_OPENBSD_VERSIONING + - GENERATOR_IS_MULTI_CONFIG + - GLOBAL_DEPENDS_DEBUG_MODE + - GLOBAL_DEPENDS_NO_CYCLES + - IN_TRY_COMPILE + - PACKAGES_FOUND + - PACKAGES_NOT_FOUND + - JOB_POOLS + - PREDEFINED_TARGETS_FOLDER + - ECLIPSE_EXTRA_NATURES + - REPORT_UNDEFINED_PROPERTIES + - RULE_LAUNCH_COMPILE + - RULE_LAUNCH_CUSTOM + - RULE_LAUNCH_LINK + - RULE_MESSAGES + - TARGET_ARCHIVES_MAY_BE_SHARED_LIBS + - TARGET_MESSAGES + - TARGET_SUPPORTS_SHARED_LIBS + - USE_FOLDERS + - XCODE_EMIT_EFFECTIVE_PLATFORM_NAME + # Other well-known global properties + # - FeatureSummary + - FeatureSummary_PKG_TYPES + - FeatureSummary_REQUIRED_PKG_TYPES + - FeatureSummary_DEFAULT_PKG_TYPE + - FeatureSummary__DESCRIPTION + +directory-properties: + - ADDITIONAL_MAKE_CLEAN_FILES + - BINARY_DIR + - BUILDSYSTEM_TARGETS + - CACHE_VARIABLES + - CLEAN_NO_CUSTOM + - CMAKE_CONFIGURE_DEPENDS + - COMPILE_DEFINITIONS + - COMPILE_OPTIONS + - DEFINITIONS + - EXCLUDE_FROM_ALL + - IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + - INCLUDE_DIRECTORIES + - INCLUDE_REGULAR_EXPRESSION + - INTERPROCEDURAL_OPTIMIZATION_ + - INTERPROCEDURAL_OPTIMIZATION + - LABELS # Since 3.10 + - LINK_DIRECTORIES + - LINK_OPTIONS # Since 3.13 + - LISTFILE_STACK + - MACROS + - PARENT_DIRECTORY + - RULE_LAUNCH_COMPILE + - RULE_LAUNCH_CUSTOM + - RULE_LAUNCH_LINK + - SOURCE_DIR + - SUBDIRECTORIES + - TESTS # Since 3.12 + - TEST_INCLUDE_FILE + - TEST_INCLUDE_FILES # Since 3.10 + - VARIABLES + - VS_GLOBAL_SECTION_POST_
+ - VS_GLOBAL_SECTION_PRE_
+ - VS_STARTUP_PROJECT + +# NOTE Copy-n-pasting this list from official docs may contain a redudant item `Example`! Check it! +target-properties: + - ALIASED_TARGET + - ANDROID_ANT_ADDITIONAL_OPTIONS + - ANDROID_API + - ANDROID_API_MIN + - ANDROID_ARCH + - ANDROID_ASSETS_DIRECTORIES + - ANDROID_GUI + - ANDROID_JAR_DEPENDENCIES + - ANDROID_JAR_DIRECTORIES + - ANDROID_JAVA_SOURCE_DIR + - ANDROID_NATIVE_LIB_DEPENDENCIES + - ANDROID_NATIVE_LIB_DIRECTORIES + - ANDROID_PROCESS_MAX + - ANDROID_PROGUARD + - ANDROID_PROGUARD_CONFIG_PATH + - ANDROID_SECURE_PROPS_PATH + - ANDROID_SKIP_ANT_STEP + - ANDROID_STL_TYPE + - ARCHIVE_OUTPUT_DIRECTORY_ + - ARCHIVE_OUTPUT_DIRECTORY + - ARCHIVE_OUTPUT_NAME_ + - ARCHIVE_OUTPUT_NAME + - AUTOGEN_BUILD_DIR + - AUTOGEN_TARGET_DEPENDS + - AUTOMOC_DEPEND_FILTERS + - AUTOMOC_MOC_OPTIONS + - AUTOMOC + - AUTOUIC + - AUTOUIC_OPTIONS + - AUTOUIC_SEARCH_PATHS + - AUTORCC + - AUTORCC_OPTIONS + - BINARY_DIR + - BUILD_RPATH + - BUILD_WITH_INSTALL_NAME_DIR + - BUILD_WITH_INSTALL_RPATH + - BUNDLE_EXTENSION + - BUNDLE + - C_EXTENSIONS + - C_STANDARD + - C_STANDARD_REQUIRED + - COMMON_LANGUAGE_RUNTIME # Sine 3.12 + - COMPATIBLE_INTERFACE_BOOL + - COMPATIBLE_INTERFACE_NUMBER_MAX + - COMPATIBLE_INTERFACE_NUMBER_MIN + - COMPATIBLE_INTERFACE_STRING + - COMPILE_DEFINITIONS + - COMPILE_FEATURES + - COMPILE_FLAGS + - COMPILE_OPTIONS + - COMPILE_PDB_NAME + - COMPILE_PDB_NAME_ + - COMPILE_PDB_OUTPUT_DIRECTORY + - COMPILE_PDB_OUTPUT_DIRECTORY_ + - _OUTPUT_NAME + - _POSTFIX + - CROSSCOMPILING_EMULATOR + - CUDA_PTX_COMPILATION + - CUDA_SEPARABLE_COMPILATION + - CUDA_RESOLVE_DEVICE_SYMBOLS + - CUDA_EXTENSIONS + - CUDA_STANDARD + - CUDA_STANDARD_REQUIRED + - CXX_EXTENSIONS + - CXX_STANDARD + - CXX_STANDARD_REQUIRED + # - DEBUG_POSTFIX # NOTE: Handled by `_POSTFIX` + - DEFINE_SYMBOL + - DEPLOYMENT_ADDITIONAL_FILES # Since 3.13 + - DEPLOYMENT_REMOTE_DIRECTORY + - DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12 + - EchoString + - ENABLE_EXPORTS + - EXCLUDE_FROM_ALL + - EXCLUDE_FROM_DEFAULT_BUILD_ + - EXCLUDE_FROM_DEFAULT_BUILD + - EXPORT_NAME + - EXPORT_PROPERTIES # Since 3.12 + - FOLDER + - Fortran_FORMAT + - Fortran_MODULE_DIRECTORY + - FRAMEWORK + - FRAMEWORK_VERSION + - GENERATOR_FILE_NAME + - GNUtoMS + - HAS_CXX + - IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + - IMPORTED_COMMON_LANGUAGE_RUNTIME # Since 3.12 + - IMPORTED_CONFIGURATIONS + - IMPORTED_GLOBAL # Since 3.11 + - IMPORTED_IMPLIB_ + - IMPORTED_IMPLIB + - IMPORTED_LIBNAME_ + - IMPORTED_LIBNAME + - IMPORTED_LINK_DEPENDENT_LIBRARIES_ + - IMPORTED_LINK_DEPENDENT_LIBRARIES + - IMPORTED_LINK_INTERFACE_LANGUAGES_ + - IMPORTED_LINK_INTERFACE_LANGUAGES + - IMPORTED_LINK_INTERFACE_LIBRARIES_ + - IMPORTED_LINK_INTERFACE_LIBRARIES + - IMPORTED_LINK_INTERFACE_MULTIPLICITY_ + - IMPORTED_LINK_INTERFACE_MULTIPLICITY + - IMPORTED_LOCATION_ + - IMPORTED_LOCATION + - IMPORTED_NO_SONAME_ + - IMPORTED_NO_SONAME + - IMPORTED_OBJECTS_ + - IMPORTED_OBJECTS + - IMPORTED + - IMPORTED_SONAME_ + - IMPORTED_SONAME + - IMPORT_PREFIX + - IMPORT_SUFFIX + - INCLUDE_DIRECTORIES + - INSTALL_NAME_DIR + - INSTALL_RPATH + - INSTALL_RPATH_USE_LINK_PATH + - INTERFACE_AUTOUIC_OPTIONS + - INTERFACE_COMPILE_DEFINITIONS + - INTERFACE_COMPILE_FEATURES + - INTERFACE_COMPILE_OPTIONS + - INTERFACE_INCLUDE_DIRECTORIES + - INTERFACE_LINK_DEPENDS # Since 3.13 + - INTERFACE_LINK_DIRECTORIES # Since 3.13 + - INTERFACE_LINK_LIBRARIES + - INTERFACE_LINK_OPTIONS # Since 3.13 + - INTERFACE_POSITION_INDEPENDENT_CODE + - INTERFACE_SOURCES + - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + - INTERPROCEDURAL_OPTIMIZATION_ + - INTERPROCEDURAL_OPTIMIZATION + - IOS_INSTALL_COMBINED + - JOB_POOL_COMPILE + - JOB_POOL_LINK + - LABELS + - _CLANG_TIDY + - _COMPILER_LAUNCHER + - _CPPCHECK # Since 3.10 + - _CPPLINT + - _INCLUDE_WHAT_YOU_USE + - _VISIBILITY_PRESET + - LIBRARY_OUTPUT_DIRECTORY_ + - LIBRARY_OUTPUT_DIRECTORY + - LIBRARY_OUTPUT_NAME_ + - LIBRARY_OUTPUT_NAME + - LINK_DEPENDS_NO_SHARED + - LINK_DEPENDS + - LINK_DIRECTORIES # Since 3.13 + - LINKER_LANGUAGE + - LINK_FLAGS_ + - LINK_FLAGS + - LINK_INTERFACE_LIBRARIES_ + - LINK_INTERFACE_LIBRARIES + - LINK_INTERFACE_MULTIPLICITY_ + - LINK_INTERFACE_MULTIPLICITY + - LINK_LIBRARIES + - LINK_OPTIONS # Since 3.13 + - LINK_SEARCH_END_STATIC + - LINK_SEARCH_START_STATIC + - LINK_WHAT_YOU_USE + - LOCATION_ + - LOCATION + - MACOSX_BUNDLE_INFO_PLIST + - MACOSX_BUNDLE + - MACOSX_FRAMEWORK_INFO_PLIST + - MACOSX_RPATH + - MANUALLY_ADDED_DEPENDENCIES + - MAP_IMPORTED_CONFIG_ + - NAME + - NO_SONAME + - NO_SYSTEM_FROM_IMPORTED + - OSX_ARCHITECTURES_ + - OSX_ARCHITECTURES + - OUTPUT_NAME_ + - OUTPUT_NAME + - PDB_NAME_ + - PDB_NAME + - PDB_OUTPUT_DIRECTORY_ + - PDB_OUTPUT_DIRECTORY + - POSITION_INDEPENDENT_CODE + - PREFIX + - PRIVATE_HEADER + - PROJECT_LABEL + - PUBLIC_HEADER + - RESOURCE + - RULE_LAUNCH_COMPILE + - RULE_LAUNCH_CUSTOM + - RULE_LAUNCH_LINK + - RUNTIME_OUTPUT_DIRECTORY_ + - RUNTIME_OUTPUT_DIRECTORY + - RUNTIME_OUTPUT_NAME_ + - RUNTIME_OUTPUT_NAME + - SKIP_BUILD_RPATH + - SOURCE_DIR + - SOURCES + - SOVERSION + - STATIC_LIBRARY_FLAGS_ + - STATIC_LIBRARY_FLAGS + - STATIC_LIBRARY_OPTIONS # Since 3.13 + - SUFFIX + - TYPE + - VERSION + - VISIBILITY_INLINES_HIDDEN + - VS_CONFIGURATION_TYPE + - VS_DEBUGGER_COMMAND # Since 3.12 + - VS_DEBUGGER_COMMAND_ARGUMENTS # Since 3.13 + - VS_DEBUGGER_ENVIRONMENT # Since 3.13 + - VS_DEBUGGER_WORKING_DIRECTORY + - VS_DESKTOP_EXTENSIONS_VERSION + - VS_DOTNET_REFERENCE_ + - VS_DOTNET_REFERENCEPROP__TAG_ # Since 3.10 + - VS_DOTNET_REFERENCES + - VS_DOTNET_REFERENCES_COPY_LOCAL + - VS_DOTNET_TARGET_FRAMEWORK_VERSION + - VS_GLOBAL_KEYWORD + - VS_GLOBAL_PROJECT_TYPES + - VS_GLOBAL_ROOTNAMESPACE + - VS_GLOBAL_ + - VS_IOT_EXTENSIONS_VERSION + - VS_IOT_STARTUP_TASK + - VS_KEYWORD + - VS_MOBILE_EXTENSIONS_VERSION + - VS_SCC_AUXPATH + - VS_SCC_LOCALPATH + - VS_SCC_PROJECTNAME + - VS_SCC_PROVIDER + - VS_SDK_REFERENCES + - VS_USER_PROPS + - VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION + - VS_WINRT_COMPONENT + - VS_WINRT_EXTENSIONS + - VS_WINRT_REFERENCES + - WIN32_EXECUTABLE + - WINDOWS_EXPORT_ALL_SYMBOLS + - XCODE_ATTRIBUTE_ + - XCODE_EXPLICIT_FILE_TYPE + - XCODE_PRODUCT_TYPE + - XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 + - XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 + - XCODE_SCHEME_THREAD_SANITIZER # Since 3.13 + - XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13 + - XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13 + - XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13 + - XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 + - XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13 + - XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13 + - XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13 + - XCODE_SCHEME_GUARD_MALLOC # Since 3.13 + - XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13 + - XCODE_SCHEME_MALLOC_STACK # Since 3.13 + - XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 + - XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 + - XCODE_SCHEME_EXECUTABLE # Since 3.13 + - XCODE_SCHEME_ARGUMENTS # Since 3.13 + - XCODE_SCHEME_ENVIRONMENT # Since 3.13 + - XCTEST + +test-properties: + - ATTACHED_FILES_ON_FAIL + - ATTACHED_FILES + - COST + - DEPENDS + - DISABLED + - ENVIRONMENT + - FAIL_REGULAR_EXPRESSION + - FIXTURES_CLEANUP + - FIXTURES_REQUIRED + - FIXTURES_SETUP + - LABELS + - MEASUREMENT + - PASS_REGULAR_EXPRESSION + - PROCESSOR_AFFINITY # Since 3.12 + - PROCESSORS + - REQUIRED_FILES + - RESOURCE_LOCK + - RUN_SERIAL + - SKIP_RETURN_CODE + - TIMEOUT + - TIMEOUT_AFTER_MATCH + - WILL_FAIL + - WORKING_DIRECTORY + +source-properties: + - ABSTRACT + - AUTOUIC_OPTIONS + - AUTORCC_OPTIONS + - COMPILE_DEFINITIONS + - COMPILE_FLAGS + - COMPILE_OPTIONS # Since 3.11 + - EXTERNAL_OBJECT + - Fortran_FORMAT + - GENERATED + - HEADER_FILE_ONLY + - INCLUDE_DIRECTORIES # Since 3.11 + - KEEP_EXTENSION + - LABELS + - LANGUAGE + - LOCATION + - MACOSX_PACKAGE_LOCATION + - OBJECT_DEPENDS + - OBJECT_OUTPUTS + - SKIP_AUTOGEN + - SKIP_AUTOMOC + - SKIP_AUTORCC + - SKIP_AUTOUIC + - SYMBOLIC + - VS_COPY_TO_OUT_DIR + - VS_CSHARP_ + - VS_DEPLOYMENT_CONTENT + - VS_DEPLOYMENT_LOCATION + - VS_INCLUDE_IN_VSIX + - VS_RESOURCE_GENERATOR + - VS_SHADER_DISABLE_OPTIMIZATIONS # Since 3.11 + - VS_SHADER_ENABLE_DEBUG # Since 3.11 + - VS_SHADER_ENTRYPOINT + - VS_SHADER_FLAGS + - VS_SHADER_MODEL + - VS_SHADER_OBJECT_FILE_NAME # Since 3.12 + - VS_SHADER_OUTPUT_HEADER_FILE # Since 3.10 + - VS_SHADER_TYPE + - VS_SHADER_VARIABLE_NAME # Since 3.10 + - VS_TOOL_OVERRIDE + - VS_XAML_TYPE + - WRAP_EXCLUDE + - XCODE_EXPLICIT_FILE_TYPE + - XCODE_FILE_ATTRIBUTES + - XCODE_LAST_KNOWN_FILE_TYPE + +cache-properties: + - ADVANCED + - HELPSTRING + - MODIFIED + - STRINGS + - TYPE + - VALUE + +install-properties: + - CPACK_DESKTOP_SHORTCUTS + - CPACK_NEVER_OVERWRITE + - CPACK_PERMANENT + - CPACK_START_MENU_SHORTCUTS + - CPACK_STARTUP_SHORTCUTS + - CPACK_WIX_ACL + +generator-expressions: + - 0 + - 1 + - AND + - ANGLE-R + - BOOL + - BUILD_INTERFACE + - COMMA + - COMPILE_FEATURES + - COMPILE_LANGUAGE + - CONFIG + - CXX_COMPILER_ID + - CXX_COMPILER_VERSION + - C_COMPILER_ID + - C_COMPILER_VERSION + - EQUAL + - GENEX_EVAL # Since 3.12 + - IF + - INSTALL_INTERFACE + - INSTALL_PREFIX + - IN_LIST # Since 3.12 + - JOIN + - LINK_ONLY + - LOWER_CASE + - MAKE_C_IDENTIFIER + - NOT + - OR + - PLATFORM_ID + - SEMICOLON + - SHELL_PATH + - STREQUAL + - TARGET_BUNDLE_CONTENT_DIR + - TARGET_BUNDLE_DIR + - TARGET_EXISTS # Since 3.12 + - TARGET_FILE + - TARGET_FILE_DIR + - TARGET_FILE_NAME + - TARGET_GENEX_EVAL # Since 3.12 + - TARGET_LINKER_FILE + - TARGET_LINKER_FILE_DIR + - TARGET_LINKER_FILE_NAME + - TARGET_NAME + - TARGET_NAME_IF_EXISTS # Since 3.12 + - TARGET_OBJECTS + - TARGET_PDB_FILE + - TARGET_PDB_FILE_DIR + - TARGET_PDB_FILE_NAME + - TARGET_POLICY + - TARGET_PROPERTY + - TARGET_SONAME_FILE + - TARGET_SONAME_FILE_DIR + - TARGET_SONAME_FILE_NAME + - UPPER_CASE + - VERSION_EQUAL + - VERSION_GREATER + - VERSION_GREATER_EQUAL + - VERSION_LESS + - VERSION_LESS_EQUAL + +variables: + # Variables that Provide Information + - CMAKE_AR + - CMAKE_ARGC + - CMAKE_ARGV0 + - CMAKE_BINARY_DIR + - CMAKE_BUILD_TOOL + - CMAKE_CACHEFILE_DIR + - CMAKE_CACHE_MAJOR_VERSION + - CMAKE_CACHE_MINOR_VERSION + - CMAKE_CACHE_PATCH_VERSION + - CMAKE_CFG_INTDIR + - CMAKE_COMMAND + - CMAKE_CROSSCOMPILING + - CMAKE_CROSSCOMPILING_EMULATOR + - CMAKE_CTEST_COMMAND + - CMAKE_CURRENT_BINARY_DIR + - CMAKE_CURRENT_LIST_DIR + - CMAKE_CURRENT_LIST_FILE + - CMAKE_CURRENT_LIST_LINE + - CMAKE_CURRENT_SOURCE_DIR + - CMAKE_DIRECTORY_LABELS # Since 3.10 + - CMAKE_DL_LIBS + - CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION # Since 3.12 + - CMAKE_EDIT_COMMAND + - CMAKE_EXECUTABLE_SUFFIX + - CMAKE_EXTRA_GENERATOR + - CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES + - CMAKE_FIND_PACKAGE_NAME + - CMAKE_FIND_PACKAGE_SORT_DIRECTION + - CMAKE_FIND_PACKAGE_SORT_ORDER + - CMAKE_GENERATOR + - CMAKE_GENERATOR_INSTANCE # Since 3.11 + - CMAKE_GENERATOR_PLATFORM + - CMAKE_GENERATOR_TOOLSET + - CMAKE_HOME_DIRECTORY + - CMAKE_IMPORT_LIBRARY_PREFIX + - CMAKE_IMPORT_LIBRARY_SUFFIX + - CMAKE_JOB_POOL_COMPILE + - CMAKE_JOB_POOL_LINK + - CMAKE_JOB_POOLS # Since 3.11 + - CMAKE__COMPILER_AR + - CMAKE__COMPILER_RANLIB + - CMAKE_LINK_LIBRARY_SUFFIX + - CMAKE_LINK_SEARCH_END_STATIC + - CMAKE_LINK_SEARCH_START_STATIC + - CMAKE_MAJOR_VERSION + - CMAKE_MAKE_PROGRAM + - CMAKE_MATCH_COUNT + - CMAKE_MATCH_ + - CMAKE_MINIMUM_REQUIRED_VERSION + - CMAKE_MINOR_VERSION + - CMAKE_NETRC # Since 3.11 + - CMAKE_NETRC_FILE # Since 3.11 + - CMAKE_PARENT_LIST_FILE + - CMAKE_PATCH_VERSION + - CMAKE_PROJECT_DESCRIPTION + - CMAKE_PROJECT_HOMEPAGE_URL # Since 3.12 + - CMAKE_PROJECT_NAME + - CMAKE_PROJECT_VERSION # Since 3.12 + - CMAKE_PROJECT_VERSION_MAJOR # Since 3.12 + - CMAKE_PROJECT_VERSION_MINOR # Since 3.12 + - CMAKE_PROJECT_VERSION_PATCH # Since 3.12 + - CMAKE_PROJECT_VERSION_TWEAK # Since 3.12 + - CMAKE_RANLIB + - CMAKE_ROOT + - CMAKE_SCRIPT_MODE_FILE + - CMAKE_SHARED_LIBRARY_PREFIX + - CMAKE_SHARED_LIBRARY_SUFFIX + - CMAKE_SHARED_MODULE_PREFIX + - CMAKE_SHARED_MODULE_SUFFIX + - CMAKE_SIZEOF_VOID_P + - CMAKE_SKIP_INSTALL_RULES + - CMAKE_SKIP_RPATH + - CMAKE_SOURCE_DIR + - CMAKE_STATIC_LIBRARY_PREFIX + - CMAKE_STATIC_LIBRARY_SUFFIX + - CMAKE_TOOLCHAIN_FILE + - CMAKE_TWEAK_VERSION + - CMAKE_VERBOSE_MAKEFILE + - CMAKE_VERSION + - CMAKE_VS_DEVENV_COMMAND + - CMAKE_VS_INTEL_Fortran_PROJECT_VERSION + - CMAKE_VS_MSBUILD_COMMAND + - CMAKE_VS_NsightTegra_VERSION + - CMAKE_VS_PLATFORM_NAME + - CMAKE_VS_PLATFORM_TOOLSET + - CMAKE_VS_PLATFORM_TOOLSET_CUDA + - CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE + - CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION + - CMAKE_XCODE_GENERATE_SCHEME + - CMAKE_XCODE_PLATFORM_TOOLSET + - _BINARY_DIR + - _SOURCE_DIR + - _VERSION + - _VERSION_MAJOR + - _VERSION_MINOR + - _VERSION_PATCH + - _VERSION_TWEAK + - PROJECT_BINARY_DIR + - PROJECT_DESCRIPTION + - PROJECT_HOMEPAGE_URL # Since 3.12 + - PROJECT_NAME + - PROJECT_SOURCE_DIR + - PROJECT_VERSION + - PROJECT_VERSION_MAJOR + - PROJECT_VERSION_MINOR + - PROJECT_VERSION_PATCH + - PROJECT_VERSION_TWEAK + # Variables that Change Behavior + - BUILD_SHARED_LIBS + - CMAKE_ABSOLUTE_DESTINATION_FILES + - CMAKE_APPBUNDLE_PATH + - CMAKE_AUTOMOC_RELAXED_MODE + - CMAKE_BACKWARDS_COMPATIBILITY + - CMAKE_BUILD_TYPE + - CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11 + - CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10 + - CMAKE_CODELITE_USE_TARGETS + - CMAKE_COLOR_MAKEFILE + - CMAKE_CONFIGURATION_TYPES + - CMAKE_DEBUG_TARGET_PROPERTIES + - CMAKE_DEPENDS_IN_PROJECT_ONLY + - CMAKE_DISABLE_FIND_PACKAGE_ + - CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES + - CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT + - CMAKE_ECLIPSE_MAKE_ARGUMENTS + - CMAKE_ECLIPSE_VERSION + - CMAKE_ERROR_DEPRECATED + - CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + - CMAKE_EXPORT_COMPILE_COMMANDS + - CMAKE_EXPORT_NO_PACKAGE_REGISTRY + - CMAKE_FIND_APPBUNDLE + - CMAKE_FIND_FRAMEWORK + - CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX + - CMAKE_FIND_LIBRARY_PREFIXES + - CMAKE_FIND_LIBRARY_SUFFIXES + - CMAKE_FIND_NO_INSTALL_PREFIX + - CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY + - CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY + - CMAKE_FIND_PACKAGE_WARN_NO_MODULE + - CMAKE_FIND_ROOT_PATH + - CMAKE_FIND_ROOT_PATH_MODE_INCLUDE + - CMAKE_FIND_ROOT_PATH_MODE_LIBRARY + - CMAKE_FIND_ROOT_PATH_MODE_PACKAGE + - CMAKE_FIND_ROOT_PATH_MODE_PROGRAM + - CMAKE_FRAMEWORK_PATH + - CMAKE_IGNORE_PATH + - CMAKE_INCLUDE_DIRECTORIES_BEFORE + - CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE + - CMAKE_INCLUDE_PATH + - CMAKE_INSTALL_DEFAULT_COMPONENT_NAME + - CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11 + - CMAKE_INSTALL_MESSAGE + - CMAKE_INSTALL_PREFIX + - CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT + - CMAKE_LIBRARY_PATH + - CMAKE_LINK_DIRECTORIES_BEFORE # Since 3.13 + - CMAKE_MFC_FLAG + - CMAKE_MODULE_PATH + - CMAKE_NOT_USING_CONFIG_FLAGS + - CMAKE_POLICY_DEFAULT_CMP + - CMAKE_POLICY_WARNING_CMP + - CMAKE_PREFIX_PATH + - CMAKE_PROGRAM_PATH + - CMAKE_PROJECT__INCLUDE + - CMAKE_SKIP_INSTALL_ALL_DEPENDENCY + - CMAKE_STAGING_PREFIX + - CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS + - CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE + - CMAKE_SUPPRESS_REGENERATION # Since 3.12 + - CMAKE_SYSROOT + - CMAKE_SYSROOT_COMPILE + - CMAKE_SYSROOT_LINK + - CMAKE_SYSTEM_APPBUNDLE_PATH + - CMAKE_SYSTEM_FRAMEWORK_PATH + - CMAKE_SYSTEM_IGNORE_PATH + - CMAKE_SYSTEM_INCLUDE_PATH + - CMAKE_SYSTEM_LIBRARY_PATH + - CMAKE_SYSTEM_PREFIX_PATH + - CMAKE_SYSTEM_PROGRAM_PATH + - CMAKE_USER_MAKE_RULES_OVERRIDE + - CMAKE_WARN_DEPRECATED + - CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + - CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13 + - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 + - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 + - CMAKE_XCODE_SCHEME_THREAD_SANITIZER # Since 3.13 + - CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP # Since 3.13 + - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13 + - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13 + - CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 + - CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13 + - CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13 + - CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13 + - CMAKE_XCODE_SCHEME_GUARD_MALLOC # Since 3.13 + - CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13 + - CMAKE_XCODE_SCHEME_MALLOC_STACK # Since 3.13 + - CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 + - CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 + - CMAKE_SUPPRESS_DEVELOPER_WARNINGS # Undocumented yet (CMake <= 3.10) + - CMAKE_SUPPRESS_DEVELOPER_ERRORS # Undocumented yet (CMake <= 3.10) + # Variables that Describe the System + - ANDROID + - APPLE + - BORLAND + - CMAKE_CL_64 + - CMAKE_COMPILER_2005 + - CMAKE_HOST_APPLE + - CMAKE_HOST_SOLARIS + - CMAKE_HOST_SYSTEM + - CMAKE_HOST_SYSTEM_NAME + - CMAKE_HOST_SYSTEM_PROCESSOR + - CMAKE_HOST_SYSTEM_VERSION + - CMAKE_HOST_UNIX + - CMAKE_HOST_WIN32 + - CMAKE_LIBRARY_ARCHITECTURE + - CMAKE_LIBRARY_ARCHITECTURE_REGEX + - CMAKE_OBJECT_PATH_MAX + - CMAKE_SYSTEM + - CMAKE_SYSTEM_NAME + - CMAKE_SYSTEM_PROCESSOR + - CMAKE_SYSTEM_VERSION + - CYGWIN + # NOTE `ENV` not a variable in fact! + # - ENV + - GHS-MULTI + - MINGW + - MSVC + - MSVC10 + - MSVC11 + - MSVC12 + - MSVC14 + - MSVC60 + - MSVC70 + - MSVC71 + - MSVC80 + - MSVC90 + - MSVC_IDE + - MSVC_TOOLSET_VERSION # Since 3.12 + - MSVC_VERSION + - UNIX + - WIN32 + - WINCE + - WINDOWS_PHONE + - WINDOWS_STORE + - XCODE + - XCODE_VERSION + # Variables that Control the Build + - CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS + - CMAKE_ANDROID_API + - CMAKE_ANDROID_API_MIN + - CMAKE_ANDROID_ARCH + - CMAKE_ANDROID_ARCH_ABI + - CMAKE_ANDROID_ARM_MODE + - CMAKE_ANDROID_ARM_NEON + - CMAKE_ANDROID_ASSETS_DIRECTORIES + - CMAKE_ANDROID_GUI + - CMAKE_ANDROID_JAR_DEPENDENCIES + - CMAKE_ANDROID_JAR_DIRECTORIES + - CMAKE_ANDROID_JAVA_SOURCE_DIR + - CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES + - CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES + - CMAKE_ANDROID_NDK + - CMAKE_ANDROID_NDK_DEPRECATED_HEADERS + - CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG + - CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + - CMAKE_ANDROID_PROCESS_MAX + - CMAKE_ANDROID_PROGUARD + - CMAKE_ANDROID_PROGUARD_CONFIG_PATH + - CMAKE_ANDROID_SECURE_PROPS_PATH + - CMAKE_ANDROID_SKIP_ANT_STEP + - CMAKE_ANDROID_STANDALONE_TOOLCHAIN + - CMAKE_ANDROID_STL_TYPE + - CMAKE_ARCHIVE_OUTPUT_DIRECTORY + - CMAKE_ARCHIVE_OUTPUT_DIRECTORY_ + - CMAKE_AUTOGEN_PARALLEL + - CMAKE_AUTOGEN_VERBOSE # Since 3.13 + - CMAKE_AUTOMOC + - CMAKE_AUTOMOC_DEPEND_FILTERS + - CMAKE_AUTOMOC_MOC_OPTIONS + - CMAKE_AUTORCC + - CMAKE_AUTORCC_OPTIONS + - CMAKE_AUTOUIC + - CMAKE_AUTOUIC_OPTIONS + - CMAKE_AUTOUIC_SEARCH_PATHS + - CMAKE_BUILD_RPATH + - CMAKE_BUILD_WITH_INSTALL_NAME_DIR + - CMAKE_BUILD_WITH_INSTALL_RPATH + - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY + - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_ + - CMAKE__POSTFIX + - CMAKE_CUDA_SEPARABLE_COMPILATION # Since 3.11 + - CMAKE_DEBUG_POSTFIX + - CMAKE_ENABLE_EXPORTS + - CMAKE_EXE_LINKER_FLAGS + - CMAKE_EXE_LINKER_FLAGS_ + - CMAKE_EXE_LINKER_FLAGS__INIT + - CMAKE_EXE_LINKER_FLAGS_INIT + - CMAKE_FOLDER # Since 3.12 + - CMAKE_Fortran_FORMAT + - CMAKE_Fortran_MODULE_DIRECTORY + - CMAKE_GNUtoMS + - CMAKE_INCLUDE_CURRENT_DIR + - CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE + - CMAKE_INSTALL_NAME_DIR + - CMAKE_INSTALL_RPATH + - CMAKE_INSTALL_RPATH_USE_LINK_PATH + - CMAKE_INTERPROCEDURAL_OPTIMIZATION + - CMAKE_INTERPROCEDURAL_OPTIMIZATION_ + - CMAKE_IOS_INSTALL_COMBINED + - CMAKE__CLANG_TIDY + - CMAKE__COMPILER_LAUNCHER + - CMAKE__CPPCHECK # Since 3.10 + - CMAKE__CPPLINT + - CMAKE__INCLUDE_WHAT_YOU_USE + - CMAKE__VISIBILITY_PRESET + - CMAKE_LIBRARY_OUTPUT_DIRECTORY + - CMAKE_LIBRARY_OUTPUT_DIRECTORY_ + - CMAKE_LIBRARY_PATH_FLAG + - CMAKE_LINK_DEF_FILE_FLAG + - CMAKE_LINK_DEPENDS_NO_SHARED + - CMAKE_LINK_INTERFACE_LIBRARIES + - CMAKE_LINK_LIBRARY_FILE_FLAG + - CMAKE_LINK_LIBRARY_FLAG + - CMAKE_LINK_WHAT_YOU_USE + - CMAKE_MACOSX_BUNDLE + - CMAKE_MACOSX_RPATH + - CMAKE_MAP_IMPORTED_CONFIG_ + - CMAKE_MODULE_LINKER_FLAGS + - CMAKE_MODULE_LINKER_FLAGS_ + - CMAKE_MODULE_LINKER_FLAGS__INIT + - CMAKE_MODULE_LINKER_FLAGS_INIT + - CMAKE_NINJA_OUTPUT_PATH_PREFIX + - CMAKE_NO_BUILTIN_CHRPATH + - CMAKE_NO_SYSTEM_FROM_IMPORTED + - CMAKE_OSX_ARCHITECTURES + - CMAKE_OSX_DEPLOYMENT_TARGET + - CMAKE_OSX_SYSROOT + - CMAKE_PDB_OUTPUT_DIRECTORY + - CMAKE_PDB_OUTPUT_DIRECTORY_ + - CMAKE_POSITION_INDEPENDENT_CODE + - CMAKE_RUNTIME_OUTPUT_DIRECTORY + - CMAKE_RUNTIME_OUTPUT_DIRECTORY_ + - CMAKE_SHARED_LINKER_FLAGS + - CMAKE_SHARED_LINKER_FLAGS_ + - CMAKE_SHARED_LINKER_FLAGS__INIT + - CMAKE_SHARED_LINKER_FLAGS_INIT + - CMAKE_SKIP_BUILD_RPATH + - CMAKE_SKIP_INSTALL_RPATH + - CMAKE_STATIC_LINKER_FLAGS + - CMAKE_STATIC_LINKER_FLAGS_ + - CMAKE_STATIC_LINKER_FLAGS__INIT + - CMAKE_STATIC_LINKER_FLAGS_INIT + - CMAKE_TRY_COMPILE_CONFIGURATION + - CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + - CMAKE_TRY_COMPILE_TARGET_TYPE + - CMAKE_USE_RELATIVE_PATHS + - CMAKE_VISIBILITY_INLINES_HIDDEN + - CMAKE_VS_GLOBALS # Since 3.13 + - CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD + - CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD + - CMAKE_VS_SDK_EXCLUDE_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_INCLUDE_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_LIBRARY_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_REFERENCE_DIRECTORIES # Since 3.12 + - CMAKE_VS_SDK_SOURCE_DIRECTORIES # Since 3.12 + - CMAKE_WIN32_EXECUTABLE + - CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS + - CMAKE_XCODE_ATTRIBUTE_ + - EXECUTABLE_OUTPUT_PATH + - LIBRARY_OUTPUT_PATH + # Variables for Languages + - CMAKE_COMPILER_IS_GNUCC + - CMAKE_COMPILER_IS_GNUCXX + - CMAKE_COMPILER_IS_GNUG77 + - CMAKE_CUDA_EXTENSIONS + - CMAKE_CUDA_STANDARD + - CMAKE_CUDA_STANDARD_REQUIRED + - CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES + - CMAKE_CXX_COMPILE_FEATURES + - CMAKE_CXX_EXTENSIONS + - CMAKE_CXX_STANDARD + - CMAKE_CXX_STANDARD_REQUIRED + - CMAKE_C_COMPILE_FEATURES + - CMAKE_C_EXTENSIONS + - CMAKE_C_STANDARD + - CMAKE_C_STANDARD_REQUIRED + - CMAKE_Fortran_MODDIR_DEFAULT + - CMAKE_Fortran_MODDIR_FLAG + - CMAKE_Fortran_MODOUT_FLAG + - CMAKE_INTERNAL_PLATFORM_ABI + - CMAKE__ANDROID_TOOLCHAIN_MACHINE + - CMAKE__ANDROID_TOOLCHAIN_PREFIX + - CMAKE__ANDROID_TOOLCHAIN_SUFFIX + - CMAKE__ARCHIVE_APPEND + - CMAKE__ARCHIVE_CREATE + - CMAKE__ARCHIVE_FINISH + - CMAKE__COMPILER + - CMAKE__COMPILER_ABI + - CMAKE__COMPILER_EXTERNAL_TOOLCHAIN + - CMAKE__COMPILER_ID + - CMAKE__COMPILER_LOADED + - CMAKE__COMPILER_TARGET + - CMAKE__COMPILER_VERSION + - CMAKE__COMPILE_OBJECT + - CMAKE__CREATE_SHARED_LIBRARY + - CMAKE__CREATE_SHARED_MODULE + - CMAKE__CREATE_STATIC_LIBRARY + - CMAKE__FLAGS + - CMAKE__FLAGS_DEBUG + - CMAKE__FLAGS_DEBUG_INIT + - CMAKE__FLAGS_INIT + - CMAKE__FLAGS_MINSIZEREL + - CMAKE__FLAGS_MINSIZEREL_INIT + - CMAKE__FLAGS_RELEASE + - CMAKE__FLAGS_RELEASE_INIT + - CMAKE__FLAGS_RELWITHDEBINFO + - CMAKE__FLAGS_RELWITHDEBINFO_INIT + - CMAKE__GHS_KERNEL_FLAGS_DEBUG + - CMAKE__GHS_KERNEL_FLAGS_MINSIZEREL + - CMAKE__GHS_KERNEL_FLAGS_RELEASE + - CMAKE__GHS_KERNEL_FLAGS_RELWITHDEBINFO + - CMAKE__IGNORE_EXTENSIONS + - CMAKE__IMPLICIT_INCLUDE_DIRECTORIES + - CMAKE__IMPLICIT_LINK_DIRECTORIES + - CMAKE__IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + - CMAKE__IMPLICIT_LINK_LIBRARIES + - CMAKE__LIBRARY_ARCHITECTURE + - CMAKE__LINKER_PREFERENCE + - CMAKE__LINKER_PREFERENCE_PROPAGATES + - CMAKE__LINKER_WRAPPER_FLAG # Since 3.13 + - CMAKE__LINKER_WRAPPER_FLAG_SEP # Since 3.13 + - CMAKE__LINK_EXECUTABLE + - CMAKE__OUTPUT_EXTENSION + - CMAKE__PLATFORM_ID + - CMAKE__SIMULATE_ID + - CMAKE__SIMULATE_VERSION + - CMAKE__SIZEOF_DATA_PTR + - CMAKE__SOURCE_FILE_EXTENSIONS + - CMAKE__STANDARD_INCLUDE_DIRECTORIES + - CMAKE__STANDARD_LIBRARIES + - CMAKE_Swift_LANGUAGE_VERSION + - CMAKE_USER_MAKE_RULES_OVERRIDE_ + # Variables for CTest + - CTEST_BINARY_DIRECTORY + - CTEST_BUILD_COMMAND + - CTEST_BUILD_NAME + - CTEST_BZR_COMMAND + - CTEST_BZR_UPDATE_OPTIONS + - CTEST_CHANGE_ID + - CTEST_CHECKOUT_COMMAND + - CTEST_CONFIGURATION_TYPE + - CTEST_CONFIGURE_COMMAND + - CTEST_COVERAGE_COMMAND + - CTEST_COVERAGE_EXTRA_FLAGS + - CTEST_CURL_OPTIONS + - CTEST_CUSTOM_COVERAGE_EXCLUDE + - CTEST_CUSTOM_ERROR_EXCEPTION + - CTEST_CUSTOM_ERROR_MATCH + - CTEST_CUSTOM_ERROR_POST_CONTEXT + - CTEST_CUSTOM_ERROR_PRE_CONTEXT + - CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE + - CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS + - CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS + - CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE + - CTEST_CUSTOM_MEMCHECK_IGNORE + - CTEST_CUSTOM_POST_MEMCHECK + - CTEST_CUSTOM_POST_TEST + - CTEST_CUSTOM_PRE_MEMCHECK + - CTEST_CUSTOM_PRE_TEST + - CTEST_CUSTOM_TEST_IGNORE + - CTEST_CUSTOM_WARNING_EXCEPTION + - CTEST_CUSTOM_WARNING_MATCH + - CTEST_CVS_CHECKOUT + - CTEST_CVS_COMMAND + - CTEST_CVS_UPDATE_OPTIONS + - CTEST_DROP_LOCATION + - CTEST_DROP_METHOD + - CTEST_DROP_SITE + - CTEST_DROP_SITE_CDASH + - CTEST_DROP_SITE_PASSWORD + - CTEST_DROP_SITE_USER + - CTEST_EXTRA_COVERAGE_GLOB + - CTEST_GIT_COMMAND + - CTEST_GIT_INIT_SUBMODULES + - CTEST_GIT_UPDATE_CUSTOM + - CTEST_GIT_UPDATE_OPTIONS + - CTEST_HG_COMMAND + - CTEST_HG_UPDATE_OPTIONS + - CTEST_LABELS_FOR_SUBPROJECTS # Since 3.10 + - CTEST_MEMORYCHECK_COMMAND + - CTEST_MEMORYCHECK_COMMAND_OPTIONS + - CTEST_MEMORYCHECK_SANITIZER_OPTIONS + - CTEST_MEMORYCHECK_SUPPRESSIONS_FILE + - CTEST_MEMORYCHECK_TYPE + - CTEST_NIGHTLY_START_TIME + - CTEST_P4_CLIENT + - CTEST_P4_COMMAND + - CTEST_P4_OPTIONS + - CTEST_P4_UPDATE_OPTIONS + - CTEST_SCP_COMMAND + - CTEST_SITE + - CTEST_SOURCE_DIRECTORY + - CTEST_SVN_COMMAND + - CTEST_SVN_OPTIONS + - CTEST_SVN_UPDATE_OPTIONS + - CTEST_TEST_LOAD + - CTEST_TEST_TIMEOUT + - CTEST_TRIGGER_SITE + - CTEST_UPDATE_COMMAND + - CTEST_UPDATE_OPTIONS + - CTEST_UPDATE_VERSION_ONLY + - CTEST_USE_LAUNCHERS + # Variables for CPack + - CPACK_ABSOLUTE_DESTINATION_FILES + - CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + - CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION + - CPACK_INCLUDE_TOPLEVEL_DIRECTORY + - CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11 + - CPACK_INSTALL_SCRIPT + - CPACK_PACKAGING_INSTALL_PREFIX + - CPACK_SET_DESTDIR + - CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION + # Variables for `find_package()` + - PACKAGE_FIND_NAME + - PACKAGE_FIND_VERSION + - PACKAGE_FIND_VERSION_MAJOR + - PACKAGE_FIND_VERSION_MINOR + - PACKAGE_FIND_VERSION_PATCH + - PACKAGE_FIND_VERSION_TWEAK + - PACKAGE_FIND_VERSION_COUNT + - PACKAGE_VERSION + - PACKAGE_VERSION_EXACT + - PACKAGE_VERSION_COMPATIBLE + - PACKAGE_VERSION_UNSUITABLE + # NOTE _VERSION and components already defined above, so skipped here + - _FOUND + - _VERSION_COUNT + - _FIND_REQUIRED + - _FIND_QUIETLY + - _FIND_VERSION + - _FIND_VERSION_MAJOR + - _FIND_VERSION_MINOR + - _FIND_VERSION_PATCH + - _FIND_VERSION_TWEAK + - _FIND_VERSION_COUNT + - _FIND_VERSION_EXACT + - _FIND_COMPONENTS + - _FIND_REQUIRED_ + - _CONSIDERED_CONFIGS + - _CONSIDERED_VERSIONS + - _ROOT # Since 3.12 + # Other standard variables/patterns + # - `try_run` + - __TRYRUN_OUTPUT + # Well known CMake's official module's variables + # - CheckCCompilerFlag + # - CheckCSourceCompiles + # - CheckCSourceRuns + # - CheckCxxCompilerFlag + # - CheckCxxSourceCompiles + # - CheckCxxSourceRuns + # - CheckCXXSymbolExists + # - CheckFortranCompilerFlag + # - CheckFortranFunctionExists + # - CheckFortranSourceCompiles + # - CheckFortranSourceCompiles + # - CheckFunctionExists + # - CheckIncludeFileCXX + # - CheckIncludeFile + # - CheckIncludeFiles + # - CheckLibraryExists + # - CheckPrototypeDefinition + # - CheckStructHasMember + # - CheckSymbolExists + # - CheckTypeSize + # - CheckVariableExists + - CMAKE_REQUIRED_DEFINITIONS + - CMAKE_REQUIRED_FLAGS + - CMAKE_REQUIRED_INCLUDES + - CMAKE_REQUIRED_LIBRARIES + - CMAKE_REQUIRED_QUIET + # - CheckTypeSize + # - CMakePushCheckState + - CMAKE_EXTRA_INCLUDE_FILES + # - CMakeBackwardCompatibilityCXX + - CMAKE_ANSI_CXXFLAGS + - CMAKE_HAS_ANSI_STRING_STREAM + # - CMakeFindFrameworks + - CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS + # - CMakeGraphVizOptions + - GRAPHVIZ_GRAPH_TYPE + - GRAPHVIZ_GRAPH_NAME + - GRAPHVIZ_GRAPH_HEADER + - GRAPHVIZ_NODE_PREFIX + - GRAPHVIZ_EXECUTABLES + - GRAPHVIZ_STATIC_LIBS + - GRAPHVIZ_SHARED_LIBS + - GRAPHVIZ_MODULE_LIBS + - GRAPHVIZ_EXTERNAL_LIBS + - GRAPHVIZ_IGNORE_TARGETS + - GRAPHVIZ_GENERATE_PER_TARGET + # - CPackArchive + - CPACK_ARCHIVE_FILE_NAME + - CPACK_ARCHIVE__FILE_NAME + - CPACK_ARCHIVE_COMPONENT_INSTALL + # - CPackBundle + - CPACK_BUNDLE_NAME + - CPACK_BUNDLE_PLIST + - CPACK_BUNDLE_ICON + - CPACK_BUNDLE_STARTUP_COMMAND + - CPACK_BUNDLE_APPLE_CERT_APP + - CPACK_BUNDLE_APPLE_ENTITLEMENTS + - CPACK_BUNDLE_APPLE_CODESIGN_FILES + - CPACK_BUNDLE_APPLE_CODESIGN_PARAMETER + - CPACK_COMMAND_CODESIGN + # - CPackComponent + - CPACK_COMPONENTS_ALL + - CPACK__COMPONENT_INSTALL + - CPACK_COMPONENTS_GROUPING + - CPACK_COMPONENT__DISPLAY_NAME + - CPACK_COMPONENT__DESCRIPTION + - CPACK_COMPONENT__GROUP + - CPACK_COMPONENT__DEPENDS + - CPACK_COMPONENT__HIDDEN + - CPACK_COMPONENT__REQUIRED + - CPACK_COMPONENT__DISABLED + # - CPackCygwin + - CPACK_CYGWIN_PATCH_NUMBER + - CPACK_CYGWIN_PATCH_FILE + - CPACK_CYGWIN_BUILD_SCRIPT + # - CPackDeb + - CPACK_DEB_COMPONENT_INSTALL + - CPACK_DEBIAN_PACKAGE_NAME + - CPACK_DEBIAN__PACKAGE_NAME + - CPACK_DEBIAN_FILE_NAME + - CPACK_DEBIAN__FILE_NAME + - CPACK_DEBIAN_PACKAGE_EPOCH # Since 3.10 + - CPACK_DEBIAN_PACKAGE_VERSION + - CPACK_DEBIAN_PACKAGE_RELEASE + - CPACK_DEBIAN_PACKAGE_ARCHITECTURE + - CPACK_DEBIAN__PACKAGE_ARCHITECTURE + - CPACK_DEBIAN_PACKAGE_DEPENDS + - CPACK_DEBIAN__PACKAGE_DEPENDS + - CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS + - CPACK_DEBIAN_PACKAGE_MAINTAINER + - CPACK_DEBIAN_PACKAGE_DESCRIPTION + - CPACK_COMPONENT__DESCRIPTION + - CPACK_DEBIAN_PACKAGE_SECTION + - CPACK_DEBIAN__PACKAGE_SECTION + - CPACK_DEBIAN_ARCHIVE_TYPE + - CPACK_DEBIAN_COMPRESSION_TYPE + - CPACK_DEBIAN_PACKAGE_PRIORITY + - CPACK_DEBIAN__PACKAGE_PRIORITY + - CPACK_DEBIAN_PACKAGE_HOMEPAGE + - CPACK_DEBIAN_PACKAGE_SHLIBDEPS + - CPACK_DEBIAN__PACKAGE_SHLIBDEPS + - CPACK_DEBIAN_PACKAGE_DEBUG + - CPACK_DEBIAN_PACKAGE_PREDEPENDS + - CPACK_DEBIAN__PACKAGE_PREDEPENDS + - CPACK_DEBIAN_PACKAGE_ENHANCES + - CPACK_DEBIAN__PACKAGE_ENHANCES + - CPACK_DEBIAN_PACKAGE_BREAKS + - CPACK_DEBIAN__PACKAGE_BREAKS + - CPACK_DEBIAN_PACKAGE_CONFLICTS + - CPACK_DEBIAN__PACKAGE_CONFLICTS + - CPACK_DEBIAN_PACKAGE_PROVIDES + - CPACK_DEBIAN__PACKAGE_PROVIDES + - CPACK_DEBIAN_PACKAGE_REPLACES + - CPACK_DEBIAN__PACKAGE_REPLACES + - CPACK_DEBIAN_PACKAGE_RECOMMENDS + - CPACK_DEBIAN__PACKAGE_RECOMMENDS + - CPACK_DEBIAN_PACKAGE_SUGGESTS + - CPACK_DEBIAN__PACKAGE_SUGGESTS + - CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS + - CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY + - CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA + - CPACK_DEBIAN__PACKAGE_CONTROL_EXTRA + - CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION + - CPACK_DEBIAN__PACKAGE_CONTROL_STRICT_PERMISSION + - CPACK_DEBIAN_PACKAGE_SOURCE + - CPACK_DEBIAN__PACKAGE_SOURCE + - CPACK_DEBIAN_DEBUGINFO_PACKAGE # Since 3.13 + - CPACK_DEBIAN__DEBUGINFO_PACKAGE # Since 3.13 + # - CPackDMG + - CPACK_DMG_VOLUME_NAME + - CPACK_DMG_FORMAT + - CPACK_DMG_DS_STORE + - CPACK_DMG_DS_STORE_SETUP_SCRIPT + - CPACK_DMG_BACKGROUND_IMAGE + - CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK + - CPACK_DMG_SLA_DIR + - CPACK_DMG_SLA_LANGUAGES + - CPACK_COMMAND_HDIUTIL + - CPACK_COMMAND_SETFILE + - CPACK_COMMAND_REZ + # -CPackExt (Since 3.13) + - CPACK_EXT_REQUESTED_VERSIONS + - CPACK_EXT_ENABLE_STAGING + - CPACK_EXT_PACKAGE_SCRIPT + # - CPackIFW + - CPACK_IFW_ROOT + - QTIFWDIR + - CPACK_IFW_VERBOSE + - CPACK_IFW_PACKAGE_TITLE + - CPACK_IFW_PACKAGE_PUBLISHER + - CPACK_IFW_PRODUCT_URL + - CPACK_IFW_PACKAGE_ICON + - CPACK_IFW_PACKAGE_WINDOW_ICON + - CPACK_IFW_PACKAGE_LOGO + - CPACK_IFW_PACKAGE_WATERMARK + - CPACK_IFW_PACKAGE_BANNER + - CPACK_IFW_PACKAGE_BACKGROUND + - CPACK_IFW_PACKAGE_WIZARD_STYLE + - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH + - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT + - CPACK_IFW_PACKAGE_TITLE_COLOR + - CPACK_IFW_PACKAGE_START_MENU_DIRECTORY + - CPACK_IFW_TARGET_DIRECTORY + - CPACK_IFW_ADMIN_TARGET_DIRECTORY + - CPACK_IFW_PACKAGE_GROUP + - CPACK_IFW_PACKAGE_NAME + - CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME + - CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE + - CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS + - CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH + - CPACK_IFW_PACKAGE_CONTROL_SCRIPT + - CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR # Since 3.11 + - CPACK_IFW_PACKAGE_RESOURCES + - CPACK_IFW_REPOSITORIES_ALL + - CPACK_IFW_DOWNLOAD_ALL + - CPACK_IFW_RESOLVE_DUPLICATE_NAMES + - CPACK_IFW_PACKAGES_DIRECTORIES + - CPACK_IFW_FRAMEWORK_VERSION + - CPACK_IFW_BINARYCREATOR_EXECUTABLE + - CPACK_IFW_REPOGEN_EXECUTABLE + - CPACK_IFW_INSTALLERBASE_EXECUTABLE + - CPACK_IFW_DEVTOOL_EXECUTABLE + # - CPackNSIS + - CPACK_NSIS_INSTALL_ROOT + - CPACK_NSIS_MUI_ICON + - CPACK_NSIS_MUI_UNIICON + - CPACK_NSIS_INSTALLER_MUI_ICON_CODE + - CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP + - CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP + - CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS + - CPACK_NSIS_EXTRA_INSTALL_COMMANDS + - CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS + - CPACK_NSIS_COMPRESSOR + - CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL + - CPACK_NSIS_MODIFY_PATH + - CPACK_NSIS_DISPLAY_NAME + - CPACK_NSIS_PACKAGE_NAME + - CPACK_NSIS_INSTALLED_ICON_NAME + - CPACK_NSIS_HELP_LINK + - CPACK_NSIS_URL_INFO_ABOUT + - CPACK_NSIS_CONTACT + - CPACK_NSIS__INSTALL_DIRECTORY + - CPACK_NSIS_CREATE_ICONS_EXTRA + - CPACK_NSIS_DELETE_ICONS_EXTRA + - CPACK_NSIS_EXECUTABLES_DIRECTORY + - CPACK_NSIS_MUI_FINISHPAGE_RUN + - CPACK_NSIS_MENU_LINKS + # - CPackNuGet (since 3.12) + - CPACK_NUGET_COMPONENT_INSTALL + - CPACK_NUGET_PACKAGE_NAME + - CPACK_NUGET__PACKAGE_NAME + - CPACK_NUGET_PACKAGE_VERSION + - CPACK_NUGET__PACKAGE_VERSION + - CPACK_NUGET_PACKAGE_DESCRIPTION + - CPACK_NUGET__PACKAGE_DESCRIPTION + - CPACK_NUGET_PACKAGE_AUTHORS + - CPACK_NUGET__PACKAGE_AUTHORS + - CPACK_NUGET_PACKAGE_TITLE + - CPACK_NUGET__PACKAGE_TITLE + - CPACK_NUGET_PACKAGE_OWNERS + - CPACK_NUGET__PACKAGE_OWNERS + - CPACK_NUGET_PACKAGE_HOMEPAGE_URL + - CPACK_NUGET__PACKAGE_HOMEPAGE_URL + - CPACK_NUGET_PACKAGE_LICENSEURL + - CPACK_NUGET__PACKAGE_LICENSEURL + - CPACK_NUGET_PACKAGE_ICONURL + - CPACK_NUGET__PACKAGE_ICONURL + - CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY + - CPACK_NUGET__PACKAGE_DESCRIPTION_SUMMARY + - CPACK_NUGET_PACKAGE_RELEASE_NOTES + - CPACK_NUGET__PACKAGE_RELEASE_NOTES + - CPACK_NUGET_PACKAGE_COPYRIGHT + - CPACK_NUGET__PACKAGE_COPYRIGHT + - CPACK_NUGET_PACKAGE_TAGS + - CPACK_NUGET__PACKAGE_TAGS + - CPACK_NUGET_PACKAGE_DEPENDENCIES + - CPACK_NUGET__PACKAGE_DEPENDENCIES + - CPACK_NUGET_PACKAGE_DEPENDENCIES__VERSION + - CPACK_NUGET__PACKAGE_DEPENDENCIES__VERSION + - CPACK_NUGET_PACKAGE_DEBUG + # - CPackPackageMaker + - CPACK_OSX_PACKAGE_VERSION + # - CPackProductBuild + - CPACK_COMMAND_PRODUCTBUILD + - CPACK_PRODUCTBUILD_IDENTITY_NAME + - CPACK_PRODUCTBUILD_KEYCHAIN_PATH + - CPACK_COMMAND_PKGBUILD + - CPACK_PKGBUILD_IDENTITY_NAME + - CPACK_PKGBUILD_KEYCHAIN_PATH + - CPACK_PRODUCTBUILD_RESOURCES_DIR + # - CPackRPM + - CPACK_RPM_COMPONENT_INSTALL + - CPACK_RPM_PACKAGE_SUMMARY + - CPACK_RPM__PACKAGE_SUMMARY + - CPACK_RPM_PACKAGE_NAME + - CPACK_RPM__PACKAGE_NAME + - CPACK_RPM_FILE_NAME + - CPACK_RPM__FILE_NAME + - CPACK_RPM_MAIN_COMPONENT + - CPACK_RPM_PACKAGE_EPOCH # Since 3.10 + - CPACK_RPM_PACKAGE_VERSION + - CPACK_RPM_PACKAGE_ARCHITECTURE + - CPACK_RPM__PACKAGE_ARCHITECTURE + - CPACK_RPM_PACKAGE_RELEASE + - CPACK_RPM_PACKAGE_RELEASE_DIST + - CPACK_RPM_PACKAGE_LICENSE + - CPACK_RPM_PACKAGE_GROUP + - CPACK_RPM__PACKAGE_GROUP + - CPACK_RPM_PACKAGE_VENDOR + - CPACK_RPM_PACKAGE_URL + - CPACK_RPM__PACKAGE_URL + - CPACK_RPM_PACKAGE_DESCRIPTION + - CPACK_RPM__PACKAGE_DESCRIPTION + - CPACK_RPM_COMPRESSION_TYPE + - CPACK_RPM_PACKAGE_AUTOREQ + - CPACK_RPM__PACKAGE_AUTOREQ + - CPACK_RPM_PACKAGE_AUTOPROV + - CPACK_RPM__PACKAGE_AUTOPROV + - CPACK_RPM_PACKAGE_AUTOREQPROV + - CPACK_RPM__PACKAGE_AUTOREQPROV + - CPACK_RPM_PACKAGE_REQUIRES + - CPACK_RPM__PACKAGE_REQUIRES + - CPACK_RPM_PACKAGE_CONFLICTS + - CPACK_RPM__PACKAGE_CONFLICTS + - CPACK_RPM_PACKAGE_REQUIRES_PRE + - CPACK_RPM__PACKAGE_REQUIRES_PRE + - CPACK_RPM_PACKAGE_REQUIRES_POST + - CPACK_RPM__PACKAGE_REQUIRES_POST + - CPACK_RPM_PACKAGE_REQUIRES_POSTUN + - CPACK_RPM__PACKAGE_REQUIRES_POSTUN + - CPACK_RPM_PACKAGE_REQUIRES_PREUN + - CPACK_RPM__PACKAGE_REQUIRES_PREUN + - CPACK_RPM_PACKAGE_SUGGESTS + - CPACK_RPM__PACKAGE_SUGGESTS + - CPACK_RPM_PACKAGE_PROVIDES + - CPACK_RPM__PACKAGE_PROVIDES + - CPACK_RPM_PACKAGE_OBSOLETES + - CPACK_RPM__PACKAGE_OBSOLETES + - CPACK_RPM_PACKAGE_RELOCATABLE + - CPACK_RPM_SPEC_INSTALL_POST + - CPACK_RPM_SPEC_MORE_DEFINE + - CPACK_RPM_PACKAGE_DEBUG + - CPACK_RPM_USER_BINARY_SPECFILE + - CPACK_RPM__USER_BINARY_SPECFILE + - CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE + - CPACK_RPM_PRE_INSTALL_SCRIPT_FILE + - CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE + - CPACK_RPM_POST_INSTALL_SCRIPT_FILE + - CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE + - CPACK_RPM_USER_FILELIST + - CPACK_RPM__USER_FILELIST + - CPACK_RPM_CHANGELOG_FILE + - CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST + - CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION + - CPACK_RPM_RELOCATION_PATHS + - CPACK_RPM__PACKAGE_PREFIX + - CPACK_RPM_NO_INSTALL_PREFIX_RELOCATION + - CPACK_RPM_NO__INSTALL_PREFIX_RELOCATION + - CPACK_RPM_ADDITIONAL_MAN_DIRS + - CPACK_RPM_DEFAULT_USER + - CPACK_RPM__DEFAULT_USER + - CPACK_RPM_DEFAULT_GROUP + - CPACK_RPM__DEFAULT_GROUP + - CPACK_RPM_DEFAULT_FILE_PERMISSIONS + - CPACK_RPM__DEFAULT_FILE_PERMISSIONS + - CPACK_RPM_DEFAULT_DIR_PERMISSIONS + - CPACK_RPM__DEFAULT_DIR_PERMISSIONS + - CPACK_RPM_INSTALL_WITH_EXEC # Since 3.11 + - CPACK_RPM_DEBUGINFO_PACKAGE + - CPACK_RPM__DEBUGINFO_PACKAGE + - CPACK_BUILD_SOURCE_DIRS + - CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX + - CPACK_RPM__BUILD_SOURCE_DIRS_PREFIX + - CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS + - CPACK_RPM_DEBUGINFO_EXCLUDE_DIRS_ADDITION + - CPACK_RPM_DEBUGINFO_SINGLE_PACKAGE + - CPACK_RPM_DEBUGINFO_FILE_NAME + - CPACK_RPM__DEBUGINFO_FILE_NAME + - CPACK_RPM_FILE_NAME + - CPACK_RPM_PACKAGE_SOURCES + - CPACK_RPM_SOURCE_PKG_BUILD_PARAMS + - CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX + - CPACK_RPM_BUILDREQUIRES + # - CPack + - CPACK_PACKAGE_NAME + - CPACK_PACKAGE_VENDOR + # `CPACK_PACKAGE_CONTACT` used by some modules (like Deb and NSIS), + # but not documented yet... + - CPACK_PACKAGE_CONTACT + - CPACK_PACKAGE_DIRECTORY + - CPACK_PACKAGE_VERSION_MAJOR + - CPACK_PACKAGE_VERSION_MINOR + - CPACK_PACKAGE_VERSION_PATCH + - CPACK_PACKAGE_DESCRIPTION # Documented since 3.12 + - CPACK_PACKAGE_DESCRIPTION_FILE + - CPACK_PACKAGE_DESCRIPTION_SUMMARY + - CPACK_PACKAGE_HOMEPAGE_URL # Since 3.12 + - CPACK_PACKAGE_FILE_NAME + - CPACK_PACKAGE_INSTALL_DIRECTORY + - CPACK_PACKAGE_ICON + - CPACK_PACKAGE_CHECKSUM + - CPACK_PROJECT_CONFIG_FILE + - CPACK_RESOURCE_FILE_LICENSE + - CPACK_RESOURCE_FILE_README + - CPACK_RESOURCE_FILE_WELCOME + - CPACK_MONOLITHIC_INSTALL + - CPACK_GENERATOR + - CPACK_OUTPUT_CONFIG_FILE + - CPACK_PACKAGE_EXECUTABLES + - CPACK_STRIP_FILES + - CPACK_VERBATIM_VARIABLES + - CPACK_SOURCE_PACKAGE_FILE_NAME + - CPACK_SOURCE_STRIP_FILES + - CPACK_SOURCE_GENERATOR + - CPACK_SOURCE_OUTPUT_CONFIG_FILE + - CPACK_SOURCE_IGNORE_FILES + - CPACK_CMAKE_GENERATOR + - CPACK_INSTALL_CMAKE_PROJECTS + - CPACK_SYSTEM_NAME + - CPACK_PACKAGE_VERSION + - CPACK_TOPLEVEL_TAG + - CPACK_INSTALL_COMMANDS + - CPACK_INSTALLED_DIRECTORIES + - CPACK_PACKAGE_INSTALL_REGISTRY_KEY + - CPACK_CREATE_DESKTOP_LINKS + - CPACK_BINARY_ + # - CPackWIX + - CPACK_WIX_UPGRADE_GUID + - CPACK_WIX_PRODUCT_GUID + - CPACK_WIX_LICENSE_RTF + - CPACK_WIX_PRODUCT_ICON + - CPACK_WIX_UI_REF + - CPACK_WIX_UI_BANNER + - CPACK_WIX_UI_DIALOG + - CPACK_WIX_PROGRAM_MENU_FOLDER + - CPACK_WIX_CULTURES + - CPACK_WIX_TEMPLATE + - CPACK_WIX_PATCH_FILE + - CPACK_WIX_EXTRA_SOURCES + - CPACK_WIX_EXTRA_OBJECTS + - CPACK_WIX_EXTENSIONS + - CPACK_WIX__EXTENSIONS + - CPACK_WIX__EXTRA_FLAGS + - CPACK_WIX_CMAKE_PACKAGE_REGISTRY + - CPACK_WIX_PROPERTY_ + - CPACK_WIX_ROOT_FEATURE_TITLE + - CPACK_WIX_ROOT_FEATURE_DESCRIPTION + - CPACK_WIX_SKIP_PROGRAM_FOLDER + - CPACK_WIX_ROOT_FOLDER_ID + - CPACK_WIX_ROOT + # - CTest + # - Dart + - BUILD_TESTING + # - ExternalData + - ExternalData_BINARY_ROOT + - ExternalData_CUSTOM_SCRIPT_ + - ExternalData_LINK_CONTENT + - ExternalData_NO_SYMLINKS + - ExternalData_OBJECT_STORES + - ExternalData_SERIES_PARSE + - ExternalData_SERIES_PARSE_PREFIX + - ExternalData_SERIES_PARSE_NUMBER + - ExternalData_SERIES_PARSE_SUFFIX + - ExternalData_SERIES_MATCH + - ExternalData_SOURCE_ROOT + - ExternalData_TIMEOUT_ABSOLUTE + - ExternalData_TIMEOUT_INACTIVITY + - ExternalData_URL_ALGO__ + - ExternalData_URL_TEMPLATES + - ExternalData_CUSTOM_LOCATION + - ExternalData_CUSTOM_FILE + - ExternalData_CUSTOM_ERROR + # - FindXXX module "standard" variables + - _INCLUDE_DIRS + - _LIBRARIES + - _LIBRARY_DIRS + - _VERSION_STRING + # - FindDoxygen + - DOXYGEN_ + # - FindPkgConfig + - PKG_CONFIG_EXECUTABLE + - PKG_CONFIG_VERSION_STRING + - PKG_CONFIG_USE_CMAKE_PREFIX_PATH + # - FindThreads + - CMAKE_THREAD_LIBS_INIT + - CMAKE_USE_SPROC_INIT + - CMAKE_USE_WIN32_THREADS_INIT + - CMAKE_USE_PTHREADS_INIT + - CMAKE_HP_PTHREADS_INIT + - CMAKE_THREAD_PREFER_PTHREAD + - THREADS_PREFER_PTHREAD_FLAG + # - GNUInstallDirs + - CMAKE_INSTALL_BINDIR + - CMAKE_INSTALL_FULL_BINDIR + - CMAKE_INSTALL_SBINDIR + - CMAKE_INSTALL_FULL_SBINDIR + - CMAKE_INSTALL_LIBEXECDIR + - CMAKE_INSTALL_FULL_LIBEXECDIR + - CMAKE_INSTALL_SYSCONFDIR + - CMAKE_INSTALL_FULL_SYSCONFDIR + - CMAKE_INSTALL_SHAREDSTATEDIR + - CMAKE_INSTALL_FULL_SHAREDSTATEDIR + - CMAKE_INSTALL_LOCALSTATEDIR + - CMAKE_INSTALL_FULL_LOCALSTATEDIR + - CMAKE_INSTALL_RUNSTATEDIR + - CMAKE_INSTALL_FULL_RUNSTATEDIR + - CMAKE_INSTALL_LIBDIR + - CMAKE_INSTALL_FULL_LIBDIR + - CMAKE_INSTALL_INCLUDEDIR + - CMAKE_INSTALL_FULL_INCLUDEDIR + - CMAKE_INSTALL_OLDINCLUDEDIR + - CMAKE_INSTALL_FULL_OLDINCLUDEDIR + - CMAKE_INSTALL_DATAROOTDIR + - CMAKE_INSTALL_FULL_DATAROOTDIR + - CMAKE_INSTALL_DATADIR + - CMAKE_INSTALL_FULL_DATADIR + - CMAKE_INSTALL_INFODIR + - CMAKE_INSTALL_FULL_INFODIR + - CMAKE_INSTALL_LOCALEDIR + - CMAKE_INSTALL_FULL_LOCALEDIR + - CMAKE_INSTALL_MANDIR + - CMAKE_INSTALL_FULL_MANDIR + - CMAKE_INSTALL_DOCDIR + - CMAKE_INSTALL_FULL_DOCDIR + # - InstallRequiredSystemLibraries + - CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS + - CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP + - CMAKE_INSTALL_DEBUG_LIBRARIES + - CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY + - CMAKE_INSTALL_UCRT_LIBRARIES + - CMAKE_INSTALL_MFC_LIBRARIES + - CMAKE_INSTALL_OPENMP_LIBRARIES + - CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION + - CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS + - CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT + # - TestForANSIForScope + - CMAKE_NO_ANSI_FOR_SCOPE + # - TestForANSIStreamHeaders + - CMAKE_NO_ANSI_STREAM_HEADERS + # - TestForSSTREAM + - CMAKE_NO_ANSI_STRING_STREAM + # - TestForSTDNamespace + - CMAKE_NO_STD_NAMESPACE + # - UseSWIG + - CMAKE_SWIG_FLAGS + - CMAKE_SWIG_OUTDIR + - SWIG_MODULE__EXTRA_DEPS + +scripting-commands: + - + name: break + nulary?: true + - + name: cmake_host_system_information + named-args: [RESULT, QUERY] + special-args: [ + NUMBER_OF_LOGICAL_CORES + , NUMBER_OF_PHYSICAL_CORES + , HOSTNAME + , FQDN + , TOTAL_VIRTUAL_MEMORY + , AVAILABLE_VIRTUAL_MEMORY + , TOTAL_PHYSICAL_MEMORY + , AVAILABLE_PHYSICAL_MEMORY + # Since 3.10 + , IS_64BIT + , HAS_FPU + , HAS_MMX + , HAS_MMX_PLUS + , HAS_SSE + , HAS_SSE2 + , HAS_SSE_FP + , HAS_SSE_MMX + , HAS_AMD_3DNOW + , HAS_AMD_3DNOW_PLUS + , HAS_IA64 + , HAS_SERIAL_NUMBER + , PROCESSOR_SERIAL_NUMBER + , PROCESSOR_NAME + , PROCESSOR_DESCRIPTION + , OS_NAME + , OS_RELEASE + , OS_VERSION + , OS_PLATFORM + ] + - + name: cmake_minimum_required + named-args: [VERSION, FATAL_ERROR] + - + name: cmake_parse_arguments + named-args: [PARSE_ARGV] + - + name: cmake_policy + named-args: [GET, SET, PUSH, POP, VERSION] + special-args: [OLD, NEW] + - + name: configure_file + named-args: [COPYONLY, ESCAPE_QUOTES, "@ONLY", NEWLINE_STYLE] + special-args: [UNIX, DOS, WIN32, LF, CRLF] + - + name: continue + nulary?: true + - + name: elseif + named-args: &if [ + NOT + , AND + , OR + , POLICY + , TARGET + , TEST + , EXISTS + , IS_NEWER_THAN + , IS_NEWER_THAN + , IS_DIRECTORY + , IS_SYMLINK + , IS_ABSOLUTE + , MATCHES + , LESS + , GREATER + , EQUAL + , LESS_EQUAL + , GREATER_EQUAL + , STRLESS + , STRGREATER + , STREQUAL + , STRLESS_EQUAL + , STRGREATER_EQUAL + , VERSION_LESS + , VERSION_GREATER + , VERSION_EQUAL + , VERSION_LESS_EQUAL + , VERSION_GREATER_EQUAL + , IN_LIST + , DEFINED + ] + nested-parentheses?: true + - + name: else + nulary?: true + - + name: endforeach + nulary?: true + - + name: endfunction + nulary?: true + - + name: endif + nulary?: true + - + name: endmacro + nulary?: true + - + name: endwhile + nulary?: true + - + name: execute_process + named-args: [ + COMMAND + , WORKING_DIRECTORY + , TIMEOUT + , RESULT_VARIABLE + , RESULTS_VARIABLE # Since 3.10 + , OUTPUT_VARIABLE + , ERROR_VARIABLE + , INPUT_FILE + , OUTPUT_FILE + , ERROR_FILE + , OUTPUT_QUIET + , ERROR_QUIET + , OUTPUT_STRIP_TRAILING_WHITESPACE + , ERROR_STRIP_TRAILING_WHITESPACE + , ENCODING + ] + special-args: [NONE, AUTO, ANSI, OEM, UTF8] + - + name: file + named-args: [ + WRITE + , APPEND + , TOUCH # Since 3.12 + , TOUCH_NOCREATE # Since 3.12 + , READ + , OFFSET + , LIMIT + , HEX + , STRINGS + , LENGTH_MAXIMUM + , LENGTH_MINIMUM + , LIMIT_COUNT + , LIMIT_INPUT + , LIMIT_OUTPUT + , NEWLINE_CONSUME + , NO_HEX_CONVERSION + , REGEX + , ENCODING + , MD5 + , SHA1 + , SHA224 + , SHA256 + , SHA384 + , SHA512 + , SHA3_224 + , SHA3_256 + , SHA3_384 + , SHA3_512 + , GLOB + , GLOB_RECURSE + , LIST_DIRECTORIES + , RELATIVE + , CONFIGURE_DEPENDS # Since 3.12 + , FOLLOW_SYMLINKS + , RENAME + , REMOVE + , REMOVE_RECURSE + , MAKE_DIRECTORY + , RELATIVE_PATH + , TO_CMAKE_PATH + , TO_NATIVE_PATH + , DOWNLOAD + , UPLOAD + , INACTIVITY_TIMEOUT + , LOG + , SHOW_PROGRESS + , STATUS + , TIMEOUT + , USERPWD + , HTTPHEADER + , EXPECTED_HASH + , EXPECTED_MD5 + , TLS_VERIFY + , TLS_CAINFO + , TIMESTAMP + , UTC + , GENERATE + , OUTPUT + , INPUT + , CONTENT + , CONDITION + , COPY + , INSTALL + , DESTINATION + , FILE_PERMISSIONS + , DIRECTORY_PERMISSIONS + , NO_SOURCE_PERMISSIONS + , USE_SOURCE_PERMISSIONS + , FILES_MATCHING + , PATTERN + , REGEX + , EXCLUDE + , PERMISSIONS + , LOCK + , DIRECTORY + , RELEASE + , GUARD + , RESULT_VARIABLE + , TIMEOUT + # Sub-options of UPLOAD/DOWNLOAD since 3.11 + , NETRC + , NETRC_FILE + ] + special-args: [ + UTF-8 + , UTF-16LE + , UTF-16BE + , UTF-32LE + , UTF-32B + , FUNCTION + , FILE + , PROCESS + , OWNER_READ + , OWNER_WRITE + , OWNER_EXECUTE + , GROUP_READ + , GROUP_WRITE + , GROUP_EXECUTE + , WORLD_READ + , WORLD_WRITE + , WORLD_EXECUTE + , SETUID + , SETGID + , IGNORED # NETRC options since 3.11 + , OPTIONAL + , REQUIRED + ] + - + name: find_file + named-args: &find_file [ + NAMES + , HINTS + , PATHS + , PATH_SUFFIXES + , DOC + , NO_DEFAULT_PATH + , NO_PACKAGE_ROOT_PATH + , NO_CMAKE_PATH + , NO_CMAKE_ENVIRONMENT_PATH + , NO_SYSTEM_ENVIRONMENT_PATH + , NO_CMAKE_SYSTEM_PATH + , CMAKE_FIND_ROOT_PATH_BOTH + , ONLY_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_FIND_ROOT_PATH + ] + - + name: find_library + named-args: &find_library [ + NAMES + , NAMES_PER_DIR + , HINTS + , PATHS + , PATH_SUFFIXES + , DOC + , NO_DEFAULT_PATH + , NO_PACKAGE_ROOT_PATH + , NO_CMAKE_PATH + , NO_CMAKE_ENVIRONMENT_PATH + , NO_SYSTEM_ENVIRONMENT_PATH + , NO_CMAKE_SYSTEM_PATH + , CMAKE_FIND_ROOT_PATH_BOTH + , ONLY_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_FIND_ROOT_PATH + ] + - + name: find_package + named-args: [ + EXACT + , QUIET + , MODULE + , REQUIRED + , COMPONENTS + , OPTIONAL_COMPONENTS + , NO_POLICY_SCOPE + , CONFIG + , NO_MODULE + , NAMES + , CONFIGS + , HINTS + , PATHS + , PATH_SUFFIXES + , NO_DEFAULT_PATH + , NO_PACAKGE_ROOT_PATH + , NO_CMAKE_PATH + , NO_CMAKE_ENVIRONMENT_PATH + , NO_SYSTEM_ENVIRONMENT_PATH + , NO_CMAKE_PACKAGE_REGISTRY + , NO_CMAKE_SYSTEM_PATH + , NO_CMAKE_SYSTEM_PACKAGE_REGISTRY + , CMAKE_FIND_ROOT_PATH_BOTH + , ONLY_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_FIND_ROOT_PATH + ] + - + name: find_path + named-args: *find_file + - + name: find_program + named-args: *find_library + - + name: foreach + named-args: [RANGE, IN, LISTS, ITEMS] + - + name: function + - + name: get_cmake_property + property-args: [global-properties] + - + name: get_directory_property + named-args: [DIRECTORY, DEFINITION] + property-args: &get_directory_property [directory-properties] + - + name: get_filename_component + named-args: [DIRECTORY, NAME, EXT, NAME_WE, PATH, CACHE, BASE_DIR, ABSOLUTE, REALPATH, PROGRAM, PROGRAM_ARGS] + - + name: get_property + named-args: [GLOBAL, DIRECTORY, TARGET, SOURCE, INSTALL, TEST, CACHE, VARIABLE, PROPERTY, SET, DEFINED, BRIEF_DOCS, FULL_DOCS] + property-args: &get-property [ + global-properties + , directory-properties + , target-properties + , test-properties + , source-properties + , cache-properties + , install-properties + ] + - + name: if + named-args: *if + nested-parentheses?: true + - + name: include + named-args: [OPTIONAL, RESULT_VARIABLE, NO_POLICY_SCOPE] + - + # Since 3.10 + name: include_guard + named-args: [DIRECTORY, GLOBAL] + - + name: list + named-args: [ + LENGTH + , GET + , APPEND + , FILTER + , INCLUDE + , EXCLUDE + , REGEX + , FIND + , INSERT + , REMOVE_ITEM + , REMOVE_AT + , REMOVE_DUPLICATES + , REVERSE + , SORT + # Since 3.13 + , COMPARE + , CASE + , ORDER + # Since 3.12 + , JOIN + , SUBLIST + , TRANSFORM + # `TRANSFORM`'s actions + # NOTE Another `APPEND` named arg has already added + , PREPEND + , TOLOWER + , TOLOWER + , STRIP + , GENEX_STRIP + , REPLACE + # `TRANSFORM`'s selectors + , AT + , FOR + # NOTE Another `REGEX` named arg has already added + , OUTPUT_VARIABLE + ] + # Since 3.13 + special-args: [STRING, FILE_BASENAME, SENSITIVE, INSENSITIVE, ASCENDING, DESCENDING] + - + name: macro + - + name: mark_as_advanced + named-args: [CLEAR, FORCE] + - + name: math + named-args: [ + EXPR + , OUTPUT_FORMAT # Since 3.13 + ] + # Since 3.13 + special-args: [DECIMAL, HEXADECIMAL] + - + name: message + named-args: [STATUS, WARNING, AUTHOR_WARNING, SEND_ERROR, FATAL_ERROR, DEPRECATION] + - + name: option + - + name: return + nulary?: true + - + name: separate_arguments + named-args: [NATIVE_COMMAND, UNIX_COMMAND, WINDOWS_COMMAND] + - + name: set_directory_properties + named-args: [PROPERTIES] + property-args: *get-property + - + name: set_property + named-args: [GLOBAL, DIRECTORY, TARGET, DIRECTORY, SOURCE, INSTALL, TEST, CACHE, VARIABLE, APPEND, APPEND_STRING, PROPERTY] + property-args: *get-property + - + name: set + named-args: [PARENT_SCOPE, CACHE, FORCE] + special-args: [BOOL, FILEPATH, PATH, STRING, INTERNAL, STATIC] + - + name: site_name + - + name: string + named-args: [ + FIND + , REVERSE + , REPLACE + , REGEX + , MATCH + , MATCHALL + , APPEND + , PREPEND # Since 3.10 + , CONCAT + , JOIN # Since 3.12 + , TOLOWER + , TOUPPER + , LENGTH + , SUBSTRING + , STRIP + , GENEX_STRIP + , COMPARE + , LESS + , GREATER + , EQUAL + , NOTEQUAL + , LESS_EQUAL + , GREATER_EQUAL + , MD5 + , SHA1 + , SHA224 + , SHA256 + , SHA384 + , SHA512 + , SHA3_224 + , SHA3_256 + , SHA3_384 + , SHA3_512 + , ASCII + , CONFIGURE + , "@ONLY" + , ESCAPE_QUOTES + , RANDOM + , LENGTH + , ALPHABET + , RANDOM_SEED + , TIMESTAMP + , UTC + , MAKE_C_IDENTIFIER + , UUID + , NAMESPACE + , NAME + , TYPE + , UPPER + ] + - + name: unset + named-args: [CACHE, PARENT_SCOPE] + - + name: variable_watch + - + name: while + named-args: *if + nested-parentheses?: true + +project-commands: + - + name: add_compile_definitions # Since 3.12 + - + name: add_compile_options + - + name: add_custom_command + named-args: [ + OUTPUT + , COMMAND + , ARGS + , MAIN_DEPENDENCY + , DEPENDS + , BYPRODUCTS + , IMPLICIT_DEPENDS + , WORKING_DIRECTORY + , COMMENT + , DEPFILE + , VERBATIM + , APPEND + , USES_TERMINAL + , COMMAND_EXPAND_LISTS + , TARGET + , PRE_BUILD + , PRE_LINK + , POST_BUILD + ] + - + name: add_custom_target + named-args: [ + ALL + , COMMAND + , DEPENDS + , BYPRODUCTS + , IMPLICIT_DEPENDS + , WORKING_DIRECTORY + , COMMENT + , DEPFILE + , VERBATIM + , APPEND + , USES_TERMINAL + , COMMAND_EXPAND_LISTS + , SOURCES + ] + - + name: add_definitions + - + name: add_dependencies + - + name: add_executable + named-args: [WIN32, MACOSX_BUNDLE, EXCLUDE_FROM_ALL, IMPORTED, GLOBAL, ALIAS] + - + name: add_library + named-args: [STATIC, SHARED, MODULE, OBJECT, EXCLUDE_FROM_ALL, IMPORTED, UNKNOWN, GLOBAL, ALIAS, INTERFACE] + - + name: add_link_options + - + name: add_subdirectory + named-args: [EXCLUDE_FROM_ALL] + - + name: add_test + named-args: [NAME, COMMAND, CONFIGURATIONS, WORKING_DIRECTORY] + - + name: aux_source_directory + - + name: build_command + named-args: [CONFIGURATION, TARGET] + - + name: create_test_sourcelist + named-args: [EXTRA_INCLUDE, FUNCTION] + - + name: define_property + named-args: [GLOBAL, DIRECTORY, DIRECTORY, SOURCE, TEST, VARIABLE, CACHED_VARIABLE, PROPERTY, INHERITED, BRIEF_DOCS, FULL_DOCS] + property-args: *get-property + - + name: enable_language + named-args: [OPTIONAL] + special-args: [C, CXX, RC, Fortran] + - + name: enable_testing + - + name: export + named-args: [EXPORT, NAMESPACE, FILE, TARGETS, APPEND, EXPORT_LINK_INTERFACE_LIBRARIES, ANDROID_MK] + - + name: fltk_wrap_ui + - + name: get_source_file_property + property-args: &get_source_file_property [source-properties] + - + name: get_target_property + property-args: &get_target_property [target-properties] + - + name: get_test_property + property-args: &get_test_property [test-properties] + - + name: include_directories + named-args: [AFTER, BEFORE, SYSTEM] + - + name: include_external_msproject + named-args: [TYPE, GUID, PLATFORM] + - + name: include_regular_expression + - + name: install + named-args: [ + # Common + DESTINATION + , PERMISSIONS + , CONFIGURATIONS + , COMPONENT + , NAMELINK_COMPONENT # Since 3.12 + , EXCLUDE_FROM_ALL + , RENAME + , OPTIONAL + # Installing Targets + , TARGETS + , EXPORT + , ARCHIVE + , LIBRARY + , RUNTIME + , OBJECTS + , FRAMEWORK + , BUNDLE + , PRIVATE_HEADER + , PUBLIC_HEADER + , RESOURCE + , INCLUDES + , NAMELINK_ONLY + , NAMELINK_SKIP + # Installing Files + , FILES + , PROGRAMS + # Installing Directories + , DIRECTORY + , FILE_PERMISSIONS + , DIRECTORY_PERMISSIONS + , USE_SOURCE_PERMISSIONS + , MESSAGE_NEVER + , FILES_MATCHING + , PATTERN + , REGEX + , EXCLUDE + # Custom Installation Logic + , SCRIPT + , CODE + # Installing Exports + , NAMESPACE + , FILE + , EXPORT_ANDROID_MK + , EXPORT_LINK_INTERFACE_LIBRARIES + ] + special-args: &valid_permissions [ + OWNER_READ + , OWNER_WRITE + , OWNER_EXECUTE + , GROUP_READ + , GROUP_WRITE + , GROUP_EXECUTE + , WORLD_READ + , WORLD_WRITE + , WORLD_EXECUTE + , SETUID + , SETGID + ] + - + name: link_directories + named-args: [AFTER, BEFORE] + - + name: link_libraries + named-args: [debug, optimized, general] + - + name: load_cache + named-args: [READ_WITH_PREFIX, EXCLUDE, INCLUDE_INTERNALS] + - + name: project + named-args: [ + VERSION + , DESCRIPTION # Since 3.8 or 3.9 (?) + , HOMEPAGE_URL # Since 3.12 + , LANGUAGES + ] + special-args: [NONE, C, CXX, RC, CUDA, Fortran, ASM] + - + name: qt_wrap_cpp + - + name: qt_wrap_ui + - + name: remove_definitions + - + name: set_source_files_properties + named-args: [PROPERTIES] + property-args: *get_source_file_property + - + name: set_target_properties + named-args: [PROPERTIES] + property-args: *get_target_property + - + name: set_tests_properties + named-args: [PROPERTIES] + property-args: *get_test_property + - + name: source_group + named-args: [FILES, REGULAR_EXPRESSION, TREE, PREFIX] + - + name: target_compile_definitions + named-args: &target_compile_definitions [INTERFACE, PUBLIC, PRIVATE] + - + name: target_compile_features + named-args: *target_compile_definitions + special-args: [ + # CMAKE_CXX_KNOWN_FEATURES + cxx_std_98 + , cxx_std_11 + , cxx_std_14 + , cxx_std_17 + , cxx_std_20 # Since 3.12 + , cxx_aggregate_default_initializers + , cxx_alias_templates + , cxx_alignas + , cxx_alignof + , cxx_attributes + , cxx_attribute_deprecated + , cxx_auto_type + , cxx_binary_literals + , cxx_constexpr + , cxx_contextual_conversions + , cxx_decltype_incomplete_return_types + , cxx_decltype + , cxx_decltype_auto + , cxx_default_function_template_args + , cxx_defaulted_functions + , cxx_defaulted_move_initializers + , cxx_delegating_constructors + , cxx_deleted_functions + , cxx_digit_separators + , cxx_enum_forward_declarations + , cxx_explicit_conversions + , cxx_extended_friend_declarations + , cxx_extern_templates + , cxx_final + , cxx_func_identifier + , cxx_generalized_initializers + , cxx_generic_lambdas + , cxx_inheriting_constructors + , cxx_inline_namespaces + , cxx_lambdas + , cxx_lambda_init_captures + , cxx_local_type_template_args + , cxx_long_long_type + , cxx_noexcept + , cxx_nonstatic_member_init + , cxx_nullptr + , cxx_override + , cxx_range_for + , cxx_raw_string_literals + , cxx_reference_qualified_functions + , cxx_relaxed_constexpr + , cxx_return_type_deduction + , cxx_right_angle_brackets + , cxx_rvalue_references + , cxx_sizeof_member + , cxx_static_assert + , cxx_strong_enums + , cxx_thread_local + , cxx_trailing_return_types + , cxx_unicode_literals + , cxx_uniform_initialization + , cxx_unrestricted_unions + , cxx_user_literals + , cxx_variable_templates + , cxx_variadic_macros + , cxx_variadic_templates + , cxx_template_template_parameters + # CMAKE_C_KNOWN_FEATURES + , c_std_90 + , c_std_99 + , c_std_11 + , c_function_prototypes + , c_restrict + , c_static_assert + , c_variadic_macros + ] + - + name: target_compile_options + named-args: &target_compile_options [BEFORE, INTERFACE, PUBLIC, PRIVATE] + - + name: target_include_directories + named-args: [BEFORE, SYSTEM, INTERFACE, PUBLIC, PRIVATE] + - + # Since 3.13 + name: target_link_directories + named-args: *target_compile_options + - + name: target_link_libraries + named-args: *target_compile_definitions + - + name: target_link_options + named-args: *target_compile_definitions + - + name: target_sources + named-args: *target_compile_definitions + - + name: try_compile + named-args: [ + RESULT_VAR + , CMAKE_FLAGS + , OUTPUT_VARIABLE + , SOURCES + , COMPILE_DEFINITIONS + , LINK_LIBRARIES + , COPY_FILE + , COPY_FILE_ERROR + , _STANDARD + , _STANDARD_REQUIRED + , _EXTENSIONS + ] + - + name: try_run + named-args: [ + RUN_RESULT_VAR + , COMPILE_RESULT_VAR + , CMAKE_FLAGS + , COMPILE_DEFINITIONS + , LINK_LIBRARIES + , COMPILE_OUTPUT_VARIABLE + , RUN_OUTPUT_VARIABLE + , OUTPUT_VARIABLE + , ARGS + ] + +ctest-commands: + - + name: ctest_build + named-args: [BUILD, APPEND, CONFIGURATION, FLAGS, PROJECT_NAME, TARGET, NUMBER_ERRORS, NUMBER_WARNINGS, RETURN_VALUE, CAPTURE_CMAKE_ERROR] + - + name: ctest_configure + named-args: [BUILD, SOURCE, APPEND, OPTIONS, RETURN_VALUE, QUIET, CAPTURE_CMAKE_ERROR] + - + name: ctest_coverage + named-args: [BUILD, LABELS, APPEND, RETURN_VALUE, CAPTURE_CMAKE_ERROR, QUIET] + - + name: ctest_empty_binary_directory + - + name: ctest_memcheck + named-args: [ + BUILD + , APPEND + , START + , END + , STRIDE + , EXCLUDE + , INCLUDE + , EXCLUDE_LABEL + , INCLUDE_LABEL + , EXCLUDE_FIXTURE + , EXCLUDE_FIXTURE_SETUP + , EXCLUDE_FIXTURE_CLEANUP + , PARALLEL_LEVEL + , TEST_LOAD + , SCHEDULE_RANDOM + , STOP_TIME + , RETURN_VALUE + , DEFECT_COUNT + , QUIET + ] + - + name: ctest_read_custom_files + - + name: ctest_run_script + named-args: [NEW_PROCESS, RETURN_VALUE] + - + name: ctest_sleep + - + name: ctest_start + named-args: [TRACK, APPEND, QUIET] + - + name: ctest_submit + named-args: [PARTS, FILES, HTTPHEADER, RETRY_COUNT, RETRY_DELAY, RETURN_VALUE, QUIET, CDASH_UPLOAD, CDASH_UPLOAD_TYPE] + - + name: ctest_test + named-args: [ + BUILD + , APPEND + , START + , END + , STRIDE + , EXCLUDE + , INCLUDE + , EXCLUDE_LABEL + , INCLUDE_LABEL + , EXCLUDE_FIXTURE + , EXCLUDE_FIXTURE_SETUP + , EXCLUDE_FIXTURE_CLEANUP + , PARALLEL_LEVEL + , TEST_LOAD + , SCHEDULE_RANDOM + , STOP_TIME + , RETURN_VALUE + , CAPTURE_CMAKE_ERROR + , QUIET + ] + - + name: ctest_update + named-args: [SOURCE, RETURN_VALUE, QUIET] + - + name: ctest_upload + named-args: [FILES, CAPTURE_CMAKE_ERROR, QUIET] diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py new file mode 100644 index 00000000000..61f60a682d6 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Generate Kate syntax file for CMake +# +# Copyright (c) 2017, Alex Turbov +# +# To install prerequisites: +# +# $ pip install --user click jinja2 yaml +# +# To use: +# +# $ ./generate-cmake-syntax.py cmake.yaml > ../syntax/cmake.xml +# +import click +import jinja2 +import pathlib +import re +import yaml + +import pprint + + +_TEMPLATED_NAME = re.compile('<[^>]+>') +_PROPERTY_KEYS = [ + 'global-properties' + , 'directory-properties' + , 'target-properties' + , 'source-properties' + , 'test-properties' + , 'cache-properties' + , 'install-properties' + ] +_KW_RE_LIST = ['kw', 're'] + + +def try_transform_placeholder_string_to_regex(name): + ''' + NOTE Some placeholders are not IDs, but numbers... + `CMAKE_MATCH_` 4 example + ''' + m = _TEMPLATED_NAME.split(name) + if 'CMAKE_MATCH_' in m: + return '\\bCMAKE_MATCH_[0-9]+\\b' + + return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name + + +def partition_iterable(fn, iterable): + true, false = [], [] + for i in iterable: + (false, true)[int(fn(i))].append(i) + return true, false + + +def _transform_command_set(cmd, list_name): + args, args_re = partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, cmd[list_name]) + del cmd[list_name] + list_name = list_name.replace('-', '_') + + cmd[list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [args, args_re])} + cmd[list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), args_re)] + + return cmd + + +def transform_command(cmd): + can_be_nulary = True + + if 'name' not in cmd: + raise RuntimeError('Command have no name') + + if 'named-args' in cmd: + new_cmd = _transform_command_set(cmd, 'named-args') + assert new_cmd == cmd + can_be_nulary = False + + if 'special-args' in cmd: + new_cmd = _transform_command_set(cmd, 'special-args') + assert new_cmd == cmd + can_be_nulary = False + + if 'property-args' in cmd: + new_cmd = _transform_command_set(cmd, 'property-args') + assert new_cmd == cmd + can_be_nulary = False + + cmd['nested_parentheses'] = cmd['nested-parentheses?'] if 'nested-parentheses?' in cmd else False + + if 'nulary?' in cmd and cmd['nulary?'] and not can_be_nulary: + raise RuntimeError('Command `{}` w/ args declared nulary!?'.format(cmd['name'])) + + return cmd + + +#BEGIN Jinja filters + +def cmd_is_nulary(cmd): + assert not ('named-args' in cmd or 'special-args' in cmd or 'property-args' in cmd) + return 'nulary?' in cmd and cmd['nulary?'] + +#END Jinja filters + + +@click.command() +@click.argument('input_yaml', type=click.File('r')) +@click.argument('template', type=click.File('r'), default='./cmake.xml.tpl') +def cli(input_yaml, template): + data = yaml.load(input_yaml) + + # Partition `variables` list into "pure" words and regexes to match + data['variables'] = { + k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data['variables'])]) + } + data['variables']['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), data['variables']['re'])] + + # Transform properties and make all-properties list + data['properties'] = {} + for prop in _PROPERTY_KEYS: + python_prop_list_name = prop.replace('-', '_') + props, props_re = partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[prop]) + del data[prop] + + data['properties'][python_prop_list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])} + data['properties'][python_prop_list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)] + + + data['properties']['kinds'] = [*map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS)] + + # Make all commands list + data['commands'] = [*map(lambda cmd: transform_command(cmd), data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])] + + data['generator_expressions'] = data['generator-expressions'] + + + env = jinja2.Environment( + keep_trailing_newline=True + ) + + # Register convenience filters + env.tests['nulary'] = cmd_is_nulary + + tpl = env.from_string(template.read()) + result = tpl.render(data) + print(result) + + +if __name__ == '__main__': + cli() + # TODO Handle execptions and show errors diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl new file mode 100644 index 00000000000..c8274aab582 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl + +# This perl script read stdin and write on stdout. It shall be an XML language file. +# +# * If the name of the language is 'HTML', then it creates the language 'PHP (HTML)' +# which shall be used for PHP hl. +# +# * If the name of the language is something else (say '*'), it creates the language '*/PHP'. +# This new language is the same as the old one, but is able to detect PHP everywhere. +# +# This script will correctly set extensions & mimetype, and will replace +# by +# +# Generated languages need a language named 'PHP/PHP', which shall take care of PHP hl itself +# and which will be called every time something like +# License: LGPL + +my $file = ""; + +while (<>) +{ + $file .= $_; +} + +$warning = "\n\n\n"; + +$file =~ s/(?=]+name="HTML"/) +{ + $root = 1; +} + +if ($root == 1) +{ + $file =~ s/]+)name="[^"]*"/]+)section="[^"]*"/]+)extensions="[^"]*"/]+)mimetype="[^"]*"/]+)name="([^"]*)"/ - <html><head/><body> -<p>Highlight definitions are provided by the <a href="http://kate-editor.org/">Kate Text Editor</a>.</p></body></html> + <html><head/><body><p>Highlight definitions are provided by the <a href="https://api.kde.org/frameworks/syntax-highlighting/html/index.html">KSyntaxHighlighting</a> engine.</p></body></html> Qt::RichText @@ -62,6 +61,37 @@ Syntax Highlight Definition Files + + + + + + Update Definitions + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -69,7 +99,7 @@ - Location: + User Highlight Definition Files @@ -80,48 +110,22 @@ - - - - 0 - - - - - Use fallback location - - - - - - - - - - - Behavior - - - - - - - - Ignored file patterns: - - - - - - - - - - + + + + + Ignored file patterns: + + + + + + + @@ -151,7 +155,6 @@ - useFallbackLocation ignoreEdit diff --git a/src/plugins/texteditor/highlighterutils.cpp b/src/plugins/texteditor/highlighterutils.cpp deleted file mode 100644 index 9b7332823b2..00000000000 --- a/src/plugins/texteditor/highlighterutils.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "highlighterutils.h" -#include "generichighlighter/highlighter.h" -#include "generichighlighter/highlightdefinition.h" -#include "generichighlighter/manager.h" -#include -#include - -using namespace TextEditor; -using namespace Internal; - -void TextEditor::setMimeTypeForHighlighter(Highlighter *highlighter, const Utils::MimeType &mimeType, - const QString &filePath, QString *foundDefinitionId) -{ - QString definitionId = Manager::instance()->definitionIdByMimeTypeAndFile(mimeType, filePath); - if (!definitionId.isEmpty()) { - const QSharedPointer &definition = - Manager::instance()->definition(definitionId); - if (!definition.isNull() && definition->isValid()) - highlighter->setDefaultContext(definition->initialContext()); - } - - if (foundDefinitionId) - *foundDefinitionId = definitionId; -} - diff --git a/src/plugins/texteditor/highlighterutils.h b/src/plugins/texteditor/highlighterutils.h deleted file mode 100644 index 57b62c07129..00000000000 --- a/src/plugins/texteditor/highlighterutils.h +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include -#include "texteditor_global.h" - -/* These functions were originally a part of TextEditor::Highlighter, - * but due to a very hackish test of that generic highlighter, - * there functions must be outside. */ - -namespace Utils { class MimeType; } - -namespace TextEditor { - -class Highlighter; - -void setMimeTypeForHighlighter(Highlighter *highlighter, const Utils::MimeType &mimeType, - const QString &filePath, - QString *foundDefinitionId = nullptr); - -} // namespace TextEditor diff --git a/src/plugins/texteditor/snippets/snippetprovider.cpp b/src/plugins/texteditor/snippets/snippetprovider.cpp index 0d5caa52297..be84ef8bdb1 100644 --- a/src/plugins/texteditor/snippets/snippetprovider.cpp +++ b/src/plugins/texteditor/snippets/snippetprovider.cpp @@ -25,7 +25,7 @@ #include "snippetprovider.h" -#include "texteditorplugin.h" +#include #include diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index 6b947c43751..32daaa503b7 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -29,10 +29,10 @@ #include "snippet.h" #include "snippetscollection.h" #include "snippetssettings.h" -#include "textdocument.h" #include "ui_snippetssettingspage.h" #include +#include #include #include #include diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index ef504447a5d..352c6091431 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -35,7 +35,6 @@ #include "texteditor.h" #include "texteditorconstants.h" #include "typingsettings.h" -#include #include #include #include @@ -340,9 +339,6 @@ void TextDocument::setTabSettings(const TabSettings &newTabSettings) return; d->m_tabSettings = newTabSettings; - if (auto highlighter = qobject_cast(d->m_highlighter)) - highlighter->setTabSettings(tabSettings()); - emit tabSettingsChanged(); } diff --git a/src/plugins/texteditor/textdocumentlayout.h b/src/plugins/texteditor/textdocumentlayout.h index f436b30d034..119dcb7e2c1 100644 --- a/src/plugins/texteditor/textdocumentlayout.h +++ b/src/plugins/texteditor/textdocumentlayout.h @@ -30,6 +30,8 @@ #include "textmark.h" #include "textdocument.h" +#include + #include #include @@ -133,6 +135,9 @@ public: CodeFormatterData *codeFormatterData() const { return m_codeFormatterData; } void setCodeFormatterData(CodeFormatterData *data); + KSyntaxHighlighting::State syntaxState() { return m_syntaxState; } + void setSyntaxState(KSyntaxHighlighting::State state) { m_syntaxState = state; } + private: TextMarks m_marks; int m_foldingIndent : 16; @@ -144,6 +149,7 @@ private: int m_additionalAnnotationHeight = 0; Parentheses m_parentheses; CodeFormatterData *m_codeFormatterData; + KSyntaxHighlighting::State m_syntaxState; }; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index 96cf099c5e3..aed04a3ba77 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -37,31 +37,27 @@ #include "circularclipboardassist.h" #include "codecselector.h" #include "completionsettings.h" -#include "highlighterutils.h" +#include "extraencodingsettings.h" +#include "highlighter.h" +#include "highlightersettings.h" #include "icodestylepreferences.h" #include "indenter.h" +#include "refactoroverlay.h" #include "snippets/snippet.h" +#include "storagesettings.h" #include "syntaxhighlighter.h" #include "tabsettings.h" #include "textdocument.h" #include "textdocumentlayout.h" #include "texteditorconstants.h" #include "texteditoroverlay.h" -#include "refactoroverlay.h" #include "texteditorsettings.h" #include "typingsettings.h" -#include "extraencodingsettings.h" -#include "storagesettings.h" #include #include #include #include -#include -#include -#include -#include -#include #include #include @@ -94,6 +90,7 @@ #include #include #include +#include #include #include #include @@ -847,17 +844,21 @@ TextEditorWidgetPrivate::~TextEditorWidgetPrivate() */ static void updateEditorInfoBar(TextEditorWidget *widget) { - Id infoSyntaxDefinition(Constants::INFO_SYNTAX_DEFINITION); + Id id(Constants::INFO_SYNTAX_DEFINITION); InfoBar *infoBar = widget->textDocument()->infoBar(); if (!widget->isMissingSyntaxDefinition()) { - infoBar->removeInfo(infoSyntaxDefinition); - } else if (infoBar->canInfoBeAdded(infoSyntaxDefinition)) { - InfoBarEntry info(infoSyntaxDefinition, + infoBar->removeInfo(id); + } else if (infoBar->canInfoBeAdded(id)) { + InfoBarEntry info(id, BaseTextEditor::tr("A highlight definition was not found for this file. " - "Would you like to try to find one?"), + "Would you like to update highlight definition files?"), InfoBarEntry::GlobalSuppressionEnabled); - info.setCustomButtonInfo(BaseTextEditor::tr("Show Highlighter Options..."), [widget]() { - ICore::showOptionsDialog(Constants::TEXT_EDITOR_HIGHLIGHTER_SETTINGS, widget); + info.setCustomButtonInfo(BaseTextEditor::tr("Update Definitions"), [id, widget]() { + widget->textDocument()->infoBar()->removeInfo(id); + Highlighter::updateDefinitions([widget = QPointer(widget)]() { + if (widget) + widget->configureGenericHighlighter(); + }); }); infoBar->addInfo(info); @@ -8463,37 +8464,30 @@ QString TextEditorWidget::textAt(int from, int to) const void TextEditorWidget::configureGenericHighlighter() { auto highlighter = new Highlighter(); - highlighter->setTabSettings(textDocument()->tabSettings()); textDocument()->setSyntaxHighlighter(highlighter); setCodeFoldingSupported(false); const QString type = textDocument()->mimeType(); const MimeType mimeType = Utils::mimeTypeForName(type); - if (mimeType.isValid()) { - d->m_isMissingSyntaxDefinition = true; + const QString fileName = textDocument()->filePath().fileName(); + KSyntaxHighlighting::Definition definition; + if (mimeType.isValid()) + definition = Highlighter::definitionForMimeType(mimeType.name()); + if (!definition.isValid()) + definition = Highlighter::definitionForFileName(fileName); - QString definitionId; - setMimeTypeForHighlighter(highlighter, mimeType, textDocument()->filePath().toString(), - &definitionId); + if (definition.isValid()) { + highlighter->setDefinition(definition); + d->m_isMissingSyntaxDefinition = false; + d->m_commentDefinition.singleLine = definition.singleLineCommentMarker(); + d->m_commentDefinition.multiLineStart = definition.multiLineCommentMarker().first; + d->m_commentDefinition.multiLineEnd = definition.multiLineCommentMarker().second; - if (!definitionId.isEmpty()) { - d->m_isMissingSyntaxDefinition = false; - const QSharedPointer &definition = - Manager::instance()->definition(definitionId); - if (!definition.isNull() && definition->isValid()) { - d->m_commentDefinition.isAfterWhiteSpaces = definition->isCommentAfterWhiteSpaces(); - d->m_commentDefinition.singleLine = definition->singleLineComment(); - d->m_commentDefinition.multiLineStart = definition->multiLineCommentStart(); - d->m_commentDefinition.multiLineEnd = definition->multiLineCommentEnd(); - - setCodeFoldingSupported(true); - } - } else { - const QString fileName = textDocument()->filePath().toString(); - if (TextEditorSettings::highlighterSettings().isIgnoredFilePattern(fileName)) - d->m_isMissingSyntaxDefinition = false; - } + setCodeFoldingSupported(true); + } else { + d->m_isMissingSyntaxDefinition = + !TextEditorSettings::highlighterSettings().isIgnoredFilePattern(fileName); } textDocument()->setFontSettings(TextEditorSettings::fontSettings()); @@ -8546,9 +8540,6 @@ void TextEditorWidget::setupGenericHighlighter() connect(textDocument(), &IDocument::filePathChanged, d, &TextEditorWidgetPrivate::reconfigure); - connect(Manager::instance(), &Manager::highlightingFilesRegistered, - d, &TextEditorWidgetPrivate::reconfigure); - updateEditorInfoBar(this); } diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index 6de9e934694..d5bf895ee47 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -34,23 +34,9 @@ SOURCES += texteditorplugin.cpp \ textindenter.cpp \ quickfix.cpp \ syntaxhighlighter.cpp \ - highlighterutils.cpp \ - generichighlighter/itemdata.cpp \ - generichighlighter/specificrules.cpp \ - generichighlighter/rule.cpp \ - generichighlighter/dynamicrule.cpp \ - generichighlighter/context.cpp \ - generichighlighter/includerulesinstruction.cpp \ - generichighlighter/progressdata.cpp \ - generichighlighter/keywordlist.cpp \ - generichighlighter/highlightdefinition.cpp \ - generichighlighter/highlighter.cpp \ - generichighlighter/manager.cpp \ - generichighlighter/highlightdefinitionhandler.cpp \ - generichighlighter/highlightersettingspage.cpp \ - generichighlighter/highlightersettings.cpp \ - generichighlighter/managedefinitionsdialog.cpp \ - generichighlighter/definitiondownloader.cpp \ + highlighter.cpp \ + highlightersettings.cpp \ + highlightersettingspage.cpp \ refactoringchanges.cpp \ refactoroverlay.cpp \ outlinefactory.cpp \ @@ -137,27 +123,9 @@ HEADERS += texteditorplugin.h \ textindenter.h \ quickfix.h \ syntaxhighlighter.h \ - highlighterutils.h \ - generichighlighter/reuse.h \ - generichighlighter/itemdata.h \ - generichighlighter/specificrules.h \ - generichighlighter/rule.h \ - generichighlighter/reuse.h \ - generichighlighter/dynamicrule.h \ - generichighlighter/context.h \ - generichighlighter/includerulesinstruction.h \ - generichighlighter/progressdata.h \ - generichighlighter/keywordlist.h \ - generichighlighter/highlighterexception.h \ - generichighlighter/highlightdefinition.h \ - generichighlighter/highlighter.h \ - generichighlighter/manager.h \ - generichighlighter/highlightdefinitionhandler.h \ - generichighlighter/highlightersettingspage.h \ - generichighlighter/highlightersettings.h \ - generichighlighter/managedefinitionsdialog.h \ - generichighlighter/highlightdefinitionmetadata.h \ - generichighlighter/definitiondownloader.h \ + highlighter.h \ + highlightersettings.h \ + highlightersettingspage.h \ refactoringchanges.h \ refactoroverlay.h \ outlinefactory.h \ @@ -223,14 +191,14 @@ FORMS += \ displaysettingspage.ui \ fontsettingspage.ui \ colorschemeedit.ui \ - generichighlighter/highlightersettingspage.ui \ - generichighlighter/managedefinitionsdialog.ui \ snippets/snippetssettingspage.ui \ behaviorsettingswidget.ui \ behaviorsettingspage.ui \ tabsettingswidget.ui \ completionsettingspage.ui \ - codestyleselectorwidget.ui + codestyleselectorwidget.ui \ + highlightersettingspage.ui + RESOURCES += texteditor.qrc equals(TEST, 1) { diff --git a/src/plugins/texteditor/texteditor.qbs b/src/plugins/texteditor/texteditor.qbs index 1e8b4c5be83..475e414dbc4 100644 --- a/src/plugins/texteditor/texteditor.qbs +++ b/src/plugins/texteditor/texteditor.qbs @@ -1,4 +1,6 @@ import qbs 1.0 +import qbs.FileInfo +import qbs.Environment Project { name: "TextEditor" @@ -9,10 +11,14 @@ Project { Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "printsupport"] } Depends { name: "Aggregation" } Depends { name: "Utils" } + Depends { name: "KSyntaxHighlighting" } + + Export { + Depends { name: "KSyntaxHighlighting" } + } Depends { name: "Core" } - cpp.includePaths: base.concat([path]) // Needed for the highlighterengine autotest. cpp.enableExceptions: true files: [ @@ -80,8 +86,13 @@ Project { "fontsettingspage.ui", "formattexteditor.cpp", "formattexteditor.h", - "highlighterutils.cpp", - "highlighterutils.h", + "highlighter.cpp", + "highlighter.h", + "highlightersettings.cpp", + "highlightersettings.h", + "highlightersettingspage.cpp", + "highlightersettingspage.h", + "highlightersettingspage.ui", "icodestylepreferences.cpp", "icodestylepreferences.h", "icodestylepreferencesfactory.cpp", @@ -197,50 +208,6 @@ Project { ] } - Group { - name: "GenericHighlighter" - prefix: "generichighlighter/" - files: [ - "context.cpp", - "context.h", - "definitiondownloader.cpp", - "definitiondownloader.h", - "dynamicrule.cpp", - "dynamicrule.h", - "highlightdefinition.cpp", - "highlightdefinition.h", - "highlightdefinitionhandler.cpp", - "highlightdefinitionhandler.h", - "highlightdefinitionmetadata.h", - "highlighter.cpp", - "highlighter.h", - "highlighterexception.h", - "highlightersettings.cpp", - "highlightersettings.h", - "highlightersettingspage.cpp", - "highlightersettingspage.h", - "highlightersettingspage.ui", - "includerulesinstruction.cpp", - "includerulesinstruction.h", - "itemdata.cpp", - "itemdata.h", - "keywordlist.cpp", - "keywordlist.h", - "managedefinitionsdialog.cpp", - "managedefinitionsdialog.h", - "managedefinitionsdialog.ui", - "manager.cpp", - "manager.h", - "progressdata.cpp", - "progressdata.h", - "reuse.h", - "rule.cpp", - "rule.h", - "specificrules.cpp", - "specificrules.h", - ] - } - Group { name: "Snippets" prefix: "snippets/" diff --git a/src/plugins/texteditor/texteditor_dependencies.pri b/src/plugins/texteditor/texteditor_dependencies.pri index 1bab312c8a8..c624e4cfb23 100644 --- a/src/plugins/texteditor/texteditor_dependencies.pri +++ b/src/plugins/texteditor/texteditor_dependencies.pri @@ -2,6 +2,7 @@ QTC_PLUGIN_NAME = TextEditor QTC_LIB_DEPENDS += \ aggregation \ extensionsystem \ - utils + utils \ + syntax-highlighting QTC_PLUGIN_DEPENDS += \ coreplugin diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index 5cacd941c47..e08ecbe75de 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -25,16 +25,16 @@ #include "texteditorplugin.h" -#include "texteditor.h" #include "findincurrentfile.h" #include "findinfiles.h" #include "findinopenfiles.h" #include "fontsettings.h" -#include "generichighlighter/manager.h" +#include "highlighter.h" #include "linenumberfilter.h" #include "outlinefactory.h" #include "plaintexteditorfactory.h" #include "snippets/snippetprovider.h" +#include "texteditor.h" #include "texteditoractionhandler.h" #include "texteditorsettings.h" @@ -144,9 +144,6 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe editor->editorWidget()->showContextMenu(); }); - // Generic highlighter. - connect(ICore::instance(), &ICore::coreOpened, Manager::instance(), &Manager::registerHighlightingFiles); - // Add text snippet provider. SnippetProvider::registerGroup(Constants::TEXT_SNIPPET_GROUP_ID, tr("Text", "SnippetProvider")); @@ -229,6 +226,12 @@ LineNumberFilter *TextEditorPlugin::lineNumberFilter() return &m_instance->d->lineNumberFilter; } +ExtensionSystem::IPlugin::ShutdownFlag TextEditorPlugin::aboutToShutdown() +{ + Highlighter::handleShutdown(); + return SynchronousShutdown; +} + void TextEditorPluginPrivate::updateSearchResultsFont(const FontSettings &settings) { if (auto window = SearchResultWindow::instance()) { diff --git a/src/plugins/texteditor/texteditorplugin.h b/src/plugins/texteditor/texteditorplugin.h index 297cde9a8b5..e5dba0f4ac3 100644 --- a/src/plugins/texteditor/texteditorplugin.h +++ b/src/plugins/texteditor/texteditorplugin.h @@ -44,6 +44,8 @@ public: static TextEditorPlugin *instance(); static LineNumberFilter *lineNumberFilter(); + ShutdownFlag aboutToShutdown() override; + private: bool initialize(const QStringList &arguments, QString *errorMessage) final; void extensionsInitialized() final; diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index c6b1710c7c9..78cea2b828b 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -25,23 +25,24 @@ #include "texteditorsettings.h" -#include "fontsettings.h" -#include "texteditor.h" #include "behaviorsettings.h" #include "behaviorsettingspage.h" #include "completionsettings.h" -#include "marginsettings.h" +#include "completionsettingspage.h" #include "displaysettings.h" #include "displaysettingspage.h" -#include "fontsettingspage.h" -#include "typingsettings.h" -#include "storagesettings.h" -#include "tabsettings.h" #include "extraencodingsettings.h" +#include "fontsettings.h" +#include "fontsettingspage.h" +#include "highlightersettingspage.h" #include "icodestylepreferences.h" #include "icodestylepreferencesfactory.h" -#include "completionsettingspage.h" -#include +#include "marginsettings.h" +#include "storagesettings.h" +#include "tabsettings.h" +#include "texteditor.h" +#include "typingsettings.h" + #include #include diff --git a/src/share/3rdparty/data.pro b/src/share/3rdparty/data.pro index 17ad36c8d2e..3c3ab29bcdb 100644 --- a/src/share/3rdparty/data.pro +++ b/src/share/3rdparty/data.pro @@ -7,7 +7,6 @@ STATIC_OUTPUT_BASE = $$IDE_DATA_PATH STATIC_INSTALL_BASE = $$INSTALL_DATA_PATH DATA_DIRS = \ - generic-highlighter \ fonts for(data_dir, DATA_DIRS) { diff --git a/src/share/3rdparty/generic-highlighter/autoconf.xml b/src/share/3rdparty/generic-highlighter/autoconf.xml deleted file mode 100644 index 71740f8a8cb..00000000000 --- a/src/share/3rdparty/generic-highlighter/autoconf.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - if - then - elif - else - fi - for - in - do - don - function - select - until - while - set - ifelse - case - esac - - - - - : - source - alias - bg - bind - break - builtin - cd - caller - command - compgen - complete - continue - dirs - disown - echo - enable - eval - exec - exit - fc - fg - getopts - hash - help - history - jobs - kill - let - logout - popd - printf - pushd - pwd - return - set - shift - shopt - suspend - test - time - times - trap - type - ulimit - umask - unalias - wait - - - - no - yes - false - true - - - - - AS_BOURNE_COMPATIBLE - AS_BOX - AS_CASE - AS_DIRNAME - AS_ECHO - AS_ECHO_N - AS_ESCAPE - AS_EXIT - AS_HELP_STRING - AS_IF - AS_INIT - AS_INIT_GENERATED - AS_LINENO_PREPARE - AS_LITERAL_IF - AS_LITERAL_WORD_IF - AS_ME_PREPARE - AS_MESSAGE_FD - AS_MESSAGE_LOG_FD - AS_MKDIR_P - AS_ORIGINAL_STDIN_FD - AS_SET_CATFILE - AS_SET_STATUS - AS_SHELL_SANITIZE - AS_TMPDIR - AS_TR_CPP - AS_TR_SH - AS_UNSET - AS_VAR_APPEND - AS_VAR_ARITH - AS_VAR_COPY - AS_VAR_IF - AS_VAR_POPDEF - AS_VAR_PUSHDEF - AS_VAR_SET - AS_VAR_SET_IF - AS_VAR_TEST_SET - AS_VERSION_COMPARE - m4_append - m4_append_uniq - m4_append_uniq_w - m4_apply - m4_argn - m4_assert - m4_bmatch - m4_bpatsubst - m4_bpatsubsts - m4_bregexp - m4_builtin - m4_car - m4_case - m4_cdr - m4_changecom - m4_changequote - m4_chomp - m4_chomp_all - m4_cleardivert - m4_cmp - m4_combine - m4_cond - m4_copy - m4_copy_force - m4_count - m4_curry - m4_debugfile - m4_debugmode - m4_decr - m4_default - m4_default_nblank - m4_default_nblank_quoted - m4_default_quoted - m4_define - m4_define_default - m4_defn - m4_divert - m4_divert_once - m4_divert_pop - m4_divert_push - m4_divert_text - m4_divnum - m4_do - m4_dquote - m4_dquote_elt - m4_dumpdef - m4_dumpdefs - m4_echo - m4_errprint - m4_errprintn - m4_escape - m4_esyscmd - m4_esyscmd_s - m4_eval - m4_exit - m4_expand - m4_fatal - m4_flatten - m4_for - m4_foreach - m4_foreach_w - m4_format - m4_if - m4_ifblank - m4_ifdef - m4_ifnblank - m4_ifndef - m4_ifset - m4_ifval - m4_ifvaln - m4_ignore - m4_include - m4_incr - m4_index - m4_indir - m4_init - m4_join - m4_joinall - m4_len - m4_list_cmp - m4_location - m4_make_list - m4_maketemp - m4_map - m4_map_args - m4_map_args_pair - m4_map_args_sep - m4_map_args_w - m4_map_sep - m4_mapall - m4_mapall_sep - m4_max - m4_min - m4_mkstemp - m4_n - m4_newline - m4_normalize - m4_pattern_allow - m4_pattern_forbid - m4_popdef - m4_pushdef - m4_quote - m4_re_escape - m4_rename - m4_rename_force - m4_reverse - m4_set_add - m4_set_add_all - m4_set_contains - m4_set_contents - m4_set_delete - m4_set_difference - m4_set_dump - m4_set_empty - m4_set_foreach - m4_set_intersection - m4_set_list - m4_set_listc - m4_set_map - m4_set_map_sep - m4_set_remove - m4_set_size - m4_set_union - m4_shift - m4_shift2 - m4_shift3 - m4_shiftn - m4_sign - m4_sinclude - m4_split - m4_stack_foreach - m4_stack_foreach_lifo - m4_stack_foreach_sep - m4_stack_foreach_sep_lifo - m4_strip - m4_substr - m4_syscmd - m4_sysval - m4_text_box - m4_text_wrap - m4_tolower - m4_toupper - m4_traceoff - m4_traceon - m4_translit - m4_undefine - m4_undivert - m4_unquote - m4_version_compare - m4_version_prereq - m4_warn - m4_wrap - m4_wrap_lifo - - - - - AT_ARG_OPTION - AT_ARG_OPTION_ARG - AT_BANNER - AT_CAPTURE_FILE - AT_CHECK - AT_CHECK_EUNIT - AT_CHECK_UNQUOTED - AT_CLEANUP - AT_COLOR_TESTS - AT_COPYRIGHT - AT_DATA - AT_FAIL_IF - AT_INIT - AT_KEYWORDS - AT_PACKAGE_BUGREPORT - AT_PACKAGE_NAME - AT_PACKAGE_STRING - AT_PACKAGE_TARNAME - AT_PACKAGE_URL - AT_PACKAGE_VERSION - AT_SETUP - AT_SKIP_IF - AT_TESTED - AT_XFAIL_IF - - - - LT_PREREQ - LT_LANG - LT_INIT - LTDL_INIT - LT_CONFIG_LTDL_DIR - - - - PKG_CHECK_MODULES - PKG_PROG_PKG_CONFIG - PKG_CHECK_EXISTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 78e86348107..d68d3ed43f9 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -10,7 +10,6 @@ SUBDIRS += \ extensionsystem \ externaltool \ environment \ - generichighlighter \ pointeralgorithm \ profilewriter \ ssh \ diff --git a/tests/auto/auto.qbs b/tests/auto/auto.qbs index 1b6c5a7b307..895f7d8da85 100644 --- a/tests/auto/auto.qbs +++ b/tests/auto/auto.qbs @@ -14,7 +14,6 @@ Project { "extensionsystem/extensionsystem.qbs", "externaltool/externaltool.qbs", "filesearch/filesearch.qbs", - "generichighlighter/generichighlighter.qbs", "json/json.qbs", "languageserverprotocol/languageserverprotocol.qbs", "profilewriter/profilewriter.qbs", diff --git a/tests/auto/generichighlighter/generichighlighter.pro b/tests/auto/generichighlighter/generichighlighter.pro deleted file mode 100644 index a4fea710612..00000000000 --- a/tests/auto/generichighlighter/generichighlighter.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += highlighterengine specificrules diff --git a/tests/auto/generichighlighter/generichighlighter.qbs b/tests/auto/generichighlighter/generichighlighter.qbs deleted file mode 100644 index 07ab96a02ea..00000000000 --- a/tests/auto/generichighlighter/generichighlighter.qbs +++ /dev/null @@ -1,11 +0,0 @@ -import qbs - -Project { - name: "Generic highlighter autotests" - property path genericHighlighterDir: project.ide_source_tree - + "/src/plugins/texteditor/generichighlighter" - references: [ - "highlighterengine/highlighterengine.qbs", - "specificrules/specificrules.qbs" - ] -} diff --git a/tests/auto/generichighlighter/highlighterengine/formats.cpp b/tests/auto/generichighlighter/highlighterengine/formats.cpp deleted file mode 100644 index cf8fc790cf5..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/formats.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "formats.h" - -#include - -Formats::Formats() -{ - m_keywordFormat.setForeground(Qt::darkGray); - m_dataTypeFormat.setForeground(Qt::gray); - m_decimalFormat.setForeground(Qt::lightGray); - m_baseNFormat.setForeground(Qt::red); - m_floatFormat.setForeground(Qt::green); - m_charFormat.setForeground(Qt::blue); - m_stringFormat.setForeground(Qt::cyan); - m_commentFormat.setForeground(Qt::magenta); - m_alertFormat.setForeground(Qt::yellow); - m_errorFormat.setForeground(Qt::darkRed); - m_functionFormat.setForeground(Qt::darkGreen); - m_regionMarkerFormat.setForeground(Qt::darkBlue); - m_othersFormat.setForeground(Qt::darkCyan); -} - -Formats &Formats::instance() -{ - static Formats formats; - return formats; -} - -QString Formats::name(const QTextCharFormat &format) const -{ - if (format == QTextCharFormat()) - return "Default format"; - else if (format == m_keywordFormat) - return "Keyword"; - else if (format == m_dataTypeFormat) - return "Data type format"; - else if (format == m_decimalFormat) - return "Decimal format"; - else if (format == m_baseNFormat) - return "Base N format"; - else if (format == m_floatFormat) - return "Float format"; - else if (format == m_charFormat) - return "Char format"; - else if (format == m_stringFormat) - return "String format"; - else if (format == m_commentFormat) - return "Comment format"; - else if (format == m_alertFormat) - return "Alert format"; - else if (format == m_errorFormat) - return "Error format"; - else if (format == m_functionFormat) - return "Function format"; - else if (format == m_regionMarkerFormat) - return "Region Marker format"; - else if (format == m_othersFormat) - return "Others format"; - else - return "Unidentified format"; -} diff --git a/tests/auto/generichighlighter/highlighterengine/formats.h b/tests/auto/generichighlighter/highlighterengine/formats.h deleted file mode 100644 index 11c3916a8b0..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/formats.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -class Formats -{ -public: - static Formats &instance(); - - const QTextCharFormat &keywordFormat() const { return m_keywordFormat; } - const QTextCharFormat &dataTypeFormat() const { return m_dataTypeFormat; } - const QTextCharFormat &decimalFormat() const { return m_decimalFormat; } - const QTextCharFormat &baseNFormat() const { return m_baseNFormat; } - const QTextCharFormat &floatFormat() const { return m_floatFormat; } - const QTextCharFormat &charFormat() const { return m_charFormat; } - const QTextCharFormat &stringFormat() const { return m_stringFormat; } - const QTextCharFormat &commentFormat() const { return m_commentFormat; } - const QTextCharFormat &alertFormat() const { return m_alertFormat; } - const QTextCharFormat &errorFormat() const { return m_errorFormat; } - const QTextCharFormat &functionFormat() const { return m_functionFormat; } - const QTextCharFormat ®ionMarketFormat() const { return m_regionMarkerFormat; } - const QTextCharFormat &othersFormat() const { return m_othersFormat; } - - QString name(const QTextCharFormat &format) const; - -private: - Formats(); - Q_DISABLE_COPY(Formats); - - QTextCharFormat m_keywordFormat; - QTextCharFormat m_dataTypeFormat; - QTextCharFormat m_decimalFormat; - QTextCharFormat m_baseNFormat; - QTextCharFormat m_floatFormat; - QTextCharFormat m_charFormat; - QTextCharFormat m_stringFormat; - QTextCharFormat m_commentFormat; - QTextCharFormat m_alertFormat; - QTextCharFormat m_errorFormat; - QTextCharFormat m_functionFormat; - QTextCharFormat m_regionMarkerFormat; - QTextCharFormat m_othersFormat; -}; diff --git a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro b/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro deleted file mode 100644 index d78de7871eb..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/highlighterengine.pro +++ /dev/null @@ -1,39 +0,0 @@ -QTC_PLUGIN_DEPENDS += coreplugin texteditor -include(../../qttest.pri) -QT += gui -PLUGINSDIR = $$IDE_SOURCE_TREE/src/plugins -GENERICHIGHLIGHTERDIR = $$PLUGINSDIR/texteditor/generichighlighter - -SOURCES += \ - tst_highlighterengine.cpp \ - highlightermock.cpp \ - formats.cpp \ - textdocumentlayout.cpp \ - syntaxhighlighter.cpp \ - $$GENERICHIGHLIGHTERDIR/highlighter.cpp \ - $$GENERICHIGHLIGHTERDIR/context.cpp \ - $$GENERICHIGHLIGHTERDIR/dynamicrule.cpp \ - $$GENERICHIGHLIGHTERDIR/rule.cpp \ - $$GENERICHIGHLIGHTERDIR/specificrules.cpp \ - $$GENERICHIGHLIGHTERDIR/progressdata.cpp \ - $$GENERICHIGHLIGHTERDIR/highlightdefinition.cpp \ - $$GENERICHIGHLIGHTERDIR/keywordlist.cpp \ - $$GENERICHIGHLIGHTERDIR/itemdata.cpp - -HEADERS += \ - highlightermock.h \ - formats.h \ - textdocumentlayout.h \ - syntaxhighlighter.h \ - tabsettings.h \ - $$GENERICHIGHLIGHTERDIR/highlighter.h \ - $$GENERICHIGHLIGHTERDIR/context.h \ - $$GENERICHIGHLIGHTERDIR/dynamicrule.h \ - $$GENERICHIGHLIGHTERDIR/rule.h \ - $$GENERICHIGHLIGHTERDIR/specificrules.h \ - $$GENERICHIGHLIGHTERDIR/progressdata.h \ - $$GENERICHIGHLIGHTERDIR/highlightdefinition.h \ - $$GENERICHIGHLIGHTERDIR/keywordlist.h \ - $$GENERICHIGHLIGHTERDIR/itemdata.h - -INCLUDEPATH += $$PWD diff --git a/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs b/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs deleted file mode 100644 index 8e12d56d153..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/highlighterengine.qbs +++ /dev/null @@ -1,45 +0,0 @@ -import qbs - -QtcAutotest { - name: "Highlighter engine autotest" - Depends { name: "Core" } - Depends { name: "Utils" } - Depends { name: "TextEditor" } - Depends { name: "Qt.widgets" } - Group { - name: "Sources from TextEditor plugin" - prefix: project.genericHighlighterDir + '/' - files: [ - "context.h", "context.cpp", - "dynamicrule.h", "dynamicrule.cpp", - "highlightdefinition.h", "highlightdefinition.cpp", - "highlighter.h", "highlighter.cpp", - "itemdata.h", "itemdata.cpp", - "keywordlist.h", "keywordlist.cpp", - "progressdata.h", "progressdata.cpp", - "rule.h", "rule.cpp", - "specificrules.h", "specificrules.cpp" - ] - } - Group { - name: "Test sources" - files: [ - "formats.h", "formats.cpp", - "highlightermock.h", "highlightermock.cpp", - "tst_highlighterengine.cpp" - ] - } - Group { - name: "Drop-in sources for the plugin" - files: [ - "textdocumentlayout.h", "textdocumentlayout.cpp", - "syntaxhighlighter.h", "syntaxhighlighter.cpp", - "tabsettings.h" - ] - } - - cpp.includePaths: base.concat([ - path, - project.genericHighlighterDir + "/../..", - ]) -} diff --git a/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp b/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp deleted file mode 100644 index 1cdabee5d3f..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/highlightermock.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "formats.h" -#include "highlightermock.h" - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE -namespace QTest { - template<> inline char *toString(const QTextCharFormat &format) - { - QByteArray ba = Formats::instance().name(format).toLatin1(); - return qstrdup(ba.data()); - } -} -QT_END_NAMESPACE - -using namespace TextEditor; -using namespace Internal; - -HighlighterMock::HighlighterMock(QTextDocument *parent) : - Highlighter(parent), - m_statesCounter(0), - m_formatsCounter(0), - m_debugDetails(false), - m_noTestCall(false), - m_considerEmptyLines(false) -{} - -void HighlighterMock::reset() -{ - m_states.clear(); - m_statesCounter = 0; - m_formatSequence.clear(); - m_formatsCounter = 0; - m_debugDetails = false; - m_noTestCall = false; - m_considerEmptyLines = false; -} - -void HighlighterMock::showDebugDetails() -{ m_debugDetails = true; } - -void HighlighterMock::considerEmptyLines() -{ m_considerEmptyLines = true; } - -void HighlighterMock::startNoTestCalls() -{ m_noTestCall = true; } - -void HighlighterMock::endNoTestCalls() -{ m_noTestCall = false; } - -void HighlighterMock::setExpectedBlockState(const int state) -{ m_states << state; } - -void HighlighterMock::setExpectedBlockStates(const QList &states) -{ m_states = states; } - -void HighlighterMock::setExpectedHighlightSequence(const HighlightSequence &format) -{ m_formatSequence << format; } - -void HighlighterMock::setExpectedHighlightSequences(const QList &formats) -{ m_formatSequence = formats; } - -void HighlighterMock::highlightBlock(const QString &text) -{ - Highlighter::highlightBlock(text); - - if (text.isEmpty() && !m_considerEmptyLines) - return; - - if (m_noTestCall) - return; - - if (m_states.isEmpty() || m_formatSequence.isEmpty()) - QFAIL("No expected data setup."); - - if (m_debugDetails) - qDebug() << "Highlighting" << text; - - if (m_states.size() <= m_statesCounter) - QFAIL("Expected state for current block not set."); - const int observableState = currentBlockState() & 0xFFF; - QCOMPARE(observableState, m_states.at(m_statesCounter++)); - - if (m_formatSequence.size() <= m_formatsCounter) - QFAIL("Expected highlight sequence for current block not set."); - for (int i = 0; i < text.length(); ++i) { - if (text.at(i).isSpace()) - continue; - if (m_debugDetails) - qDebug() << "at offset" << i; - QCOMPARE(format(i), m_formatSequence.at(m_formatsCounter).m_formats.at(i)); - } - ++m_formatsCounter; -} diff --git a/tests/auto/generichighlighter/highlighterengine/highlightermock.h b/tests/auto/generichighlighter/highlighterengine/highlightermock.h deleted file mode 100644 index 09cfcef5bbd..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/highlightermock.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -#include - -struct HighlightSequence -{ - HighlightSequence() {} - HighlightSequence(int from, int to, const QTextCharFormat &format = QTextCharFormat()) - { add(from, to, format); } - HighlightSequence(const HighlightSequence &sequence) - { m_formats = sequence.m_formats; } - - void add(int from, int to, const QTextCharFormat &format = QTextCharFormat()) - { - for (int i = from; i < to; ++i) - m_formats.append(format); - } - - QList m_formats; -}; - -class HighlighterMock : public TextEditor::Highlighter -{ -public: - HighlighterMock(QTextDocument *parent = 0); - - void reset(); - void showDebugDetails(); - void considerEmptyLines(); - - void startNoTestCalls(); - void endNoTestCalls(); - - void setExpectedBlockState(const int state); - void setExpectedBlockStates(const QList &states); - void setExpectedHighlightSequence(const HighlightSequence &format); - void setExpectedHighlightSequences(const QList &formats); - -protected: - virtual void highlightBlock(const QString &text); - -private: - QList m_states; - int m_statesCounter; - QList m_formatSequence; - int m_formatsCounter; - bool m_debugDetails; - bool m_noTestCall; - bool m_considerEmptyLines; -}; diff --git a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp b/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp deleted file mode 100644 index 4e4a9cfb475..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/syntaxhighlighter.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "syntaxhighlighter.h" -#include "formats.h" - -#include -#include - -using namespace TextEditor; -using namespace Internal; - -QTextCharFormat SyntaxHighlighter::formatForCategory(int categoryIndex) const -{ - switch (categoryIndex) { - case Highlighter::Keyword: return Formats::instance().keywordFormat(); - case Highlighter::DataType: return Formats::instance().dataTypeFormat(); - case Highlighter::Decimal: return Formats::instance().decimalFormat(); - case Highlighter::BaseN: return Formats::instance().baseNFormat(); - case Highlighter::Float: return Formats::instance().floatFormat(); - case Highlighter::Char: return Formats::instance().charFormat(); - case Highlighter::String: return Formats::instance().stringFormat(); - case Highlighter::Comment: return Formats::instance().commentFormat(); - case Highlighter::Alert: return Formats::instance().alertFormat(); - case Highlighter::Error: return Formats::instance().errorFormat(); - case Highlighter::Function: return Formats::instance().functionFormat(); - case Highlighter::RegionMarker: return Formats::instance().regionMarketFormat(); - case Highlighter::Others: return Formats::instance().othersFormat(); - default: return QTextCharFormat(); - } -} - -FontSettings SyntaxHighlighter::fontSettings() const -{ - return FontSettings(); -} diff --git a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.cpp b/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.cpp deleted file mode 100644 index 5b0d50f0e72..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "textdocumentlayout.h" - -namespace TextEditor { - -TextBlockUserData *TextDocumentLayout::userData(const QTextBlock &block) -{ - TextBlockUserData *data = static_cast(block.userData()); - if (!data && block.isValid()) - const_cast(block).setUserData((data = new TextBlockUserData)); - return data; -} - -void TextDocumentLayout::setParentheses(const QTextBlock &, const Parentheses &) {} - -} // namespace TextEditor diff --git a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h b/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h deleted file mode 100644 index aa0751c4842..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/textdocumentlayout.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include - -// Replaces the "real" textdocumentlayout.h file. -namespace TextEditor { -struct Parenthesis; -typedef QVector Parentheses; - -struct Parenthesis -{ - enum Type { Opened, Closed }; - - inline Parenthesis() : type(Opened), pos(-1) {} - inline Parenthesis(Type t, QChar c, int position) - : type(t), chr(c), pos(position) {} - Type type; - QChar chr; - int pos; -}; - -struct CodeFormatterData { virtual ~CodeFormatterData() {} }; - -struct TextBlockUserData : QTextBlockUserData -{ - TextBlockUserData() : m_data(0) {} - virtual ~TextBlockUserData() {} - - void setFoldingStartIncluded(const bool) {} - void setFoldingEndIncluded(const bool) {} - void setFoldingIndent(const int) {} - void setCodeFormatterData(CodeFormatterData *data) { m_data = data; } - CodeFormatterData *codeFormatterData() { return m_data; } - CodeFormatterData *m_data; -}; - -namespace TextDocumentLayout { -TextBlockUserData *userData(const QTextBlock &block); -void setParentheses(const QTextBlock &, const Parentheses &); -} - -} // namespace TextEditor diff --git a/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp b/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp deleted file mode 100644 index e671d7b393e..00000000000 --- a/tests/auto/generichighlighter/highlighterengine/tst_highlighterengine.cpp +++ /dev/null @@ -1,1105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "formats.h" -#include "highlightermock.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace TextEditor; -using namespace Internal; - -Q_DECLARE_METATYPE(HighlightSequence) - -//TESTED_COMPONENT=src/plugins/texteditor/generichighlighter - -class tst_HighlighterEngine : public QObject -{ - Q_OBJECT -public: - tst_HighlighterEngine(); - -private slots: - void initTestCase(); - void init(); - - void testSimpleLine(); - void testSimpleLine_data(); - - void testLineContinue(); - void testLineContinue_data(); - void testEditingLineContinue0(); - void testEditingLineContinue1(); - void testEditingLineContinue2(); - void testEditingLineContinue3(); - void testEditingLineContinue4(); - void testEditingLineContinue5(); - - void testPersistentStates(); - void testPersistentStates_data(); - void testEditingPersistentStates0(); - void testEditingPersistentStates1(); - void testEditingPersistentStates2(); - - void testDynamicContexts(); - void testDynamicContexts_data(); - - void testFirstNonSpace(); - void testFirstNonSpace_data(); - -private: - void createKeywords(); - void createContexts(); - void createItemDatas(); - - void setExpectedData(int state, const HighlightSequence &seq); - void setExpectedData(const QList &states, const QList &seqs); - void createColumns(); - void test(); - void test(int state, const HighlightSequence &seq, const QString &line); - void test(const QList &states, const QList &seqs, const QString &lines); - - void clear(QList *states, QList *sequences) const; - - QList createlDefaultStatesList(int size) const; - - void addCharactersToBegin(QTextBlock block, const QString &s); - void addCharactersToEnd(QTextBlock block, const QString &s); - void removeFirstCharacters(const QTextBlock &block, int n); - void removeLastCharacters(const QTextBlock &block, int n); - - void setupForEditingLineContinue(); - - QSharedPointer m_definition; - QScopedPointer m_highlighterMock; - QPlainTextEdit m_text; -}; - -tst_HighlighterEngine::tst_HighlighterEngine() : - m_definition(new HighlightDefinition) -{} - -void tst_HighlighterEngine::initTestCase() -{ - /***********************************************************/ - /*** Spaces are ignored when comparing text char formats ***/ - /***********************************************************/ - - createKeywords(); - createContexts(); - createItemDatas(); -} - -void tst_HighlighterEngine::init() -{ - m_highlighterMock.reset(new HighlighterMock()); - m_highlighterMock->setDefaultContext(m_definition->initialContext()); - m_highlighterMock->setDocument(m_text.document()); -} - -void tst_HighlighterEngine::createKeywords() -{ - QSharedPointer keywords = m_definition->createKeywordList("keywords"); - keywords->addKeyword("int"); - keywords->addKeyword("long"); -} - -void tst_HighlighterEngine::createContexts() -{ - // Normal context - QSharedPointer normal = m_definition->createContext("Normal", true); - normal->setItemData("Normal Text"); - normal->setLineEndContext("#stay"); - normal->setDefinition(m_definition); - - // AfterHash context - QSharedPointer afterHash = m_definition->createContext("AfterHash", false); - afterHash->setItemData("Error"); - afterHash->setLineEndContext("#pop"); - afterHash->setDefinition(m_definition); - - // Define context - QSharedPointer define = m_definition->createContext("Define", false); - define->setItemData("Preprocessor"); - define->setLineEndContext("#pop"); - define->setDefinition(m_definition); - - // Preprocessor context - QSharedPointer preprocessor = m_definition->createContext("Preprocessor", false); - preprocessor->setItemData("Preprocessor"); - preprocessor->setLineEndContext("#pop"); - preprocessor->setDefinition(m_definition); - - // SimpleComment context - QSharedPointer simpleComment = m_definition->createContext("SimpleComment", false); - simpleComment->setItemData("Comment"); - simpleComment->setLineEndContext("#pop"); - simpleComment->setDefinition(m_definition); - - // MultilineComment context - QSharedPointer multiComment = m_definition->createContext("MultilineComment", false); - multiComment->setItemData("Comment"); - multiComment->setLineEndContext("#stay"); - multiComment->setDefinition(m_definition); - - // NestedComment context - QSharedPointer nestedComment = m_definition->createContext("NestedComment", false); - nestedComment->setItemData("Other Comment"); - nestedComment->setLineEndContext("#stay"); - nestedComment->setDefinition(m_definition); - - // SimpleNestedComment context - QSharedPointer simpleNestedComment = - m_definition->createContext("SimpleNestedComment", false); - simpleNestedComment->setItemData("Comment"); - simpleNestedComment->setLineEndContext("#pop"); - simpleNestedComment->setDefinition(m_definition); - - // Dummy context - QSharedPointer dummy = m_definition->createContext("Dummy", false); - dummy->setItemData("Dummy"); - dummy->setLineEndContext("#pop"); - dummy->setDefinition(m_definition); - - // AfterPlus context - QSharedPointer afterPlus = m_definition->createContext("AfterPlus", false); - afterPlus->setItemData("Char"); - afterPlus->setLineEndContext("#pop"); - afterPlus->setDefinition(m_definition); - - // AfterMinus context - QSharedPointer afterMinus = m_definition->createContext("AfterMinus", false); - afterMinus->setItemData("String"); - afterMinus->setLineEndContext("#pop#pop"); - afterMinus->setDefinition(m_definition); - - // AfterEqual context - QSharedPointer afterEqual = m_definition->createContext("AfterEqual", false); - afterEqual->setItemData("Float"); - afterEqual->setLineEndContext("#pop#pop#pop"); - afterEqual->setDefinition(m_definition); - - // Dynamic context - QSharedPointer dynamic = m_definition->createContext("Dynamic", false); - dynamic->setItemData("Marker"); - dynamic->setLineEndContext("#pop"); - dynamic->setDynamic("true"); - dynamic->setDefinition(m_definition); - - // Rules - DetectCharRule *r = new DetectCharRule; - r->setChar("?"); - r->setContext("#stay"); - r->setItemData("Decimal"); - r->setDefinition(m_definition); - normal->addRule(QSharedPointer(r)); // Needs to be the first one added. - - DetectCharRule *r0 = new DetectCharRule; - r0->setChar("#"); - r0->setContext("AfterHash"); - r0->setFirstNonSpace("true"); - r0->setLookAhead("true"); - r0->setDefinition(m_definition); - normal->addRule(QSharedPointer(r0)); - - RegExprRule *r1 = new RegExprRule; - r1->setPattern("#\\s*define.*((?=\\\\))"); - r1->setInsensitive("true"); - r1->setContext("Define"); - r1->setItemData("Preprocessor"); - r1->setFirstNonSpace("true"); - r1->setDefinition(m_definition); - afterHash->addRule(QSharedPointer(r1)); - - RegExprRule *r2 = new RegExprRule; - r2->setPattern("#\\s*(?:define|undef)"); - r2->setInsensitive("true"); - r2->setContext("Preprocessor"); - r2->setItemData("Preprocessor"); - r2->setFirstNonSpace("true"); - r2->setDefinition(m_definition); - afterHash->addRule(QSharedPointer(r2)); - - LineContinueRule *r3 = new LineContinueRule; - r3->setItemData("Preprocessor"); - r3->setContext("#stay"); - r3->setDefinition(m_definition); - define->addRule(QSharedPointer(r3)); - - LineContinueRule *r4 = new LineContinueRule; - r4->setItemData("Preprocessor"); - r4->setContext("#stay"); - r4->setDefinition(m_definition); - preprocessor->addRule(QSharedPointer(r4)); - - KeywordRule *r5 = new KeywordRule(m_definition); - r5->setList("keywords"); - r5->setItemData("Keyword"); - r5->setContext("#stay"); - r5->setDefinition(m_definition); - normal->addRule(QSharedPointer(r5)); - - IntRule *r6 = new IntRule; - r6->setItemData("Decimal"); - r6->setContext("#stay"); - r6->setDefinition(m_definition); - normal->addRule(QSharedPointer(r6)); - - StringDetectRule *r7 = new StringDetectRule; - r7->setItemData("Decimal"); - r7->setContext("#stay"); - r7->setString("LL"); - r7->setInsensitive("true"); - r7->setDefinition(m_definition); - r6->addChild(QSharedPointer(r7)); - - StringDetectRule *r8 = new StringDetectRule; - r8->setItemData("Decimal"); - r8->setContext("#stay"); - r8->setString("UL"); - r8->setInsensitive("true"); - r8->setDefinition(m_definition); - r6->addChild(QSharedPointer(r8)); - - HlCOctRule *r9 = new HlCOctRule; - r9->setItemData("Octal"); - r9->setContext("#stay"); - r9->setDefinition(m_definition); - normal->addRule(QSharedPointer(r9)); - - Detect2CharsRule *r10 = new Detect2CharsRule; - r10->setChar("/"); - r10->setChar1("/"); - r10->setItemData("Comment"); - r10->setContext("SimpleComment"); - r10->setDefinition(m_definition); - normal->addRule(QSharedPointer(r10)); - - DetectIdentifierRule *r11 = new DetectIdentifierRule; - r11->setDefinition(m_definition); - simpleComment->addRule(QSharedPointer(r11)); - - Detect2CharsRule *r12 = new Detect2CharsRule; - r12->setChar("/"); - r12->setChar1("*"); - r12->setItemData("Comment"); - r12->setContext("MultilineComment"); - r12->setDefinition(m_definition); - normal->addRule(QSharedPointer(r12)); - - Detect2CharsRule *r13 = new Detect2CharsRule; - r13->setChar("*"); - r13->setChar1("/"); - r13->setItemData("Comment"); - r13->setContext("#pop"); - r13->setDefinition(m_definition); - multiComment->addRule(QSharedPointer(r13)); - - Detect2CharsRule *r14 = new Detect2CharsRule; - r14->setChar("/"); - r14->setChar1("#"); - r14->setItemData("Other Comment"); - r14->setContext("NestedComment"); - r14->setDefinition(m_definition); - QSharedPointer sr14(r14); - multiComment->addRule(sr14); - dummy->addRule(sr14); - afterEqual->addRule(sr14); - afterMinus->addRule(sr14); - afterPlus->addRule(sr14); - - Detect2CharsRule *r15 = new Detect2CharsRule; - r15->setChar("#"); - r15->setChar1("/"); - r15->setItemData("Other Comment"); - r15->setContext("#pop"); - r15->setDefinition(m_definition); - nestedComment->addRule(QSharedPointer(r15)); - - DetectCharRule *r16 = new DetectCharRule; - r16->setChar("@"); - r16->setItemData("Marker"); - r16->setContext("Dummy"); - r16->setDefinition(m_definition); - multiComment->addRule(QSharedPointer(r16)); - - StringDetectRule *r17 = new StringDetectRule; - r17->setString("dummy"); - r17->setItemData("Dummy"); - r17->setContext("#stay"); - r17->setDefinition(m_definition); - dummy->addRule(QSharedPointer(r17)); - - DetectCharRule *r18 = new DetectCharRule; - r18->setChar("+"); - r18->setContext("AfterPlus"); - r18->setDefinition(m_definition); - QSharedPointer sr18(r18); - multiComment->addRule(sr18); - nestedComment->addRule(sr18); - afterMinus->addRule(sr18); - afterEqual->addRule(sr18); - - DetectCharRule *r19 = new DetectCharRule; - r19->setChar("-"); - r19->setContext("AfterMinus"); - r19->setDefinition(m_definition); - QSharedPointer sr19(r19); - multiComment->addRule(sr19); - nestedComment->addRule(sr19); - afterPlus->addRule(sr19); - afterEqual->addRule(sr19); - - DetectCharRule *r20 = new DetectCharRule; - r20->setChar("="); - r20->setContext("AfterEqual"); - r20->setDefinition(m_definition); - QSharedPointer sr20(r20); - multiComment->addRule(sr20); - nestedComment->addRule(sr20); - afterPlus->addRule(sr20); - afterMinus->addRule(sr20); - - DetectCharRule *r22 = new DetectCharRule; - r22->setChar("$"); - r22->setContext("#stay"); - r22->setDefinition(m_definition); - normal->addRule(QSharedPointer(r22)); - - DetectCharRule *r23 = new DetectCharRule; - r23->setChar("?"); - r23->setContext("#stay"); - r23->setItemData("Comment"); - r23->setDefinition(m_definition); - normal->addRule(QSharedPointer(r23)); - - RegExprRule *r24 = new RegExprRule; - r24->setInsensitive("true"); - r24->setPattern("---([a-c]*)([d-f]*)"); - r24->setDefinition(m_definition); - r24->setItemData("Dummy"); - r24->setContext("Dynamic"); - normal->addRule(QSharedPointer(r24)); - - DetectCharRule *r25 = new DetectCharRule; - r25->setChar("1"); - r25->setItemData("Preprocessor"); - r25->setActive("true"); - r25->setDefinition(m_definition); - dynamic->addRule(QSharedPointer(r25)); - - StringDetectRule *r26 = new StringDetectRule; - r26->setString("begin%2end"); - r26->setItemData("Error"); - r26->setActive("true"); - r26->setDefinition(m_definition); - dynamic->addRule(QSharedPointer(r26)); - - DetectCharRule *r27 = new DetectCharRule; - r27->setChar("|"); - r27->setItemData("Error"); - r27->setFirstNonSpace("true"); - r27->setDefinition(m_definition); - normal->addRule(QSharedPointer(r27)); - - Detect2CharsRule *r28 = new Detect2CharsRule; - r28->setChar("#"); - r28->setChar1("#"); - r28->setItemData("Comment"); - r28->setContext("SimpleNestedComment"); - r28->setDefinition(m_definition); - QSharedPointer sr28(r28); - multiComment->addRule(sr28); - nestedComment->addRule(sr28); - - LineContinueRule *r29 = new LineContinueRule; - r29->setItemData("Comment"); - r29->setContext("#stay"); - r29->setDefinition(m_definition); - simpleNestedComment->addRule(QSharedPointer(r29)); -} - -void tst_HighlighterEngine::createItemDatas() -{ - QSharedPointer normalText = m_definition->createItemData("Normal Text"); - normalText->setStyle("dsNormal"); - QSharedPointer preprocessor = m_definition->createItemData("Preprocessor"); - preprocessor->setStyle("dsOthers"); - QSharedPointer error = m_definition->createItemData("Error"); - error->setStyle("dsError"); - QSharedPointer keyword = m_definition->createItemData("Keyword"); - keyword->setStyle("dsKeyword"); - QSharedPointer decimal = m_definition->createItemData("Decimal"); - decimal->setStyle("dsDecVal"); - QSharedPointer octal = m_definition->createItemData("Octal"); - octal->setStyle("dsBaseN"); - QSharedPointer comment = m_definition->createItemData("Comment"); - comment->setStyle("dsComment"); - QSharedPointer otherComment = m_definition->createItemData("Other Comment"); - otherComment->setStyle("dsError"); - QSharedPointer marker = m_definition->createItemData("Marker"); - marker->setStyle("dsRegionMarker"); - QSharedPointer dummy = m_definition->createItemData("Dummy"); - dummy->setStyle("dsDataType"); - QSharedPointer charStyle = m_definition->createItemData("Char"); - charStyle->setStyle("dsChar"); - QSharedPointer stringStyle = m_definition->createItemData("String"); - stringStyle->setStyle("dsString"); - QSharedPointer floatStyle = m_definition->createItemData("Float"); - floatStyle->setStyle("dsFloat"); -} - -void tst_HighlighterEngine::setExpectedData(int state, const HighlightSequence &seq) -{ - m_highlighterMock->setExpectedBlockState(state); - m_highlighterMock->setExpectedHighlightSequence(seq); -} - -void tst_HighlighterEngine::setExpectedData(const QList &states, - const QList &seqs) -{ - m_highlighterMock->setExpectedBlockStates(states); - m_highlighterMock->setExpectedHighlightSequences(seqs); -} - -void tst_HighlighterEngine::createColumns() -{ - QTest::addColumn >("states"); - QTest::addColumn >("sequences"); - QTest::addColumn("lines"); -} - -void tst_HighlighterEngine::test() -{ - QFETCH(QList, states); - QFETCH(QList, sequences); - QFETCH(QString, lines); - - init(); - test(states, sequences, lines); -} - -void tst_HighlighterEngine::test(int state, const HighlightSequence &seq, const QString &line) -{ - setExpectedData(state, seq); - m_text.setPlainText(line); -} - -void tst_HighlighterEngine::test(const QList &states, - const QList &seqs, - const QString &lines) -{ - setExpectedData(states, seqs); - m_text.setPlainText(lines); -} - -void tst_HighlighterEngine::clear(QList *states, QList *sequences) const -{ - states->clear(); - sequences->clear(); -} - -QList tst_HighlighterEngine::createlDefaultStatesList(int size) const -{ - QList states; - for (int i = 0; i < size; ++i) - states.append(0); - return states; -} - -void tst_HighlighterEngine::addCharactersToBegin(QTextBlock block, const QString &s) -{ - QTextCursor cursor = m_text.textCursor(); - cursor.beginEditBlock(); - cursor.setPosition(block.position()); - cursor.insertText(s); - cursor.endEditBlock(); -} - -void tst_HighlighterEngine::addCharactersToEnd(QTextBlock block, const QString &s) -{ - QTextCursor cursor = m_text.textCursor(); - cursor.beginEditBlock(); - cursor.setPosition(block.position() + block.length() - 1); - cursor.insertText(s); - cursor.endEditBlock(); -} - -void tst_HighlighterEngine::removeFirstCharacters(const QTextBlock &block, int n) -{ - QTextCursor cursor = m_text.textCursor(); - cursor.beginEditBlock(); - cursor.setPosition(block.position()); - cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, n); - cursor.removeSelectedText(); - cursor.endEditBlock(); -} - -void tst_HighlighterEngine::removeLastCharacters(const QTextBlock &block, int n) -{ - QTextCursor cursor = m_text.textCursor(); - cursor.beginEditBlock(); - cursor.setPosition(block.position() + block.length() - 1); - cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, n); - cursor.removeSelectedText(); - cursor.endEditBlock(); -} - -void tst_HighlighterEngine::testSimpleLine() -{ - test(); -} - -void tst_HighlighterEngine::testSimpleLine_data() -{ - createColumns(); - - QList states; - QList sequences; - QString text; - - HighlightSequence seqa(0, 3); - HighlightSequence seqb(0, 15, Formats::instance().othersFormat()); - HighlightSequence seqc(0, 1, Formats::instance().errorFormat()); - HighlightSequence seqd(0, 3, Formats::instance().keywordFormat()); - seqd.add(3, 8); - seqd.add(8, 9, Formats::instance().baseNFormat()); - HighlightSequence seqe(0, 4, Formats::instance().keywordFormat()); - seqe.add(4, 9); - seqe.add(9, 12, Formats::instance().decimalFormat()); - HighlightSequence seqf(seqe); - seqf.add(12, 13); - HighlightSequence seqg(seqf); - seqg.add(13, 14); - HighlightSequence seqh(0, 8, Formats::instance().commentFormat()); - HighlightSequence seqi(seqd); - seqi.add(9, 17, Formats::instance().commentFormat()); - HighlightSequence seqj(seqd); - seqj.add(9, 11, Formats::instance().commentFormat()); - HighlightSequence seqk(0, 3); - HighlightSequence seql(0, 3, Formats::instance().keywordFormat()); - HighlightSequence seqm(0, 2); - HighlightSequence seqn(0, 8, Formats::instance().commentFormat()); - HighlightSequence seqo(0, 1); - seqo.add(1, 2, Formats::instance().decimalFormat()); - - states << 0; - sequences << seqa; - text = "abc"; - QTest::newRow("case 0") << states << sequences << text; - - sequences.clear(); - sequences << seqb; - text = "#define max 100"; - QTest::newRow("case 1") << states << sequences << text; - - sequences.clear(); - sequences << seqc; - text = "#"; - QTest::newRow("case 2") << states << sequences << text; - - sequences.clear(); - sequences << seqd; - text = "int i = 0"; - QTest::newRow("case 3") << states << sequences << text; - - sequences.clear(); - sequences << seqe; - text = "long i = 1LL"; - QTest::newRow("case 4") << states << sequences << text; - - text = "long i = 1ul"; - QTest::newRow("case 5") << states << sequences << text; - - sequences.clear(); - sequences << seqf; - text = "long i = 1ULL"; - QTest::newRow("case 6") << states << sequences << text; - - sequences.clear(); - sequences << seqg; - text = "long i = 1LLUL"; - QTest::newRow("case 7") << states << sequences << text; - - text = "long i = 1ULLL"; - QTest::newRow("case 8") << states << sequences << text; - - sequences.clear(); - sequences << seqh; - text = "//int i;"; - QTest::newRow("case 9") << states << sequences << text; - - sequences.clear(); - sequences << seqi; - text = "int i = 0//int i;"; - QTest::newRow("case 10") << states << sequences << text; - - sequences.clear(); - sequences << seqj; - text = "int i = 0//"; - QTest::newRow("case 11") << states << sequences << text; - - sequences.clear(); - sequences << seqk << seqk; - text = "bla\nbla"; - QTest::newRow("case 12") << createlDefaultStatesList(2) << sequences << text; - - sequences.clear(); - sequences << seql << seqm; - text = "int\ni;"; - QTest::newRow("case 13") << createlDefaultStatesList(2) << sequences << text; - - sequences.clear(); - sequences << seqn << seqm; - text = "//int i;\ni;"; - QTest::newRow("case 14") << createlDefaultStatesList(2) << sequences << text; - - // Even when a matching rule does not take to another context, iteration over the rules - // should start over from the first rule in the current context. - sequences.clear(); - sequences << seqo; - text = "$?"; - QTest::newRow("case 15") << createlDefaultStatesList(2) << sequences << text; -} - -void tst_HighlighterEngine::testLineContinue() -{ - test(); -} - -void tst_HighlighterEngine::testLineContinue_data() -{ - createColumns(); - - QList states; - QList sequences; - QString lines; - - HighlightSequence seqa(0, 12, Formats::instance().othersFormat()); - HighlightSequence seqb(0, 7, Formats::instance().othersFormat()); - HighlightSequence seqc(0, 8, Formats::instance().othersFormat()); - HighlightSequence seqd(0, 3, Formats::instance().othersFormat()); - HighlightSequence seqe(0, 3, Formats::instance().keywordFormat()); - seqe.add(3, 8); - seqe.add(8, 9, Formats::instance().baseNFormat()); - seqe.add(9, 10); - HighlightSequence seqf(0, 9, Formats::instance().commentFormat()); - seqf.add(9, 18, Formats::instance().errorFormat()); - HighlightSequence seqg(0, 7, Formats::instance().commentFormat()); - HighlightSequence seqh(0, 5, Formats::instance().commentFormat()); - HighlightSequence seqi(0, 5, Formats::instance().errorFormat()); - seqi.add(5, 8, Formats::instance().commentFormat()); - - states << 1 << 2; - sequences << seqa << seqb; - lines = "#define max\\\n 100"; - QTest::newRow("case 0") << states << sequences << lines; - - clear(&states, &sequences); - states << 1 << 1; - sequences << seqa << seqc; - lines = "#define max\\\n 100\\"; - QTest::newRow("case 1") << states << sequences << lines; - - clear(&states, &sequences); - states << 1 << 1 << 2; - sequences << seqa << seqc << seqd; - lines = "#define max\\\n 100\\\n000"; - QTest::newRow("case 2") << states << sequences << lines; - - clear(&states, &sequences); - states << 1 << 1 << 2 << 0; - sequences << seqa << seqc << seqd << seqe; - lines = "#define max\\\n 100\\\n000\nint i = 0;"; - QTest::newRow("case 3") << states << sequences << lines; - - clear(&states, &sequences); - states << 4 << 1 << 1 << 2 << 3 << 0 << 1; - sequences << seqf << seqg << seqh << seqh << seqi << seqh; - lines = "/*int i; /# int j;\n##foo \\\nbar \\\nbaz \nxxx#/yyy\nzzz*/"; - QTest::newRow("case 4") << states << sequences << lines; -} - -void tst_HighlighterEngine::setupForEditingLineContinue() -{ - init(); - m_highlighterMock->startNoTestCalls(); - m_text.setPlainText("#define max\\\n xxx\\\nzzz"); - m_highlighterMock->endNoTestCalls(); -} - -void tst_HighlighterEngine::testEditingLineContinue0() -{ - setupForEditingLineContinue(); - - QList sequences; - HighlightSequence seqa(0, 11, Formats::instance().othersFormat()); - HighlightSequence seqb(0, 8); - HighlightSequence seqc(0, 3); - sequences << seqa << seqb << seqc; - setExpectedData(createlDefaultStatesList(3), sequences); - - removeLastCharacters(m_text.document()->firstBlock(), 1); -} - -void tst_HighlighterEngine::testEditingLineContinue1() -{ - setupForEditingLineContinue(); - - setExpectedData(1, HighlightSequence(0, 6, Formats::instance().othersFormat())); - - // In this case highlighting should be triggered only for the modified line. - removeFirstCharacters(m_text.document()->firstBlock().next(), 2); -} - -void tst_HighlighterEngine::testEditingLineContinue2() -{ - setupForEditingLineContinue(); - - QList sequences; - HighlightSequence seqa(0, 17, Formats::instance().othersFormat()); - HighlightSequence seqb(0, 8); - HighlightSequence seqc(0, 3); - sequences << seqa << seqb << seqc; - setExpectedData(createlDefaultStatesList(3), sequences); - - addCharactersToEnd(m_text.document()->firstBlock(), "ixum"); -} - -void tst_HighlighterEngine::testEditingLineContinue3() -{ - setupForEditingLineContinue(); - - setExpectedData(1, HighlightSequence(0, 12, Formats::instance().othersFormat())); - - // In this case highlighting should be triggered only for the modified line. - addCharactersToBegin(m_text.document()->firstBlock().next(), "ixum"); -} - -void tst_HighlighterEngine::testEditingLineContinue4() -{ - setupForEditingLineContinue(); - - QList states; - states << 2 << 0 << 0; - QList sequences; - HighlightSequence seqa(0, 0); - HighlightSequence seqb(0, 8); - HighlightSequence seqc(0, 3); - sequences << seqa << seqb << seqc; - setExpectedData(states, sequences); - - m_highlighterMock->considerEmptyLines(); - addCharactersToBegin(m_text.document()->firstBlock().next(), "\n"); -} - -void tst_HighlighterEngine::testEditingLineContinue5() -{ - setupForEditingLineContinue(); - - QList states; - states << 2 << 0; - QList sequences; - HighlightSequence seqa(0, 9, Formats::instance().othersFormat()); - HighlightSequence seqb(0, 3); - sequences << seqa << seqb; - setExpectedData(states, sequences); - - addCharactersToEnd(m_text.document()->firstBlock().next(), "x"); -} - -void tst_HighlighterEngine::testPersistentStates() -{ - test(); -} - -void tst_HighlighterEngine::testPersistentStates_data() -{ - createColumns(); - - QList states; - QList sequences; - QString text; - - HighlightSequence seqa(0, 3, Formats::instance().keywordFormat()); - seqa.add(3, 6); - seqa.add(6, 15, Formats::instance().commentFormat()); - seqa.add(15, 16); - HighlightSequence seqb(0, 8, Formats::instance().commentFormat()); - HighlightSequence seqc(0, 2, Formats::instance().commentFormat()); - HighlightSequence seqd(0, 9, Formats::instance().commentFormat()); - seqd.add(9, 18, Formats::instance().errorFormat()); - HighlightSequence seqe(0, 5, Formats::instance().errorFormat()); - seqe.add(5, 8, Formats::instance().commentFormat()); - HighlightSequence seqf(0, 2, Formats::instance().commentFormat()); - seqf.add(2, 6); - HighlightSequence seqg(0, 1); - seqg.add(1, 7, Formats::instance().commentFormat()); - seqg.add(7, 8, Formats::instance().regionMarketFormat()); - seqg.add(8, 15, Formats::instance().errorFormat()); - seqg.add(15, 16, Formats::instance().regionMarketFormat()); - seqg.add(16, 21, Formats::instance().dataTypeFormat()); - seqg.add(21, 22, Formats::instance().regionMarketFormat()); - HighlightSequence seqh(seqc); - seqh.add(2, 3); - HighlightSequence seqi(seqc); - seqi.add(2, 3, Formats::instance().charFormat()); - seqi.add(3, 4, Formats::instance().stringFormat()); - HighlightSequence seqj(seqc); - seqj.add(2, 3, Formats::instance().charFormat()); - seqj.add(3, 4, Formats::instance().floatFormat()); - HighlightSequence seqk(seqc); - seqk.add(2, 3, Formats::instance().charFormat()); - seqk.add(3, 5, Formats::instance().errorFormat()); - seqk.add(5, 6, Formats::instance().floatFormat()); - HighlightSequence seql(seqk); - seql.add(6, 7, Formats::instance().stringFormat()); - - states << 0; - sequences << seqa; - text = "int i /* 000 */;"; - QTest::newRow("case 0") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3; - sequences << seqb << seqc; - text = "/*int i;\ni;"; - QTest::newRow("case 1") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3 << 3; - sequences << seqb << seqc << seqb; - text = "/*int i;\ni;\nint abc;"; - QTest::newRow("case 2") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3 << 0; - sequences << seqb << seqc << seqc; - text = "/*int i;\ni;\n*/"; - QTest::newRow("case 3") << states << sequences << text; - - clear(&states, &sequences); - states << 4 << 3 << 0; - sequences << seqd << seqe << seqf; - text = "/*int i; /# int j;\nfoo#/bar\n*/f();"; - QTest::newRow("case 4") << states << sequences << text; - - clear(&states, &sequences); - states << 3; - sequences << seqg; - text = "i/*bla @/#foo#/ dummy "; - QTest::newRow("case 5") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3; - sequences << seqg << seqc; - text = "i/*bla @/#foo#/ dummy \ni;"; - QTest::newRow("case 6") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3 << 0; - sequences << seqg << seqc << seqc; - text = "i/*bla @/#foo#/ dummy \ni;\n*/"; - QTest::newRow("case 7") << states << sequences << text; - - clear(&states, &sequences); - states << 3 << 3 << 0; - sequences << seqg << seqc << seqh; - text = "i/*bla @/#foo#/ dummy \ni;\n*/a"; - QTest::newRow("case 8") << states << sequences << text; - - clear(&states, &sequences); - states << 3; - sequences << seqi; - text = "/*+-"; - QTest::newRow("case 9") << states << sequences << text; - - clear(&states, &sequences); - states << 0; - sequences << seqj; - text = "/*+="; - QTest::newRow("case 10") << states << sequences << text; - - clear(&states, &sequences); - states << 3; - sequences << seqk; - text = "/*+/#="; - QTest::newRow("case 11") << states << sequences << text; - - clear(&states, &sequences); - states << 4; - sequences << seql; - text = "/*+/#=-"; - QTest::newRow("case 12") << states << sequences << text; -} - -void tst_HighlighterEngine::testEditingPersistentStates0() -{ - m_highlighterMock->startNoTestCalls(); - m_text.setPlainText("a b c /\ninside\n*/\na b c"); - m_highlighterMock->endNoTestCalls(); - - QList states; - states << 3 << 3 << 0 << 0; - QList sequences; - HighlightSequence seqa(0, 6); - seqa.add(6, 8, Formats::instance().commentFormat()); - HighlightSequence seqb(0, 6, Formats::instance().commentFormat()); - HighlightSequence seqc(0, 2, Formats::instance().commentFormat()); - HighlightSequence seqd(0, 5); - sequences << seqa << seqb << seqc << seqd; - setExpectedData(states, sequences); - - addCharactersToEnd(m_text.document()->firstBlock(), "*"); -} - -void tst_HighlighterEngine::testEditingPersistentStates1() -{ - m_highlighterMock->startNoTestCalls(); - m_text.setPlainText("/*abc\n/\nnesting\nnesting\n#/\n*/xyz"); - m_highlighterMock->endNoTestCalls(); - - QList states; - states << 4 << 4 << 4 << 3 << 0; - QList sequences; - HighlightSequence seqa(0, 2, Formats::instance().errorFormat()); - HighlightSequence seqb(0, 7, Formats::instance().errorFormat()); - HighlightSequence seqc(seqb); - HighlightSequence seqd(0, 2, Formats::instance().errorFormat()); - HighlightSequence seqe(0, 2, Formats::instance().commentFormat()); - seqe.add(2, 5); - sequences << seqa << seqb << seqc << seqd << seqe; - setExpectedData(states, sequences); - - addCharactersToEnd(m_text.document()->firstBlock().next(), "#"); -} - -void tst_HighlighterEngine::testEditingPersistentStates2() -{ - m_highlighterMock->startNoTestCalls(); - m_text.setPlainText("/*abc\n/\nnesting\nnesting\n*/\n#/xyz"); - m_highlighterMock->endNoTestCalls(); - - QList states; - states << 4 << 4 << 4 << 4 << 3; - QList sequences; - HighlightSequence seqa(0, 2, Formats::instance().errorFormat()); - HighlightSequence seqb(0, 7, Formats::instance().errorFormat()); - HighlightSequence seqc(seqb); - HighlightSequence seqd(0, 2, Formats::instance().errorFormat()); - HighlightSequence seqe(seqd); - seqe.add(2, 5, Formats::instance().commentFormat()); - sequences << seqa << seqb << seqc << seqd << seqe; - setExpectedData(states, sequences); - - addCharactersToEnd(m_text.document()->firstBlock().next(), "#"); -} - -void tst_HighlighterEngine::testDynamicContexts() -{ - test(); -} - -void tst_HighlighterEngine::testDynamicContexts_data() -{ - createColumns(); - - QList states; - QList sequences; - QString text; - - HighlightSequence seqa(0, 2); - seqa.add(2, 15, Formats::instance().dataTypeFormat()); - seqa.add(15, 16, Formats::instance().othersFormat()); - seqa.add(16, 17, Formats::instance().regionMarketFormat()); - HighlightSequence seqb(seqa); - seqb.add(17, 31, Formats::instance().errorFormat()); - - states << 0; - sequences << seqa; - text = "a ---abcddeeff a "; - QTest::newRow("case 0") << states << sequences << text; - - sequences.clear(); - sequences << seqb; - text = "a ---abcddeeff a beginddeeffend"; - QTest::newRow("case 1") << states << sequences << text; -} - -void tst_HighlighterEngine::testFirstNonSpace() -{ - test(); -} - -void tst_HighlighterEngine::testFirstNonSpace_data() -{ - createColumns(); - - QList states; - QList sequences; - QString text; - - HighlightSequence seqa(0, 1, Formats::instance().errorFormat()); - HighlightSequence seqb(0, 3); - seqb.add(3, 4, Formats::instance().errorFormat()); - HighlightSequence seqc(0, 1); - seqc.add(1, 2, Formats::instance().errorFormat()); - HighlightSequence seqd(0, 2); - - states << 0; - sequences << seqa; - text = "|"; - QTest::newRow("case 0") << states << sequences << text; - - sequences.clear(); - sequences << seqb; - text = " |"; - QTest::newRow("case 1") << states << sequences << text; - - sequences.clear(); - sequences << seqc; - text = "\t|"; - QTest::newRow("case 2") << states << sequences << text; - - sequences.clear(); - sequences << seqd; - text = "a|"; - QTest::newRow("case 3") << states << sequences << text; -} - -QTEST_MAIN(tst_HighlighterEngine) -#include "tst_highlighterengine.moc" - diff --git a/tests/auto/generichighlighter/specificrules/specificrules.pro b/tests/auto/generichighlighter/specificrules/specificrules.pro deleted file mode 100644 index 6c15e34bc9d..00000000000 --- a/tests/auto/generichighlighter/specificrules/specificrules.pro +++ /dev/null @@ -1,14 +0,0 @@ -include(../../qttest.pri) - -PLUGINSDIR = $$IDE_SOURCE_TREE/src/plugins -GENERICHIGHLIGHTERDIR = $$PLUGINSDIR/texteditor/generichighlighter - -SOURCES += tst_specificrules.cpp \ - $$GENERICHIGHLIGHTERDIR/context.cpp \ - $$GENERICHIGHLIGHTERDIR/dynamicrule.cpp \ - $$GENERICHIGHLIGHTERDIR/rule.cpp \ - $$GENERICHIGHLIGHTERDIR/specificrules.cpp \ - $$GENERICHIGHLIGHTERDIR/progressdata.cpp \ - $$GENERICHIGHLIGHTERDIR/highlightdefinition.cpp \ - $$GENERICHIGHLIGHTERDIR/keywordlist.cpp \ - $$GENERICHIGHLIGHTERDIR/itemdata.cpp diff --git a/tests/auto/generichighlighter/specificrules/specificrules.qbs b/tests/auto/generichighlighter/specificrules/specificrules.qbs deleted file mode 100644 index 9548bf0668d..00000000000 --- a/tests/auto/generichighlighter/specificrules/specificrules.qbs +++ /dev/null @@ -1,26 +0,0 @@ -import qbs - -QtcAutotest { - name: "Generic highlighter specific rules autotest" - Depends { name: "Qt.widgets" } - Group { - name: "Sources from TextEditor plugin" - prefix: project.genericHighlighterDir + '/' - files: [ - "context.cpp", - "dynamicrule.cpp", - "highlightdefinition.cpp", - "itemdata.cpp", - "keywordlist.cpp", - "progressdata.cpp", - "rule.cpp", - "specificrules.cpp", - ] - } - Group { - name: "Test sources" - files: "tst_specificrules.cpp" - } - - cpp.includePaths: base.concat([project.genericHighlighterDir + "/../.."]) -} diff --git a/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp b/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp deleted file mode 100644 index 30cd9d552ad..00000000000 --- a/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp +++ /dev/null @@ -1,781 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include -#include -#include -#include - -#include - -//TESTED_COMPONENT=src/plugins/texteditor/generichighlighter -using namespace TextEditor; -using namespace Internal; - -class tst_SpecificRules : public QObject -{ - Q_OBJECT -public: - tst_SpecificRules() : m_definition(new HighlightDefinition) {} - -private slots: - void initTestCase(); - - void testDetectChar(); - void testDetectChar_data(); - - void testDetect2Char(); - void testDetect2Char_data(); - - void testAnyChar(); - void testAnyChar_data(); - - void testStringDetect(); - void testStringDetect_data(); - - void testRegExpr(); - void testRegExpr_data(); - void testRegExprOffsetIncremented(); - void testRegExprOffsetIncremented_data(); - - void testKeywordGlobalSensitiveLocalSensitive(); - void testKeywordGlobalSensitiveLocalSensitive_data(); - void testKeywordGlobalSensitiveLocalInsensitive(); - void testKeywordGlobalSensitiveLocalInsensitive_data(); - void testKeywordGlobalInsensitiveLocalInsensitive(); - void testKeywordGlobalInsensitiveLocalInsensitive_data(); - void testKeywordGlobalInsensitiveLocalSensitive(); - void testKeywordGlobalInsensitiveLocalSensitive_data(); - - void testInt(); - void testInt_data(); - - void testFloat(); - void testFloat_data(); - - void testCOctal(); - void testCOctal_data(); - - void testCHex(); - void testCHex_data(); - - void testCString(); - void testCString_data(); - - void testCChar(); - void testCChar_data(); - - void testRangeDetect(); - void testRangeDetect_data(); - - void testLineContinue(); - void testLineContinue_data(); - - void testDetectSpaces(); - void testDetectSpaces_data(); - - void testDetectIdentifier(); - void testDetectIdentifier_data(); - -private: - void addCommonColumns() const; - void testMatch(Rule *rule); - void testMatch(Rule *rule, ProgressData *progress); - - void noMatchForInt() const; - void noMatchForFloat() const; - void noMatchForCOctal() const; - void noMatchForCHex() const; - void noMatchForNumber() const; - - void commonCasesForKeywords() const; - - QSharedPointer m_definition; -}; - -void tst_SpecificRules::initTestCase() -{ - QSharedPointer list = m_definition->createKeywordList("keywords"); - list->addKeyword("for"); - list->addKeyword("while"); - list->addKeyword("BEGIN"); - list->addKeyword("END"); - list->addKeyword("WeIrD"); -} - -void tst_SpecificRules::addCommonColumns() const -{ - QTest::addColumn("s"); - QTest::addColumn("match"); - QTest::addColumn("offset"); - QTest::addColumn("only spaces"); - QTest::addColumn("will continue"); -} - -void tst_SpecificRules::testMatch(Rule *rule) -{ - ProgressData progress; - testMatch(rule, &progress); -} - -void tst_SpecificRules::testMatch(Rule *rule, ProgressData *progress) -{ - QFETCH(QString, s); - - QTEST(rule->matchSucceed(s, s.length(), progress), "match"); - QTEST(progress->offset(), "offset"); - QTEST(progress->isOnlySpacesSoFar(), "only spaces"); - QTEST(progress->isWillContinueLine(), "will continue"); -} - -void tst_SpecificRules::testDetectChar() -{ - QFETCH(QString, c); - DetectCharRule rule; - rule.setChar(c); - - testMatch(&rule); -} - -void tst_SpecificRules::testDetectChar_data() -{ - QTest::addColumn("c"); - addCommonColumns(); - - QTest::newRow("[#] against [#]") << "#" << "#" << true << 1 << false << false; - QTest::newRow("[#] against [##]") << "#" << "##" << true << 1 << false << false; - QTest::newRow("[#] against [ ]") << "#" << " " << false << 0 << true << false; - QTest::newRow("[#] against [a]") << "#" << "a" << false << 0 << true << false; - QTest::newRow("[#] against [abc]") << "#" << "abc" << false << 0 << true << false; - QTest::newRow("[#] against [x#]") << "#" << "x#" << false << 0 << true << false; - QTest::newRow("[ ] against [a]") << " " << "a" << false << 0 << true << false; - //QTest::newRow("[ ] against [ ]") << " " << " " << true << 1 << true << false; -} - -void tst_SpecificRules::testDetect2Char() -{ - QFETCH(QString, c); - QFETCH(QString, c1); - Detect2CharsRule rule; - rule.setChar(c); - rule.setChar1(c1); - - testMatch(&rule); -} - -void tst_SpecificRules::testDetect2Char_data() -{ - QTest::addColumn("c"); - QTest::addColumn("c1"); - addCommonColumns(); - - QTest::newRow("[//] against [//]") << "/" << "/" << "//" << true << 2 << false << false; - QTest::newRow("[//] against [///]") << "/" << "/" << "///" << true << 2 << false << false; - QTest::newRow("[//] against [// ]") << "/" << "/" << "// " << true << 2 << false << false; - QTest::newRow("[//] against [ //]") << "/" << "/" << " //" << false << 0 << true << false; - QTest::newRow("[//] against [a]") << "/" << "/" << "a" << false << 0 << true << false; - QTest::newRow("[//] against [ a]") << "/" << "/" << " a" << false << 0 << true << false; - QTest::newRow("[//] against [abc]") << "/" << "/" << "abc" << false << 0 << true << false; - QTest::newRow("[//] against [/a]") << "/" << "/" << "/a" << false << 0 << true << false; - QTest::newRow("[//] against [a/]") << "/" << "/" << "a/" << false << 0 << true << false; - QTest::newRow("[ ] against [xx]") << " " << " " << "xx" << false << 0 << true << false; - //QTest::newRow("[ ] against [ ]") << " " << " " << " " << true << 3 << true << false; -} - -void tst_SpecificRules::testAnyChar() -{ - QFETCH(QString, chars); - AnyCharRule rule; - rule.setCharacterSet(chars); - - testMatch(&rule); -} - -void tst_SpecificRules::testAnyChar_data() -{ - QTest::addColumn("chars"); - addCommonColumns(); - - QTest::newRow("[:!<>?] against [:]") << ":!<>?" << ":" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [!]") << ":!<>?" << "!" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [<]") << ":!<>?" << "<" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [>]") << ":!<>?" << ">" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [?]") << ":!<>?" << "?" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [:]") << ":!<>?" << ":" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [ ]") << ":!<>?" << " " << false << 0 << true << false; - QTest::newRow("[:!<>?] against [#]") << ":!<>?" << "#" << false << 0 << true << false; - QTest::newRow("[:!<>?] against [!#]") << ":!<>?" << "!#" << true << 1 << false << false; - QTest::newRow("[:!<>?] against [#!]") << ":!<>?" << "#!" << false << 0 << true << false; - QTest::newRow("[:] against [:]") << ":" << ":" << true << 1 << false << false; - QTest::newRow("[:] against [#]") << ":" << "#" << false << 0 << true << false; - //QTest::newRow("[ ] against [ ]") << " " << " " << true << 1 << true << false; -} - -void tst_SpecificRules::testStringDetect() -{ - QFETCH(QString, referenceString); - QFETCH(QString, insensitive); - StringDetectRule rule; - rule.setString(referenceString); - rule.setInsensitive(insensitive); - - testMatch(&rule); -} - -void tst_SpecificRules::testStringDetect_data() -{ - QTest::addColumn("referenceString"); - QTest::addColumn("insensitive"); - addCommonColumns(); - - QTest::newRow("[LL] against [LL]") << "LL" << "0" << "LL" << true << 2 << false << false; - QTest::newRow("[LL] against [ll]") << "LL" << "0" << "ll" << false << 0 << true << false; - QTest::newRow("[LL] against [ll] i") << "LL" << "1" << "ll" << true << 2 << false << false; - QTest::newRow("[ll] against [ll] i") << "LL" << "1" << "LL" << true << 2 << false << false; - QTest::newRow("[LL] against [5LL]") << "LL" << "0" << "5LL" << false << 0 << true << false; - QTest::newRow("[LL] against [L]") << "LL" << "0" << "L" << false << 0 << true << false; - QTest::newRow("[LL] against [LLL]") << "LL" << "0" << "LLL" << true << 2 << false << false; - QTest::newRow("[LL] against [ ]") << "LL" << "0" << " " << false << 0 << true << false; - QTest::newRow("[LL] against [xLLx]") << "LL" << "0" << "xLLx" << false << 0 << true << false; - QTest::newRow("[\"\"\"] against [\"\"\"]") << "\"\"\"" << "0" << "\"\"\"" << true << 3 - << false << false; -} - -void tst_SpecificRules::testRegExpr() -{ - QFETCH(QString, pattern); - QFETCH(QString, insensitive); - QFETCH(QString, minimal); - RegExprRule rule; - rule.setPattern(pattern); - rule.setInsensitive(insensitive); - rule.setMinimal(minimal); - - testMatch(&rule); -} - -void tst_SpecificRules::testRegExpr_data() -{ - QTest::addColumn("pattern"); - QTest::addColumn("insensitive"); - QTest::addColumn("minimal"); - addCommonColumns(); - - QTest::newRow("[#[a-z]+\\s+\\d] against [#as 9]") << "#[a-z]+\\s+\\d" << "0" << "0" - << "#as 9" << true << 5 << false << false; - QTest::newRow("[#[a-z]+\\s+\\d] against [#As 9]") << "#[a-z]+\\s+\\d" << "0" << "0" - << "#As 9" << false << 0 << true << false; - QTest::newRow("[#[a-z]+\\s+\\d] against [#As 9] i") << "#[a-z]+\\s+\\d" << "1" << "0" - << "#As 9" << true << 5 << false << false; - QTest::newRow("[#[a-z]+\\s+\\d] against [as 9]") << "#[a-z]+\\s+\\d" << "0" << "0" - << "as 9" << false << 0 << true << false; - QTest::newRow("[#[a-z]+\\s+\\d] against [w#as 9]") << "#[a-z]+\\s+\\d" << "0" << "0" - << "w#as 9" << false << 0 << true << false; - QTest::newRow("[^\\s+[a-z]] against [x]") << "^\\s+[a-z]" << "0" << "0" - << "x" << false << 0 << true << false; - QTest::newRow("[^\\s+[a-z]] against [ x]") << "^\\s+[a-z]" << "0" << "0" - << " x" << true << 3 << false << false; - QTest::newRow("[0+] against [1001]") << "0+" << "0" << "0" - << "1001" << false << 0 << true << false; - QTest::newRow("[0+] against [001]") << "0+" << "0" << "0" - << "001" << true << 2 << false << false; - QTest::newRow("[0+] against [001]") << "0+" << "0" << "1" - << "001" << true << 1 << false << false; - QTest::newRow("[\\s*] against []") << "\\s*" << "0" << "0" - << "" << false << 0 << true << false; - //QTest::newRow("[\\s*] against []") << "\\s*" << "0" << "0" - // << " " << true << 1 << true << false; -} - -void tst_SpecificRules::testRegExprOffsetIncremented() -{ - QFETCH(QString, pattern); - RegExprRule rule; - rule.setPattern(pattern); - - ProgressData progress; - progress.setOffset(1); - - testMatch(&rule, &progress); -} - -void tst_SpecificRules::testRegExprOffsetIncremented_data() -{ - QTest::addColumn("pattern"); - addCommonColumns(); - - // To make sure that QRegExp::CaretAtZero is set. - QTest::newRow("[^\\s+[a-z]] against [ x]") << "^\\s+[a-z]" << " x" << false << 1 - << true << false; -} - -void tst_SpecificRules::commonCasesForKeywords() const -{ - QTest::newRow("[for]") << "for" << true << 3 << false << false; - QTest::newRow("[while]") << "while" << true << 5 << false << false; - QTest::newRow("[BEGIN]") << "BEGIN" << true << 5 << false << false; - QTest::newRow("[END]") << "END" << true << 3 << false << false; - QTest::newRow("[WeIrD]") << "WeIrD" << true << 5 << false << false; - QTest::newRow("[forr]") << "forr" << false << 0 << true << false; - QTest::newRow("[for#]") << "for#" << false << 0 << true << false; - QTest::newRow("[abc]") << "abc" << false << 0 << true << false; - QTest::newRow("[ ]") << " " << false << 0 << true << false; - QTest::newRow("[foe]") << "foe" << false << 0 << true << false; - QTest::newRow("[sor]") << "sor" << false << 0 << true << false; - QTest::newRow("[ffor]") << "ffor" << false << 0 << true << false; - - // Valid default delimiters. - QTest::newRow("[for ]") << "for " << true << 3 << false << false; - QTest::newRow("[for.for]") << "for.for" << true << 3 << false << false; - QTest::newRow("[for(]") << "for(" << true << 3 << false << false; - QTest::newRow("[for)]") << "for)" << true << 3 << false << false; - QTest::newRow("[for:]") << "for:" << true << 3 << false << false; - QTest::newRow("[for!]") << "for!" << true << 3 << false << false; - QTest::newRow("[for+]") << "for+" << true << 3 << false << false; - QTest::newRow("[for,]") << "for," << true << 3 << false << false; - QTest::newRow("[for-]") << "for-" << true << 3 << false << false; - QTest::newRow("[for<]") << "for>" << true << 3 << false << false; - QTest::newRow("[for=]") << "for=" << true << 3 << false << false; - QTest::newRow("[for>]") << "for>" << true << 3 << false << false; - QTest::newRow("[for%]") << "for%" << true << 3 << false << false; - QTest::newRow("[for&]") << "for&" << true << 3 << false << false; - QTest::newRow("[for/]") << "for/" << true << 3 << false << false; - QTest::newRow("[for;]") << "for;" << true << 3 << false << false; - QTest::newRow("[for?]") << "for?" << true << 3 << false << false; - QTest::newRow("[for[]") << "for[" << true << 3 << false << false; - QTest::newRow("[for]]") << "for]" << true << 3 << false << false; - QTest::newRow("[for^]") << "for^" << true << 3 << false << false; - QTest::newRow("[for{]") << "for{" << true << 3 << false << false; - QTest::newRow("[for|]") << "for|" << true << 3 << false << false; - QTest::newRow("[for}]") << "for}" << true << 3 << false << false; - QTest::newRow("[for~]") << "for~" << true << 3 << false << false; - QTest::newRow("[for\\]") << "for\\" << true << 3 << false << false; - QTest::newRow("[for*]") << "for*" << true << 3 << false << false; - QTest::newRow("[for,for]") << "for,for" << true << 3 << false << false; - QTest::newRow("[for\t]") << "for\t" << true << 3 << false << false; -} - -void tst_SpecificRules::testKeywordGlobalSensitiveLocalSensitive() -{ - m_definition->setKeywordsSensitive("true"); - KeywordRule rule(m_definition); - rule.setInsensitive("false"); - rule.setList("keywords"); - - testMatch(&rule); -} - -void tst_SpecificRules::testKeywordGlobalSensitiveLocalSensitive_data() -{ - addCommonColumns(); - - commonCasesForKeywords(); - QTest::newRow("[fOr]") << "fOr" << false << 0 << true << false; - QTest::newRow("[whilE") << "whilE" << false << 0 << true << false; - QTest::newRow("[bEGIN]") << "bEGIN" << false << 0 << true << false; - QTest::newRow("[end]") << "end" << false << 0 << true << false; - QTest::newRow("[weird]") << "weird" << false << 0 << true << false; -} - -void tst_SpecificRules::testKeywordGlobalSensitiveLocalInsensitive() -{ - m_definition->setKeywordsSensitive("true"); - KeywordRule rule(m_definition); - rule.setInsensitive("true"); - rule.setList("keywords"); - - testMatch(&rule); -} - -void tst_SpecificRules::testKeywordGlobalSensitiveLocalInsensitive_data() -{ - addCommonColumns(); - - commonCasesForKeywords(); - QTest::newRow("[fOr]") << "fOr" << true << 3 << false << false; - QTest::newRow("[whilE") << "whilE" << true << 5 << false << false; - QTest::newRow("[bEGIN]") << "bEGIN" << true << 5 << false << false; - QTest::newRow("[end]") << "end" << true << 3 << false << false; - QTest::newRow("[weird]") << "weird" << true << 5 << false << false; -} - -void tst_SpecificRules::testKeywordGlobalInsensitiveLocalInsensitive() -{ - m_definition->setKeywordsSensitive("false"); - KeywordRule rule(m_definition); - rule.setInsensitive("true"); - rule.setList("keywords"); - - testMatch(&rule); -} - -void tst_SpecificRules::testKeywordGlobalInsensitiveLocalInsensitive_data() -{ - testKeywordGlobalSensitiveLocalInsensitive_data(); -} - -void tst_SpecificRules::testKeywordGlobalInsensitiveLocalSensitive() -{ - m_definition->setKeywordsSensitive("false"); - KeywordRule rule(m_definition); - rule.setInsensitive("false"); - rule.setList("keywords"); - - testMatch(&rule); -} - -void tst_SpecificRules::testKeywordGlobalInsensitiveLocalSensitive_data() -{ - testKeywordGlobalSensitiveLocalSensitive_data(); -} - -void tst_SpecificRules::noMatchForInt() const -{ - QTest::newRow("[1]") << "1" << false << 0 << true << false; - QTest::newRow("[1299]") << "1299" << false << 0 << true << false; - QTest::newRow("[10]") << "10" << false << 0 << true << false; - QTest::newRow("[9]") << "9" << false << 0 << true << false; -} - -void tst_SpecificRules::noMatchForFloat() const -{ - QTest::newRow("[4e-11]") << "4e-11" << false << 0 << true << false; - QTest::newRow("[1e+5]") << "1e+5" << false << 0 << true << false; - QTest::newRow("[7.321E-3]") << "7.321E-3" << false << 0 << true << false; - QTest::newRow("[3.2E+4]") << "3.2E+4" << false << 0 << true << false; - QTest::newRow("[0.5e-6]") << "0.5e-6" << false << 0 << true << false; - QTest::newRow("[0.45]") << "0.45" << false << 0 << true << false; - QTest::newRow("[6.e10]") << "6.e10" << false << 0 << true << false; - QTest::newRow("[.2e23]") << ".2e23" << false << 0 << true << false; - QTest::newRow("[23.]") << "23." << false << 0 << true << false; - QTest::newRow("[2.e23]") << "2.e23" << false << 0 << true << false; - QTest::newRow("[23e2]") << "23e2" << false << 0 << true << false; - QTest::newRow("[4.3e]") << "4.3e" << false << 0 << true << false; - QTest::newRow("[4.3ef]") << "4.3ef" << false << 0 << true << false; -} - -void tst_SpecificRules::noMatchForCOctal() const -{ - QTest::newRow("[0]") << "0" << false << 0 << true << false; - QTest::newRow("[07]") << "07" << false << 0 << true << false; - QTest::newRow("[01234567]") << "01234567" << false << 0 << true << false; -} - -void tst_SpecificRules::noMatchForCHex() const -{ - QTest::newRow("[0X934AF]") << "0X934AF" << false << 0 << true << false; - QTest::newRow("[0x934af]") << "0x934af" << false << 0 << true << false; -} - -void tst_SpecificRules::noMatchForNumber() const -{ - QTest::newRow("[a]") << "a" << false << 0 << true << false; - QTest::newRow("[#]") << "#" << false << 0 << true << false; - QTest::newRow("[ ]") << " " << false << 0 << true << false; - QTest::newRow("[a1]") << "a1" << false << 0 << true << false; - QTest::newRow("[.e23]") << ".e23" << false << 0 << true << false; - QTest::newRow("[.e23]") << ".e23" << false << 0 << true << false; - - // + and - are not directly matched by number rules. - QTest::newRow("[+1]") << "+1" << false << 0 << true << false; - QTest::newRow("[-1]") << "-1" << false << 0 << true << false; -} - -void tst_SpecificRules::testInt() -{ - IntRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testInt_data() -{ - addCommonColumns(); - - noMatchForCOctal(); - noMatchForCHex(); - noMatchForNumber(); - - QTest::newRow("[1]") << "1" << true << 1 << false << false; - QTest::newRow("[1299]") << "1299" << true << 4 << false << false; - QTest::newRow("[10]") << "10" << true << 2 << false << false; - QTest::newRow("[9]") << "9" << true << 1 << false << false; - - // LL, U, and others are matched through child rules. - QTest::newRow("[234U]") << "234U" << true << 3 << false << false; - QTest::newRow("[234LL]") << "234LL" << true << 3 << false << false; -} - -void tst_SpecificRules::testFloat() -{ - FloatRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testFloat_data() -{ - addCommonColumns(); - - noMatchForInt(); - noMatchForCOctal(); - noMatchForCHex(); - noMatchForNumber(); - - QTest::newRow("[4e-11]") << "4e-11" << true << 5 << false << false; - QTest::newRow("[1e+5]") << "1e+5" << true << 4 << false << false; - QTest::newRow("[7.321E-3]") << "7.321E-3" << true << 8 << false << false; - QTest::newRow("[3.2E+4]") << "3.2E+4" << true << 6 << false << false; - QTest::newRow("[0.5e-6]") << "0.5e-6" << true << 6 << false << false; - QTest::newRow("[0.45]") << "0.45" << true << 4 << false << false; - QTest::newRow("[6.e10]") << "6.e10" << true << 5 << false << false; - QTest::newRow("[.2e23]") << ".2e23" << true << 5 << false << false; - QTest::newRow("[23.]") << "23." << true << 3 << false << false; - QTest::newRow("[2.e23]") << "2.e23" << true << 5 << false << false; - QTest::newRow("[23e2]") << "23e2" << true << 4 << false << false; - - // F, L, and others are matched through child rules. - QTest::newRow("[6.e10f]") << "6.e10f" << true << 5 << false << false; - QTest::newRow("[0.5e-6F]") << "0.5e-6F" << true << 6 << false << false; - QTest::newRow("[23.f]") << "23.f" << true << 3 << false << false; - QTest::newRow("[.2L]") << ".2L" << true << 2 << false << false; -} - -void tst_SpecificRules::testCOctal() -{ - HlCOctRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testCOctal_data() -{ - addCommonColumns(); - - noMatchForInt(); - noMatchForCHex(); - noMatchForNumber(); - - QTest::newRow("[0]") << "0" << true << 1 << false << false; - QTest::newRow("[07]") << "07" << true << 2 << false << false; - QTest::newRow("[01234567]") << "01234567" << true << 8 << false << false; - QTest::newRow("[012345678]") << "012345678" << true << 8 << false << false; - QTest::newRow("[0888]") << "0888" << true << 1 << false << false; -} - -void tst_SpecificRules::testCHex() -{ - HlCHexRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testCHex_data() -{ - addCommonColumns(); - - noMatchForInt(); - noMatchForFloat(); - noMatchForCOctal(); - noMatchForNumber(); - - QTest::newRow("[0X934AF]") << "0X934AF" << true << 7 << false << false; - QTest::newRow("[0x934af]") << "0x934af" << true << 7 << false << false; - QTest::newRow("[0x2ik]") << "0x2ik" << true << 3 << false << false; -} - -void tst_SpecificRules::testCString() -{ - HlCStringCharRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testCString_data() -{ - addCommonColumns(); - - // Escape sequences - QTest::newRow("[\\a]") << "\\a" << true << 2 << false << false; - QTest::newRow("[\\b]") << "\\b" << true << 2 << false << false; - QTest::newRow("[\\e]") << "\\e" << true << 2 << false << false; - QTest::newRow("[\\f]") << "\\f" << true << 2 << false << false; - QTest::newRow("[\\n]") << "\\n" << true << 2 << false << false; - QTest::newRow("[\\r]") << "\\r" << true << 2 << false << false; - QTest::newRow("[\\t]") << "\\t" << true << 2 << false << false; - QTest::newRow("[\\v]") << "\\v" << true << 2 << false << false; - QTest::newRow("[\\?]") << "\\?" << true << 2 << false << false; - QTest::newRow("[\\']") << "\\'" << true << 2 << false << false; - QTest::newRow("[\\\"]") << "\\\"" << true << 2 << false << false; - QTest::newRow("[\\\\]") << "\\\\" << true << 2 << false << false; - QTest::newRow("[\\c]") << "\\c" << false << 0 << true << false; - QTest::newRow("[x]") << "x" << false << 0 << true << false; - QTest::newRow("[ ]") << " " << false << 0 << true << false; - QTest::newRow("[a]") << "x" << false << 0 << true << false; - QTest::newRow("[r]") << "r" << false << 0 << true << false; - QTest::newRow("[//]") << "//" << false << 0 << true << false; - - // Octal values - QTest::newRow("[\\1]") << "\\1" << true << 2 << false << false; - QTest::newRow("[\\12]") << "\\12" << true << 3 << false << false; - QTest::newRow("[\\123]") << "\\123" << true << 4 << false << false; - QTest::newRow("[\\1234]") << "\\1234" << true << 4 << false << false; - QTest::newRow("[\\123x]") << "\\123x" << true << 4 << false << false; - - // Hex values - QTest::newRow("[\\xa]") << "\\xa" << true << 3 << false << false; - QTest::newRow("[\\xA]") << "\\xA" << true << 3 << false << false; - QTest::newRow("[\\Xa]") << "\\Xa" << false << 0 << true << false; - QTest::newRow("[\\xA10]") << "\\xA10" << true << 5 << false << false; - QTest::newRow("[\\xA0123456789]") << "\\xA0123456789" << true << 13 << false << false; - QTest::newRow("[\\xABCDEF]") << "\\xABCDEF" << true << 8 << false << false; - QTest::newRow("[\\xABCDEFGHI]") << "\\xABCDEFGHI" << true << 8 << false << false; -} - -void tst_SpecificRules::testCChar() -{ - HlCCharRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testCChar_data() -{ - addCommonColumns(); - - // Escape sequences - QTest::newRow("[\'\\a\']") << "\'\\a\'" << true << 4 << false << false; - QTest::newRow("[\'\\b\']") << "\'\\b\'" << true << 4 << false << false; - QTest::newRow("[\'\\e\']") << "\'\\e\'" << true << 4 << false << false; - QTest::newRow("[\'\\f\']") << "\'\\f\'" << true << 4 << false << false; - QTest::newRow("[\'\\n\']") << "\'\\n\'" << true << 4 << false << false; - QTest::newRow("[\'\\r\']") << "\'\\r\'" << true << 4 << false << false; - QTest::newRow("[\'\\t\']") << "\'\\t\'" << true << 4 << false << false; - QTest::newRow("[\'\\v\']") << "\'\\v\'" << true << 4 << false << false; - QTest::newRow("[\'\\?\']") << "\'\\?\'" << true << 4 << false << false; - QTest::newRow("[\'\\'\']") << "\'\\'\'" << true << 4 << false << false; - QTest::newRow("[\'\\\"\']") << "\'\\\"\'" << true << 4 << false << false; - QTest::newRow("[\'\\\\\']") << "\'\\\\\'" << true << 4 << false << false; - QTest::newRow("[\'\\c\']") << "\'\\c\'" << false << 0 << true << false; - QTest::newRow("[x]") << "x" << false << 0 << true << false; - QTest::newRow("[ ]") << " " << false << 0 << true << false; - QTest::newRow("[a]") << "x" << false << 0 << true << false; - QTest::newRow("[r]") << "r" << false << 0 << true << false; - QTest::newRow("[//]") << "//" << false << 0 << true << false; -} - -void tst_SpecificRules::testRangeDetect() -{ - QFETCH(QString, c); - QFETCH(QString, c1); - RangeDetectRule rule; - rule.setChar(c); - rule.setChar1(c1); - - testMatch(&rule); -} - -void tst_SpecificRules::testRangeDetect_data() -{ - QTest::addColumn("c"); - QTest::addColumn("c1"); - addCommonColumns(); - - QTest::newRow("[<>] against []") << "<" << ">" << "" - << true << 9 << false << false; - QTest::newRow("[<>] against ") << "<" << ">" << "" << true << 3 << false << false; - QTest::newRow("[<>] against < >") << "<" << ">" << "< >" << true << 5 << false << false; - QTest::newRow("[<>] against abc") << "<" << ">" << "abc" << true << 3 << false << false; - QTest::newRow("[<>] against ") << "<" << ">" << " " << true << 3 << false << false; - QTest::newRow("[<>] against abc") << "<" << ">" << "abc" << false << 0 << true << false; - QTest::newRow("[<>] against " << "] against abc<") << "<" << ">" << "abc<" << false << 0 << true << false; - QTest::newRow("[<>] against a" << "a] against abc<") << "<" << ">" << "abc<" << false << 0 << true << false; - QTest::newRow("[\"\"] against \"test.h\"") << "\"" << "\"" << "\"test.h\"" - << true << 8 << false << false; -} - -void tst_SpecificRules::testLineContinue() -{ - LineContinueRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testLineContinue_data() -{ - addCommonColumns(); - - QTest::newRow("\\") << "\\" << true << 1 << false << true; - QTest::newRow("\\\\") << "\\\\" << false << 0 << true << false; - QTest::newRow("\\x") << "\\x" << false << 0 << true << false; - QTest::newRow("x\\") << "x\\" << false << 0 << true << false; - QTest::newRow("x") << "x" << false << 0 << true << false; - QTest::newRow("/") << "/" << false << 0 << true << false; -} - -void tst_SpecificRules::testDetectSpaces() -{ - DetectSpacesRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testDetectSpaces_data() -{ - addCommonColumns(); - - QTest::newRow(" ") << " " << true << 1 << true << false; - QTest::newRow(" ") << " " << true << 4 << true << false; - QTest::newRow("\t") << "\t" << true << 1 << true << false; - QTest::newRow("x") << "x" << false << 0 << true << false; - QTest::newRow("#") << "#" << false << 0 << true << false; -} - -void tst_SpecificRules::testDetectIdentifier() -{ - DetectIdentifierRule rule; - testMatch(&rule); -} - -void tst_SpecificRules::testDetectIdentifier_data() -{ - addCommonColumns(); - - QTest::newRow("name") << "name" << true << 4 << false << false; - QTest::newRow("x") << "x" << true << 1 << false << false; - QTest::newRow("x1") << "x1" << true << 2 << false << false; - QTest::newRow("1x") << "1x" << false << 0 << true << false; - QTest::newRow("_x") << "_x" << true << 2 << false << false; - QTest::newRow("___x") << "___x" << true << 4 << false << false; - QTest::newRow("-x") << "-x" << false << 0 << true << false; - QTest::newRow("@x") << "@x" << false << 0 << true << false; - QTest::newRow("+x") << "+x" << false << 0 << true << false; - QTest::newRow("#x") << "#x" << false << 0 << true << false; - QTest::newRow("x_x") << "x_x" << true << 3 << false << false; - QTest::newRow("x1x") << "x1x" << true << 3 << false << false; - QTest::newRow("x#x") << "x#x" << true << 1 << false << false; - QTest::newRow("x-x") << "x-x" << true << 1 << false << false; - QTest::newRow("abc_") << "abc_" << true << 4 << false << false; - QTest::newRow("abc____") << "abc____" << true << 7 << false << false; - QTest::newRow("abc-") << "abc-" << true << 3 << false << false; - QTest::newRow("abc$") << "abc$" << true << 3 << false << false; -} - -QTEST_MAIN(tst_SpecificRules) -#include "tst_specificrules.moc" diff --git a/tests/auto/qml/qmleditor/qmlcodeformatter/qmlcodeformatter.qbs b/tests/auto/qml/qmleditor/qmlcodeformatter/qmlcodeformatter.qbs index 3cccb75c166..c0ad2eff3a9 100644 --- a/tests/auto/qml/qmleditor/qmlcodeformatter/qmlcodeformatter.qbs +++ b/tests/auto/qml/qmleditor/qmlcodeformatter/qmlcodeformatter.qbs @@ -4,6 +4,7 @@ QtcAutotest { name: "QML code formatter autotest" Depends { name: "QmlJS" } Depends { name: "QmlJSTools" } + Depends { name: "TextEditor" } Depends { name: "Qt.widgets" } files: "tst_qmlcodeformatter.cpp" }