diff --git a/src/libs/3rdparty/syntax-highlighting/.git-blame-ignore-revs b/src/libs/3rdparty/syntax-highlighting/.git-blame-ignore-revs new file mode 100644 index 00000000000..8b2ba6d3d5f --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.git-blame-ignore-revs @@ -0,0 +1,4 @@ +# clang-format +56ed6f3f5f505eb0dbffc630729d67c3fb510546 +#clang-tidy +0960472cc3f57831a97697a4ae0cd139e2cc5551 diff --git a/src/libs/3rdparty/syntax-highlighting/.gitignore b/src/libs/3rdparty/syntax-highlighting/.gitignore index 4d50e82c2dc..a29428fe5e1 100644 --- a/src/libs/3rdparty/syntax-highlighting/.gitignore +++ b/src/libs/3rdparty/syntax-highlighting/.gitignore @@ -9,6 +9,11 @@ callgrind.* heaptrack.* /build*/ *.unc-backup* -.clang-format -.cmake/ -*.code-workspace \ No newline at end of file +/.clang-format +/.cmake/ +/*.code-workspace +/compile_commands.json +.clangd +.idea +/cmake-build* +.cache diff --git a/src/libs/3rdparty/syntax-highlighting/.gitlab-ci.yml b/src/libs/3rdparty/syntax-highlighting/.gitlab-ci.yml new file mode 100644 index 00000000000..8950fb6d61c --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.gitlab-ci.yml @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2020 Volker Krause +# SPDX-License-Identifier: CC0-1.0 + +include: + - https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml diff --git a/src/libs/3rdparty/syntax-highlighting/.kde-ci.yml b/src/libs/3rdparty/syntax-highlighting/.kde-ci.yml new file mode 100644 index 00000000000..cf1d3363f9d --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/.kde-ci.yml @@ -0,0 +1,7 @@ +Dependencies: +- 'on': ['@all'] + 'require': + 'frameworks/extra-cmake-modules': '@same' + +Options: + test-before-installing: True diff --git a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt index 8dc268071a8..25f1af35730 100644 --- a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt @@ -10,11 +10,12 @@ add_qtc_library(KSyntaxHighlighting SHARED PUBLIC_INCLUDES src/lib autogenerated/src/lib - DEFINES KSYNTAXHIGHLIGHTING_LIBRARY + DEFINES KF5SyntaxHighlighting_EXPORTS DEPENDS Qt5::Network Qt5::Widgets SOURCES autogenerated/src/lib/ksyntaxhighlighting_logging.cpp autogenerated/src/lib/ksyntaxhighlighting_logging.h autogenerated/ksyntaxhighlighting_version.h + autogenerated/src/lib/ksyntaxhighlighting_export.h data/themes/theme-data.qrc @@ -29,7 +30,6 @@ add_qtc_library(KSyntaxHighlighting SHARED src/lib/format.cpp src/lib/format.h src/lib/format_p.h src/lib/htmlhighlighter.cpp src/lib/htmlhighlighter.h src/lib/keywordlist.cpp src/lib/keywordlist_p.h - src/lib/ksyntaxhighlighting_export.h src/lib/matchresult_p.h src/lib/repository.cpp src/lib/repository.h src/lib/repository_p.h src/lib/rule.cpp src/lib/rule_p.h diff --git a/src/libs/3rdparty/syntax-highlighting/README.md b/src/libs/3rdparty/syntax-highlighting/README.md index 2acff73b185..2e668dd3da6 100644 --- a/src/libs/3rdparty/syntax-highlighting/README.md +++ b/src/libs/3rdparty/syntax-highlighting/README.md @@ -23,6 +23,8 @@ It's meant as a building block for text editors as well as for simple highlighte text rendering (e.g. as HTML), supporting both integration with a custom editor as well as a ready-to-use QSyntaxHighlighter sub-class. +Besides a C++ API, a [QML API](@ref qml_api) is also provided. + ## Out of scope To not turn this into yet another text editor, the following things are considered @@ -46,7 +48,7 @@ in **data/syntax/** and have the **.xml** extension. Additional ones are picked up from the file system if present, so you can easily extend this by application-specific syntax definitions for example. -To install or test a syntax definiton file locally, place it in +To install or test a syntax definition file locally, place it in **org.kde.syntax-highlighting/syntax/**, which is located in your user directory. Usually it is: @@ -56,47 +58,56 @@ Usually it is: $HOME/.local/share/org.kde.syntax-highlighting/syntax/ - For Kate's Flatpak package - $HOME/.var/app/org.kde.kate/data/org.kde.syntax-highlighting/syntax/ + For Flatpak packages + $HOME/.var/app/package-name/data/org.kde.syntax-highlighting/syntax/ - For Kate's Snap package - $HOME/snap/kate/current/.local/share/org.kde.syntax-highlighting/syntax/ + For Snap packages + $HOME/snap/package-name/current/.local/share/org.kde.syntax-highlighting/syntax/ On Windows® %USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\ + + On macOS® + $HOME/Library/Application Support/org.kde.syntax-highlighting/syntax/ + For more details, see ["The Highlight Definition XML Format" (Working with Syntax Highlighting, KDE Documentation)](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html#katehighlight-xml-format). -Also, in **data/schema/** there is a script to validate the syntax definiton XML +Also, in **data/schema/** there is a script to validate the syntax definition XML files. Use the command `validatehl.sh mySyntax.xml`. ## Color theme files -This library includes the color themes, the theme files use the **JSON** -format and are located in **data/themes/** with the **.theme** extension. +This library includes the color themes, which are documented +[here](https://docs.kde.org/?application=katepart&branch=trunk5&path=color-themes.html). +The color theme files use the JSON format and are located in **data/themes/** +with the **.theme** extension. Additional ones are also picked up from the file system if present, in the **org.kde.syntax-highlighting/themes/** folder of your user directory, -allowing you to easily add custom color theme files. -The location of **org.kde.syntax-highlighting/themes/** is the same +allowing you to easily add custom color theme files. This location is the same as shown in the table of the [previous section](#syntax-definition-files), replacing the **syntax** folder with **themes**. +For more details, see ["The Color Themes JSON Format" (Working with Color Themes, KDE Documentation)](https://docs.kde.org/?application=katepart&branch=trunk5&path=color-themes.html#color-themes-json). The [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/) library -(used by Kate, Kile and KDevelop, for example) provides -a user interface for editing and creating KSyntaxHighlighting color themes, including +(used by Kate, Kile and KDevelop, for example) provides a +[user interface](https://docs.kde.org/?application=katepart&branch=trunk5&path=color-themes.html#color-themes-gui) +for editing and creating KSyntaxHighlighting color themes, including a tool for exporting and importing the JSON theme files. + +Note that in KDE text editors, the KSyntaxHighlighting color themes are used +[since KDE Frameworks 5.75](https://kate-editor.org/post/2020/2020-09-13-kate-color-themes-5.75/), +released on October 10, 2020. Previously, Kate's color schemes +(KConfig based schema config) were used and are now deprecated. The tool **utils/schema-converter/** and the script **utils/kateschema_to_theme_converter.py** convert the old Kate schemas to KSyntaxHighlighting themes. -For more information, see: - -* [Kate - Color Themes with Frameworks 5.75 (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-13-kate-color-themes-5.75/) -* [Submit a KSyntaxHighlighting Color Theme (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-18-submit-a-ksyntaxhighlighting-color-theme/) +Also see ["Submit a KSyntaxHighlighting Color Theme" (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-18-submit-a-ksyntaxhighlighting-color-theme/). ## Build it diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri b/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri index aee620add95..1c540d45bed 100644 --- a/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/autogenerated.pri @@ -6,4 +6,5 @@ SOURCES += \ HEADERS += \ $$PWD/ksyntaxhighlighting_version.h \ - $$PWD/src/lib/ksyntaxhighlighting_logging.h + $$PWD/src/lib/ksyntaxhighlighting_logging.h \ + $$PWD/src/lib/ksyntaxhighlighting_export.h diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h index 32e5aa62a75..a8c5d74235a 100644 --- a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h @@ -3,10 +3,10 @@ #ifndef SyntaxHighlighting_VERSION_H #define SyntaxHighlighting_VERSION_H -#define SyntaxHighlighting_VERSION_STRING "5.80.0" +#define SyntaxHighlighting_VERSION_STRING "5.87.0" #define SyntaxHighlighting_VERSION_MAJOR 5 -#define SyntaxHighlighting_VERSION_MINOR 80 +#define SyntaxHighlighting_VERSION_MINOR 87 #define SyntaxHighlighting_VERSION_PATCH 0 -#define SyntaxHighlighting_VERSION ((5<<16)|(80<<8)|(0)) +#define SyntaxHighlighting_VERSION ((5<<16)|(87<<8)|(0)) #endif diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/WildcardMatcher b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/WildcardMatcher new file mode 100644 index 00000000000..ecea1b09bd9 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/WildcardMatcher @@ -0,0 +1 @@ +#include "wildcardmatcher.h" diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h new file mode 100644 index 00000000000..1213499635c --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h @@ -0,0 +1,218 @@ + +#ifndef KSYNTAXHIGHLIGHTING_EXPORT_H +#define KSYNTAXHIGHLIGHTING_EXPORT_H + +#include + +#ifdef KSYNTAXHIGHLIGHTING_STATIC_DEFINE +# define KSYNTAXHIGHLIGHTING_EXPORT +# define KSYNTAXHIGHLIGHTING_NO_EXPORT +#else +# ifndef KSYNTAXHIGHLIGHTING_EXPORT +# ifdef KF5SyntaxHighlighting_EXPORTS + /* We are building this library */ +# define KSYNTAXHIGHLIGHTING_EXPORT Q_DECL_EXPORT +# else + /* We are using this library */ +# define KSYNTAXHIGHLIGHTING_EXPORT Q_DECL_IMPORT +# endif +# endif + +# ifndef KSYNTAXHIGHLIGHTING_NO_EXPORT +# define KSYNTAXHIGHLIGHTING_NO_EXPORT +# endif +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DECL_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DECL_DEPRECATED __declspec(deprecated) +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_EXPORT +# define KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_NO_EXPORT +# define KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED +#endif + +#if 0 /* DEFINE_NO_DEPRECATED */ +# ifndef KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# endif +#endif + +#define KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_TEXT(text) __declspec(deprecated(text)) + +#define ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +/* Take any defaults from group settings */ +#if !defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED) && !defined(KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) +# ifdef KF_NO_DEPRECATED +# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# elif defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT) +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT +# endif +#endif +#if !defined(KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) && defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT) +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT +#endif + +#if !defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS) && !defined(KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE) +# ifdef KF_NO_DEPRECATED_WARNINGS +# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS +# elif defined(KF_DEPRECATED_WARNINGS_SINCE) +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE +# endif +#endif +#if !defined(KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE) && defined(KF_DEPRECATED_WARNINGS_SINCE) +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE +#endif + +#if defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED) +# undef KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT +#elif defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS) +# define KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT +#else +# define KSYNTAXHIGHLIGHTING_DEPRECATED KSYNTAXHIGHLIGHTING_DECL_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_NO_EXPORT +#endif + +/* No deprecated API had been removed from build */ +#define KSYNTAXHIGHLIGHTING_EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 + +#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1 + +#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55700 +#endif +#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0 +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE +# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# else +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55700 +# endif +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0 +#endif + +#ifdef KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_ENABLE_DEPRECATED_SINCE(major, minor) (ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, 0) > KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) +#else +# define KSYNTAXHIGHLIGHTING_ENABLE_DEPRECATED_SINCE(major, minor) 0 +#endif + +#if KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE >= 0x55700 +# define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_87(text) KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_TEXT(text) +#else +# define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_87(text) +#endif +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5(minor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_##minor(text) +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION(major, minor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_##major(minor, "Since "#major"."#minor". " text) +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_##major(minor, "Since "#textmajor"."#textminor". " text) +// Not yet implemented for MSVC +#define KSYNTAXHIGHLIGHTING_ENUMERATOR_DEPRECATED_VERSION(major, minor, text) +#define KSYNTAXHIGHLIGHTING_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) + +#endif /* KSYNTAXHIGHLIGHTING_EXPORT_H */ + + +#ifndef ECM_GENERATEEXPORTHEADER_KSYNTAXHIGHLIGHTING_EXPORT_H +#define ECM_GENERATEEXPORTHEADER_KSYNTAXHIGHLIGHTING_EXPORT_H + + +#define KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_TEXT(text) __declspec(deprecated(text)) + +#define ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +/* Take any defaults from group settings */ +#if !defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED) && !defined(KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) +# ifdef KF_NO_DEPRECATED +# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# elif defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT) +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT +# endif +#endif +#if !defined(KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) && defined(KF_DISABLE_DEPRECATED_BEFORE_AND_AT) +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT KF_DISABLE_DEPRECATED_BEFORE_AND_AT +#endif + +#if !defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS) && !defined(KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE) +# ifdef KF_NO_DEPRECATED_WARNINGS +# define KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS +# elif defined(KF_DEPRECATED_WARNINGS_SINCE) +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE +# endif +#endif +#if !defined(KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE) && defined(KF_DEPRECATED_WARNINGS_SINCE) +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KF_DEPRECATED_WARNINGS_SINCE +#endif + +#if defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED) +# undef KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT +#elif defined(KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS) +# define KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_NO_EXPORT +#else +# define KSYNTAXHIGHLIGHTING_DEPRECATED KSYNTAXHIGHLIGHTING_DECL_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DEPRECATED_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_EXPORT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_NO_EXPORT KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_NO_EXPORT +#endif + +/* No deprecated API had been removed from build */ +#define KSYNTAXHIGHLIGHTING_EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 + +#define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1 + +#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55700 +#endif +#ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0 +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE +# ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# else +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55700 +# endif +#endif + +#ifndef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0 +#endif + +#ifdef KSYNTAXHIGHLIGHTING_DEPRECATED +# define KSYNTAXHIGHLIGHTING_ENABLE_DEPRECATED_SINCE(major, minor) (ECM_GENERATEEXPORTHEADER_VERSION_VALUE(major, minor, 0) > KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT) +#else +# define KSYNTAXHIGHLIGHTING_ENABLE_DEPRECATED_SINCE(major, minor) 0 +#endif + +#if KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE >= 0x55700 +# define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_87(text) KSYNTAXHIGHLIGHTING_DECL_DEPRECATED_TEXT(text) +#else +# define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_87(text) +#endif +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5(minor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_5_##minor(text) +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION(major, minor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_##major(minor, "Since "#major"."#minor". " text) +#define KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) KSYNTAXHIGHLIGHTING_DEPRECATED_VERSION_##major(minor, "Since "#textmajor"."#textminor". " text) +// Not yet implemented for MSVC +#define KSYNTAXHIGHLIGHTING_ENUMERATOR_DEPRECATED_VERSION(major, minor, text) +#define KSYNTAXHIGHLIGHTING_ENUMERATOR_DEPRECATED_VERSION_BELATED(major, minor, textmajor, textminor, text) + + +#endif /* ECM_GENERATEEXPORTHEADER_KSYNTAXHIGHLIGHTING_EXPORT_H */ diff --git a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt index 8b923c47952..acc2429ec84 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt @@ -38,8 +38,11 @@ generate_syntax_definition(generate-doxygenlua.pl doxygenlua.xml doxygen.xml) file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml") set(defs ${src_defs} ${gen_defs}) +# object library to make cross-folder dependencies work +add_library(SyntaxHighlightingData OBJECT) + # theme data resource -qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc) +target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc) # do we want syntax files bundled in the library? if (QRC_SYNTAX) @@ -66,14 +69,10 @@ if (QRC_SYNTAX) ) 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) + target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp) else() # install the syntax files as normal files into the prefix install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/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 diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl index 8e8d37d266c..1c1a3da4ba2 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl @@ -22,7 +22,7 @@ @@ -172,6 +175,7 @@ target-properties: - EXCLUDE_FROM_ALL - EXCLUDE_FROM_DEFAULT_BUILD_ - EXCLUDE_FROM_DEFAULT_BUILD + - EXPORT_COMPILE_COMMANDS # Since 3.20 - EXPORT_NAME - EXPORT_PROPERTIES # Since 3.12 - FOLDER @@ -243,6 +247,7 @@ target-properties: - _CPPCHECK # Since 3.10 - _CPPLINT - _INCLUDE_WHAT_YOU_USE + - _LINKER_LAUNCHER # Sine 3.21 - _VISIBILITY_PRESET - LIBRARY_OUTPUT_DIRECTORY_ - LIBRARY_OUTPUT_DIRECTORY @@ -284,7 +289,6 @@ target-properties: - OBJCXX_STANDARD # Since 3.16 - OBJCXX_STANDARD_REQUIRED # Since 3.16 - OPTIMIZE_DEPENDENCIES # Since 3.19 - - OBJC_STANDARD - OSX_ARCHITECTURES_ - OSX_ARCHITECTURES - OSX_CURRENT_VERSION # Since 3.17 @@ -329,6 +333,7 @@ target-properties: - UNITY_BUILD_CODE_AFTER_INCLUDE # Since 3.16 - UNITY_BUILD_CODE_BEFORE_INCLUDE # Since 3.16 - UNITY_BUILD_MODE # Since 3.18 + - UNITY_BUILD_UNIQUE_ID # Since 3.20 - VERSION - VISIBILITY_INLINES_HIDDEN - VS_CONFIGURATION_TYPE @@ -372,6 +377,10 @@ target-properties: - WIN32_EXECUTABLE - WINDOWS_EXPORT_ALL_SYMBOLS - XCODE_ATTRIBUTE_ + - XCODE_EMBED__CODE_SIGN_ON_COPY # Since 3.20 + - XCODE_EMBED__PATH # Since 3.20 + - XCODE_EMBED__REMOVE_HEADERS_ON_COPY # Since 3.20 + - XCODE_EMBED_ # Since 3.20 - XCODE_EXPLICIT_FILE_TYPE - XCODE_GENERATE_SCHEME # Since 3.15 - XCODE_LINK_BUILD_PHASE_MODE # Since 3.19 @@ -572,6 +581,7 @@ generator-expressions: - TARGET_BUNDLE_DIR - TARGET_BUNDLE_CONTENT_DIR - TARGET_PROPERTY + - TARGET_RUNTIME_DLLS # Since 3.21 - INSTALL_PREFIX # Output-Related Expressions - TARGET_NAME @@ -581,6 +591,8 @@ generator-expressions: - MAKE_C_IDENTIFIER - TARGET_OBJECTS - SHELL_PATH + - OUTPUT_CONFIG # Since 3.20 + - COMMAND_CONFIG # Since 3.20 variables: # Variables that Provide Information @@ -687,6 +699,7 @@ variables: - CMAKE_XCODE_PLATFORM_TOOLSET - _BINARY_DIR - _DESCRIPTION # Since 3.12 + - _IS_TOP_LEVEL # Since 3.21 - _HOMEPAGE_URL # Since 3.12 - _SOURCE_DIR - _VERSION @@ -696,6 +709,7 @@ variables: - _VERSION_TWEAK - PROJECT_BINARY_DIR - PROJECT_DESCRIPTION # Since 3.9 + - PROJECT_IS_TOP_LEVEL # Since 3.21 - PROJECT_HOMEPAGE_URL # Since 3.12 - PROJECT_NAME - PROJECT_SOURCE_DIR @@ -819,6 +833,7 @@ variables: - ANDROID - APPLE - BORLAND + - CMAKE_ANDROID_NDK_VERSION # Since 3.20 - CMAKE_CL_64 - CMAKE_COMPILER_2005 - CMAKE_HOST_APPLE @@ -949,6 +964,9 @@ variables: - CMAKE__CPPCHECK # Since 3.10 - CMAKE__CPPLINT - CMAKE__INCLUDE_WHAT_YOU_USE + - CMAKE__LINKER_LAUNCHER # Sine 3.21 + - CMAKE__LINK_LIBRARY_FILE_FLAG # Sine 3.16 + - CMAKE__LINK_LIBRARY_FLAG # Sine 3.16 - CMAKE__VISIBILITY_PRESET - CMAKE_LIBRARY_OUTPUT_DIRECTORY - CMAKE_LIBRARY_OUTPUT_DIRECTORY_ @@ -1046,6 +1064,7 @@ variables: - CMAKE__ARCHIVE_APPEND - CMAKE__ARCHIVE_CREATE - CMAKE__ARCHIVE_FINISH + - CMAKE__BYTE_ORDER # Since 3.20 - CMAKE__COMPILER - CMAKE__COMPILER_EXTERNAL_TOOLCHAIN - CMAKE__COMPILER_ID @@ -1173,6 +1192,7 @@ variables: # Variables for CPack - CPACK_ABSOLUTE_DESTINATION_FILES - CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY + - CPACK_CUSTOM_INSTALL_VARIABLES # Since 3.21 - CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION - CPACK_INCLUDE_TOPLEVEL_DIRECTORY - CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11 @@ -1182,32 +1202,57 @@ variables: - 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 + # NOTE _VERSION and components already defined above, so skipped here - PACKAGE_FIND_VERSION_COUNT + - PACKAGE_FIND_VERSION_RANGE + - PACKAGE_FIND_VERSION_RANGE_MIN + - PACKAGE_FIND_VERSION_RANGE_MAX + - PACKAGE_FIND_VERSION_MIN + - PACKAGE_FIND_VERSION_MIN_MAJOR + - PACKAGE_FIND_VERSION_MIN_MINOR + - PACKAGE_FIND_VERSION_MIN_PATCH + - PACKAGE_FIND_VERSION_MIN_TWEAK + - PACKAGE_FIND_VERSION_MIN_COUNT + - PACKAGE_FIND_VERSION_MAX + - PACKAGE_FIND_VERSION_MAX_MAJOR + - PACKAGE_FIND_VERSION_MAX_MINOR + - PACKAGE_FIND_VERSION_MAX_PATCH + - PACKAGE_FIND_VERSION_MAX_TWEAK + - PACKAGE_FIND_VERSION_MAX_COUNT + - PACKAGE_FIND_VERSION_COMPLETE - PACKAGE_VERSION - PACKAGE_VERSION_EXACT - PACKAGE_VERSION_COMPATIBLE - PACKAGE_VERSION_UNSUITABLE - # NOTE _VERSION and components already defined above, so skipped here + # Package File Interface Variables - _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 + - _VERSION_COUNT + # NOTE _VERSION and components already defined above, so skipped here + - _FIND_VERSION_COUNT + - _FIND_VERSION_EXACT + - _FIND_COMPONENTS + - _FIND_REQUIRED_ + - _FIND_VERSION_RANGE + - _FIND_VERSION_RANGE_MIN + - _FIND_VERSION_RANGE_MAX + - _FIND_VERSION_MIN + - _FIND_VERSION_MIN_MAJOR + - _FIND_VERSION_MIN_MINOR + - _FIND_VERSION_MIN_PATCH + - _FIND_VERSION_MIN_TWEAK + - _FIND_VERSION_MIN_COUNT + - _FIND_VERSION_MAX + - _FIND_VERSION_MAX_MAJOR + - _FIND_VERSION_MAX_MINOR + - _FIND_VERSION_MAX_PATCH + - _FIND_VERSION_MAX_TWEAK + - _FIND_VERSION_MAX_COUNT + - _FIND_VERSION_COMPLETE + - _CONFIG + - _CONSIDERED_CONFIGS + - _CONSIDERED_VERSIONS - _ROOT # Since 3.12 # Other standard variables/patterns # - `try_run` @@ -1220,6 +1265,10 @@ variables: # - `cmake_parse_arguments` - _UNPARSED_ARGUMENTS - _KEYWORDS_MISSING_VALUES + # Variables that control `file(GET_RUNTIME_DEPENDENCIES)` behavior + - CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM + - CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL + - CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND # Well known CMake's official module's variables # - CheckCompilerFlag # - CheckCCompilerFlag @@ -1327,6 +1376,7 @@ variables: - CPACK_DEBIAN_PACKAGE_HOMEPAGE - CPACK_DEBIAN_PACKAGE_SHLIBDEPS - CPACK_DEBIAN__PACKAGE_SHLIBDEPS + - CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS # Since 3.20 - CPACK_DEBIAN_PACKAGE_DEBUG - CPACK_DEBIAN_PACKAGE_PREDEPENDS - CPACK_DEBIAN__PACKAGE_PREDEPENDS @@ -1364,6 +1414,7 @@ variables: - CPACK_DMG_SLA_DIR - CPACK_DMG_SLA_LANGUAGES - CPACK_DMG__FILE_NAME # Since 3.17 + - CPACK_DMG_FILESYSTEM # Since 3.21 - CPACK_COMMAND_HDIUTIL - CPACK_COMMAND_SETFILE - CPACK_COMMAND_REZ @@ -1389,6 +1440,7 @@ variables: - CPACK_IFW_PACKAGE_STYLE_SHEET # Since 3.15 - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH - CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT + - CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST # Since 3.20 - CPACK_IFW_PACKAGE_TITLE_COLOR - CPACK_IFW_PACKAGE_START_MENU_DIRECTORY - CPACK_IFW_TARGET_DIRECTORY @@ -1443,6 +1495,9 @@ variables: - CPACK_NSIS_FINISH_TITLE_3LINES # Since 3.17 - CPACK_NSIS_MUI_HEADERIMAGE # Since 3.17 - CPACK_NSIS_MANIFEST_DPI_AWARE # Since 3.18 + - CPACK_NSIS_BRANDING_TEXT # Since 3.20 + - CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION # Since 3.20 + - CPACK_NSIS_EXECUTABLE # Since 3.21 # - CPackNuGet (since 3.12) - CPACK_NUGET_COMPONENT_INSTALL - CPACK_NUGET_PACKAGE_NAME @@ -1461,14 +1516,22 @@ variables: - CPACK_NUGET__PACKAGE_HOMEPAGE_URL - CPACK_NUGET_PACKAGE_LICENSEURL - CPACK_NUGET__PACKAGE_LICENSEURL + - CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION # Since 3.20 + - CPACK_NUGET__PACKAGE_LICENSE_EXPRESSION # Since 3.20 + - CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME # Since 3.20 + - CPACK_NUGET__PACKAGE_LICENSE_FILE_NAME # Since 3.20 - CPACK_NUGET_PACKAGE_ICONURL - CPACK_NUGET__PACKAGE_ICONURL + - CPACK_NUGET_PACKAGE_ICON # Since 3.20 + - CPACK_NUGET__PACKAGE_ICON # Since 3.20 - 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_LANGUAGE # Since 3.20 + - CPACK_NUGET__PACKAGE_LANGUAGE # Since 3.20 - CPACK_NUGET_PACKAGE_TAGS - CPACK_NUGET__PACKAGE_TAGS - CPACK_NUGET_PACKAGE_DEPENDENCIES @@ -1617,6 +1680,7 @@ variables: - CPACK_PACKAGE_EXECUTABLES - CPACK_STRIP_FILES - CPACK_VERBATIM_VARIABLES + - CPACK_THREADS # Since 3.20 - CPACK_SOURCE_PACKAGE_FILE_NAME - CPACK_SOURCE_STRIP_FILES - CPACK_SOURCE_GENERATOR @@ -1754,12 +1818,19 @@ variables: - CMAKE_NO_ANSI_STRING_STREAM # - TestForSTDNamespace - CMAKE_NO_STD_NAMESPACE + # - UseJava + - CMAKE_JAVA_COMPILE_FLAGS + - CMAKE_JAVA_INCLUDE_PATH + - CMAKE_JNI_TARGET + - CMAKE_JAR_CLASSES_PREFIX # - UseSWIG + - UseSWIG_MODULE_VERSION # Since 3.12 - CMAKE_SWIG_FLAGS - CMAKE_SWIG_OUTDIR - SWIG_OUTFILE_DIR - SWIG_MODULE__EXTRA_DEPS - SWIG_SOURCE_FILE_EXTENSIONS # Since 3.14 + - SWIG_USE_SWIG_DEPENDENCIES # Since 3.20 deprecated-or-internal-variables: - CMAKE_HOME_DIRECTORY @@ -1784,6 +1855,10 @@ deprecated-or-internal-variables: - CPACK_TEMPORARY_DIRECTORY - CPACK_TOPLEVEL_DIRECTORY - CPACK_INSTALL_PREFIX + # Mentioned in `file(GET_RUNTIME_DEPENDENCIES)` docs + - CMAKE_OBJDUMP + # Mentioned in "Deprecated and Removed Features" of release notes 3.21 + - CMAKE_SYSTEM_ARCH # https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html # NOTE Added to syntax file version 14 at 3.15.0 version of CMake @@ -1801,6 +1876,7 @@ environment-variables: - CMAKE_MSVCIDE_RUN_PATH - CMAKE_NO_VERBOSE - CMAKE_OSX_ARCHITECTURES + - CMAKE_TOOLCHAIN_FILE # Since 3.21 - DESTDIR - LDFLAGS - MACOSX_DEPLOYMENT_TARGET @@ -1812,6 +1888,7 @@ environment-variables: - CC - CFLAGS - CSFLAGS + - CUDAARCHS # Since 3.20 - CUDACXX - CUDAFLAGS - CUDAHOSTCXX @@ -1896,6 +1973,55 @@ scripting-commands: - name: cmake_parse_arguments named-args: [PARSE_ARGV] + - + name: cmake_path # Since 3.20 + named-args: [ + # Decomposition + GET + , ROOT_NAME + , ROOT_DIRECTORY + , ROOT_PATH + , FILENAME + , EXTENSION + , LAST_ONLY + , STEM + , RELATIVE_PART + , PARENT_PATH + # Query + , HAS_ROOT_NAME + , HAS_ROOT_DIRECTORY + , HAS_ROOT_PATH + , HAS_FILENAME + , HAS_EXTENSION + , HAS_STEM + , HAS_RELATIVE_PART + , HAS_PARENT_PATH + , IS_ABSOLUTE + , IS_RELATIVE + , IS_PREFIX + , NORMALIZE + # Modification + , SET + , APPEND + , OUTPUT_VARIABLE + , APPEND_STRING + , REMOVE_FILENAME + , REPLACE_FILENAME + , REMOVE_EXTENSION + , REPLACE_EXTENSION + # Generation + , NORMAL_PATH + , RELATIVE_PATH + , BASE_DIRECTORY + , ABSOLUTE_PATH + # Native Conversion + , NATIVE_PATH + , CONVERT + , TO_CMAKE_PATH_LIST + , TO_NATIVE_PATH_LIST + # Hashing + , HASH + ] - name: cmake_policy named-args: [GET, SET, PUSH, POP, VERSION] @@ -1908,6 +2034,8 @@ scripting-commands: , NO_SOURCE_PERMISSIONS # Since 3.19 , "@ONLY" , NEWLINE_STYLE + , USE_SOURCE_PERMISSIONS # Since 3.20 + , FILE_PERMISSIONS # Since 3.20 ] special-args: [UNIX, DOS, WIN32, LF, CRLF] - @@ -2098,6 +2226,19 @@ scripting-commands: , SIZE # New sub-options since 3.16 , GET_RUNTIME_DEPENDENCIES + , RESOLVED_DEPENDENCIES_VAR + , UNRESOLVED_DEPENDENCIES_VAR + , EXECUTABLES + , LIBRARIES + , MODULES + , DIRECTORIES + , BUNDLE_EXECUTABLE + , PRE_INCLUDE_REGEXES + , PRE_EXCLUDE_REGEXES + , POST_INCLUDE_REGEXES + , POST_EXCLUDE_REGEXES + , POST_INCLUDE_FILES # Since 3.21 + , POST_EXCLUDE_FILES # Since 3.21 # New sub-options since 3.18 , ARCHIVE_CREATE , FILES @@ -2112,10 +2253,17 @@ scripting-commands: , ESCAPE_QUOTES , "@ONLY" , NEWLINE_STYLE - , CHMOD # Since 3.19 - , CHMOD_RECURSE # Since 3.19 - , REAL_PATH # Since 3.19 - , BASE_DIRECTORY # Since 3.19 + # New sub-options since 3.19 + , CHMOD + , CHMOD_RECURSE + , REAL_PATH + , BASE_DIRECTORY + # New sub-options since 3.21 + , COPY_FILE + , RESULT + , ONLY_IF_DIFFERENT + , EXPAND_TILDE + , NO_REPLACE ] special-args: [ UTF-8 @@ -2169,6 +2317,7 @@ scripting-commands: , PATHS , PATH_SUFFIXES , DOC + , NO_CACHE # Since 3.21 , REQUIRED # Since 3.18 , NO_DEFAULT_PATH , NO_PACKAGE_ROOT_PATH @@ -2189,6 +2338,7 @@ scripting-commands: , PATHS , PATH_SUFFIXES , DOC + , NO_CACHE # Since 3.21 , REQUIRED # Since 3.18 , NO_DEFAULT_PATH , NO_PACKAGE_ROOT_PATH @@ -2595,7 +2745,11 @@ project-commands: name: aux_source_directory - name: build_command - named-args: [CONFIGURATION, TARGET] + named-args: [ + CONFIGURATION + , PARALLEL_LEVEL # Since 3.21 + , TARGET + ] - name: create_test_sourcelist named-args: [EXTRA_INCLUDE, FUNCTION] @@ -2615,6 +2769,7 @@ project-commands: , CSharp , CXX , CUDA + , HIP # Since 3.21 , ISPC # Since 3.19 , Java , OBJC # Since 3.16 @@ -2664,6 +2819,7 @@ project-commands: , EXCLUDE_FROM_ALL , RENAME , OPTIONAL + , TYPE # Since 3.20 # Installing Targets , TARGETS , EXPORT @@ -2679,6 +2835,7 @@ project-commands: , INCLUDES , NAMELINK_ONLY , NAMELINK_SKIP + , RUNTIME_DEPENDENCIES # Since 3.21 # Installing Files , FILES , PROGRAMS @@ -2700,6 +2857,17 @@ project-commands: , FILE , EXPORT_ANDROID_MK , EXPORT_LINK_INTERFACE_LIBRARIES + # Installing Imported Runtime Artifacts (since 3.21) + , IMPORTED_RUNTIME_ARTIFACTS + , RUNTIME_DEPENDENCY_SET + # Installing Runtime Dependencies (since 3.21) + , PRE_INCLUDE_REGEXES + , PRE_EXCLUDE_REGEXES + , POST_INCLUDE_REGEXES + , POST_EXCLUDE_REGEXES + , POST_INCLUDE_FILES + , POST_EXCLUDE_FILES + , DIRECTORIES ] special-args: &valid_permissions [ OWNER_READ @@ -2740,6 +2908,7 @@ project-commands: , CSharp , CXX , CUDA + , HIP # Since 3.21 , ISPC # Since 3.19 , Java , OBJC # Since 3.16 @@ -2787,6 +2956,7 @@ project-commands: , cxx_std_14 , cxx_std_17 , cxx_std_20 # Since 3.12 + , cxx_std_23 # Since 3.20 , cxx_aggregate_default_initializers , cxx_alias_templates , cxx_alignas @@ -2848,6 +3018,8 @@ project-commands: , c_std_90 , c_std_99 , c_std_11 + , c_std_17 # Since 3.21 + , c_std_23 # Since 3.21 , c_function_prototypes , c_restrict , c_static_assert @@ -2858,13 +3030,21 @@ project-commands: , cuda_std_14 , cuda_std_17 , cuda_std_20 + , cuda_std_23 # Since 3.21 ] - name: target_compile_options named-args: &target_compile_options [BEFORE, INTERFACE, PUBLIC, PRIVATE] - name: target_include_directories - named-args: [BEFORE, SYSTEM, INTERFACE, PUBLIC, PRIVATE] + named-args: [ + AFTER # Since 3.20 + , BEFORE + , SYSTEM + , INTERFACE + , PUBLIC + , PRIVATE + ] - # Since 3.13 name: target_link_directories @@ -2910,6 +3090,7 @@ project-commands: , COMPILE_OUTPUT_VARIABLE , RUN_OUTPUT_VARIABLE , OUTPUT_VARIABLE + , WORKING_DIRECTORY # Since 3.20 , ARGS ] diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-doxygenlua.pl b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-doxygenlua.pl new file mode 100644 index 00000000000..ffc38ea17ea --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-doxygenlua.pl @@ -0,0 +1,42 @@ +#!/usr/bin/env perl +# SPDX-FileCopyrightText: 2020 Jonathan Poelen +# SPDX-License-Identifier: MIT + +my $file = ""; + +open(my $input, '<:encoding(UTF-8)', $ARGV[0]) + or die "Could not open file '$ARGV[0]': $!"; + +open(my $output, '>:encoding(UTF-8)', $ARGV[1]) + or die "Could not open file '$ARGV[1]': $!"; + +while (<$input>) +{ + $file .= $_; +} + +$warning = "\n\n\n"; +$first_context = " + + + + "; + +$file =~ s/\n\s*//gs; +$file =~ s/\n\s*/\n$first_context/s; +$file =~ s/\n[^\n]*?(?: ml_word|LineContinue)[^\n]+//gs; +$file =~ s/\/\/\//---/gs; +$file =~ s/\/\/!/--!/gs; + +$language = $file =~ s/.*?(]+?>).*/$1/sr; +$language =~ s/ name="[^"]+/ name="DoxygenLua/s; +$language =~ s/ extensions="[^"]+/ extensions="/s; +$language =~ s/ mimetype="[^"]+/ mimetype="/s; +$language =~ s/ priority="[^"]+"//s; +$version = $language =~ s/.*? version="([^"]+).*/$1/sr; +$version = $version+2; +$language =~ s/ version="[^"]+/ version="$version/s; +$file =~ s/]+?>/$warning\n$language/s; + +print $output $file; +print $output $warning; diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl index a3b20fb5546..a516332ef2f 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl @@ -45,6 +45,7 @@ if ($root == 1) $file =~ s/]+)section="[^"]*"/]+)extensions="[^"]*"/]+)mimetype="[^"]*"/]+)*/ +# SPDX-License-Identifier: MIT +# +# To install prerequisites: +# +# $ pip install --user click jinja2 +# +# To use: +# +# $ ./generate-spdx-syntax.py > ../syntax/spdx-comments.xml +# + +import json +import pathlib +import urllib.request + +import click +import jinja2 + + +def get_json(url): + with urllib.request.urlopen(url=url) as body: + return json.load(body) + + +@click.command() +@click.argument('template', type=click.File('r'), default='./spdx-comments.xml.tpl') +def cli(template): + + data = { + 'licenses': [ + *filter( + lambda l: not l['licenseId'].endswith('+') + , get_json(url='https://spdx.org/licenses/licenses.json')['licenses'] + ) + ] + , 'exceptions': [ + *filter( + lambda l: not l['licenseExceptionId'].endswith('+') + , get_json(url='https://spdx.org/licenses/exceptions.json')['exceptions'] + ) + ] + } + + env = jinja2.Environment( + keep_trailing_newline=True + ) + env.block_start_string = '' + env.variable_start_string = '' + env.comment_start_string = '' + + tpl = env.from_string(template.read()) + result = tpl.render(data) + print(result.strip(), end=None) + + +if __name__ == '__main__': + cli() + # TODO Handle execptions and show errors diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/spdx-comments.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/spdx-comments.xml.tpl new file mode 100644 index 00000000000..58cc80f960b --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/spdx-comments.xml.tpl @@ -0,0 +1,91 @@ + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml index d7e4ed3d705..c7b21cb2a01 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/bash.xml @@ -5,7 +5,7 @@ - |&;])"> + |&;)])"> |&;()"> @@ -18,6 +18,13 @@ + + + + + + + |&;{}\\`'"$"> @@ -28,9 +35,11 @@ + + ]> - + - + @@ -554,8 +563,8 @@ - - + + @@ -695,27 +704,30 @@ + - - - - - + + + + + + + + - - + @@ -724,6 +736,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1038,7 +1091,7 @@ - + @@ -1084,7 +1137,7 @@ - + @@ -1109,7 +1162,7 @@ - + @@ -1125,7 +1178,7 @@ - + @@ -1164,19 +1217,26 @@ + + + + + + + - @@ -1184,8 +1244,9 @@ + - + @@ -1216,11 +1277,18 @@ + + + + + + @@ -1305,7 +1373,7 @@ - + @@ -1321,6 +1389,18 @@ + + + + + + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml index 7f3920bfb64..d8676a250db 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/cmake.xml @@ -22,7 +22,7 @@ cmake_language cmake_minimum_required cmake_parse_arguments + cmake_path cmake_policy configure_file continue @@ -196,6 +197,47 @@ PARSE_ARGV + + ABSOLUTE_PATH + APPEND + APPEND_STRING + BASE_DIRECTORY + CONVERT + EXTENSION + FILENAME + GET + HASH + HAS_EXTENSION + HAS_FILENAME + HAS_PARENT_PATH + HAS_RELATIVE_PART + HAS_ROOT_DIRECTORY + HAS_ROOT_NAME + HAS_ROOT_PATH + HAS_STEM + IS_ABSOLUTE + IS_PREFIX + IS_RELATIVE + LAST_ONLY + NATIVE_PATH + NORMALIZE + NORMAL_PATH + OUTPUT_VARIABLE + PARENT_PATH + RELATIVE_PART + RELATIVE_PATH + REMOVE_EXTENSION + REMOVE_FILENAME + REPLACE_EXTENSION + REPLACE_FILENAME + ROOT_DIRECTORY + ROOT_NAME + ROOT_PATH + SET + STEM + TO_CMAKE_PATH_LIST + TO_NATIVE_PATH_LIST + GET POP @@ -211,8 +253,10 @@ @ONLY COPYONLY ESCAPE_QUOTES + FILE_PERMISSIONS NEWLINE_STYLE NO_SOURCE_PERMISSIONS + USE_SOURCE_PERMISSIONS CRLF @@ -291,6 +335,7 @@ ARCHIVE_CREATE ARCHIVE_EXTRACT BASE_DIRECTORY + BUNDLE_EXECUTABLE CHMOD CHMOD_RECURSE COMPRESSION @@ -300,13 +345,17 @@ CONFIGURE_DEPENDS CONTENT COPY + COPY_FILE DESTINATION + DIRECTORIES DIRECTORY DIRECTORY_PERMISSIONS DOWNLOAD ENCODING ESCAPE_QUOTES EXCLUDE + EXECUTABLES + EXPAND_TILDE EXPECTED_HASH EXPECTED_MD5 FILES @@ -327,6 +376,7 @@ INSTALL LENGTH_MAXIMUM LENGTH_MINIMUM + LIBRARIES LIMIT LIMIT_COUNT LIMIT_INPUT @@ -337,17 +387,26 @@ LOG MAKE_DIRECTORY MD5 + MODULES MTIME NETRC NETRC_FILE NEWLINE_CONSUME NEWLINE_STYLE NO_HEX_CONVERSION + NO_REPLACE NO_SOURCE_PERMISSIONS OFFSET + ONLY_IF_DIFFERENT OUTPUT PATTERN PERMISSIONS + POST_EXCLUDE_FILES + POST_EXCLUDE_REGEXES + POST_INCLUDE_FILES + POST_INCLUDE_REGEXES + PRE_EXCLUDE_REGEXES + PRE_INCLUDE_REGEXES READ READ_SYMLINK REAL_PATH @@ -358,6 +417,8 @@ REMOVE REMOVE_RECURSE RENAME + RESOLVED_DEPENDENCIES_VAR + RESULT RESULT_VARIABLE SHA1 SHA224 @@ -381,6 +442,7 @@ TOUCH_NOCREATE TO_CMAKE_PATH TO_NATIVE_PATH + UNRESOLVED_DEPENDENCIES_VAR UPLOAD USERPWD USE_SOURCE_PERMISSIONS @@ -433,6 +495,7 @@ DOC HINTS NAMES + NO_CACHE NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_PATH @@ -451,6 +514,7 @@ HINTS NAMES NAMES_PER_DIR + NO_CACHE NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_PATH @@ -495,6 +559,7 @@ DOC HINTS NAMES + NO_CACHE NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_PATH @@ -513,6 +578,7 @@ HINTS NAMES NAMES_PER_DIR + NO_CACHE NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_PATH @@ -883,6 +949,7 @@ CONFIGURATION + PARALLEL_LEVEL TARGET @@ -914,6 +981,7 @@ CUDA CXX Fortran + HIP ISPC Java OBJC @@ -951,6 +1019,7 @@ COMPONENT CONFIGURATIONS DESTINATION + DIRECTORIES DIRECTORY DIRECTORY_PERMISSIONS EXCLUDE @@ -963,6 +1032,7 @@ FILES_MATCHING FILE_PERMISSIONS FRAMEWORK + IMPORTED_RUNTIME_ARTIFACTS INCLUDES LIBRARY MESSAGE_NEVER @@ -974,6 +1044,12 @@ OPTIONAL PATTERN PERMISSIONS + POST_EXCLUDE_FILES + POST_EXCLUDE_REGEXES + POST_INCLUDE_FILES + POST_INCLUDE_REGEXES + PRE_EXCLUDE_REGEXES + PRE_INCLUDE_REGEXES PRIVATE_HEADER PROGRAMS PUBLIC_HEADER @@ -981,8 +1057,11 @@ RENAME RESOURCE RUNTIME + RUNTIME_DEPENDENCIES + RUNTIME_DEPENDENCY_SET SCRIPT TARGETS + TYPE USE_SOURCE_PERMISSIONS @@ -1028,6 +1107,7 @@ CUDA CXX Fortran + HIP ISPC Java NONE @@ -1068,6 +1148,8 @@ c_restrict c_static_assert c_std_11 + c_std_17 + c_std_23 c_std_90 c_std_99 c_variadic_macros @@ -1076,6 +1158,7 @@ cuda_std_14 cuda_std_17 cuda_std_20 + cuda_std_23 cxx_aggregate_default_initializers cxx_alias_templates cxx_alignas @@ -1126,6 +1209,7 @@ cxx_std_14 cxx_std_17 cxx_std_20 + cxx_std_23 cxx_std_98 cxx_strong_enums cxx_template_template_parameters @@ -1146,6 +1230,7 @@ PUBLIC + AFTER BEFORE INTERFACE PRIVATE @@ -1201,6 +1286,7 @@ OUTPUT_VARIABLE RUN_OUTPUT_VARIABLE RUN_RESULT_VAR + WORKING_DIRECTORY APPEND @@ -1342,6 +1428,7 @@ CMAKE_ANDROID_NDK_DEPRECATED_HEADERS CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION + CMAKE_ANDROID_NDK_VERSION CMAKE_ANDROID_PROCESS_MAX CMAKE_ANDROID_PROGUARD CMAKE_ANDROID_PROGUARD_CONFIG_PATH @@ -1497,6 +1584,9 @@ CMAKE_GENERATOR_NO_COMPILER_ENV CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET + CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND + CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM + CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL CMAKE_GLOBAL_AUTOGEN_TARGET CMAKE_GLOBAL_AUTOGEN_TARGET_NAME CMAKE_GLOBAL_AUTORCC_TARGET @@ -1576,6 +1666,10 @@ CMAKE_ISPC_HEADER_DIRECTORY CMAKE_ISPC_HEADER_SUFFIX CMAKE_ISPC_INSTRUCTION_SETS + CMAKE_JAR_CLASSES_PREFIX + CMAKE_JAVA_COMPILE_FLAGS + CMAKE_JAVA_INCLUDE_PATH + CMAKE_JNI_TARGET CMAKE_JOB_POOLS CMAKE_JOB_POOL_COMPILE CMAKE_JOB_POOL_LINK @@ -1787,6 +1881,7 @@ CPACK_COMPONENTS_GROUPING CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY CPACK_CREATE_DESKTOP_LINKS + CPACK_CUSTOM_INSTALL_VARIABLES CPACK_CYGWIN_BUILD_SCRIPT CPACK_CYGWIN_PATCH_FILE CPACK_CYGWIN_PATCH_NUMBER @@ -1818,6 +1913,7 @@ CPACK_DEBIAN_PACKAGE_REPLACES CPACK_DEBIAN_PACKAGE_SECTION CPACK_DEBIAN_PACKAGE_SHLIBDEPS + CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS CPACK_DEBIAN_PACKAGE_SOURCE CPACK_DEBIAN_PACKAGE_SUGGESTS CPACK_DEBIAN_PACKAGE_VERSION @@ -1826,6 +1922,7 @@ CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK CPACK_DMG_DS_STORE CPACK_DMG_DS_STORE_SETUP_SCRIPT + CPACK_DMG_FILESYSTEM CPACK_DMG_FORMAT CPACK_DMG_SLA_DIR CPACK_DMG_SLA_LANGUAGES @@ -1865,6 +1962,7 @@ CPACK_IFW_PACKAGE_WINDOW_ICON CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH + CPACK_IFW_PACKAGE_WIZARD_SHOW_PAGE_LIST CPACK_IFW_PACKAGE_WIZARD_STYLE CPACK_IFW_PRODUCT_URL CPACK_IFW_REPOGEN_EXECUTABLE @@ -1880,12 +1978,15 @@ CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS CPACK_INSTALL_SCRIPTS CPACK_MONOLITHIC_INSTALL + CPACK_NSIS_BRANDING_TEXT + CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION CPACK_NSIS_COMPRESSOR CPACK_NSIS_CONTACT CPACK_NSIS_CREATE_ICONS_EXTRA CPACK_NSIS_DELETE_ICONS_EXTRA CPACK_NSIS_DISPLAY_NAME CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL + CPACK_NSIS_EXECUTABLE CPACK_NSIS_EXECUTABLES_DIRECTORY CPACK_NSIS_EXTRA_INSTALL_COMMANDS CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS @@ -1918,8 +2019,12 @@ CPACK_NUGET_PACKAGE_DESCRIPTION CPACK_NUGET_PACKAGE_DESCRIPTION_SUMMARY CPACK_NUGET_PACKAGE_HOMEPAGE_URL + CPACK_NUGET_PACKAGE_ICON CPACK_NUGET_PACKAGE_ICONURL + CPACK_NUGET_PACKAGE_LANGUAGE CPACK_NUGET_PACKAGE_LICENSEURL + CPACK_NUGET_PACKAGE_LICENSE_EXPRESSION + CPACK_NUGET_PACKAGE_LICENSE_FILE_NAME CPACK_NUGET_PACKAGE_NAME CPACK_NUGET_PACKAGE_OWNERS CPACK_NUGET_PACKAGE_RELEASE_NOTES @@ -2037,6 +2142,7 @@ CPACK_SOURCE_STRIP_FILES CPACK_STRIP_FILES CPACK_SYSTEM_NAME + CPACK_THREADS CPACK_TOPLEVEL_TAG CPACK_VERBATIM_VARIABLES CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION @@ -2180,12 +2286,23 @@ MSVC_TOOLSET_VERSION MSVC_VERSION PACKAGE_FIND_NAME - PACKAGE_FIND_VERSION + PACKAGE_FIND_VERSION_COMPLETE PACKAGE_FIND_VERSION_COUNT - PACKAGE_FIND_VERSION_MAJOR - PACKAGE_FIND_VERSION_MINOR - PACKAGE_FIND_VERSION_PATCH - PACKAGE_FIND_VERSION_TWEAK + PACKAGE_FIND_VERSION_MAX + PACKAGE_FIND_VERSION_MAX_COUNT + PACKAGE_FIND_VERSION_MAX_MAJOR + PACKAGE_FIND_VERSION_MAX_MINOR + PACKAGE_FIND_VERSION_MAX_PATCH + PACKAGE_FIND_VERSION_MAX_TWEAK + PACKAGE_FIND_VERSION_MIN + PACKAGE_FIND_VERSION_MIN_COUNT + PACKAGE_FIND_VERSION_MIN_MAJOR + PACKAGE_FIND_VERSION_MIN_MINOR + PACKAGE_FIND_VERSION_MIN_PATCH + PACKAGE_FIND_VERSION_MIN_TWEAK + PACKAGE_FIND_VERSION_RANGE + PACKAGE_FIND_VERSION_RANGE_MAX + PACKAGE_FIND_VERSION_RANGE_MIN PACKAGE_VERSION PACKAGE_VERSION_COMPATIBLE PACKAGE_VERSION_EXACT @@ -2196,6 +2313,7 @@ PROJECT_BINARY_DIR PROJECT_DESCRIPTION PROJECT_HOMEPAGE_URL + PROJECT_IS_TOP_LEVEL PROJECT_NAME PROJECT_SOURCE_DIR PROJECT_VERSION @@ -2206,8 +2324,10 @@ QTIFWDIR SWIG_OUTFILE_DIR SWIG_SOURCE_FILE_EXTENSIONS + SWIG_USE_SWIG_DEPENDENCIES THREADS_PREFER_PTHREAD_FLAG UNIX + UseSWIG_MODULE_VERSION WIN32 WINCE WINDOWS_PHONE @@ -2220,8 +2340,10 @@ CMAKE_HOME_DIRECTORY CMAKE_INTERNAL_PLATFORM_ABI CMAKE_NOT_USING_CONFIG_FLAGS + CMAKE_OBJDUMP CMAKE_SUPPRESS_DEVELOPER_ERRORS CMAKE_SUPPRESS_DEVELOPER_WARNINGS + CMAKE_SYSTEM_ARCH CMAKE_VS_INTEL_Fortran_PROJECT_VERSION CPACK_INSTALL_PREFIX CPACK_INSTALL_SCRIPT @@ -2248,12 +2370,14 @@ CMAKE_NO_VERBOSE CMAKE_OSX_ARCHITECTURES CMAKE_PREFIX_PATH + CMAKE_TOOLCHAIN_FILE CSFLAGS CTEST_INTERACTIVE_DEBUG_MODE CTEST_OUTPUT_ON_FAILURE CTEST_PARALLEL_LEVEL CTEST_PROGRESS_OUTPUT CTEST_USE_LAUNCHERS_DEFAULT + CUDAARCHS CUDACXX CUDAFLAGS CUDAHOSTCXX @@ -2326,6 +2450,7 @@ DEFINITIONS EXCLUDE_FROM_ALL IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + IMPORTED_TARGETS INCLUDE_DIRECTORIES INCLUDE_REGULAR_EXPRESSION INTERPROCEDURAL_OPTIMIZATION @@ -2429,6 +2554,7 @@ ENABLE_EXPORTS EXCLUDE_FROM_ALL EXCLUDE_FROM_DEFAULT_BUILD + EXPORT_COMPILE_COMMANDS EXPORT_NAME EXPORT_PROPERTIES EchoString @@ -2554,6 +2680,7 @@ UNITY_BUILD_CODE_AFTER_INCLUDE UNITY_BUILD_CODE_BEFORE_INCLUDE UNITY_BUILD_MODE + UNITY_BUILD_UNIQUE_ID VERSION VISIBILITY_INLINES_HIDDEN VS_CONFIGURATION_TYPE @@ -2782,6 +2909,7 @@ TARGET_BUNDLE_DIR TARGET_BUNDLE_CONTENT_DIR TARGET_PROPERTY + TARGET_RUNTIME_DLLS INSTALL_PREFIX TARGET_NAME LINK_ONLY @@ -2790,6 +2918,8 @@ MAKE_C_IDENTIFIER TARGET_OBJECTS SHELL_PATH + OUTPUT_CONFIG + COMMAND_CONFIG @@ -2801,6 +2931,7 @@ + @@ -2950,6 +3081,14 @@ + + + + + + + + @@ -3860,7 +3999,7 @@ - + @@ -3894,7 +4033,7 @@ - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml index d7a53a167c0..5516c1454b7 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml @@ -1,12 +1,12 @@ + ]> - + @@ -34,15 +34,26 @@ - + + + - + + + + + - + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml index 6091cd4ee29..e71b1618a0d 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml @@ -7,7 +7,7 @@ ]> - + ACTIVE @@ -3732,6 +3732,7 @@ volatile + assert break case catch @@ -3760,6 +3761,7 @@ long short static + var void diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml index b35397af9c9..f03587977a4 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/markdown.xml @@ -90,7 +90,7 @@ ]> - + @@ -149,14 +149,33 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml index fdf2266558a..c9a60d64dbe 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml @@ -39,7 +39,7 @@ Enhance tr/// and y/// support. --> - + if @@ -92,7 +92,7 @@ + - * - + % || // @@ -420,7 +420,8 @@ - + + @@ -756,6 +757,12 @@ + + + + + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml index f1c89a54e41..676872f03fc 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml @@ -33,6 +33,10 @@ type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%" --> + + + + ]> @@ -48,7 +52,7 @@ - + import @@ -86,10 +90,21 @@ try while with - yield async await + + yield + + yield from + + + match + case + __import__ abs @@ -366,89 +381,137 @@ + + + + - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + + - + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + @@ -472,35 +535,53 @@ + + + + + + - + + + + - + + + + - - + + + + + - - + + + + + @@ -520,14 +601,25 @@ + + + + + + + + - + + @@ -542,107 +634,218 @@ Adding byte literals wouldn’t make the current 2⁴ into 2⁵ contexts, as there are no byte f-literals --> - + + + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - + + + + + + + + + + + + + + + + + + - + + + + - - + + + + + + - + + + + - - + + + + + + + + + + + + + + + + + + + + + - + + + + - - + + + + + + - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -668,6 +871,8 @@ + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml index fbefcb6dad0..839e8f9162c 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml @@ -6,7 +6,7 @@ ]> - + @@ -16,13 +16,13 @@ + + - + - - @@ -70,13 +70,13 @@ - + - + @@ -116,7 +116,7 @@ - + @@ -131,7 +131,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -175,6 +175,7 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme index ebfde027973..fea8def01f3 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Feb 22, 2021 (revision 3)", + "Last update: Jul 28, 2021 (revision 4)", "This file has been converted from: https://github.com/dempfi/ayu", "Also see: https://github.com/ayu-theme" ], @@ -11,7 +11,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "ayu Dark", - "revision": 3 + "revision": 4 }, "editor-colors": { "BackgroundColor": "#0a0e14", @@ -169,8 +169,8 @@ "text-color": "#39bae6" }, "VerbatimString": { - "selected-text-color": "#c2d94c", - "text-color": "#c2d94c" + "selected-text-color": "#99ca44", + "text-color": "#99ca44" }, "Warning": { "selected-text-color": "#f07178", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-light.theme index c93e414457e..30e119ed1b0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-light.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Sep 21, 2020 (revision 2)", + "Last update: Jul 28, 2021 (revision 3)", "This file has been converted from: https://github.com/dempfi/ayu", "Also see: https://github.com/ayu-theme" ], @@ -11,7 +11,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "ayu Light", - "revision": 2 + "revision": 3 }, "editor-colors": { "BackgroundColor": "#fafafa", @@ -169,8 +169,8 @@ "text-color": "#55b4d4" }, "VerbatimString": { - "selected-text-color": "#86b300", - "text-color": "#86b300" + "selected-text-color": "#729800", + "text-color": "#729800" }, "Warning": { "selected-text-color": "#f07171", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme index e389ecf2981..005d6a0ad2a 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Feb 22, 2021 (revision 3)", + "Last update: Jul 28, 2021 (revision 4)", "This file has been converted from: https://github.com/dempfi/ayu", "Also see: https://github.com/ayu-theme" ], @@ -11,7 +11,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "ayu Mirage", - "revision": 3 + "revision": 4 }, "editor-colors": { "BackgroundColor": "#1f2430", @@ -169,8 +169,8 @@ "text-color": "#5ccfe6" }, "VerbatimString": { - "selected-text-color": "#bae67e", - "text-color": "#bae67e" + "selected-text-color": "#82e26a", + "text-color": "#82e26a" }, "Warning": { "selected-text-color": "#f28779", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme index 712da4acc4a..1ad7fffee39 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme @@ -5,7 +5,7 @@ "SPDX-FileCopyrightText: 2016 Dominik Haumann " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 6, + "revision" : 7, "name" : "Breeze Dark" }, "text-styles": { @@ -149,7 +149,7 @@ "editor-colors": { "BackgroundColor" : "#232629", "CodeFolding" : "#224e65", - "BracketMatching" : "#323030", + "BracketMatching" : "#8e44ad", "CurrentLine" : "#2A2E32", "IconBorder" : "#31363b", "IndentationLine" : "#3a3f44", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme index 7d0116bea95..6dee8dd7777 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme @@ -5,7 +5,7 @@ "SPDX-FileCopyrightText: 2016 Dominik Haumann " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 8, + "revision" : 9, "name" : "Breeze Light" }, "text-styles": { @@ -70,7 +70,7 @@ "selected-text-color" : "#9c0e0e" }, "VerbatimString" : { - "text-color" : "#bf0303", + "text-color" : "#e31616", "selected-text-color" : "#9c0e0e" }, "SpecialString" : { diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme index 93b1833334f..b388396050c 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme @@ -570,7 +570,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "Dracula", - "revision": 7 + "revision": 8 }, "text-styles": { "Alert": { @@ -694,8 +694,8 @@ "text-color": "#8be9fd" }, "VerbatimString": { - "selected-text-color": "#f1fa8c", - "text-color": "#f1fa8c" + "selected-text-color": "#d7e60a", + "text-color": "#d7e60a" }, "Warning": { "selected-text-color": "#ff5555", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/falcon.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/falcon.theme new file mode 100644 index 00000000000..1ebf8c69466 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/falcon.theme @@ -0,0 +1,184 @@ +{ + "_comments": [ + "A theme focused on ergonomics, using the 3 digit Tango color palette" + ], + "metadata": { + "name": "Falcon", + "revision": 4, + "license": "SPDX-License-Identifier: MIT", + "copyright": [ "SPDX-FileCopyrightText: 2021 Alberto Salvia Novella " ] + }, + "custom-styles": { + "Bash": { + "Normal Text": { + "text-color": "#bbbbbb" + } + } + }, + "editor-colors": { + "BackgroundColor": "#223333", + "BracketMatching": "#555555", + "CodeFolding": "#224488", + "CurrentLine": "#555555", + "CurrentLineNumber": "#bbbbbb", + "IconBorder": "#223333", + "IndentationLine": "#888888", + "LineNumbers": "#888888", + "MarkBookmark": "#7799cc", + "MarkBreakpointActive": "#ffaa33", + "MarkBreakpointDisabled": "#aa77aa", + "MarkBreakpointReached": "#449900", + "MarkError": "#ef2929", + "MarkExecution": "#888888", + "MarkWarning": "#aa77aa", + "ModifiedLines": "#aa0000", + "ReplaceHighlight": "#224488", + "SavedLines": "#449900", + "SearchHighlight": "#224488", + "Separator": "#555753", + "SpellChecking": "#ef2929", + "TabMarker": "#555555", + "TemplateBackground": "#223333", + "TemplateFocusedPlaceholder": "#23321a", + "TemplatePlaceholder": "#23321a", + "TemplateReadOnlyPlaceholder": "#451e1a", + "TextSelection": "#3366aa", + "WordWrapMarker": "#555753" + }, + "text-styles": { + "Alert": { + "background-color": "#320000", + "bold": true, + "selected-text-color": "#ffaa33", + "text-color": "#ee2222" + }, + "Annotation": { + "selected-text-color": "#ddddcc", + "text-color": "#aa77aa" + }, + "Attribute": { + "selected-text-color": "#ddddcc", + "text-color": "#aa77aa" + }, + "BaseN": { + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "BuiltIn": { + "selected-text-color": "#ddddcc", + "text-color": "#7799cc" + }, + "Char": { + "selected-text-color": "#ffaa33", + "text-color": "#ffaa33" + }, + "Comment": { + "selected-text-color": "#eeeeec", + "text-color": "#888888" + }, + "CommentVar": { + "selected-text-color": "#ddddcc", + "text-color": "#aa77aa" + }, + "Constant": { + "bold": true, + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "DataType": { + "selected-text-color": "#ddddcc", + "text-color": "#7799cc" + }, + "DecVal": { + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "Documentation": { + "selected-text-color": "#eeeeee", + "text-color": "#d3d7cf" + }, + "Error": { + "selected-text-color": "#ffaa33", + "text-color": "#ee2222", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#ddddcc", + "text-color": "#7799cc" + }, + "Float": { + "selected-text-color": "#ffaa33", + "text-color": "#ffaa33" + }, + "Function": { + "bold": true, + "selected-text-color": "#ddddcc", + "text-color": "#7799cc" + }, + "Import": { + "selected-text-color": "#88ee33", + "text-color": "#88ee33" + }, + "Information": { + "selected-text-color": "#eeeeee", + "text-color": "#ddddcc" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#ddddcc", + "text-color": "#aa77aa" + }, + "Normal": { + "selected-text-color": "#eeeeee", + "text-color": "#ddddcc" + }, + "Operator": { + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "Others": { + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + }, + "Preprocessor": { + "selected-text-color": "#ddddcc", + "text-color": "#aa77aa" + }, + "RegionMarker": { + "background-color": "#0d1932", + "selected-text-color": "#ddddcc", + "text-color": "#7799cc" + }, + "SpecialChar": { + "selected-text-color": "#ffaa33", + "text-color": "#ffaa33" + }, + "SpecialString": { + "selected-text-color": "#eeeeee", + "text-color": "#ddddcc" + }, + "String": { + "selected-text-color": "#eeeeee", + "text-color": "#ddddcc" + }, + "Variable": { + "bold": true, + "selected-text-color": "#ffaa33", + "text-color": "#ffaa33" + }, + "VerbatimString": { + "selected-text-color": "#ffaa33", + "text-color": "#ffaa33" + }, + "Warning": { + "selected-text-color": "#ffee44", + "text-color": "#eedd00" + } + } +} diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme index 313e99f0529..a6996385327 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/github-dark.theme @@ -82,7 +82,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "GitHub Dark", - "revision": 2 + "revision": 3 }, "text-styles": { "Alert": { @@ -205,8 +205,8 @@ "text-color": "#ffab70" }, "VerbatimString": { - "selected-text-color": "#9ecbff", - "text-color": "#9ecbff" + "selected-text-color": "#41a0ff", + "text-color": "#41a0ff" }, "Warning": { "selected-text-color": "#ff5555", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme index 5f465c653ce..ed56418fde3 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/github-light.theme @@ -82,7 +82,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "GitHub Light", - "revision": 2 + "revision": 3 }, "text-styles": { "Alert": { @@ -205,8 +205,8 @@ "text-color": "#e36209" }, "VerbatimString": { - "selected-text-color": "#032f62", - "text-color": "#032f62" + "selected-text-color": "#034c95", + "text-color": "#034c95" }, "Warning": { "selected-text-color": "#ff5555", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-dark.theme index 66c6c9afb7e..0e006ab46e0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-dark.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Sep 17, 2020 (revision 2)", + "Last update: Jul 28, 2021 (revision 3)", "This file has been converted from: https://github.com/morhetz/gruvbox" ], "metadata" : { @@ -10,7 +10,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name" : "gruvbox Dark", - "revision" : 2 + "revision" : 3 }, "text-styles": { "Normal" : { @@ -73,7 +73,7 @@ "selected-text-color" : "#b8bb26" }, "VerbatimString" : { - "text-color" : "#98971a", + "text-color" : "#848216", "selected-text-color" : "#b8bb26" }, "SpecialString" : { diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme index 6038c70e94f..937a43d084c 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Sep 17, 2020 (revision 2)", + "Last update: Jul 28, 2021 (revision 3)", "This file has been converted from: https://github.com/morhetz/gruvbox" ], "metadata" : { @@ -10,7 +10,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name" : "gruvbox Light", - "revision" : 2 + "revision" : 3 }, "text-styles": { "Normal" : { @@ -73,7 +73,7 @@ "selected-text-color" : "#79740e" }, "VerbatimString" : { - "text-color" : "#98971a", + "text-color" : "#848216", "selected-text-color" : "#79740e" }, "SpecialString" : { diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme index 3df8e66c005..e0026ca3b3e 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/monokai.theme @@ -259,7 +259,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "Monokai", - "revision": 5 + "revision": 6 }, "text-styles": { "Alert": { @@ -383,8 +383,8 @@ "text-color": "#f8f8f2" }, "VerbatimString": { - "selected-text-color": "#e6db74", - "text-color": "#e6db74" + "selected-text-color": "#d8c72c", + "text-color": "#d8c72c" }, "Warning": { "selected-text-color": "#ff5555", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme index 6ad4d82e43c..dbe44d9b096 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme @@ -1,6 +1,6 @@ { "_comments": [ - "Last update: Sep 21, 2020 (revision 2)", + "Last update: Jul 28, 2020 (revision 3)", "This theme has been adapted from: https://www.nordtheme.com" ], "metadata": { @@ -11,7 +11,7 @@ ], "license": "SPDX-License-Identifier: MIT", "name": "Nord", - "revision": 2 + "revision": 3 }, "editor-colors": { "BackgroundColor": "#2e3440", @@ -170,8 +170,8 @@ "text-color": "#5e81ac" }, "VerbatimString": { - "selected-text-color": "#a3be8c", - "text-color": "#a3be8c" + "selected-text-color": "#8dae70", + "text-color": "#8dae70" }, "Warning": { "selected-text-color": "#bf616a", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme index 26d779582d7..49bbe6419f0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme @@ -5,7 +5,7 @@ "SPDX-FileCopyrightText: 2016 Dominik Haumann " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 4, + "revision" : 5, "name" : "Printing" }, "text-styles": { @@ -69,7 +69,7 @@ "selected-text-color" : "#9c0e0e" }, "VerbatimString" : { - "text-color" : "#bf0303", + "text-color" : "#ea0404", "selected-text-color" : "#9c0e0e" }, "SpecialString" : { diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme index b8d13b31d3c..1fe48bacd0b 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme @@ -9,7 +9,7 @@ "SPDX-FileCopyrightText: 2018 Andrew Crouthamel " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 5, + "revision" : 6, "name" : "Solarized Dark" }, "text-styles": { @@ -70,8 +70,8 @@ "selected-text-color" : "#2aa198" }, "VerbatimString" : { - "text-color" : "#2aa198", - "selected-text-color" : "#2aa198" + "text-color" : "#23877e", + "selected-text-color" : "#23877e" }, "SpecialString" : { "text-color" : "#dc322f", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme index a532b128f8d..51c76faaec4 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme @@ -9,7 +9,7 @@ "SPDX-FileCopyrightText: 2018 Andrew Crouthamel " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 4, + "revision" : 5, "name" : "Solarized Light" }, "text-styles": { @@ -73,8 +73,8 @@ "selected-text-color" : "#2aa198" }, "VerbatimString" : { - "text-color" : "#2aa198", - "selected-text-color" : "#2aa198" + "text-color" : "#23837a", + "selected-text-color" : "#23837a" }, "SpecialString" : { "text-color" : "#dc322f", diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc b/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc index fe0a1627be6..cf9d658c824 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc @@ -9,6 +9,7 @@ ayu-light.theme ayu-mirage.theme dracula.theme + falcon.theme github-dark.theme github-light.theme gruvbox-dark.theme diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/vim-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/vim-dark.theme index 1a2c7785ac7..d039822cae3 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/vim-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/vim-dark.theme @@ -5,7 +5,7 @@ "SPDX-FileCopyrightText: 2020 Nibaldo González " ], "license": "SPDX-License-Identifier: MIT", - "revision" : 3, + "revision" : 4, "name" : "Vim Dark" }, "text-styles": { @@ -70,8 +70,8 @@ "selected-text-color" : "#ff54ff" }, "VerbatimString" : { - "text-color" : "#ff54ff", - "selected-text-color" : "#ff54ff" + "text-color" : "#f000f0", + "selected-text-color" : "#f000f0" }, "SpecialString" : { "text-color" : "#ff5500", diff --git a/src/libs/3rdparty/syntax-highlighting/metainfo.yaml b/src/libs/3rdparty/syntax-highlighting/metainfo.yaml index 7a3220a31e1..a82f7a986d4 100644 --- a/src/libs/3rdparty/syntax-highlighting/metainfo.yaml +++ b/src/libs/3rdparty/syntax-highlighting/metainfo.yaml @@ -6,7 +6,7 @@ platforms: - name: Linux - name: FreeBSD - name: Windows - - name: MacOSX + - name: macOS - name: Android portingAid: false deprecated: false diff --git a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp index a009c4f2591..749123aa545 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/cli/kate-syntax-highlighter.cpp @@ -30,10 +30,11 @@ static void applyHighlighter(Highlighter &highlighter, const QCommandLineOption &outputName, const Ts &...highlightParams) { - if (parser.isSet(outputName)) + if (parser.isSet(outputName)) { highlighter.setOutputFile(parser.value(outputName)); - else + } else { highlighter.setOutputFile(stdout); + } if (fromFileName) { highlighter.highlightFile(inFileName, highlightParams...); @@ -126,8 +127,9 @@ int main(int argc, char **argv) } if (parser.isSet(listThemes)) { - for (const auto &theme : repo.themes()) + for (const auto &theme : repo.themes()) { std::cout << qPrintable(theme.name()) << std::endl; + } return 0; } @@ -158,9 +160,10 @@ int main(int argc, char **argv) if (!def.isValid()) { /* see if it's a extension instead */ def = repo.definitionForFileName(QLatin1String("f.") + syntax); - if (!def.isValid()) + if (!def.isValid()) { /* see if it's a filename instead */ def = repo.definitionForFileName(syntax); + } } } } else if (fromFileName) { @@ -177,8 +180,9 @@ int main(int argc, char **argv) QString outputFormat = parser.value(outputFormatOption); if (0 == outputFormat.compare(QLatin1String("html"), Qt::CaseInsensitive)) { QString title; - if (parser.isSet(titleOption)) + if (parser.isSet(titleOption)) { title = parser.value(titleOption); + } HtmlHighlighter highlighter; highlighter.setDefinition(def); diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt index 508cd276cc3..4a84696ad91 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/CMakeLists.txt @@ -28,7 +28,8 @@ elseif(CMAKE_CROSSCOMPILING) else() # host build add_executable(katehighlightingindexer katehighlightingindexer.cpp ../lib/worddelimiters.cpp) - if(Qt5XmlPatterns_FOUND) + ecm_mark_nongui_executable(katehighlightingindexer) + if(Qt5XmlPatterns_FOUND AND NOT ECM_ENABLE_SANITIZERS) target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) else() target_link_libraries(katehighlightingindexer Qt5::Core) diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp index 86b3a38b12d..789089625b8 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp @@ -31,7 +31,8 @@ using KSyntaxHighlighting::Xml::attrToBool; class HlFilesChecker { public: - void setDefinition(const QStringRef &verStr, const QString &filename, const QString &name) + template + void setDefinition(const T &verStr, const QString &filename, const QString &name) { m_currentDefinition = &*m_definitions.insert(name, Definition{}); m_currentDefinition->languageName = name; @@ -93,6 +94,12 @@ public: continue; } + auto markAsUsedContext = [](ContextName &ContextName) { + if (!ContextName.stay && ContextName.context) { + ContextName.context->isOnlyIncluded = false; + } + }; + QMutableMapIterator contextIt(contexts); while (contextIt.hasNext()) { contextIt.next(); @@ -100,12 +107,21 @@ public: resolveContextName(definition, context, context.lineEndContext, context.line); resolveContextName(definition, context, context.lineEmptyContext, context.line); resolveContextName(definition, context, context.fallthroughContext, context.line); + markAsUsedContext(context.lineEndContext); + markAsUsedContext(context.lineEmptyContext); + markAsUsedContext(context.fallthroughContext); for (auto &rule : context.rules) { + rule.parentContext = &context; resolveContextName(definition, context, rule.context, rule.line); + if (rule.type != Context::Rule::Type::IncludeRules) { + markAsUsedContext(rule.context); + } } } - definition.firstContext = &*definition.contexts.find(definition.firstContextName); + auto *firstContext = &*definition.contexts.find(definition.firstContextName); + firstContext->isOnlyIncluded = false; + definition.firstContext = firstContext; } resolveIncludeRules(); @@ -118,6 +134,7 @@ public: const auto usedContexts = extractUsedContexts(); QMap maxVersionByDefinitions; + QMap unreachableIncludedRules; QMapIterator def(m_definitions); while (def.hasNext()) { @@ -135,14 +152,7 @@ public: QSet referencedKeywords; QSet usedAttributeNames; success = checkKeywordsList(definition, referencedKeywords) && success; - success = checkContexts(definition, referencedKeywords, usedAttributeNames, usedContexts) && success; - - // search for non-existing or unreferenced keyword lists. - for (const auto &keywords : definition.keywordsList) { - if (!referencedKeywords.contains(&keywords)) { - qWarning() << filename << "line" << keywords.line << "unused keyword:" << keywords.name; - } - } + success = checkContexts(definition, referencedKeywords, usedAttributeNames, usedContexts, unreachableIncludedRules) && success; // search for non-existing itemDatas. const auto invalidNames = usedAttributeNames - definition.itemDatas.styleNames; @@ -159,6 +169,56 @@ public: } } + QMutableMapIterator unreachableIncludedRuleIt(unreachableIncludedRules); + while (unreachableIncludedRuleIt.hasNext()) { + unreachableIncludedRuleIt.next(); + IncludedRuleUnreachableBy &unreachableRulesBy = unreachableIncludedRuleIt.value(); + if (unreachableRulesBy.alwaysUnreachable) { + auto *rule = unreachableIncludedRuleIt.key(); + + if (!rule->parentContext->isOnlyIncluded) { + continue; + } + + // remove duplicates rules + QSet rules; + auto &unreachableBy = unreachableRulesBy.unreachableBy; + unreachableBy.erase(std::remove_if(unreachableBy.begin(), + unreachableBy.end(), + [&](const RuleAndInclude &ruleAndInclude) { + if (rules.contains(ruleAndInclude.rule)) { + return true; + } + rules.insert(ruleAndInclude.rule); + return false; + }), + unreachableBy.end()); + + QString message; + message.reserve(128); + for (auto &ruleAndInclude : std::as_const(unreachableBy)) { + message += QStringLiteral("line "); + message += QString::number(ruleAndInclude.rule->line); + message += QStringLiteral(" ["); + message += ruleAndInclude.rule->parentContext->name; + if (rule->filename != ruleAndInclude.rule->filename) { + message += QStringLiteral(" ("); + message += ruleAndInclude.rule->filename; + message += QLatin1Char(')'); + } + if (ruleAndInclude.includeRules) { + message += QStringLiteral(" via line "); + message += QString::number(ruleAndInclude.includeRules->line); + } + message += QStringLiteral("], "); + } + message.chop(2); + + qWarning() << rule->filename << "line" << rule->line << "no IncludeRule can reach this rule, hidden by" << message; + success = false; + } + } + return success; } @@ -176,7 +236,7 @@ private: int popCount = 0; bool stay = false; - const Context *context = nullptr; + Context *context = nullptr; }; struct Parser { @@ -185,12 +245,13 @@ private: QXmlStreamAttribute &attr; bool success; - //! Read a string type attribute, \c sucess = \c false when \p str is not empty + //! Read a string type attribute, \c success = \c false when \p str is not empty //! \return \c true when attr.name() == attrName, otherwise false bool extractString(QString &str, const QString &attrName) { - if (attr.name() != attrName) + if (attr.name() != attrName) { return false; + } str = attr.value().toString(); if (str.isEmpty()) { @@ -201,24 +262,26 @@ private: return true; } - //! Read a bool type attribute, \c sucess = \c false when \p xmlBool is not \c XmlBool::Unspecified. + //! Read a bool type attribute, \c success = \c false when \p xmlBool is not \c XmlBool::Unspecified. //! \return \c true when attr.name() == attrName, otherwise false bool extractXmlBool(XmlBool &xmlBool, const QString &attrName) { - if (attr.name() != attrName) + if (attr.name() != attrName) { return false; + } xmlBool = attr.value().isNull() ? XmlBool::Unspecified : attrToBool(attr.value()) ? XmlBool::True : XmlBool::False; return true; } - //! Read a positive integer type attribute, \c sucess = \c false when \p positive is already greater than or equal to 0 + //! Read a positive integer type attribute, \c success = \c false when \p positive is already greater than or equal to 0 //! \return \c true when attr.name() == attrName, otherwise false bool extractPositive(int &positive, const QString &attrName) { - if (attr.name() != attrName) + if (attr.name() != attrName) { return false; + } bool ok = true; positive = attr.value().toInt(&ok); @@ -231,12 +294,13 @@ private: return true; } - //! Read a color, \c sucess = \c false when \p color is already greater than or equal to 0 + //! Read a color, \c success = \c false when \p color is already greater than or equal to 0 //! \return \c true when attr.name() == attrName, otherwise false bool checkColor(const QString &attrName) { - if (attr.name() != attrName) + if (attr.name() != attrName) { return false; + } const auto value = attr.value().toString(); if (value.isEmpty() /*|| QColor(value).isValid()*/) { @@ -247,16 +311,17 @@ private: return true; } - //! Read a QChar, \c sucess = \c false when \p c is not \c '\0' or does not have one char + //! Read a QChar, \c success = \c false when \p c is not \c '\0' or does not have one char //! \return \c true when attr.name() == attrName, otherwise false bool extractChar(QChar &c, const QString &attrName) { - if (attr.name() != attrName) + if (attr.name() != attrName) { return false; + } - if (attr.value().size() == 1) + if (attr.value().size() == 1) { c = attr.value()[0]; - else { + } else { c = QLatin1Char('_'); qWarning() << filename << "line" << xml.lineNumber() << attrName << "must contain exactly one char:" << attr.value(); success = false; @@ -268,8 +333,9 @@ private: //! \return parsing status when \p isExtracted is \c true, otherwise \c false bool checkIfExtracted(bool isExtracted) { - if (isExtracted) + if (isExtracted) { return success; + } qWarning() << filename << "line" << xml.lineNumber() << "unknown attribute:" << attr.name(); return false; @@ -400,18 +466,19 @@ private: QString additionalDeliminator; QString weakDeliminator; - // rules included by IncludeRules + // rules included by IncludeRules (without IncludeRule) QVector includedRules; // IncludeRules included by IncludeRules QSet includedIncludeRules; + Context const *parentContext = nullptr; + QString filename; bool parseElement(const QString &filename, QXmlStreamReader &xml) { this->filename = filename; - line = xml.lineNumber(); using Pair = QPair; @@ -579,6 +646,8 @@ private: }; int line; + // becomes false when a context refers to it + bool isOnlyIncluded = true; QString name; QString attribute; ContextName lineEndContext; @@ -723,8 +792,9 @@ private: { Context context; m_success = context.parseElement(m_currentDefinition->filename, xml) && m_success; - if (m_currentDefinition->firstContextName.isEmpty()) + if (m_currentDefinition->firstContextName.isEmpty()) { m_currentDefinition->firstContextName = context.name; + } if (m_currentDefinition->contexts.contains(context.name)) { qWarning() << m_currentDefinition->filename << "line" << xml.lineNumber() << "duplicate context:" << context.name; m_success = false; @@ -784,6 +854,7 @@ private: m_success = false; continue; } + if (rule.context.popCount) { qWarning() << definition.filename << "line" << rule.line << "IncludeRules with #pop prefix"; m_success = false; @@ -794,6 +865,8 @@ private: continue; } + // resolve includedRules and includedIncludeRules + usedContexts.clear(); usedContexts.insert(rule.context.context); contexts.clear(); @@ -866,11 +939,27 @@ private: return usedContexts; } + struct RuleAndInclude { + const Context::Rule *rule; + const Context::Rule *includeRules; + + explicit operator bool() const + { + return rule; + } + }; + + struct IncludedRuleUnreachableBy { + QVector unreachableBy; + bool alwaysUnreachable = true; + }; + //! Check contexts and rules bool checkContexts(const Definition &definition, QSet &referencedKeywords, QSet &usedAttributeNames, - const QSet &usedContexts) const + const QSet &usedContexts, + QMap &unreachableIncludedRules) const { bool success = true; @@ -892,16 +981,18 @@ private: success = false; } - if (!context.attribute.isEmpty()) + if (!context.attribute.isEmpty()) { usedAttributeNames.insert({context.attribute, context.line}); + } success = checkfallthrough(definition, context) && success; - success = checkUreachableRules(definition.filename, context) && success; + success = checkUreachableRules(definition.filename, context, unreachableIncludedRules) && success; success = suggestRuleMerger(definition.filename, context) && success; for (const auto &rule : context.rules) { - if (!rule.attribute.isEmpty()) + if (!rule.attribute.isEmpty()) { usedAttributeNames.insert({rule.attribute, rule.line}); + } success = checkLookAhead(rule) && success; success = checkStringDetect(rule) && success; success = checkAnyChar(rule) && success; @@ -954,9 +1045,14 @@ private: return false; } +#define REG_ESCAPE_CHAR R"(\\(?:[^0BDPSWbdpswoux]|x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\}|0\d\d|o\{[0-7]+\}|u[0-9a-fA-F]{4}))" +#define REG_CHAR "(?:" REG_ESCAPE_CHAR "|\\[(?:" REG_ESCAPE_CHAR "|.)\\]|[^[.^])" + // is RangeDetect - static const QRegularExpression isRange(QStringLiteral( - R"(^(\\(?:[^0BDPSWbdpswoux]|x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\}|0\d\d|o\{[0-7]+\}|u[0-9a-fA-F]{4})|[^[.]|\[[^].\\]\])(?:\.|\[^\1\])\*[?*]?\1$)")); + static const QRegularExpression isRange(QStringLiteral("^\\^?" REG_CHAR "(?:" + "\\.\\*[?*]?" REG_CHAR "|" + "\\[\\^(" REG_ESCAPE_CHAR "|.)\\]\\*[?*]?\\1" + ")$")); if (( rule.lookAhead == XmlBool::True || rule.minimal == XmlBool::True || rule.string.contains(QStringLiteral(".*?")) @@ -967,11 +1063,21 @@ private: return false; } + // is LineContinue + static const QRegularExpression isLineContinue(QStringLiteral("^\\^?" REG_CHAR "\\$$")); + if (reg.contains(isLineContinue)) { + auto extra = (reg[0] == QLatin1Char('^')) ? "with column=\"0\"" : ""; + qWarning() << filename << "line" << rule.line << "RegExpr should be replaced by LineContinue:" << rule.string << extra; + return false; + } + // replace \c, \xhhh, \x{hhh...}, \0dd, \o{ddd}, \uhhhh, with _ - static const QRegularExpression sanitize1( - QStringLiteral(R"(\\(?:[^0BDPSWbdpswoux]|x[0-9a-fA-F]{2}|x\{[0-9a-fA-F]+\}|0\d\d|o\{[0-7]+\}|u[0-9a-fA-F]{4}))")); + static const QRegularExpression sanitize1(QStringLiteral(REG_ESCAPE_CHAR)); reg.replace(sanitize1, QStringLiteral("_")); +#undef REG_CHAR +#undef REG_ESCAPE_CHAR + // use minimal or lazy operator static const QRegularExpression isMinimal(QStringLiteral( R"([.][*+][^][?+*()|$]*$)")); @@ -1008,8 +1114,9 @@ private: char const *extraMsg = rule.string.contains(QLatin1Char('^')) ? "+ column=\"0\" or firstNonSpace=\"1\"" : ""; qWarning() << rule.filename << "line" << rule.line << "RegExpr should be replaced by StringDetect / Detect2Chars / DetectChar" << extraMsg << ":" << rule.string; - if (len != reg.size()) + if (len != reg.size()) { qWarning() << rule.filename << "line" << rule.line << "insensitive=\"1\" missing:" << rule.string; + } return false; } @@ -1019,8 +1126,8 @@ private: // (^sas*) -> ok // (^sa|s*) -> ko // (^(sa|s*)) -> ok - auto first = qAsConst(reg).begin(); - auto last = qAsConst(reg).end(); + auto first = std::as_const(reg).begin(); + auto last = std::as_const(reg).end(); int depth = 0; while (QLatin1Char('(') == *first) { @@ -1066,8 +1173,8 @@ private: // add ^ with column=0 if (rule.column == 0 && !rule.isDotRegex) { bool hasStartOfLine = false; - auto first = qAsConst(reg).begin(); - auto last = qAsConst(reg).end(); + auto first = std::as_const(reg).begin(); + auto last = std::as_const(reg).end(); for (; first != last; ++first) { if (*first == QLatin1Char('^')) { hasStartOfLine = true; @@ -1306,8 +1413,9 @@ private: //! Search for additionalDeliminator/weakDeliminator which has no effect. bool checkDelimiters(const Definition &definition, const Context::Rule &rule) const { - if (rule.additionalDeliminator.isEmpty() && rule.weakDeliminator.isEmpty()) + if (rule.additionalDeliminator.isEmpty() && rule.weakDeliminator.isEmpty()) { return true; + } bool success = true; @@ -1472,16 +1580,39 @@ private: //! - StringDetect, WordDetect, RegExpr with as prefix Detect2Chars or other strings //! - duplicate rule (Int, Float, keyword with same String, etc) //! - Rule hidden by a dot regex - bool checkUreachableRules(const QString &filename, const Context &context) const + bool checkUreachableRules(const QString &filename, + const Context &context, + QMap &unreachableIncludedRules) const { - struct RuleAndInclude { - const Context::Rule *rule; - const Context::Rule *includeRules; + if (context.isOnlyIncluded) { + return true; + } - explicit operator bool() const + struct Rule4 { + RuleAndInclude setRule(const Context::Rule &rule, const Context::Rule *includeRules = nullptr) { - return rule; + auto set = [&](RuleAndInclude &ruleAndInclude) { + auto old = ruleAndInclude; + ruleAndInclude = {&rule, includeRules}; + return old; + }; + + if (rule.firstNonSpace == XmlBool::True) { + return set(firstNonSpace); + } else if (rule.column == 0) { + return set(column0); + } else if (rule.column > 0) { + return set(columnGreaterThan0[rule.column]); + } else { + return set(normal); + } } + + private: + RuleAndInclude normal; + RuleAndInclude column0; + QMap columnGreaterThan0; + RuleAndInclude firstNonSpace; }; // Associate QChar with RuleAndInclude @@ -1489,8 +1620,9 @@ private: /// Search RuleAndInclude associated with @p c. RuleAndInclude find(QChar c) const { - if (c.unicode() < 128) + if (c.unicode() < 128) { return m_asciiMap[c.unicode()]; + } auto it = m_utf8Map.find(c); return it == m_utf8Map.end() ? RuleAndInclude{nullptr, nullptr} : it.value(); } @@ -1517,10 +1649,11 @@ private: /// Associates @p c with a rule. void append(QChar c, const Context::Rule &rule, const Context::Rule *includeRule = nullptr) { - if (c.unicode() < 128) + if (c.unicode() < 128) { m_asciiMap[c.unicode()] = {&rule, includeRule}; - else + } else { m_utf8Map[c] = {&rule, includeRule}; + } } /// Associates each character of @p s with a rule. @@ -1549,13 +1682,15 @@ private: // Char4Tables::char is always added. CharTableArray(Char4Tables &tables, const Context::Rule &rule) { - if (rule.firstNonSpace == XmlBool::True) + if (rule.firstNonSpace == XmlBool::True) { appendTable(tables.charsFirstNonSpace); + } - if (rule.column == 0) + if (rule.column == 0) { appendTable(tables.charsColumn0); - else if (rule.column > 0) + } else if (rule.column > 0) { appendTable(tables.charsColumnGreaterThan0[rule.column]); + } appendTable(tables.chars); } @@ -1572,8 +1707,9 @@ private: RuleAndInclude find(QChar c) const { for (int i = 0; i < m_size; ++i) { - if (auto ruleAndInclude = m_charTables[i]->find(c)) + if (auto ruleAndInclude = m_charTables[i]->find(c)) { return ruleAndInclude; + } } return RuleAndInclude{nullptr, nullptr}; } @@ -1621,9 +1757,19 @@ private: int m_size = 0; }; + struct ObservableRule { + const Context::Rule *rule; + const Context::Rule *includeRules; + + bool hasResolvedIncludeRules() const + { + return rule == includeRules; + } + }; + // Iterates over all the rules, including those in includedRules struct RuleIterator { - RuleIterator(const QVector &rules, const Context::Rule &endRule) + RuleIterator(const QVector &rules, const ObservableRule &endRule) : m_end(&endRule - rules.data()) , m_rules(rules) { @@ -1635,7 +1781,7 @@ private: // if in includedRules if (m_includedRules) { ++m_i2; - if (m_i2 != m_rules[m_i].includedRules.size()) { + if (m_i2 != m_includedRules->size()) { return (*m_includedRules)[m_i2]; } ++m_i; @@ -1643,10 +1789,10 @@ private: } // if is a includedRules - while (m_i < m_end && m_rules[m_i].type == Context::Rule::Type::IncludeRules) { - if (m_rules[m_i].includedRules.size()) { + while (m_i < m_end && m_rules[m_i].rule->type == Context::Rule::Type::IncludeRules) { + if (!m_rules[m_i].includeRules && m_rules[m_i].rule->includedRules.size()) { m_i2 = 0; - m_includedRules = &m_rules[m_i].includedRules; + m_includedRules = &m_rules[m_i].rule->includedRules; return (*m_includedRules)[m_i2]; } ++m_i; @@ -1654,7 +1800,7 @@ private: if (m_i < m_end) { ++m_i; - return &m_rules[m_i - 1]; + return m_rules[m_i - 1].rule; } return nullptr; @@ -1663,14 +1809,14 @@ private: /// \return current IncludeRules or nullptr const Context::Rule *currentIncludeRules() const { - return m_includedRules ? &m_rules[m_i] : nullptr; + return m_includedRules ? m_rules[m_i].rule : m_rules[m_i].includeRules; } private: int m_i = 0; int m_i2; int m_end; - const QVector &m_rules; + const QVector &m_rules; const QVector *m_includedRules = nullptr; }; @@ -1680,20 +1826,24 @@ private: void append(const Context::Rule &rule, const Context::Rule *includedRule) { auto array = extractDotRegexes(rule); - if (array[0]) + if (array[0]) { *array[0] = {&rule, includedRule}; - if (array[1]) + } + if (array[1]) { *array[1] = {&rule, includedRule}; + } } /// Search dot regex which hides @p rule RuleAndInclude find(const Context::Rule &rule) { auto array = extractDotRegexes(rule); - if (array[0]) + if (array[0]) { return *array[0]; - if (array[1]) + } + if (array[1]) { return *array[1]; + } return RuleAndInclude{}; } @@ -1707,13 +1857,15 @@ private: if (rule.firstNonSpace != XmlBool::True && rule.column == -1) { ret[0] = &dotRegex; } else { - if (rule.firstNonSpace == XmlBool::True) + if (rule.firstNonSpace == XmlBool::True) { ret[0] = &dotRegexFirstNonSpace; + } - if (rule.column == 0) + if (rule.column == 0) { ret[1] = &dotRegexColumn0; - else if (rule.column > 0) + } else if (rule.column > 0) { ret[1] = &dotRegexColumnGreaterThan0[rule.column]; + } } return ret; @@ -1734,23 +1886,44 @@ private: // characters of LineContinue Char4Tables lineContinueChars; - RuleAndInclude intRule{}; - RuleAndInclude floatRule{}; - RuleAndInclude hlCCharRule{}; - RuleAndInclude hlCOctRule{}; - RuleAndInclude hlCHexRule{}; - RuleAndInclude hlCStringCharRule{}; + Rule4 intRule{}; + Rule4 floatRule{}; + Rule4 hlCCharRule{}; + Rule4 hlCOctRule{}; + Rule4 hlCHexRule{}; + Rule4 hlCStringCharRule{}; + Rule4 detectIdentifierRule{}; // Contains includedRules and included includedRules QMap includeContexts; DotRegex dotRegex; + QVector observedRules; + observedRules.reserve(context.rules.size()); for (const Context::Rule &rule : context.rules) { + const Context::Rule *includeRule = nullptr; + if (rule.type == Context::Rule::Type::IncludeRules) { + auto *context = rule.context.context; + if (context && context->isOnlyIncluded) { + includeRule = &rule; + } + } + + observedRules.push_back({&rule, includeRule}); + if (includeRule) { + for (const Context::Rule *rule2 : rule.includedRules) { + observedRules.push_back({rule2, includeRule}); + } + } + } + + for (auto &observedRule : observedRules) { + const Context::Rule &rule = *observedRule.rule; bool isUnreachable = false; QVector unreachableBy; - // declare rule as unreacheable if ruleAndInclude is not empty + // declare rule as unreachable if ruleAndInclude is not empty auto updateUnreachable1 = [&](RuleAndInclude ruleAndInclude) { if (ruleAndInclude) { isUnreachable = true; @@ -1758,7 +1931,7 @@ private: } }; - // declare rule as unreacheable if ruleAndIncludes is not empty + // declare rule as unreachable if ruleAndIncludes is not empty auto updateUnreachable2 = [&](const QVector &ruleAndIncludes) { if (!ruleAndIncludes.isEmpty()) { isUnreachable = true; @@ -1810,43 +1983,42 @@ private: // check if hidden by DetectChar/AnyChar case Context::Rule::Type::HlCChar: updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('\''))); - updateUnreachable1(hlCCharRule); - hlCCharRule = {&rule, nullptr}; + updateUnreachable1(hlCCharRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar case Context::Rule::Type::HlCHex: updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('0'))); - updateUnreachable1(hlCHexRule); - hlCHexRule = {&rule, nullptr}; + updateUnreachable1(hlCHexRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar case Context::Rule::Type::HlCOct: updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('0'))); - updateUnreachable1(hlCOctRule); - hlCOctRule = {&rule, nullptr}; + updateUnreachable1(hlCOctRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar case Context::Rule::Type::HlCStringChar: updateUnreachable1(CharTableArray(detectChars, rule).find(QLatin1Char('\\'))); - updateUnreachable1(hlCStringCharRule); - hlCStringCharRule = {&rule, nullptr}; + updateUnreachable1(hlCStringCharRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar case Context::Rule::Type::Int: updateUnreachable2(CharTableArray(detectChars, rule).find(QStringLiteral("0123456789"))); - updateUnreachable1(intRule); - intRule = {&rule, nullptr}; + updateUnreachable1(intRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar case Context::Rule::Type::Float: updateUnreachable2(CharTableArray(detectChars, rule).find(QStringLiteral("0123456789."))); - updateUnreachable1(floatRule); - floatRule = {&rule, nullptr}; + updateUnreachable1(floatRule.setRule(rule)); + break; + + // check if hidden by another DetectIdentifier rule + case Context::Rule::Type::DetectIdentifier: + updateUnreachable1(detectIdentifierRule.setRule(rule)); break; // check if hidden by DetectChar/AnyChar or another LineContinue @@ -1865,10 +2037,11 @@ private: case Context::Rule::Type::RangeDetect: updateUnreachable1(CharTableArray(detectChars, rule).find(rule.char0)); if (!isUnreachable) { - RuleIterator ruleIterator(context.rules, rule); + RuleIterator ruleIterator(observedRules, observedRule); while (const auto *rulePtr = ruleIterator.next()) { - if (isUnreachable) + if (isUnreachable) { break; + } const auto &rule2 = *rulePtr; if (rule2.type == rule.type && isCompatible(rule2) && rule.char0 == rule2.char0 && rule.char1 == rule2.char1) { updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()}); @@ -1884,10 +2057,11 @@ private: } // check that `rule` does not have another RegExpr as a prefix - RuleIterator ruleIterator(context.rules, rule); + RuleIterator ruleIterator(observedRules, observedRule); while (const auto *rulePtr = ruleIterator.next()) { - if (isUnreachable) + if (isUnreachable) { break; + } const auto &rule2 = *rulePtr; if (rule2.type == Context::Rule::Type::RegExpr && isCompatible(rule2) && rule.insensitive == rule2.insensitive && rule.dynamic == rule2.dynamic && rule.string.startsWith(rule2.string)) { @@ -1902,10 +2076,11 @@ private: case Context::Rule::Type::StringDetect: { // check that dynamic `rule` does not have another dynamic StringDetect as a prefix if (rule.type == Context::Rule::Type::StringDetect && rule.dynamic == XmlBool::True) { - RuleIterator ruleIterator(context.rules, rule); + RuleIterator ruleIterator(observedRules, observedRule); while (const auto *rulePtr = ruleIterator.next()) { - if (isUnreachable) + if (isUnreachable) { break; + } const auto &rule2 = *rulePtr; if (rule2.type != Context::Rule::Type::StringDetect || rule2.dynamic != XmlBool::True || !isCompatible(rule2)) { @@ -1963,10 +2138,11 @@ private: // combination of uppercase and lowercase RuleAndInclude detect2CharsInsensitives[]{{}, {}, {}, {}}; - RuleIterator ruleIterator(context.rules, rule); + RuleIterator ruleIterator(observedRules, observedRule); while (const auto *rulePtr = ruleIterator.next()) { - if (isUnreachable) + if (isUnreachable) { break; + } const auto &rule2 = *rulePtr; const bool isSensitive = (rule2.insensitive == XmlBool::True); const auto caseSensitivity = isSensitive ? Qt::CaseInsensitive : Qt::CaseSensitive; @@ -2030,10 +2206,11 @@ private: // check if hidden by another keyword rule case Context::Rule::Type::keyword: { - RuleIterator ruleIterator(context.rules, rule); + RuleIterator ruleIterator(observedRules, observedRule); while (const auto *rulePtr = ruleIterator.next()) { - if (isUnreachable) + if (isUnreachable) { break; + } const auto &rule2 = *rulePtr; if (rule2.type == Context::Rule::Type::keyword && isCompatible(rule2) && rule.string == rule2.string) { updateUnreachable1({&rule2, ruleIterator.currentIncludeRules()}); @@ -2049,6 +2226,10 @@ private: // <- reference a who will be added // <- hidden by previous rule case Context::Rule::Type::IncludeRules: + if (observedRule.includeRules && !observedRule.hasResolvedIncludeRules()) { + break; + } + if (auto &ruleAndInclude = includeContexts[rule.context.context]) { updateUnreachable1(ruleAndInclude); } @@ -2060,6 +2241,10 @@ private: includeContexts.insert(rulePtr->context.context, RuleAndInclude{rulePtr, &rule}); } + if (observedRule.includeRules) { + break; + } + for (const auto *rulePtr : rule.includedRules) { const auto &rule2 = *rulePtr; switch (rule2.type) { @@ -2087,27 +2272,27 @@ private: } case Context::Rule::Type::HlCChar: - hlCCharRule = {&rule2, &rule}; + hlCCharRule.setRule(rule2, &rule); break; case Context::Rule::Type::HlCHex: - hlCHexRule = {&rule2, &rule}; + hlCHexRule.setRule(rule2, &rule); break; case Context::Rule::Type::HlCOct: - hlCOctRule = {&rule2, &rule}; + hlCOctRule.setRule(rule2, &rule); break; case Context::Rule::Type::HlCStringChar: - hlCStringCharRule = {&rule2, &rule}; + hlCStringCharRule.setRule(rule2, &rule); break; case Context::Rule::Type::Int: - intRule = {&rule2, &rule}; + intRule.setRule(rule2, &rule); break; case Context::Rule::Type::Float: - floatRule = {&rule2, &rule}; + floatRule.setRule(rule2, &rule); break; case Context::Rule::Type::LineContinue: { @@ -2136,12 +2321,18 @@ private: } break; - case Context::Rule::Type::DetectIdentifier: case Context::Rule::Type::Unknown: break; } - if (isUnreachable) { + if (observedRule.includeRules && !observedRule.hasResolvedIncludeRules()) { + auto &unreachableIncludedRule = unreachableIncludedRules[&rule]; + if (isUnreachable && unreachableIncludedRule.alwaysUnreachable) { + unreachableIncludedRule.unreachableBy.append(unreachableBy); + } else { + unreachableIncludedRule.alwaysUnreachable = false; + } + } else if (isUnreachable) { success = false; QString message; message.reserve(128); @@ -2165,7 +2356,7 @@ private: message += QStringLiteral(", "); } message.chop(2); - qWarning() << filename << "line" << rule.line << "unreachable element by" << message; + qWarning() << filename << "line" << rule.line << "unreachable rule by" << message; } } @@ -2179,8 +2370,9 @@ private: { bool success = true; - if (context.rules.isEmpty()) + if (context.rules.isEmpty()) { return success; + } auto it = context.rules.begin(); const auto end = context.rules.end() - 1; @@ -2249,7 +2441,7 @@ private: //! - "#pop!Comment" -> "Comment" //! - "##ISO C++" -> "" //! - "Comment##ISO C++"-> "Comment" in ISO C++ - void resolveContextName(Definition &definition, const Context &context, ContextName &contextName, int line) + void resolveContextName(Definition &definition, Context &context, ContextName &contextName, int line) { QString name = contextName.name; if (name.isEmpty()) { @@ -2281,8 +2473,9 @@ private: const int idx = name.indexOf(QStringLiteral("##")); if (idx == -1) { auto it = definition.contexts.find(name); - if (it != definition.contexts.end()) + if (it != definition.contexts.end()) { contextName.context = &*it; + } } else { auto defName = name.mid(idx + 2); auto listName = name.left(idx); @@ -2392,14 +2585,16 @@ int main(int argc, char *argv[]) QCoreApplication app(argc, argv); // ensure enough arguments are passed - if (app.arguments().size() < 3) + if (app.arguments().size() < 3) { return 1; + } #ifdef QT_XMLPATTERNS_LIB // open schema QXmlSchema schema; - if (!schema.load(QUrl::fromLocalFile(app.arguments().at(2)))) + if (!schema.load(QUrl::fromLocalFile(app.arguments().at(2)))) { return 2; + } #endif const QString hlFilenamesListing = app.arguments().value(3); @@ -2422,7 +2617,7 @@ int main(int argc, char *argv[]) HlFilesChecker filesChecker; QVariantMap hls; int anyError = 0; - for (const QString &hlFilename : qAsConst(hlFilenames)) { + for (const QString &hlFilename : std::as_const(hlFilenames)) { QFile hlFile(hlFilename); if (!hlFile.open(QIODevice::ReadOnly)) { qWarning("Failed to open %s", qPrintable(hlFilename)); @@ -2456,7 +2651,7 @@ int main(int argc, char *argv[]) QVariantMap hl; // transfer text attributes - for (const QString &attribute : qAsConst(textAttributes)) { + for (const QString &attribute : std::as_const(textAttributes)) { hl[attribute] = xml.attributes().value(attribute).toString(); } @@ -2489,17 +2684,20 @@ int main(int argc, char *argv[]) filesChecker.resolveContexts(); - if (!filesChecker.check()) + if (!filesChecker.check()) { anyError = 7; + } // bail out if any problem was seen - if (anyError) + if (anyError) { return anyError; + } // create outfile, after all has worked! QFile outFile(app.arguments().at(1)); - if (!outFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) + if (!outFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { return 9; + } // write out json outFile.write(QCborValue::fromVariant(QVariant(hls)).toCbor()); diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt index 722f92742be..43a60cc19b0 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt @@ -1,6 +1,8 @@ +add_library(KF5SyntaxHighlighting) + ecm_create_qm_loader(syntax_highlighting_QM_LOADER syntaxhighlighting5_qt) -set(syntax_highlighting_srcs +target_sources(KF5SyntaxHighlighting PRIVATE abstracthighlighter.cpp context.cpp contextswitch.cpp @@ -20,8 +22,9 @@ set(syntax_highlighting_srcs themedata.cpp worddelimiters.cpp ${syntax_highlighting_QM_LOADER} + $ ) -ecm_qt_declare_logging_category(syntax_highlighting_srcs +ecm_qt_declare_logging_category(KF5SyntaxHighlighting HEADER ksyntaxhighlighting_logging.h IDENTIFIER KSyntaxHighlighting::Log CATEGORY_NAME kf.syntaxhighlighting @@ -30,16 +33,27 @@ ecm_qt_declare_logging_category(syntax_highlighting_srcs EXPORT KSYNTAXHIGHLIGHTING ) -add_library(KF5SyntaxHighlighting ${syntax_highlighting_srcs} $) -generate_export_header(KF5SyntaxHighlighting BASE_NAME KSyntaxHighlighting) +ecm_generate_export_header(KF5SyntaxHighlighting + BASE_NAME KSyntaxHighlighting + GROUP_BASE_NAME KF + VERSION ${KF_VERSION} + DEPRECATED_BASE_VERSION 0 + DEPRECATION_VERSIONS 5.87 + EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} +) set_target_properties(KF5SyntaxHighlighting PROPERTIES - VERSION ${SyntaxHighlighting_VERSION_STRING} + VERSION ${SyntaxHighlighting_VERSION} SOVERSION ${SyntaxHighlighting_SOVERSION} EXPORT_NAME SyntaxHighlighting ) target_include_directories(KF5SyntaxHighlighting INTERFACE "$") target_include_directories(KF5SyntaxHighlighting PUBLIC "$") -target_link_libraries(KF5SyntaxHighlighting LINK_PUBLIC Qt5::Gui LINK_PRIVATE Qt5::Network) +target_link_libraries(KF5SyntaxHighlighting + PUBLIC + Qt5::Gui + PRIVATE + Qt5::Network +) ecm_generate_headers(SyntaxHighlighting_HEADERS HEADER_NAMES @@ -52,6 +66,7 @@ ecm_generate_headers(SyntaxHighlighting_HEADERS State SyntaxHighlighter Theme + WildcardMatcher REQUIRED_HEADERS SyntaxHighlighting_HEADERS ) diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp index 2ad9d371f90..d6f8cad0c71 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp @@ -36,11 +36,13 @@ void AbstractHighlighterPrivate::ensureDefinitionLoaded() defData = DefinitionData::get(m_definition); } - if (Q_UNLIKELY(!defData->repo && !defData->fileName.isEmpty())) + if (Q_UNLIKELY(!defData->repo && !defData->fileName.isEmpty())) { qCCritical(Log) << "Repository got deleted while a highlighter is still active!"; + } - if (m_definition.isValid()) + if (m_definition.isValid()) { defData->load(); + } } AbstractHighlighter::AbstractHighlighter() @@ -85,7 +87,7 @@ void AbstractHighlighter::setTheme(const Theme &theme) * Returns the index of the first non-space character. If the line is empty, * or only contains white spaces, text.size() is returned. */ -static inline int firstNonSpaceChar(const QString &text) +static inline int firstNonSpaceChar(QStringView text) { for (int i = 0; i < text.length(); ++i) { if (!text[i].isSpace()) { @@ -95,7 +97,14 @@ static inline int firstNonSpaceChar(const QString &text) return text.size(); } +#if KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(5, 87) State AbstractHighlighter::highlightLine(const QString &text, const State &state) +{ + return highlightLine(QStringView(text), state); +} +#endif + +State AbstractHighlighter::highlightLine(QStringView text, const State &state) { Q_D(AbstractHighlighter); @@ -145,8 +154,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state * skipping empty lines after a line continuation character (see bug 405903) */ } else if (!stateData->topContext()->lineEndContext().isStay() - && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList())) + && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList())) { break; + } // guard against endless loops ++endlessLoopingCounter; @@ -160,7 +170,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state return newState; } - int offset = 0, beginOffset = 0; + int offset = 0; + int beginOffset = 0; bool lineContinuation = false; /** @@ -247,8 +258,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state skipOffsets.clear(); } const auto currentSkipOffset = skipOffsets.value(rule.get()); - if (currentSkipOffset < 0 || currentSkipOffset > offset) + if (currentSkipOffset < 0 || currentSkipOffset > offset) { continue; + } const auto newResult = rule->doMatch(text, offset, stateData->topCaptures()); newOffset = newResult.offset(); @@ -265,8 +277,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state } } - if (newOffset <= offset) + if (newOffset <= offset) { continue; + } /** * apply folding. @@ -274,12 +287,14 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state * - rule with endRegion + beginRegion: in endRegion, the length is 0 * - rule with lookAhead: length is 0 */ - if (rule->endRegion().isValid() && rule->beginRegion().isValid()) + if (rule->endRegion().isValid() && rule->beginRegion().isValid()) { applyFolding(offset, 0, rule->endRegion()); - else if (rule->endRegion().isValid()) + } else if (rule->endRegion().isValid()) { applyFolding(offset, rule->isLookAhead() ? 0 : newOffset - offset, rule->endRegion()); - if (rule->beginRegion().isValid()) + } + if (rule->beginRegion().isValid()) { applyFolding(offset, rule->isLookAhead() ? 0 : newOffset - offset, rule->beginRegion()); + } if (rule->isLookAhead()) { Q_ASSERT(!rule->context().isStay()); @@ -290,12 +305,14 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state d->switchContext(stateData, rule->context(), newResult.captures()); newFormat = rule->attributeFormat().isValid() ? &rule->attributeFormat() : &stateData->topContext()->attributeFormat(); - if (newOffset == text.size() && std::dynamic_pointer_cast(rule)) + if (newOffset == text.size() && std::dynamic_pointer_cast(rule)) { lineContinuation = true; + } break; } - if (isLookAhead) + if (isLookAhead) { continue; + } if (newOffset <= offset) { // no matching rule if (stateData->topContext()->fallthrough()) { @@ -316,8 +333,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state * on format change, apply the last one and switch to new one */ if (newFormat != currentFormat && newFormat->id() != currentFormat->id()) { - if (offset > 0) + if (offset > 0) { applyFormat(beginOffset, offset - beginOffset, *currentFormat); + } beginOffset = offset; currentFormat = newFormat; } @@ -333,8 +351,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state /** * apply format for remaining text, if any */ - if (beginOffset < offset) + if (beginOffset < offset) { applyFormat(beginOffset, text.size() - beginOffset, *currentFormat); + } /** * handle line end context switches @@ -344,8 +363,9 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state { int endlessLoopingCounter = 0; while (!stateData->topContext()->lineEndContext().isStay() && !lineContinuation) { - if (!d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList())) + if (!d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList())) { break; + } // guard against endless loops ++endlessLoopingCounter; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h index 5e85873ce03..49cfbf25303 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h @@ -108,6 +108,15 @@ protected: AbstractHighlighter(); AbstractHighlighter(AbstractHighlighterPrivate *dd); +#if KSYNTAXHIGHLIGHTING_ENABLE_DEPRECATED_SINCE(5, 87) + /** + * @copydoc highlightLine(QStringView,const State&) + * @deprecated since 5.87, use highlightLine(QStringView, const State&) instead. + */ + // no deprecation warning, as removal of this will automatically "port" the using code + State highlightLine(const QString &text, const State &state); +#endif + // TODO KF6: add an optional void* context argument that is passed through // to the applyX() calls, so highlighters dealing with some form of line object // (such as QSyntaxHighlighter or KTextEditor) can avoid some ugly hacks to have @@ -120,14 +129,14 @@ protected: * @param state The highlighting state handle returned by the call * to highlightLine() for the previous line. For the very first line, * just pass a default constructed State(). - * @returns The state of the highlighing engine after processing the + * @returns The state of the highlighting engine after processing the * given line. This needs to passed into highlightLine() for the * next line. You can store the state for efficient partial * re-highlighting for example during editing. * * @see applyFormat(), applyFolding() */ - State highlightLine(const QString &text, const State &state); + State highlightLine(QStringView text, const State &state); /** * Reimplement this to apply formats to your output. The provided @p format diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp index 9ff012e1d72..8ae47d80ebf 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp @@ -33,10 +33,6 @@ struct CieLab { double b; }; -#ifndef M_PI -constexpr double M_PI = 3.14159265358979323846; -#endif - // clang-format off // xterm color reference // constexpr Rgb888 xterm256Colors[] { @@ -388,10 +384,11 @@ CieLab rgbToLab(QRgb rgb) // Perform the inverse gamma companding for a sRGB color // http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html auto inverseGammaCompanding = [](int c) { - if (c <= 10) + if (c <= 10) { return c / (255.0 * 12.92); - else + } else { return std::pow((c / 255.0 + 0.055) / 1.055, 2.4); + } }; const double r = inverseGammaCompanding(qRed(rgb)); @@ -404,10 +401,11 @@ CieLab rgbToLab(QRgb rgb) // http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_Lab.html auto f = [](double t) { - if (t > 216.0 / 24389.0) + if (t > 216.0 / 24389.0) { return std::cbrt(t); - else + } else { return t * (24389.0 / (27.0 * 116.0)) + 4.0 / 29.0; + } }; const double f_x = f(x / illuminant_D65[0]); @@ -440,8 +438,9 @@ inline double pow2(double x) inline double computeHPrime(double a_prime, double b) { - if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon) + if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon) { return 0.0; + } const double value = std::atan2(b, a_prime) * 180.0 / M_PI; return (value < 0.0) ? value + 360.0 : value; @@ -449,34 +448,38 @@ inline double computeHPrime(double a_prime, double b) inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime) { - if (C1_prime * C2_prime < epsilon) + if (C1_prime * C2_prime < epsilon) { return 0.0; + } const double diff = h2_prime - h1_prime; - if (std::abs(diff) <= 180.0) + if (std::abs(diff) <= 180.0) { return diff; - else if (diff > 180.0) + } else if (diff > 180.0) { return diff - 360.0; - else + } else { return diff + 360.0; + } } inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime, double h2_prime) { const double sum = h1_prime + h2_prime; - if (C1_prime * C2_prime < epsilon) + if (C1_prime * C2_prime < epsilon) { return sum; + } const double dist = std::abs(h1_prime - h2_prime); - if (dist <= 180.0) + if (dist <= 180.0) { return 0.5 * sum; - else if (sum < 360.0) + } else if (sum < 360.0) { return 0.5 * (sum + 360.0); - else + } else { return 0.5 * (sum - 360.0); + } } /// Calculate the perceptual color difference based on CIEDE2000. @@ -702,7 +705,7 @@ struct GraphLine { const int n2 = offset - labelLineLength; labelLineLength += n2 + 1; fillLine(labelLine, n2); - labelLine += graphLine.rightRef(graphLine.size() - ps1); + labelLine += QStringView(graphLine).right(graphLine.size() - ps1); } } @@ -781,8 +784,9 @@ public: state = highlightLine(currentLine, state); if (hasSeparator) { - if (!firstLine) + if (!firstLine) { out << QStringLiteral("\x1b[0m────────────────────────────────────────────────────\x1b[K\n"); + } firstLine = false; } @@ -793,14 +797,15 @@ public: for (const auto &fragment : m_highlightedFragments) { auto const &ansiStyle = ansiStyles[fragment.formatId]; - out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second; + out << ansiStyle.first << QStringView(currentLine).mid(fragment.offset, fragment.length) << ansiStyle.second; } out << QStringLiteral("\x1b[K\n"); if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) { - if (m_hasContextTrace || m_hasStackSizeTrace) + if (m_hasContextTrace || m_hasStackSizeTrace) { appendContextNames(oldState, currentLine); + } printFormats(out, infoStyle, ansiStyles); out << resetBgColor; @@ -817,8 +822,9 @@ public: void applyFolding(int offset, int /*length*/, FoldingRegion region) override { - if (!m_hasRegionTrace) + if (!m_hasRegionTrace) { return; + } const auto id = region.id(); @@ -829,8 +835,9 @@ public: auto &previousRegion = m_regions[m_regions.size() - 2]; if (previousRegion.state == Region::State::Close && previousRegion.offset == offset) { std::swap(previousRegion, m_regions.back()); - if (previousRegion.bindIndex != -1) + if (previousRegion.bindIndex != -1) { m_regions[previousRegion.bindIndex].bindIndex = m_regions.size() - 1; + } } } ++m_regionDepth; @@ -840,10 +847,11 @@ public: auto eit = m_regions.rend(); for (int depth = 0; it != eit; ++it) { if (it->regionId == id && it->bindIndex < 0) { - if (it->state == Region::State::Close) + if (it->state == Region::State::Close) { ++depth; - else if (--depth < 0) + } else if (--depth < 0) { break; + } } } @@ -868,8 +876,9 @@ private: void initRegionStyles(const std::vector> &ansiStyles) { m_regionStyles.resize(ansiStyles.size()); - for (std::size_t i = 0; i < m_regionStyles.size(); ++i) + for (std::size_t i = 0; i < m_regionStyles.size(); ++i) { m_regionStyles[i] = ansiStyles[i].first; + } std::sort(m_regionStyles.begin(), m_regionStyles.end()); m_regionStyles.erase(std::unique(m_regionStyles.begin(), m_regionStyles.end()), m_regionStyles.end()); @@ -1216,7 +1225,7 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE } // initialize ansiStyles - for (auto &&definition : qAsConst(definitions)) { + for (auto &&definition : std::as_const(definitions)) { const auto formats = definition.formats(); for (auto &&format : formats) { const auto id = format.id(); @@ -1236,20 +1245,26 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE const bool hasUnderline = format.isUnderline(theme); const bool hasStrikeThrough = format.isStrikeThrough(theme); - if (hasFg) + if (hasFg) { buffer.appendForeground(format.textColor(theme).rgb(), is256Colors, colorCache); - else + } else { buffer.append(foregroundDefaultColor); - if (hasBg) + } + if (hasBg) { buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache); - if (hasBold) + } + if (hasBold) { buffer.append(QLatin1String("1;")); - if (hasItalic) + } + if (hasItalic) { buffer.append(QLatin1String("3;")); - if (hasUnderline) + } + if (hasUnderline) { buffer.append(QLatin1String("4;")); - if (hasStrikeThrough) + } + if (hasStrikeThrough) { buffer.append(QLatin1String("9;")); + } // if there is ANSI style if (buffer.latin1().size() > 2) { @@ -1266,14 +1281,18 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE d->ansiStyles[id].second = buffer.latin1(); } else if (hasEffect) { buffer.append(QLatin1String("\x1b[")); - if (hasBold) + if (hasBold) { buffer.append(QLatin1String("21;")); - if (hasItalic) + } + if (hasItalic) { buffer.append(QLatin1String("23;")); - if (hasUnderline) + } + if (hasUnderline) { buffer.append(QLatin1String("24;")); - if (hasStrikeThrough) + } + if (hasStrikeThrough) { buffer.append(QLatin1String("29;")); + } buffer.setFinalStyle(); d->ansiStyles[id].second = buffer.latin1(); } @@ -1301,10 +1320,11 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE d->currentLine = in.readLine(); state = highlightLine(d->currentLine, state); - if (useEditorBackground) + if (useEditorBackground) { d->out << QStringLiteral("\x1b[K\n"); - else + } else { d->out << QLatin1Char('\n'); + } } } else { AnsiBuffer buffer; @@ -1328,5 +1348,5 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE void AnsiHighlighter::applyFormat(int offset, int length, const Format &format) { auto const &ansiStyle = d->ansiStyles[format.id()]; - d->out << ansiStyle.first << d->currentLine.midRef(offset, length) << ansiStyle.second; + d->out << ansiStyle.first << QStringView(d->currentLine).mid(offset, length) << ansiStyle.second; } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp index f980ea5be80..724f37a03f1 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp @@ -30,8 +30,9 @@ void Context::setDefinition(const DefinitionRef &def) bool Context::indentationBasedFoldingEnabled() const { - if (m_noIndentationBasedFolding) + if (m_noIndentationBasedFolding) { return false; + } return m_def.definition().indentationBasedFoldingEnabled(); } @@ -56,8 +57,9 @@ void Context::load(QXmlStreamReader &reader) auto rule = Rule::create(reader.name()); if (rule) { rule->setDefinition(m_def.definition()); - if (rule->load(reader)) + if (rule->load(reader)) { m_rules.push_back(std::move(rule)); + } } else { reader.skipCurrentElement(); } @@ -79,8 +81,9 @@ void Context::resolveContexts() m_lineEndContext.resolve(def); m_lineEmptyContext.resolve(def); m_fallthroughContext.resolve(def); - for (const auto &rule : m_rules) + for (const auto &rule : m_rules) { rule->resolveContext(); + } } Context::ResolveState Context::resolveState() @@ -100,8 +103,9 @@ Context::ResolveState Context::resolveState() void Context::resolveIncludes() { - if (resolveState() == Resolved) + if (resolveState() == Resolved) { return; + } if (resolveState() == Resolving) { qCWarning(Log) << "Cyclic dependency!"; return; @@ -129,10 +133,11 @@ void Context::resolveIncludes() } auto defData = DefinitionData::get(def); defData->load(); - if (inc->contextName().isEmpty()) + if (inc->contextName().isEmpty()) { context = defData->initialContext(); - else + } else { context = defData->contextByName(inc->contextName()); + } } if (!context) { qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in" diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp index 7ccd73ee9b7..e829af463a3 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp @@ -29,8 +29,9 @@ Context *ContextSwitch::context() const void ContextSwitch::parse(QStringView contextInstr) { - if (contextInstr.isEmpty() || contextInstr == QLatin1String("#stay")) + if (contextInstr.isEmpty() || contextInstr == QLatin1String("#stay")) { return; + } if (contextInstr.startsWith(QLatin1String("#pop!"))) { ++m_popCount; @@ -60,13 +61,15 @@ void ContextSwitch::resolve(const Definition &def) d = DefinitionData::get(def)->repo->definitionForName(m_defName); auto data = DefinitionData::get(d); data->load(); - if (m_contextName.isEmpty()) + if (m_contextName.isEmpty()) { m_context = data->initialContext(); + } } if (!m_contextName.isEmpty()) { m_context = DefinitionData::get(d)->contextByName(m_contextName); - if (!m_context) + if (!m_context) { qCWarning(Log) << "cannot find context" << m_contextName << "in" << def.name(); + } } } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp index 7434e745b23..068907a4e28 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp @@ -51,30 +51,21 @@ DefinitionData *DefinitionData::get(const Definition &def) Definition::Definition() : d(new DefinitionData) -{ -} - -Definition::Definition(const Definition &other) - : d(other.d) { d->q = *this; } +Definition::Definition(Definition &&other) noexcept = default; +Definition::Definition(const Definition &) = default; +Definition::~Definition() = default; +Definition &Definition::operator=(Definition &&other) noexcept = default; +Definition &Definition::operator=(const Definition &) = default; + Definition::Definition(std::shared_ptr &&dd) : d(std::move(dd)) { } -Definition::~Definition() -{ -} - -Definition &Definition::operator=(const Definition &rhs) -{ - d = rhs.d; - return *this; -} - bool Definition::operator==(const Definition &other) const { return d->fileName == other.d->fileName; @@ -223,8 +214,9 @@ bool Definition::setKeywordList(const QString &name, const QStringList &content) if (list) { list->setKeywordList(content); return true; - } else + } else { return false; + } } QVector Definition::formats() const @@ -251,7 +243,7 @@ QVector Definition::includedDefinitions() const // Iterate all context rules to find associated Definitions. This will // automatically catch other Definitions referenced with IncludeRuldes or ContextSwitch. const auto definition = queue.takeLast(); - for (const auto &context : qAsConst(definition.d->contexts)) { + for (const auto &context : std::as_const(definition.d->contexts)) { // handle context switch attributes of this context itself for (const auto switchContext : {context->lineEndContext().context(), context->lineEmptyContext().context(), context->fallthroughContext().context()}) { @@ -321,8 +313,9 @@ Context *DefinitionData::initialContext() const Context *DefinitionData::contextByName(const QString &wantedName) const { for (const auto context : contexts) { - if (context->name() == wantedName) + if (context->name() == wantedName) { return context; + } } return nullptr; } @@ -336,8 +329,9 @@ KeywordList *DefinitionData::keywordList(const QString &wantedName) Format DefinitionData::formatByName(const QString &wantedName) const { const auto it = formats.constFind(wantedName); - if (it != formats.constEnd()) + if (it != formats.constEnd()) { return it.value(); + } return Format(); } @@ -349,24 +343,29 @@ bool DefinitionData::isLoaded() const bool DefinitionData::load(OnlyKeywords onlyKeywords) { - if (fileName.isEmpty()) + if (fileName.isEmpty()) { return false; + } - if (isLoaded()) + if (isLoaded()) { return true; + } - if (bool(onlyKeywords) && keywordIsLoaded) + if (bool(onlyKeywords) && keywordIsLoaded) { return true; + } QFile file(fileName); - if (!file.open(QFile::ReadOnly)) + if (!file.open(QFile::ReadOnly)) { return false; + } QXmlStreamReader reader(&file); while (!reader.atEnd()) { const auto token = reader.readNext(); - if (token != QXmlStreamReader::StartElement) + if (token != QXmlStreamReader::StartElement) { continue; + } if (reader.name() == QLatin1String("highlighting")) { loadHighlighting(reader, onlyKeywords); @@ -375,21 +374,22 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords) } } - else if (reader.name() == QLatin1String("general")) + else if (reader.name() == QLatin1String("general")) { loadGeneral(reader); + } } for (auto it = keywordLists.begin(); it != keywordLists.end(); ++it) { it->setCaseSensitivity(caseSensitive); } - for (const auto context : qAsConst(contexts)) { + for (const auto context : std::as_const(contexts)) { context->resolveContexts(); context->resolveIncludes(); context->resolveAttributeFormat(); } - for (const auto context : qAsConst(contexts)) { + for (const auto context : std::as_const(contexts)) { for (const auto &rule : context->rules()) { rule->resolvePostProcessing(); } @@ -427,14 +427,16 @@ bool DefinitionData::loadMetaData(const QString &definitionFileName) fileName = definitionFileName; QFile file(definitionFileName); - if (!file.open(QFile::ReadOnly)) + if (!file.open(QFile::ReadOnly)) { return false; + } QXmlStreamReader reader(&file); while (!reader.atEnd()) { const auto token = reader.readNext(); - if (token != QXmlStreamReader::StartElement) + if (token != QXmlStreamReader::StartElement) { continue; + } if (reader.name() == QLatin1String("language")) { return loadLanguage(reader); } @@ -457,11 +459,13 @@ bool DefinitionData::loadMetaData(const QString &file, const QCborMap &obj) fileName = file; const auto exts = obj.value(QLatin1String("extensions")).toString(); - for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) + for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) { extensions.push_back(ext); + } const auto mts = obj.value(QLatin1String("mimetype")).toString(); - for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) + for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) { mimetypes.push_back(mt); + } return true; } @@ -471,8 +475,9 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader) Q_ASSERT(reader.name() == QLatin1String("language")); Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement); - if (!checkKateVersion(reader.attributes().value(QLatin1String("kateversion")))) + if (!checkKateVersion(reader.attributes().value(QLatin1String("kateversion")))) { return false; + } name = reader.attributes().value(QLatin1String("name")).toString(); section = reader.attributes().value(QLatin1String("section")).toString(); @@ -485,13 +490,16 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader) author = reader.attributes().value(QLatin1String("author")).toString(); license = reader.attributes().value(QLatin1String("license")).toString(); const auto exts = reader.attributes().value(QLatin1String("extensions")).toString(); - for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) + for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) { extensions.push_back(ext); + } const auto mts = reader.attributes().value(QLatin1String("mimetype")).toString(); - for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) + for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) { mimetypes.push_back(mt); - if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) + } + if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) { caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; + } return true; } @@ -618,8 +626,9 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader) ++elementRefCounter; if (reader.name() == QLatin1String("keywords")) { - if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) + if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) { caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; + } // adapt wordDelimiters wordDelimiters.append(reader.attributes().value(QLatin1String("additionalDeliminator"))); @@ -628,14 +637,15 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader) // adapt WordWrapDelimiters auto wordWrapDeliminatorAttr = reader.attributes().value( QLatin1String("wordWrapDeliminator")); - if (wordWrapDeliminatorAttr.isEmpty()) + if (wordWrapDeliminatorAttr.isEmpty()) { wordWrapDelimiters = wordDelimiters; - else { + } else { wordWrapDelimiters.append(wordWrapDeliminatorAttr); } } else if (reader.name() == QLatin1String("folding")) { - if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive"))) + if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive"))) { indentationBasedFolding = Xml::attrToBool(reader.attributes().value(QLatin1String("indentationsensitive"))); + } } else if (reader.name() == QLatin1String("emptyLines")) { loadFoldingIgnoreList(reader); } else if (reader.name() == QLatin1String("comments")) { @@ -649,8 +659,9 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader) break; case QXmlStreamReader::EndElement: --elementRefCounter; - if (elementRefCounter == 0) + if (elementRefCounter == 0) { return; + } reader.readNext(); break; default: @@ -688,8 +699,9 @@ void DefinitionData::loadComments(QXmlStreamReader &reader) break; case QXmlStreamReader::EndElement: --elementRefCounter; - if (elementRefCounter == 0) + if (elementRefCounter == 0) { return; + } reader.readNext(); break; default: @@ -719,8 +731,9 @@ void DefinitionData::loadFoldingIgnoreList(QXmlStreamReader &reader) break; case QXmlStreamReader::EndElement: --elementRefCounter; - if (elementRefCounter == 0) + if (elementRefCounter == 0) { return; + } reader.readNext(); break; default: @@ -754,8 +767,9 @@ void DefinitionData::loadSpellchecking(QXmlStreamReader &reader) break; case QXmlStreamReader::EndElement: --elementRefCounter; - if (elementRefCounter == 0) + if (elementRefCounter == 0) { return; + } reader.readNext(); break; default: @@ -798,10 +812,6 @@ DefinitionRef::DefinitionRef(const Definition &def) { } -DefinitionRef::~DefinitionRef() -{ -} - DefinitionRef &DefinitionRef::operator=(const Definition &def) { d = def.d; @@ -810,8 +820,9 @@ DefinitionRef &DefinitionRef::operator=(const Definition &def) Definition DefinitionRef::definition() const { - if (!d.expired()) + if (!d.expired()) { return Definition(d.lock()); + } return Definition(); } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h index 8226fbdd24f..05757ea52a3 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h @@ -13,6 +13,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE class QChar; @@ -74,7 +75,7 @@ enum class CommentPosition { * singleLineCommentMarker() and multiLineCommentMarker() provide comment * markers that can be used for commenting/uncommenting code. Similarly, * formats() returns a list of Format items defined by this Definition (which - * equal the itemDatas of a highlighing definition file). includedDefinitions() + * equal the itemDatas of a highlighting definition file). includedDefinitions() * returns a list of all included Definition%s referenced by this Definition via * the rule IncludeRules, which is useful for displaying all Format items for * color configuration in the user interface. @@ -84,6 +85,13 @@ enum class CommentPosition { */ class KSYNTAXHIGHLIGHTING_EXPORT Definition { + Q_GADGET + Q_PROPERTY(QString name READ name) + Q_PROPERTY(QString translatedName READ translatedName) + Q_PROPERTY(QString section READ section) + Q_PROPERTY(QString translatedSection READ translatedSection) + Q_PROPERTY(QString author READ author) + Q_PROPERTY(QString license READ license) public: /** * Default constructor, creating an empty (invalid) Definition instance. @@ -93,6 +101,14 @@ public: */ Definition(); + /** + * Move constructor. + * This definition takes the Definition data from @p other. + * @note @p other may only be assigned to or destroyed afterwards. + * @since 5.86 + */ + Definition(Definition &&other) noexcept; + /** * Copy constructor. * Both this definition as well as @p other share the Definition data. @@ -105,7 +121,15 @@ public: ~Definition(); /** - * Assignment operator. + * Move assignment operator. + * This definition takes the Definition data from @p other. + * @note @p other may only be assigned to or destroyed afterwards. + * @since 5.86 + */ + Definition &operator=(Definition &&other) noexcept; + + /** + * Copy assignment operator. * Both this definition as well as @p rhs share the Definition data. */ Definition &operator=(const Definition &rhs); diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp index 3dff1dd4366..b16139b731f 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp @@ -51,24 +51,27 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply * while (!parser.atEnd()) { switch (parser.readNext()) { case QXmlStreamReader::StartElement: - if (parser.name() == QLatin1String("Definition")) + if (parser.name() == QLatin1String("Definition")) { updateDefinition(parser); + } break; default: break; } } - if (pendingDownloads == 0) + if (pendingDownloads == 0) { Q_EMIT q->informationMessage(QObject::tr("All syntax definitions are up-to-date.")); + } checkDone(); } void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser) { const auto name = parser.attributes().value(QLatin1String("name")); - if (name.isEmpty()) + if (name.isEmpty()) { return; + } auto localDef = repo->definitionForName(name.toString()); if (!localDef.isValid()) { @@ -86,11 +89,13 @@ void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser) void DefinitionDownloaderPrivate::downloadDefinition(const QUrl &downloadUrl) { - if (!downloadUrl.isValid()) + if (!downloadUrl.isValid()) { return; + } auto url = downloadUrl; - if (url.scheme() == QLatin1String("http")) + if (url.scheme() == QLatin1String("http")) { url.setScheme(QStringLiteral("https")); + } QNetworkRequest req(url); auto reply = nam->get(req); @@ -133,8 +138,9 @@ void DefinitionDownloaderPrivate::downloadDefinitionFinished(QNetworkReply *repl void DefinitionDownloaderPrivate::checkDone() { if (pendingDownloads == 0) { - if (needsReload) + if (needsReload) { repo->reload(); + } Q_EMIT QTimer::singleShot(0, q, &DefinitionDownloader::done); } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h index 25a1a749e49..285fec3e206 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h @@ -13,7 +13,6 @@ namespace KSyntaxHighlighting { class Definition; class DefinitionData; -class DefinitionPrivate; /** Weak reference for Definition instances. * @@ -21,6 +20,8 @@ class DefinitionPrivate; * in objects hold directly or indirectly by Definition * to avoid reference count loops and thus memory leaks. * + * This class follows the rule of zero. It is implicitly movable and copyable. + * * @internal */ class DefinitionRef @@ -28,7 +29,6 @@ class DefinitionRef public: DefinitionRef(); explicit DefinitionRef(const Definition &def); - ~DefinitionRef(); DefinitionRef &operator=(const Definition &def); Definition definition() const; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp index d459ee36d88..bcc64c3c2bc 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp @@ -21,8 +21,9 @@ using namespace KSyntaxHighlighting; static Theme::TextStyle stringToDefaultFormat(QStringView str) { - if (!str.startsWith(QLatin1String("ds"))) + if (!str.startsWith(QLatin1String("ds"))) { return Theme::Normal; + } static const auto idx = Theme::staticMetaObject.indexOfEnumerator("TextStyle"); Q_ASSERT(idx >= 0); @@ -30,8 +31,9 @@ static Theme::TextStyle stringToDefaultFormat(QStringView str) bool ok = false; const auto value = metaEnum.keyToValue(str.mid(2).toLatin1().constData(), &ok); - if (!ok || value < 0) + if (!ok || value < 0) { return Theme::Normal; + } return static_cast(value); } @@ -44,8 +46,9 @@ FormatPrivate *FormatPrivate::detachAndGet(Format &format) TextStyleData FormatPrivate::styleOverride(const Theme &theme) const { const auto themeData = ThemeData::get(theme); - if (themeData) + if (themeData) { return themeData->textStyleOverride(definition.definition().name(), name); + } return TextStyleData(); } @@ -113,16 +116,18 @@ bool Format::hasTextColor(const Theme &theme) const QColor Format::textColor(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.textColor) + if (overrideStyle.textColor) { return overrideStyle.textColor; + } return d->style.textColor ? QColor::fromRgba(d->style.textColor) : QColor::fromRgba(theme.textColor(d->defaultStyle)); } QColor Format::selectedTextColor(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.selectedTextColor) + if (overrideStyle.selectedTextColor) { return overrideStyle.selectedTextColor; + } return d->style.selectedTextColor ? QColor::fromRgba(d->style.selectedTextColor) : QColor::fromRgba(theme.selectedTextColor(d->defaultStyle)); } @@ -136,8 +141,9 @@ bool Format::hasBackgroundColor(const Theme &theme) const QColor Format::backgroundColor(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.backgroundColor) + if (overrideStyle.backgroundColor) { return overrideStyle.backgroundColor; + } // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! return d->style.backgroundColor ? QColor::fromRgba(d->style.backgroundColor) : QColor::fromRgba(theme.backgroundColor(d->defaultStyle)); @@ -146,8 +152,9 @@ QColor Format::backgroundColor(const Theme &theme) const QColor Format::selectedBackgroundColor(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.selectedBackgroundColor) + if (overrideStyle.selectedBackgroundColor) { return overrideStyle.selectedBackgroundColor; + } // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! return d->style.selectedBackgroundColor ? QColor::fromRgba(d->style.selectedBackgroundColor) @@ -157,32 +164,36 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const bool Format::isBold(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.hasBold) + if (overrideStyle.hasBold) { return overrideStyle.bold; + } return d->style.hasBold ? d->style.bold : theme.isBold(d->defaultStyle); } bool Format::isItalic(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.hasItalic) + if (overrideStyle.hasItalic) { return overrideStyle.italic; + } return d->style.hasItalic ? d->style.italic : theme.isItalic(d->defaultStyle); } bool Format::isUnderline(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.hasUnderline) + if (overrideStyle.hasUnderline) { return overrideStyle.underline; + } return d->style.hasUnderline ? d->style.underline : theme.isUnderline(d->defaultStyle); } bool Format::isStrikeThrough(const Theme &theme) const { const auto overrideStyle = d->styleOverride(theme); - if (overrideStyle.hasStrikeThrough) + if (overrideStyle.hasStrikeThrough) { return overrideStyle.strikeThrough; + } return d->style.hasStrikeThrough ? d->style.strikeThrough : theme.isStrikeThrough(d->defaultStyle); } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp index 5ba421d0e1b..688a42d45cd 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp @@ -70,10 +70,11 @@ void HtmlHighlighter::highlightFile(const QString &fileName, const QString &titl return; } - if (title.isEmpty()) + if (title.isEmpty()) { highlightData(&f, fi.fileName()); - else + } else { highlightData(&f, title); + } } /** @@ -87,8 +88,9 @@ void HtmlHighlighter::highlightFile(const QString &fileName, const QString &titl */ static QString toHtmlRgbaString(const QColor &color) { - if (color.alpha() == 0xFF) + if (color.alpha() == 0xFF) { return color.name(); + } QString rgba = QStringLiteral("rgba("); rgba.append(QString::number(color.red())); @@ -111,10 +113,11 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title) } QString htmlTitle; - if (title.isEmpty()) + if (title.isEmpty()) { htmlTitle = QStringLiteral("Kate Syntax Highlighter"); - else + } else { htmlTitle = title.toHtmlEscaped(); + } State state; *d->out << "\n"; @@ -125,8 +128,9 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title) << ")\"/>\n"; *d->out << "out << " style=\"background-color:" << toHtmlRgbaString(QColor::fromRgba(theme().editorColor(Theme::BackgroundColor))); - if (theme().textColor(Theme::Normal)) + if (theme().textColor(Theme::Normal)) { *d->out << ";color:" << toHtmlRgbaString(QColor::fromRgba(theme().textColor(Theme::Normal))); + } *d->out << "\">
\n";
 
     QTextStream in(dev);
@@ -148,27 +152,34 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
 
 void HtmlHighlighter::applyFormat(int offset, int length, const Format &format)
 {
-    if (length == 0)
+    if (length == 0) {
         return;
+    }
 
     // collect potential output, cheaper than thinking about "is there any?"
     QVarLengthArray formatOutput;
-    if (format.hasTextColor(theme()))
+    if (format.hasTextColor(theme())) {
         formatOutput << QStringLiteral("color:") << toHtmlRgbaString(format.textColor(theme())) << QStringLiteral(";");
-    if (format.hasBackgroundColor(theme()))
+    }
+    if (format.hasBackgroundColor(theme())) {
         formatOutput << QStringLiteral("background-color:") << toHtmlRgbaString(format.backgroundColor(theme())) << QStringLiteral(";");
-    if (format.isBold(theme()))
+    }
+    if (format.isBold(theme())) {
         formatOutput << QStringLiteral("font-weight:bold;");
-    if (format.isItalic(theme()))
+    }
+    if (format.isItalic(theme())) {
         formatOutput << QStringLiteral("font-style:italic;");
-    if (format.isUnderline(theme()))
+    }
+    if (format.isUnderline(theme())) {
         formatOutput << QStringLiteral("text-decoration:underline;");
-    if (format.isStrikeThrough(theme()))
+    }
+    if (format.isStrikeThrough(theme())) {
         formatOutput << QStringLiteral("text-decoration:line-through;");
+    }
 
     if (!formatOutput.isEmpty()) {
         *d->out << "out << out;
         }
         *d->out << "\">";
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
index b13e30607ba..3a7514897a3 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
@@ -16,6 +16,27 @@
 
 using namespace KSyntaxHighlighting;
 
+namespace
+{
+struct KeywordComparator {
+    Qt::CaseSensitivity caseSensitive;
+
+    bool operator()(QStringView a, QStringView b) const
+    {
+        if (a.size() < b.size()) {
+            return true;
+        }
+
+        if (a.size() > b.size()) {
+            return false;
+        }
+
+        return a.compare(b, caseSensitive) < 0;
+    }
+};
+
+}
+
 bool KeywordList::contains(QStringView str, Qt::CaseSensitivity caseSensitive) const
 {
     /**
@@ -26,9 +47,7 @@ bool KeywordList::contains(QStringView str, Qt::CaseSensitivity caseSensitive) c
     /**
      * search with right predicate
      */
-    return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](QStringView a, QStringView b) {
-        return a.compare(b, caseSensitive) < 0;
-    });
+    return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), KeywordComparator{caseSensitive});
 }
 
 void KeywordList::load(QXmlStreamReader &reader)
@@ -85,16 +104,14 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
      * fill vector with refs to keywords
      */
     vectorToSort.reserve(m_keywords.size());
-    for (const auto &keyword : qAsConst(m_keywords)) {
+    for (const auto &keyword : std::as_const(m_keywords)) {
         vectorToSort.push_back(keyword);
     }
 
     /**
      * sort with right predicate
      */
-    std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](QStringView a, QStringView b) {
-        return a.compare(b, caseSensitive) < 0;
-    });
+    std::sort(vectorToSort.begin(), vectorToSort.end(), KeywordComparator{caseSensitive});
 }
 
 void KeywordList::resolveIncludeKeywords(DefinitionData &def)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ksyntaxhighlighting_export.h b/src/libs/3rdparty/syntax-highlighting/src/lib/ksyntaxhighlighting_export.h
deleted file mode 100644
index a39adb5ed6f..00000000000
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/ksyntaxhighlighting_export.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 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 
-
-#if defined(KSYNTAXHIGHLIGHTING_LIBRARY)
-#  define KSYNTAXHIGHLIGHTING_EXPORT Q_DECL_EXPORT
-#else
-#  define KSYNTAXHIGHLIGHTING_EXPORT Q_DECL_IMPORT
-#endif
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
index 1e3191a7bce..f3b36df4593 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
@@ -11,7 +11,7 @@
 #include "repository_p.h"
 #include "theme.h"
 #include "themedata_p.h"
-#include "wildcardmatcher_p.h"
+#include "wildcardmatcher.h"
 
 #include 
 #include 
@@ -19,15 +19,75 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #ifndef NO_STANDARD_PATHS
 #include 
 #endif
 
+#include 
+#include 
 #include 
 
 using namespace KSyntaxHighlighting;
 
+namespace
+{
+QString fileNameFromFilePath(const QString &filePath)
+{
+    return QFileInfo{filePath}.fileName();
+}
+
+auto anyWildcardMatches(QStringView str)
+{
+    return [str](const Definition &def) {
+        const auto strings = def.extensions();
+        return std::any_of(strings.cbegin(), strings.cend(), [str](QStringView wildcard) {
+            return WildcardMatcher::exactMatch(str, wildcard);
+        });
+    };
+}
+
+auto anyMimeTypeEquals(QStringView mimeTypeName)
+{
+    return [mimeTypeName](const Definition &def) {
+        const auto strings = def.mimeTypes();
+        return std::any_of(strings.cbegin(), strings.cend(), [mimeTypeName](QStringView name) {
+            return mimeTypeName == name;
+        });
+    };
+}
+
+// The two function templates below take defs - a map sorted by highlighting name - to be deterministic and independent of translations.
+
+template
+Definition findHighestPriorityDefinitionIf(const QMap &defs, UnaryPredicate predicate)
+{
+    const Definition *match = nullptr;
+    auto matchPriority = std::numeric_limits::lowest();
+    for (const Definition &def : defs) {
+        const auto defPriority = def.priority();
+        if (defPriority > matchPriority && predicate(def)) {
+            match = &def;
+            matchPriority = defPriority;
+        }
+    }
+    return match == nullptr ? Definition{} : *match;
+}
+
+template
+QVector findDefinitionsIf(const QMap &defs, UnaryPredicate predicate)
+{
+    QVector matches;
+    std::copy_if(defs.cbegin(), defs.cend(), std::back_inserter(matches), predicate);
+    std::stable_sort(matches.begin(), matches.end(), [](const Definition &lhs, const Definition &rhs) {
+        return lhs.priority() > rhs.priority();
+    });
+    return matches;
+}
+} // unnamed namespace
+
 static void initResource()
 {
 #ifdef HAS_SYNTAX_RESOURCE
@@ -52,8 +112,9 @@ Repository::~Repository()
 {
     // reset repo so we can detect in still alive definition instances
     // that the repo was deleted
-    for (const auto &def : qAsConst(d->m_sortedDefs))
+    for (const auto &def : std::as_const(d->m_sortedDefs)) {
         DefinitionData::get(def)->repo = nullptr;
+    }
 }
 
 Definition Repository::definitionForName(const QString &defName) const
@@ -61,58 +122,24 @@ Definition Repository::definitionForName(const QString &defName) const
     return d->m_defs.value(defName);
 }
 
-static void sortDefinitions(QVector &definitions)
-{
-    std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) {
-        return lhs.priority() > rhs.priority();
-    });
-}
-
 Definition Repository::definitionForFileName(const QString &fileName) const
 {
-    return definitionsForFileName(fileName).value(0);
+    return findHighestPriorityDefinitionIf(d->m_defs, anyWildcardMatches(fileNameFromFilePath(fileName)));
 }
 
 QVector Repository::definitionsForFileName(const QString &fileName) const
 {
-    QFileInfo fi(fileName);
-    const auto name = fi.fileName();
-
-    // use d->m_defs, sorted map by highlighting name, to be deterministic and independent of translations
-    QVector candidates;
-    for (const Definition &def : qAsConst(d->m_defs)) {
-        for (const auto &pattern : def.extensions()) {
-            if (WildcardMatcher::exactMatch(name, pattern)) {
-                candidates.push_back(def);
-                break;
-            }
-        }
-    }
-
-    sortDefinitions(candidates);
-    return candidates;
+    return findDefinitionsIf(d->m_defs, anyWildcardMatches(fileNameFromFilePath(fileName)));
 }
 
 Definition Repository::definitionForMimeType(const QString &mimeType) const
 {
-    return definitionsForMimeType(mimeType).value(0);
+    return findHighestPriorityDefinitionIf(d->m_defs, anyMimeTypeEquals(mimeType));
 }
 
 QVector Repository::definitionsForMimeType(const QString &mimeType) const
 {
-    // use d->m_defs, sorted map by highlighting name, to be deterministic and independent of translations
-    QVector candidates;
-    for (const Definition &def : qAsConst(d->m_defs)) {
-        for (const auto &matchType : def.mimeTypes()) {
-            if (mimeType == matchType) {
-                candidates.push_back(def);
-                break;
-            }
-        }
-    }
-
-    sortDefinitions(candidates);
-    return candidates;
+    return findDefinitionsIf(d->m_defs, anyMimeTypeEquals(mimeType));
 }
 
 QVector Repository::definitions() const
@@ -127,7 +154,7 @@ QVector Repository::themes() const
 
 Theme Repository::theme(const QString &themeName) const
 {
-    for (const auto &theme : qAsConst(d->m_themes)) {
+    for (const auto &theme : std::as_const(d->m_themes)) {
         if (theme.name() == themeName) {
             return theme;
         }
@@ -138,14 +165,15 @@ Theme Repository::theme(const QString &themeName) const
 
 Theme Repository::defaultTheme(Repository::DefaultTheme t) const
 {
-    if (t == DarkTheme)
+    if (t == DarkTheme) {
         return theme(QLatin1String("Breeze Dark"));
+    }
     return theme(QLatin1String("Breeze Light"));
 }
 
 Theme Repository::defaultTheme(Repository::DefaultTheme t)
 {
-    return qAsConst(*this).defaultTheme(t);
+    return std::as_const(*this).defaultTheme(t);
 }
 
 Theme Repository::themeForPalette(const QPalette &palette) const
@@ -164,7 +192,7 @@ Theme Repository::themeForPalette(const QPalette &palette) const
     if (!matchingThemes.empty()) {
         // if there's multiple, search for one with a matching highlight color
         const auto highlight = palette.color(QPalette::Highlight);
-        for (const auto &theme : qAsConst(matchingThemes)) {
+        for (const auto &theme : std::as_const(matchingThemes)) {
             auto selection = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
             if (selection == highlight.rgb()) {
                 return theme;
@@ -179,7 +207,7 @@ Theme Repository::themeForPalette(const QPalette &palette) const
 
 Theme Repository::themeForPalette(const QPalette &palette)
 {
-    return qAsConst(*this).themeForPalette(palette);
+    return std::as_const(*this).themeForPalette(palette);
 }
 
 void RepositoryPrivate::load(Repository *repo)
@@ -189,29 +217,39 @@ void RepositoryPrivate::load(Repository *repo)
 
     // do lookup in standard paths, if not disabled
 #ifndef NO_STANDARD_PATHS
-    for (const auto &dir :
-         QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
+    for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
+                                                     QStringLiteral("org.kde.syntax-highlighting/syntax"),
+                                                     QStandardPaths::LocateDirectory)) {
         loadSyntaxFolder(repo, dir);
+    }
 
     // backward compatibility with Kate
-    for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("katepart5/syntax"), QStandardPaths::LocateDirectory))
+    for (const auto &dir :
+         QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("katepart5/syntax"), QStandardPaths::LocateDirectory)) {
         loadSyntaxFolder(repo, dir);
+    }
 #endif
 
-    // default resources are always used
-    loadSyntaxFolder(repo, QStringLiteral(":/org.kde.syntax-highlighting/syntax"));
+    // default resources are always used, this is the one location that has a index cbor file
+    loadSyntaxFolderFromIndex(repo, QStringLiteral(":/org.kde.syntax-highlighting/syntax"));
+
+    // extra resources provided by 3rdparty libraries/applications
+    loadSyntaxFolder(repo, QStringLiteral(":/org.kde.syntax-highlighting/syntax-addons"));
 
     // user given extra paths
-    for (const auto &path : qAsConst(m_customSearchPaths))
+    for (const auto &path : std::as_const(m_customSearchPaths)) {
         loadSyntaxFolder(repo, path + QStringLiteral("/syntax"));
+    }
 
     m_sortedDefs.reserve(m_defs.size());
-    for (auto it = m_defs.constBegin(); it != m_defs.constEnd(); ++it)
+    for (auto it = m_defs.constBegin(); it != m_defs.constEnd(); ++it) {
         m_sortedDefs.push_back(it.value());
+    }
     std::sort(m_sortedDefs.begin(), m_sortedDefs.end(), [](const Definition &left, const Definition &right) {
         auto comparison = left.translatedSection().compare(right.translatedSection(), Qt::CaseInsensitive);
-        if (comparison == 0)
+        if (comparison == 0) {
             comparison = left.translatedName().compare(right.translatedName(), Qt::CaseInsensitive);
+        }
         return comparison < 0;
     });
 
@@ -219,54 +257,60 @@ void RepositoryPrivate::load(Repository *repo)
 
     // do lookup in standard paths, if not disabled
 #ifndef NO_STANDARD_PATHS
-    for (const auto &dir :
-         QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
+    for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
+                                                     QStringLiteral("org.kde.syntax-highlighting/themes"),
+                                                     QStandardPaths::LocateDirectory)) {
         loadThemeFolder(dir);
+    }
 #endif
 
     // default resources are always used
     loadThemeFolder(QStringLiteral(":/org.kde.syntax-highlighting/themes"));
 
+    // extra resources provided by 3rdparty libraries/applications
+    loadThemeFolder(QStringLiteral(":/org.kde.syntax-highlighting/themes-addons"));
+
     // user given extra paths
-    for (const auto &path : qAsConst(m_customSearchPaths))
+    for (const auto &path : std::as_const(m_customSearchPaths)) {
         loadThemeFolder(path + QStringLiteral("/themes"));
+    }
 }
 
 void RepositoryPrivate::loadSyntaxFolder(Repository *repo, const QString &path)
 {
-    if (loadSyntaxFolderFromIndex(repo, path))
-        return;
-
     QDirIterator it(path, QStringList() << QLatin1String("*.xml"), QDir::Files);
     while (it.hasNext()) {
         Definition def;
         auto defData = DefinitionData::get(def);
         defData->repo = repo;
-        if (defData->loadMetaData(it.next()))
+        if (defData->loadMetaData(it.next())) {
             addDefinition(def);
+        }
     }
 }
 
-bool RepositoryPrivate::loadSyntaxFolderFromIndex(Repository *repo, const QString &path)
+void RepositoryPrivate::loadSyntaxFolderFromIndex(Repository *repo, const QString &path)
 {
     QFile indexFile(path + QLatin1String("/index.katesyntax"));
-    if (!indexFile.open(QFile::ReadOnly))
-        return false;
+    if (!indexFile.open(QFile::ReadOnly)) {
+        return;
+    }
 
     const auto indexDoc(QCborValue::fromCbor(indexFile.readAll()));
     const auto index = indexDoc.toMap();
     for (auto it = index.begin(); it != index.end(); ++it) {
-        if (!it.value().isMap())
+        if (!it.value().isMap()) {
             continue;
+        }
         const auto fileName = QString(path + QLatin1Char('/') + it.key().toString());
         const auto defMap = it.value().toMap();
         Definition def;
         auto defData = DefinitionData::get(def);
         defData->repo = repo;
-        if (defData->loadMetaData(fileName, defMap))
+        if (defData->loadMetaData(fileName, defMap)) {
             addDefinition(def);
+        }
     }
-    return true;
 }
 
 void RepositoryPrivate::addDefinition(const Definition &def)
@@ -277,8 +321,9 @@ void RepositoryPrivate::addDefinition(const Definition &def)
         return;
     }
 
-    if (it.value().version() >= def.version())
+    if (it.value().version() >= def.version()) {
         return;
+    }
     m_defs.insert(def.name(), def);
 }
 
@@ -287,8 +332,9 @@ void RepositoryPrivate::loadThemeFolder(const QString &path)
     QDirIterator it(path, QStringList() << QLatin1String("*.theme"), QDir::Files);
     while (it.hasNext()) {
         auto themeData = std::unique_ptr(new ThemeData);
-        if (themeData->load(it.next()))
+        if (themeData->load(it.next())) {
             addTheme(Theme(themeData.release()));
+        }
     }
 }
 
@@ -307,15 +353,17 @@ void RepositoryPrivate::addTheme(const Theme &theme)
         m_themes.insert(it, theme);
         return;
     }
-    if (themeRevision(*it) < themeRevision(theme))
+    if (themeRevision(*it) < themeRevision(theme)) {
         *it = theme;
+    }
 }
 
 quint16 RepositoryPrivate::foldingRegionId(const QString &defName, const QString &foldName)
 {
     const auto it = m_foldingRegionIds.constFind(qMakePair(defName, foldName));
-    if (it != m_foldingRegionIds.constEnd())
+    if (it != m_foldingRegionIds.constEnd()) {
         return it.value();
+    }
     m_foldingRegionIds.insert(qMakePair(defName, foldName), ++m_foldingRegionId);
     return m_foldingRegionId;
 }
@@ -329,8 +377,9 @@ quint16 RepositoryPrivate::nextFormatId()
 void Repository::reload()
 {
     qCDebug(Log) << "Reloading syntax definitions!";
-    for (const auto &def : qAsConst(d->m_sortedDefs))
+    for (const auto &def : std::as_const(d->m_sortedDefs)) {
         DefinitionData::get(def)->clear();
+    }
     d->m_defs.clear();
     d->m_sortedDefs.clear();
 
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
index 323407f0081..9e19ecda566 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
@@ -86,6 +86,11 @@ class Theme;
  *    The internal resource path is ":/org.kde.syntax-highlighting/syntax".
  *    This path should never be touched by other applications.
  *
+ * -# Then, all custom files compiled into resources are loaded.
+ *    The resource path is ":/org.kde.syntax-highlighting/syntax-addons".
+ *    This path can be used by other libraries/applications to bundle specialized definitions.
+ *    Per default this path isn't used by the framework itself.
+ *
  * -# Finally, the search path can be extended by calling addCustomSearchPath().
  *    A custom search path can either be a path on disk or again a path to
  *    a Qt resource.
@@ -102,6 +107,11 @@ class Theme;
  *    The internal resource path is ":/org.kde.syntax-highlighting/themes".
  *    This path should never be touched by other applications.
  *
+ * -# Then, all custom files compiled into resources are loaded.
+ *    The resource path is ":/org.kde.syntax-highlighting/themes-addons".
+ *    This path can be used by other libraries/applications to bundle specialized themes.
+ *    Per default this path isn't used by the framework itself.
+ *
  * -# Finally, all Theme%s located in the paths added addCustomSearchPath()
  *    are loaded.
  *
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h
index 447cfae6990..abc992358d6 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h
@@ -29,7 +29,7 @@ public:
 
     void load(Repository *repo);
     void loadSyntaxFolder(Repository *repo, const QString &path);
-    bool loadSyntaxFolderFromIndex(Repository *repo, const QString &path);
+    void loadSyntaxFolderFromIndex(Repository *repo, const QString &path);
 
     void addDefinition(const Definition &def);
 
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
index c8d3fa0e63b..3e1160b0db3 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
@@ -34,10 +34,11 @@ static bool isHexChar(QChar c)
     return isDigit(c) || (c <= QLatin1Char('f') && QLatin1Char('a') <= c) || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
 }
 
-static int matchEscapedChar(const QString &text, int offset)
+static int matchEscapedChar(QStringView text, int offset)
 {
-    if (text.at(offset) != QLatin1Char('\\') || text.size() < offset + 2)
+    if (text.at(offset) != QLatin1Char('\\') || text.size() < offset + 2) {
         return offset;
+    }
 
     const auto c = text.at(offset + 1);
     switch (c.unicode()) {
@@ -59,8 +60,9 @@ static int matchEscapedChar(const QString &text, int offset)
     // hex encoded character
     case 'x':
         if (offset + 2 < text.size() && isHexChar(text.at(offset + 2))) {
-            if (offset + 3 < text.size() && isHexChar(text.at(offset + 3)))
+            if (offset + 3 < text.size() && isHexChar(text.at(offset + 3))) {
                 return offset + 4;
+            }
             return offset + 3;
         }
         return offset;
@@ -75,8 +77,9 @@ static int matchEscapedChar(const QString &text, int offset)
     case '6':
     case '7':
         if (offset + 2 < text.size() && isOctalChar(text.at(offset + 2))) {
-            if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3)))
+            if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3))) {
                 return offset + 4;
+            }
             return offset + 3;
         }
         return offset + 2;
@@ -116,26 +119,31 @@ bool Rule::load(QXmlStreamReader &reader)
     Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement);
 
     m_attribute = reader.attributes().value(QLatin1String("attribute")).toString();
-    if (reader.name() != QLatin1String("IncludeRules")) // IncludeRules uses this with a different semantic
+    if (reader.name() != QLatin1String("IncludeRules")) { // IncludeRules uses this with a different semantic
         m_context.parse(reader.attributes().value(QLatin1String("context")));
+    }
     m_firstNonSpace = Xml::attrToBool(reader.attributes().value(QLatin1String("firstNonSpace")));
     m_lookAhead = Xml::attrToBool(reader.attributes().value(QLatin1String("lookAhead")));
     bool colOk = false;
     m_column = reader.attributes().value(QLatin1String("column")).toInt(&colOk);
-    if (!colOk)
+    if (!colOk) {
         m_column = -1;
+    }
 
     auto regionName = reader.attributes().value(QLatin1String("beginRegion"));
-    if (!regionName.isEmpty())
+    if (!regionName.isEmpty()) {
         m_beginRegion = FoldingRegion(FoldingRegion::Begin, DefinitionData::get(m_def.definition())->foldingRegionId(regionName.toString()));
+    }
     regionName = reader.attributes().value(QLatin1String("endRegion"));
-    if (!regionName.isEmpty())
+    if (!regionName.isEmpty()) {
         m_endRegion = FoldingRegion(FoldingRegion::End, DefinitionData::get(m_def.definition())->foldingRegionId(regionName.toString()));
+    }
 
     auto result = doLoad(reader);
 
-    if (m_lookAhead && m_context.isStay())
+    if (m_lookAhead && m_context.isStay()) {
         result = false;
+    }
 
     // be done with this rule, skip all subelements, e.g. no longer supported sub-rules
     reader.skipCurrentElement();
@@ -184,42 +192,60 @@ void Rule::loadAdditionalWordDelimiters(QXmlStreamReader &reader)
 
 Rule::Ptr Rule::create(QStringView name)
 {
-    if (name == QLatin1String("AnyChar"))
+    if (name == QLatin1String("AnyChar")) {
         return std::make_shared();
-    if (name == QLatin1String("DetectChar"))
+    }
+    if (name == QLatin1String("DetectChar")) {
         return std::make_shared();
-    if (name == QLatin1String("Detect2Chars"))
+    }
+    if (name == QLatin1String("Detect2Chars")) {
         return std::make_shared();
-    if (name == QLatin1String("DetectIdentifier"))
+    }
+    if (name == QLatin1String("DetectIdentifier")) {
         return std::make_shared();
-    if (name == QLatin1String("DetectSpaces"))
+    }
+    if (name == QLatin1String("DetectSpaces")) {
         return std::make_shared();
-    if (name == QLatin1String("Float"))
+    }
+    if (name == QLatin1String("Float")) {
         return std::make_shared();
-    if (name == QLatin1String("Int"))
+    }
+    if (name == QLatin1String("Int")) {
         return std::make_shared();
-    if (name == QLatin1String("HlCChar"))
+    }
+    if (name == QLatin1String("HlCChar")) {
         return std::make_shared();
-    if (name == QLatin1String("HlCHex"))
+    }
+    if (name == QLatin1String("HlCHex")) {
         return std::make_shared();
-    if (name == QLatin1String("HlCOct"))
+    }
+    if (name == QLatin1String("HlCOct")) {
         return std::make_shared();
-    if (name == QLatin1String("HlCStringChar"))
+    }
+    if (name == QLatin1String("HlCStringChar")) {
         return std::make_shared();
-    if (name == QLatin1String("IncludeRules"))
+    }
+    if (name == QLatin1String("IncludeRules")) {
         return std::make_shared();
-    if (name == QLatin1String("keyword"))
+    }
+    if (name == QLatin1String("keyword")) {
         return std::make_shared();
-    if (name == QLatin1String("LineContinue"))
+    }
+    if (name == QLatin1String("LineContinue")) {
         return std::make_shared();
-    if (name == QLatin1String("RangeDetect"))
+    }
+    if (name == QLatin1String("RangeDetect")) {
         return std::make_shared();
-    if (name == QLatin1String("RegExpr"))
+    }
+    if (name == QLatin1String("RegExpr")) {
         return std::make_shared();
-    if (name == QLatin1String("StringDetect"))
+    }
+    if (name == QLatin1String("StringDetect")) {
         return std::make_shared();
-    if (name == QLatin1String("WordDetect"))
+    }
+    if (name == QLatin1String("WordDetect")) {
         return std::make_shared();
+    }
 
     qCWarning(Log) << "Unknown rule type:" << name;
     return Ptr(nullptr);
@@ -233,23 +259,26 @@ bool Rule::isWordDelimiter(QChar c) const
 bool AnyChar::doLoad(QXmlStreamReader &reader)
 {
     m_chars = reader.attributes().value(QLatin1String("String")).toString();
-    if (m_chars.size() == 1)
+    if (m_chars.size() == 1) {
         qCDebug(Log) << "AnyChar rule with just one char: use DetectChar instead.";
+    }
     return !m_chars.isEmpty();
 }
 
-MatchResult AnyChar::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult AnyChar::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (m_chars.contains(text.at(offset)))
+    if (m_chars.contains(text.at(offset))) {
         return offset + 1;
+    }
     return offset;
 }
 
 bool DetectChar::doLoad(QXmlStreamReader &reader)
 {
     const auto s = reader.attributes().value(QLatin1String("char"));
-    if (s.isEmpty())
+    if (s.isEmpty()) {
         return false;
+    }
     m_char = s.at(0);
     m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
     if (m_dynamic) {
@@ -258,18 +287,21 @@ bool DetectChar::doLoad(QXmlStreamReader &reader)
     return true;
 }
 
-MatchResult DetectChar::doMatch(const QString &text, int offset, const QStringList &captures) const
+MatchResult DetectChar::doMatch(QStringView text, int offset, const QStringList &captures) const
 {
     if (m_dynamic) {
-        if (m_captureIndex == 0 || captures.size() <= m_captureIndex || captures.at(m_captureIndex).isEmpty())
+        if (m_captureIndex == 0 || captures.size() <= m_captureIndex || captures.at(m_captureIndex).isEmpty()) {
             return offset;
-        if (text.at(offset) == captures.at(m_captureIndex).at(0))
+        }
+        if (text.at(offset) == captures.at(m_captureIndex).at(0)) {
             return offset + 1;
+        }
         return offset;
     }
 
-    if (text.at(offset) == m_char)
+    if (text.at(offset) == m_char) {
         return offset + 1;
+    }
     return offset;
 }
 
@@ -277,40 +309,46 @@ bool Detect2Char::doLoad(QXmlStreamReader &reader)
 {
     const auto s1 = reader.attributes().value(QLatin1String("char"));
     const auto s2 = reader.attributes().value(QLatin1String("char1"));
-    if (s1.isEmpty() || s2.isEmpty())
+    if (s1.isEmpty() || s2.isEmpty()) {
         return false;
+    }
     m_char1 = s1.at(0);
     m_char2 = s2.at(0);
     return true;
 }
 
-MatchResult Detect2Char::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult Detect2Char::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (text.size() - offset < 2)
+    if (text.size() - offset < 2) {
         return offset;
-    if (text.at(offset) == m_char1 && text.at(offset + 1) == m_char2)
+    }
+    if (text.at(offset) == m_char1 && text.at(offset + 1) == m_char2) {
         return offset + 2;
+    }
     return offset;
 }
 
-MatchResult DetectIdentifier::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult DetectIdentifier::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (!text.at(offset).isLetter() && text.at(offset) != QLatin1Char('_'))
+    if (!text.at(offset).isLetter() && text.at(offset) != QLatin1Char('_')) {
         return offset;
+    }
 
     for (int i = offset + 1; i < text.size(); ++i) {
         const auto c = text.at(i);
-        if (!c.isLetterOrNumber() && c != QLatin1Char('_'))
+        if (!c.isLetterOrNumber() && c != QLatin1Char('_')) {
             return i;
+        }
     }
 
     return text.size();
 }
 
-MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult DetectSpaces::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    while (offset < text.size() && text.at(offset).isSpace())
+    while (offset < text.size() && text.at(offset).isSpace()) {
         ++offset;
+    }
     return offset;
 }
 
@@ -320,63 +358,76 @@ bool Float::doLoad(QXmlStreamReader &reader)
     return true;
 }
 
-MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult Float::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
+    if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) {
         return offset;
+    }
 
     auto newOffset = offset;
-    while (newOffset < text.size() && isDigit(text.at(newOffset)))
+    while (newOffset < text.size() && isDigit(text.at(newOffset))) {
         ++newOffset;
+    }
 
-    if (newOffset >= text.size() || text.at(newOffset) != QLatin1Char('.'))
+    if (newOffset >= text.size() || text.at(newOffset) != QLatin1Char('.')) {
         return offset;
+    }
     ++newOffset;
 
-    while (newOffset < text.size() && isDigit(text.at(newOffset)))
+    while (newOffset < text.size() && isDigit(text.at(newOffset))) {
         ++newOffset;
+    }
 
-    if (newOffset == offset + 1) // we only found a decimal point
+    if (newOffset == offset + 1) { // we only found a decimal point
         return offset;
+    }
 
     auto expOffset = newOffset;
-    if (expOffset >= text.size() || (text.at(expOffset) != QLatin1Char('e') && text.at(expOffset) != QLatin1Char('E')))
+    if (expOffset >= text.size() || (text.at(expOffset) != QLatin1Char('e') && text.at(expOffset) != QLatin1Char('E'))) {
         return newOffset;
+    }
     ++expOffset;
 
-    if (expOffset < text.size() && (text.at(expOffset) == QLatin1Char('+') || text.at(expOffset) == QLatin1Char('-')))
+    if (expOffset < text.size() && (text.at(expOffset) == QLatin1Char('+') || text.at(expOffset) == QLatin1Char('-'))) {
         ++expOffset;
+    }
     bool foundExpDigit = false;
     while (expOffset < text.size() && isDigit(text.at(expOffset))) {
         ++expOffset;
         foundExpDigit = true;
     }
 
-    if (!foundExpDigit)
+    if (!foundExpDigit) {
         return newOffset;
+    }
     return expOffset;
 }
 
-MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult HlCChar::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (text.size() < offset + 3)
+    if (text.size() < offset + 3) {
         return offset;
+    }
 
-    if (text.at(offset) != QLatin1Char('\'') || text.at(offset + 1) == QLatin1Char('\''))
+    if (text.at(offset) != QLatin1Char('\'') || text.at(offset + 1) == QLatin1Char('\'')) {
         return offset;
+    }
 
     auto newOffset = matchEscapedChar(text, offset + 1);
     if (newOffset == offset + 1) {
-        if (text.at(newOffset) == QLatin1Char('\\'))
+        if (text.at(newOffset) == QLatin1Char('\\')) {
             return offset;
-        else
+        } else {
             ++newOffset;
+        }
     }
-    if (newOffset >= text.size())
+    if (newOffset >= text.size()) {
         return offset;
+    }
 
-    if (text.at(newOffset) == QLatin1Char('\''))
+    if (text.at(newOffset) == QLatin1Char('\'')) {
         return newOffset + 1;
+    }
 
     return offset;
 }
@@ -387,23 +438,28 @@ bool HlCHex::doLoad(QXmlStreamReader &reader)
     return true;
 }
 
-MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult HlCHex::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
+    if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) {
         return offset;
+    }
 
-    if (text.size() < offset + 3)
+    if (text.size() < offset + 3) {
         return offset;
+    }
 
-    if (text.at(offset) != QLatin1Char('0') || (text.at(offset + 1) != QLatin1Char('x') && text.at(offset + 1) != QLatin1Char('X')))
+    if (text.at(offset) != QLatin1Char('0') || (text.at(offset + 1) != QLatin1Char('x') && text.at(offset + 1) != QLatin1Char('X'))) {
         return offset;
+    }
 
-    if (!isHexChar(text.at(offset + 2)))
+    if (!isHexChar(text.at(offset + 2))) {
         return offset;
+    }
 
     offset += 3;
-    while (offset < text.size() && isHexChar(text.at(offset)))
+    while (offset < text.size() && isHexChar(text.at(offset))) {
         ++offset;
+    }
 
     // TODO Kate matches U/L suffix, QtC does not?
 
@@ -416,28 +472,33 @@ bool HlCOct::doLoad(QXmlStreamReader &reader)
     return true;
 }
 
-MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult HlCOct::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
+    if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) {
         return offset;
+    }
 
-    if (text.size() < offset + 2)
+    if (text.size() < offset + 2) {
         return offset;
+    }
 
-    if (text.at(offset) != QLatin1Char('0'))
+    if (text.at(offset) != QLatin1Char('0')) {
         return offset;
+    }
 
-    if (!isOctalChar(text.at(offset + 1)))
+    if (!isOctalChar(text.at(offset + 1))) {
         return offset;
+    }
 
     offset += 2;
-    while (offset < text.size() && isOctalChar(text.at(offset)))
+    while (offset < text.size() && isOctalChar(text.at(offset))) {
         ++offset;
+    }
 
     return offset;
 }
 
-MatchResult HlCStringChar::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult HlCStringChar::doMatch(QStringView text, int offset, const QStringList &) const
 {
     return matchEscapedChar(text, offset);
 }
@@ -461,17 +522,19 @@ bool IncludeRules::doLoad(QXmlStreamReader &reader)
 {
     const auto s = reader.attributes().value(QLatin1String("context"));
     const auto split = s.split(QString::fromLatin1("##"), Qt::KeepEmptyParts);
-    if (split.isEmpty())
+    if (split.isEmpty()) {
         return false;
+    }
     m_contextName = split.at(0).toString();
-    if (split.size() > 1)
+    if (split.size() > 1) {
         m_defName = split.at(1).toString();
+    }
     m_includeAttribute = Xml::attrToBool(reader.attributes().value(QLatin1String("includeAttrib")));
 
     return !m_contextName.isEmpty() || !m_defName.isEmpty();
 }
 
-MatchResult IncludeRules::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult IncludeRules::doMatch(QStringView text, int offset, const QStringList &) const
 {
     Q_UNUSED(text);
     qCWarning(Log) << "Unresolved include rule for" << m_contextName << "##" << m_defName;
@@ -484,13 +547,15 @@ bool Int::doLoad(QXmlStreamReader &reader)
     return true;
 }
 
-MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult Int::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
+    if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) {
         return offset;
+    }
 
-    while (offset < text.size() && isDigit(text.at(offset)))
+    while (offset < text.size() && isDigit(text.at(offset))) {
         ++offset;
+    }
     return offset;
 }
 
@@ -522,21 +587,24 @@ bool KeywordListRule::doLoad(QXmlStreamReader &reader)
     return !m_keywordList->isEmpty();
 }
 
-MatchResult KeywordListRule::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult KeywordListRule::doMatch(QStringView text, int offset, const QStringList &) const
 {
     auto newOffset = offset;
-    while (text.size() > newOffset && !isWordDelimiter(text.at(newOffset)))
+    while (text.size() > newOffset && !isWordDelimiter(text.at(newOffset))) {
         ++newOffset;
-    if (newOffset == offset)
+    }
+    if (newOffset == offset) {
         return offset;
+    }
 
     if (m_hasCaseSensitivityOverride) {
-        if (m_keywordList->contains(QStringView(text).mid(offset, newOffset - offset),
-                                    m_caseSensitivityOverride))
+        if (m_keywordList->contains(text.mid(offset, newOffset - offset), m_caseSensitivityOverride)) {
             return newOffset;
+        }
     } else {
-        if (m_keywordList->contains(QStringView(text).mid(offset, newOffset - offset)))
+        if (m_keywordList->contains(text.mid(offset, newOffset - offset))) {
             return newOffset;
+        }
     }
 
     // we don't match, but we can skip until newOffset as we can't start a keyword in-between
@@ -546,17 +614,19 @@ MatchResult KeywordListRule::doMatch(const QString &text, int offset, const QStr
 bool LineContinue::doLoad(QXmlStreamReader &reader)
 {
     const auto s = reader.attributes().value(QLatin1String("char"));
-    if (s.isEmpty())
+    if (s.isEmpty()) {
         m_char = QLatin1Char('\\');
-    else
+    } else {
         m_char = s.at(0);
+    }
     return true;
 }
 
-MatchResult LineContinue::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult LineContinue::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (offset == text.size() - 1 && text.at(offset) == m_char)
+    if (offset == text.size() - 1 && text.at(offset) == m_char) {
         return offset + 1;
+    }
     return offset;
 }
 
@@ -564,24 +634,28 @@ bool RangeDetect::doLoad(QXmlStreamReader &reader)
 {
     const auto s1 = reader.attributes().value(QLatin1String("char"));
     const auto s2 = reader.attributes().value(QLatin1String("char1"));
-    if (s1.isEmpty() || s2.isEmpty())
+    if (s1.isEmpty() || s2.isEmpty()) {
         return false;
+    }
     m_begin = s1.at(0);
     m_end = s2.at(0);
     return true;
 }
 
-MatchResult RangeDetect::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult RangeDetect::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (text.size() - offset < 2)
+    if (text.size() - offset < 2) {
         return offset;
-    if (text.at(offset) != m_begin)
+    }
+    if (text.at(offset) != m_begin) {
         return offset;
+    }
 
     auto newOffset = offset + 1;
     while (newOffset < text.size()) {
-        if (text.at(newOffset) == m_end)
+        if (text.at(newOffset) == m_end) {
             return newOffset + 1;
+        }
         ++newOffset;
     }
     return offset;
@@ -596,7 +670,9 @@ bool RegExpr::doLoad(QXmlStreamReader &reader)
     m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption)
                                | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)
                                // DontCaptureOption is removed by resolvePostProcessing() when necessary
-                               | QRegularExpression::DontCaptureOption);
+                               | QRegularExpression::DontCaptureOption
+                               // ensure Unicode support is enabled
+                               | QRegularExpression::UseUnicodePropertiesOption);
 
     m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
 
@@ -605,8 +681,9 @@ bool RegExpr::doLoad(QXmlStreamReader &reader)
 
 void KSyntaxHighlighting::RegExpr::resolvePostProcessing()
 {
-    if (m_isResolved)
+    if (m_isResolved) {
         return;
+    }
 
     m_isResolved = true;
     bool hasCapture = false;
@@ -641,7 +718,7 @@ void KSyntaxHighlighting::RegExpr::resolvePostProcessing()
     }
 }
 
-MatchResult RegExpr::doMatch(const QString &text, int offset, const QStringList &captures) const
+MatchResult RegExpr::doMatch(QStringView text, int offset, const QStringList &captures) const
 {
     /**
      * for dynamic case: create new pattern with right instantiation
@@ -683,16 +760,16 @@ bool StringDetect::doLoad(QXmlStreamReader &reader)
     return !m_string.isEmpty();
 }
 
-MatchResult StringDetect::doMatch(const QString &text, int offset, const QStringList &captures) const
+MatchResult StringDetect::doMatch(QStringView text, int offset, const QStringList &captures) const
 {
     /**
      * for dynamic case: create new pattern with right instantiation
      */
     const auto &pattern = m_dynamic ? replaceCaptures(m_string, captures, false) : m_string;
 
-    if (offset + pattern.size() <= text.size()
-        && QStringView(text).mid(offset, pattern.size()).compare(pattern, m_caseSensitivity) == 0)
+    if (offset + pattern.size() <= text.size() && text.mid(offset, pattern.size()).compare(pattern, m_caseSensitivity) == 0) {
         return offset + pattern.size();
+    }
     return offset;
 }
 
@@ -704,23 +781,27 @@ bool WordDetect::doLoad(QXmlStreamReader &reader)
     return !m_word.isEmpty();
 }
 
-MatchResult WordDetect::doMatch(const QString &text, int offset, const QStringList &) const
+MatchResult WordDetect::doMatch(QStringView text, int offset, const QStringList &) const
 {
-    if (text.size() - offset < m_word.size())
+    if (text.size() - offset < m_word.size()) {
         return offset;
+    }
 
     /**
      * detect delimiter characters on the inner and outer boundaries of the string
      * NOTE: m_word isn't empty
      */
-    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)) && !isWordDelimiter(text.at(offset)))
+    if (offset > 0 && !isWordDelimiter(text.at(offset - 1)) && !isWordDelimiter(text.at(offset))) {
         return offset;
+    }
 
-    if (QStringView(text).mid(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0)
+    if (text.mid(offset, m_word.size()).compare(m_word, m_caseSensitivity) != 0) {
         return offset;
+    }
 
-    if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())) || isWordDelimiter(text.at(offset + m_word.size() - 1)))
+    if (text.size() == offset + m_word.size() || isWordDelimiter(text.at(offset + m_word.size())) || isWordDelimiter(text.at(offset + m_word.size() - 1))) {
         return offset + m_word.size();
+    }
 
     return offset;
 }
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
index 22c786eaa27..374eb87dfaf 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
@@ -87,7 +87,7 @@ public:
     {
     }
 
-    virtual MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const = 0;
+    virtual MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const = 0;
 
     static Rule::Ptr create(QStringView name);
 
@@ -121,58 +121,58 @@ protected:
     bool m_dynamic = false;
 };
 
-class AnyChar : public Rule
+class AnyChar final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 
 private:
     QString m_chars;
 };
 
-class DetectChar : public Rule
+class DetectChar final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 
 private:
     QChar m_char;
     int m_captureIndex = 0;
 };
 
-class Detect2Char : public Rule
+class Detect2Char final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 
 private:
     QChar m_char1;
     QChar m_char2;
 };
 
-class DetectIdentifier : public Rule
+class DetectIdentifier final : public Rule
 {
 protected:
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class DetectSpaces : public Rule
+class DetectSpaces final : public Rule
 {
 protected:
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class Float : public Rule
+class Float final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class IncludeRules : public Rule
+class IncludeRules final : public Rule
 {
 public:
     QString contextName() const;
@@ -181,7 +181,7 @@ public:
 
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 
 private:
     QString m_contextName;
@@ -189,44 +189,44 @@ private:
     bool m_includeAttribute;
 };
 
-class Int : public Rule
+class Int final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 };
 
-class HlCChar : public Rule
+class HlCChar final : public Rule
 {
 protected:
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class HlCHex : public Rule
+class HlCHex final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class HlCOct : public Rule
+class HlCOct final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class HlCStringChar : public Rule
+class HlCStringChar final : public Rule
 {
 protected:
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 };
 
-class KeywordListRule : public Rule
+class KeywordListRule final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 
 private:
     KeywordList *m_keywordList;
@@ -234,55 +234,55 @@ private:
     Qt::CaseSensitivity m_caseSensitivityOverride;
 };
 
-class LineContinue : public Rule
+class LineContinue final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 
 private:
     QChar m_char;
 };
 
-class RangeDetect : public Rule
+class RangeDetect final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &) const override;
 
 private:
     QChar m_begin;
     QChar m_end;
 };
 
-class RegExpr : public Rule
+class RegExpr final : public Rule
 {
 protected:
     void resolvePostProcessing() override;
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 
 private:
     QRegularExpression m_regexp;
     bool m_isResolved = false;
 };
 
-class StringDetect : public Rule
+class StringDetect final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 
 private:
     QString m_string;
     Qt::CaseSensitivity m_caseSensitivity;
 };
 
-class WordDetect : public Rule
+class WordDetect final : public Rule
 {
 protected:
     bool doLoad(QXmlStreamReader &reader) override;
-    MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
+    MatchResult doMatch(QStringView text, int offset, const QStringList &captures) const override;
 
 private:
     QString m_word;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
index f9b4f4b4ab0..ea21fef2151 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
@@ -104,7 +104,8 @@ bool State::operator!=(const State &other) const
 
 bool State::indentationBasedFoldingEnabled() const
 {
-    if (!d || d->m_contextStack.isEmpty())
+    if (!d || d->m_contextStack.isEmpty()) {
         return false;
+    }
     return d->m_contextStack.last().first->indentationBasedFoldingEnabled();
 }
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
index d0c4ee98ae8..41551e96da5 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
@@ -37,11 +37,13 @@ public:
 FoldingRegion SyntaxHighlighterPrivate::foldingRegion(const QTextBlock &startBlock)
 {
     const auto data = dynamic_cast(startBlock.userData());
-    if (!data)
+    if (!data) {
         return FoldingRegion();
+    }
     for (int i = data->foldingRegions.size() - 1; i >= 0; --i) {
-        if (data->foldingRegions.at(i).type() == FoldingRegion::Begin)
+        if (data->foldingRegions.at(i).type() == FoldingRegion::Begin) {
             return data->foldingRegions.at(i);
+        }
     }
     return FoldingRegion();
 }
@@ -68,8 +70,9 @@ void SyntaxHighlighter::setDefinition(const Definition &def)
 {
     const auto needsRehighlight = definition() != def;
     AbstractHighlighter::setDefinition(def);
-    if (needsRehighlight)
+    if (needsRehighlight) {
         rehighlight();
+    }
 }
 
 bool SyntaxHighlighter::startsFoldingRegion(const QTextBlock &startBlock) const
@@ -86,17 +89,21 @@ QTextBlock SyntaxHighlighter::findFoldingRegionEnd(const QTextBlock &startBlock)
     while (block.isValid()) {
         block = block.next();
         const auto data = dynamic_cast(block.userData());
-        if (!data)
+        if (!data) {
             continue;
+        }
         for (auto it = data->foldingRegions.constBegin(); it != data->foldingRegions.constEnd(); ++it) {
-            if ((*it).id() != region.id())
+            if ((*it).id() != region.id()) {
                 continue;
-            if ((*it).type() == FoldingRegion::End)
+            }
+            if ((*it).type() == FoldingRegion::End) {
                 --depth;
-            else if ((*it).type() == FoldingRegion::Begin)
+            } else if ((*it).type() == FoldingRegion::Begin) {
                 ++depth;
-            if (depth == 0)
+            }
+            if (depth == 0) {
                 return block;
+            }
         }
     }
 
@@ -111,8 +118,9 @@ void SyntaxHighlighter::highlightBlock(const QString &text)
     if (currentBlock().position() > 0) {
         const auto prevBlock = currentBlock().previous();
         const auto prevData = dynamic_cast(prevBlock.userData());
-        if (prevData)
+        if (prevData) {
             state = prevData->state;
+        }
     }
     d->foldingRegions.clear();
     state = highlightLine(text, state);
@@ -126,35 +134,43 @@ void SyntaxHighlighter::highlightBlock(const QString &text)
         return;
     }
 
-    if (data->state == state && data->foldingRegions == d->foldingRegions) // we ended up in the same state, so we are done here
+    if (data->state == state && data->foldingRegions == d->foldingRegions) { // we ended up in the same state, so we are done here
         return;
+    }
     data->state = state;
     data->foldingRegions = d->foldingRegions;
 
     const auto nextBlock = currentBlock().next();
-    if (nextBlock.isValid())
+    if (nextBlock.isValid()) {
         QMetaObject::invokeMethod(this, "rehighlightBlock", Qt::QueuedConnection, Q_ARG(QTextBlock, nextBlock));
+    }
 }
 
 void SyntaxHighlighter::applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format)
 {
-    if (length == 0)
+    if (length == 0) {
         return;
+    }
 
     QTextCharFormat tf;
     // always set the foreground color to avoid palette issues
     tf.setForeground(format.textColor(theme()));
 
-    if (format.hasBackgroundColor(theme()))
+    if (format.hasBackgroundColor(theme())) {
         tf.setBackground(format.backgroundColor(theme()));
-    if (format.isBold(theme()))
+    }
+    if (format.isBold(theme())) {
         tf.setFontWeight(QFont::Bold);
-    if (format.isItalic(theme()))
+    }
+    if (format.isItalic(theme())) {
         tf.setFontItalic(true);
-    if (format.isUnderline(theme()))
+    }
+    if (format.isUnderline(theme())) {
         tf.setFontUnderline(true);
-    if (format.isStrikeThrough(theme()))
+    }
+    if (format.isStrikeThrough(theme())) {
         tf.setFontStrikeOut(true);
+    }
 
     QSyntaxHighlighter::setFormat(offset, length, tf);
 }
@@ -165,13 +181,15 @@ void SyntaxHighlighter::applyFolding(int offset, int length, FoldingRegion regio
     Q_UNUSED(length);
     Q_D(SyntaxHighlighter);
 
-    if (region.type() == FoldingRegion::Begin)
+    if (region.type() == FoldingRegion::Begin) {
         d->foldingRegions.push_back(region);
+    }
 
     if (region.type() == FoldingRegion::End) {
         for (int i = d->foldingRegions.size() - 1; i >= 0; --i) {
-            if (d->foldingRegions.at(i).id() != region.id() || d->foldingRegions.at(i).type() != FoldingRegion::Begin)
+            if (d->foldingRegions.at(i).id() != region.id() || d->foldingRegions.at(i).type() != FoldingRegion::Begin) {
                 continue;
+            }
             d->foldingRegions.remove(i);
             return;
         }
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
index 076e8d0318b..37f9de1694b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
@@ -64,6 +64,8 @@ class RepositoryPrivate;
 class KSYNTAXHIGHLIGHTING_EXPORT Theme
 {
     Q_GADGET
+    Q_PROPERTY(QString name READ name)
+    Q_PROPERTY(QString translatedName READ translatedName)
 public:
     // TODO KF6:
     // - make TextStyle an enum class
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
index 2919a31a6e6..f9c386bc2a3 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
@@ -160,8 +160,9 @@ bool ThemeData::load(const QString &filePath)
     for (auto it = customStyles.begin(); it != customStyles.end(); ++it) {
         const auto obj = it.value().toObject();
         auto &overrideStyle = m_textStyleOverrides[it.key()];
-        for (auto it2 = obj.begin(); it2 != obj.end(); ++it2)
+        for (auto it2 = obj.begin(); it2 != obj.end(); ++it2) {
             overrideStyle.insert(it2.key(), readThemeData(it2.value().toObject()));
+        }
     }
 
     return true;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
index 82d3e4ea80b..98daff19d6e 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
@@ -4,14 +4,16 @@
     SPDX-License-Identifier: MIT
 */
 
-#include "wildcardmatcher_p.h"
+#include "wildcardmatcher.h"
 
 using namespace KSyntaxHighlighting;
 
 #include 
-#include 
+#include 
 
-static bool exactMatch(const QString &candidate, const QString &wildcard, int candidatePosFromRight, int wildcardPosFromRight, bool caseSensitive = true)
+namespace
+{
+bool wildcardMatch(QStringView candidate, QStringView wildcard, int candidatePosFromRight, int wildcardPosFromRight)
 {
     for (; wildcardPosFromRight >= 0; wildcardPosFromRight--) {
         const auto ch = wildcard.at(wildcardPosFromRight).unicode();
@@ -27,7 +29,7 @@ static bool exactMatch(const QString &candidate, const QString &wildcard, int ca
 
             // Eat all we can and go back as far as we have to
             for (int j = -1; j <= candidatePosFromRight; j++) {
-                if (exactMatch(candidate, wildcard, j, wildcardPosFromRight - 1)) {
+                if (wildcardMatch(candidate, wildcard, j, wildcardPosFromRight - 1)) {
                     return true;
                 }
             }
@@ -47,18 +49,19 @@ static bool exactMatch(const QString &candidate, const QString &wildcard, int ca
             }
 
             const auto candidateCh = candidate.at(candidatePosFromRight).unicode();
-            const auto match = caseSensitive ? (candidateCh == ch) : (QChar::toLower(candidateCh) == QChar::toLower(ch));
-            if (match) {
+            if (candidateCh == ch) {
                 candidatePosFromRight--;
             } else {
                 return false;
             }
         }
     }
-    return true;
+    return candidatePosFromRight == -1;
 }
 
-bool WildcardMatcher::exactMatch(const QString &candidate, const QString &wildcard, bool caseSensitive)
+} // unnamed namespace
+
+bool WildcardMatcher::exactMatch(QStringView candidate, QStringView wildcard)
 {
-    return ::exactMatch(candidate, wildcard, candidate.length() - 1, wildcard.length() - 1, caseSensitive);
+    return ::wildcardMatch(candidate, wildcard, candidate.length() - 1, wildcard.length() - 1);
 }
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.h b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.h
new file mode 100644
index 00000000000..4042de37886
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.h
@@ -0,0 +1,33 @@
+/*
+    SPDX-FileCopyrightText: 2007 Sebastian Pipping 
+
+    SPDX-License-Identifier: MIT
+*/
+
+#ifndef KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_H
+#define KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_H
+
+#include "ksyntaxhighlighting_export.h"
+
+#include 
+
+namespace KSyntaxHighlighting
+{
+namespace WildcardMatcher
+{
+/**
+ * Matches a string against a given wildcard case-sensitively.
+ * The wildcard supports '*' (".*" in regex) and '?' ("." in regex), not more.
+ *
+ * @param candidate       Text to match
+ * @param wildcard        Wildcard to use
+ * @return                True for an exact match, false otherwise
+ *
+ * @since 5.86
+ */
+KSYNTAXHIGHLIGHTING_EXPORT bool exactMatch(QStringView candidate, QStringView wildcard);
+}
+
+}
+
+#endif // KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
index 634eeb70bb3..f9079ea1f3d 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
@@ -11,15 +11,17 @@ using namespace KSyntaxHighlighting;
 WordDelimiters::WordDelimiters()
     : asciiDelimiters{}
 {
-    for (const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p)
+    for (const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p) {
         // int(*p) fix -Wchar-subscripts
         asciiDelimiters[int(*p)] = true;
+    }
 }
 
 bool WordDelimiters::contains(QChar c) const
 {
-    if (c.unicode() < 128)
+    if (c.unicode() < 128) {
         return asciiDelimiters[c.unicode()];
+    }
     // perf tells contains is MUCH faster than binary search here, very short array
     return notAsciiDelimiters.contains(c);
 }
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
index 3fa5db10a44..c1afaaa6bb0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
@@ -12,7 +12,7 @@
 namespace KSyntaxHighlighting
 {
 /**
- * Repesents a list of character that separates 2 words.
+ * Represents a list of character that separates 2 words.
  *
  * Default delimiters are .():!+*,-<=>%&/;?[]^{|}~\, space (' ') and tabulator ('\t').
  *
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
index 5aae9eebb51..2e1dd25cc82 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
@@ -17,7 +17,7 @@ namespace Xml
 /** Parse a xs:boolean attribute. */
 inline bool attrToBool(QStringView str)
 {
-    return str == QLatin1String("1") || str.compare(QString("true"), Qt::CaseInsensitive) == 0;
+    return str == QStringLiteral("1") || str.compare(QStringLiteral("true"), Qt::CaseInsensitive) == 0;
 }
 
 }
diff --git a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
index 333af297a84..e9354a2f69a 100644
--- a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
+++ b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
@@ -3,7 +3,7 @@ include(autogenerated/autogenerated.pri)
 
 QT += network
 
-DEFINES += KSYNTAXHIGHLIGHTING_LIBRARY
+DEFINES += KF5SyntaxHighlighting_EXPORTS
 
 RESOURCES += \
     data/themes/theme-data.qrc
diff --git a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
index 27b5987e1a8..985264440f7 100644
--- a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
+++ b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.qbs
@@ -25,7 +25,7 @@ Project {
         name: "KSyntaxHighlighting_bundled"
         condition: !qtc.preferSystemSyntaxHighlighting || !Qt.KSyntaxHighlighting.present
 
-        cpp.defines: base.concat("KSYNTAXHIGHLIGHTING_LIBRARY")
+        cpp.defines: base.concat("KF5SyntaxHighlighting_EXPORTS")
         cpp.includePaths: [
             product.sourceDirectory + "/src/lib/",
             product.sourceDirectory + "/autogenerated/src/lib/",
@@ -66,7 +66,6 @@ Project {
                 "htmlhighlighter.h",
                 "keywordlist.cpp",
                 "keywordlist_p.h",
-                "ksyntaxhighlighting_export.h",
                 "matchresult_p.h",
                 "repository.cpp",
                 "repository.h",