diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index ac84459e1a7..6a8dc4c39cf 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -324,12 +324,14 @@ function(enable_pch target) set_target_properties(${pch_target} PROPERTIES PRECOMPILE_HEADERS ${pch_file} CXX_VISIBILITY_PRESET hidden - VISIBILITY_INLINES_HIDDEN ON) + VISIBILITY_INLINES_HIDDEN ON + CXX_EXTENSIONS OFF + ) target_link_libraries(${pch_target} PRIVATE ${pch_dependency}) endif() endfunction() - if (NOT TARGET QtCreatorPchGui AND NOT TARGET QtCreatorPchConsole) + if (NOT TARGET ${PROJECT_NAME}PchGui AND NOT TARGET ${PROJECT_NAME}PchConsole) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c CONTENT "/*empty file*/") @@ -341,17 +343,17 @@ function(enable_pch target) ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp PROPERTIES GENERATED TRUE) - _add_pch_target(QtCreatorPchGui - "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets) - _add_pch_target(QtCreatorPchConsole - "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_pch.h" Qt5::Core) + _add_pch_target(${PROJECT_NAME}PchGui + "${QtCreator_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets) + _add_pch_target(${PROJECT_NAME}PchConsole + "${QtCreator_SOURCE_DIR}/src/shared/qtcreator_pch.h" Qt5::Core) endif() unset(PCH_TARGET) if ("Qt5::Widgets" IN_LIST dependencies) - set(PCH_TARGET QtCreatorPchGui) + set(PCH_TARGET ${PROJECT_NAME}PchGui) elseif ("Qt5::Core" IN_LIST dependencies) - set(PCH_TARGET QtCreatorPchConsole) + set(PCH_TARGET ${PROJECT_NAME}PchConsole) endif() if (TARGET "${PCH_TARGET}") diff --git a/doc/qtcreator/images/qtcreator-run-failed-tests.png b/doc/qtcreator/images/qtcreator-run-failed-tests.png new file mode 100644 index 00000000000..eb58129dbe1 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-run-failed-tests.png differ diff --git a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc index 78c7ffb680e..3a7c21cf2fb 100644 --- a/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc +++ b/doc/qtcreator/src/howto/creator-only/creator-autotest.qdoc @@ -278,6 +278,11 @@ (\uicontrol {Run All Tests}) to run all tests. \li \inlineimage qtcreator-run-selected-tests.png (\uicontrol {Run Selected Tests}) to run the selected tests. + \li \inlineimage qtcreator-run-failed-tests.png + (\uicontrol {Run Failed Tests}) to re-run the tests which failed + in the last run. + Depending on the framework this may select additional tests if it + is impossible to distinguish or to fully address the test. \li \inlineimage qtcreator-run-tests-in-current-file.png (\uicontrol {Run Tests for Current File}) to run the tests in the file currently open in the code editor. diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml index bb7f96f787c..28f39d89f31 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml @@ -90,48 +90,51 @@ QtObject { readonly property string distributeSpacingVertical: "\u0053" readonly property string distributeTop: "\u0054" readonly property string edit: "\u0055" - readonly property string fontStyleBold: "\u0056" - readonly property string fontStyleItalic: "\u0057" - readonly property string fontStyleStrikethrough: "\u0058" - readonly property string fontStyleUnderline: "\u0059" - readonly property string gridView: "\u005A" - readonly property string idAliasOff: "\u005B" - readonly property string idAliasOn: "\u005C" - readonly property string listView: "\u005D" - readonly property string lockOff: "\u005E" - readonly property string lockOn: "\u005F" - readonly property string mergeCells: "\u0060" - readonly property string minus: "\u0061" - readonly property string pin: "\u0062" - readonly property string plus: "\u0063" - readonly property string redo: "\u0064" - readonly property string rotation: "\u0065" - readonly property string splitColumns: "\u0066" - readonly property string splitRows: "\u0067" - readonly property string startNode: "\u0068" - readonly property string testIcon: "\u0069" - readonly property string textAlignBottom: "\u006A" - readonly property string textAlignCenter: "\u006B" - readonly property string textAlignLeft: "\u006C" - readonly property string textAlignMiddle: "\u006D" - readonly property string textAlignRight: "\u006E" - readonly property string textAlignTop: "\u006F" - readonly property string textBulletList: "\u0070" - readonly property string textFullJustification: "\u0071" - readonly property string textNumberedList: "\u0072" - readonly property string tickIcon: "\u0073" - readonly property string triState: "\u0074" - readonly property string undo: "\u0075" - readonly property string unpin: "\u0076" - readonly property string upDownIcon: "\u0077" - readonly property string upDownSquare2: "\u0078" - readonly property string visibilityOff: "\u0079" - readonly property string visibilityOn: "\u007A" - readonly property string wildcard: "\u007B" - readonly property string zoomAll: "\u007C" - readonly property string zoomIn: "\u007D" - readonly property string zoomOut: "\u007E" - readonly property string zoomSelection: "\u007F" + readonly property string flowAction: "\u0056" + readonly property string flowTransition: "\u0057" + readonly property string fontStyleBold: "\u0058" + readonly property string fontStyleItalic: "\u0059" + readonly property string fontStyleStrikethrough: "\u005A" + readonly property string fontStyleUnderline: "\u005B" + readonly property string gridView: "\u005C" + readonly property string idAliasOff: "\u005D" + readonly property string idAliasOn: "\u005E" + readonly property string listView: "\u005F" + readonly property string lockOff: "\u0060" + readonly property string lockOn: "\u0061" + readonly property string mergeCells: "\u0062" + readonly property string minus: "\u0063" + readonly property string pin: "\u0064" + readonly property string plus: "\u0065" + readonly property string redo: "\u0066" + readonly property string rotation: "\u0067" + readonly property string search: "\u0068" + readonly property string splitColumns: "\u0069" + readonly property string splitRows: "\u006A" + readonly property string startNode: "\u006B" + readonly property string testIcon: "\u006C" + readonly property string textAlignBottom: "\u006D" + readonly property string textAlignCenter: "\u006E" + readonly property string textAlignLeft: "\u006F" + readonly property string textAlignMiddle: "\u0070" + readonly property string textAlignRight: "\u0071" + readonly property string textAlignTop: "\u0072" + readonly property string textBulletList: "\u0073" + readonly property string textFullJustification: "\u0074" + readonly property string textNumberedList: "\u0075" + readonly property string tickIcon: "\u0076" + readonly property string triState: "\u0077" + readonly property string undo: "\u0078" + readonly property string unpin: "\u0079" + readonly property string upDownIcon: "\u007A" + readonly property string upDownSquare2: "\u007B" + readonly property string visibilityOff: "\u007C" + readonly property string visibilityOn: "\u007D" + readonly property string wildcard: "\u007E" + readonly property string zoomAll: "\u007F" + readonly property string zoomIn: "\u0080" + readonly property string zoomOut: "\u0081" + readonly property string zoomSelection: "\u0082" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf index 0c4d237c0e2..baa995bb5c5 100644 Binary files a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf and b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf differ diff --git a/share/qtcreator/templates/wizards/qtcreatorplugin/CMakeLists.txt b/share/qtcreator/templates/wizards/qtcreatorplugin/CMakeLists.txt index 214dcfc2212..d9a268a634d 100644 --- a/share/qtcreator/templates/wizards/qtcreatorplugin/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/qtcreatorplugin/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.10) # Remove when sharing with others. list(APPEND CMAKE_PREFIX_PATH "%{QtCreatorBuild}") diff --git a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt index e451df24d83..8c37bf1731a 100644 --- a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt @@ -32,6 +32,7 @@ add_qtc_library(KSyntaxHighlighting SHARED src/lib/theme.cpp src/lib/theme.h src/lib/themedata.cpp src/lib/themedata_p.h src/lib/wildcardmatcher.cpp src/lib/wildcardmatcher_p.h + src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h src/lib/xml_p.h ) qtc_add_public_header(autogenerated/src/lib/State) diff --git a/src/libs/3rdparty/syntax-highlighting/README.md b/src/libs/3rdparty/syntax-highlighting/README.md index c1b82c63d13..c090d061635 100644 --- a/src/libs/3rdparty/syntax-highlighting/README.md +++ b/src/libs/3rdparty/syntax-highlighting/README.md @@ -2,6 +2,17 @@ Syntax highlighting engine for Kate syntax definitions +## Table of contents + +1. [Introduction](#introduction) +2. [Out of scope](#out-of-scope) +3. [Syntax Definition Files](#syntax-definition-files) +4. [Build it](#build-it) +5. [How to contribute](#how-to-contribute) +6. [Adding unit tests for a syntax definition](#adding-unit-tests-for-a-syntax-definition) +7. [Report bug or help to fix them](#report-bug-or-help-to-fix-them) +8. [Updating the kate-editor.org/syntax website](#updating-the-kate-editororgsyntax-website) + ## Introduction This is a stand-alone implementation of the Kate syntax highlighting engine. @@ -9,15 +20,6 @@ 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. -## Syntax Definition Files - -This library uses Kate syntax definition files for the actual highlighting, -the file format is documented [here](https://docs.kde.org/stable5/en/applications/katepart/highlight.html). - -More than 250 syntax definition files are included, additional ones are -picked up from the file system if present, so you can easily extend this -by application-specific syntax definitions for example. - ## Out of scope To not turn this into yet another text editor, the following things are considered @@ -31,19 +33,170 @@ out of scope: If you need any of this, check out [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/). +## Syntax Definition Files + +This library uses Kate syntax definition files for the actual highlighting, +the file format is documented [here](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html). + +More than 300 syntax definition files are included, that are located +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 +**org.kde.syntax-highlighting/syntax/**, which is located in your user directory. +Usually it is: + + + + + + + + + + + + + + + + + + +
For local user$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 Kate's Snap package$HOME/snap/kate/current/.local/share/org.kde.syntax-highlighting/syntax/
On Windows®%USERPROFILE%\AppData\Local\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 +files. Use the command `validatehl.sh mySyntax.xml`. + +## Build it + +1. Create and change into a build directory. Usually, a folder called **build** + is created inside the **syntax-highlighting** source directory. + + ```bash + mkdir + cd + ``` + +2. Run the configure process with *cmake* and compile: + + ```bash + cmake + make + ``` + + For more details see ["Building Kate from Sources on Linux" (Kate Editor Website)](https://kate-editor.org/build-it/). + + **NOTE:** If running *cmake* shows an error related to your version of KDE + Frameworks, you edit the **CMakeLists.txt** file in the line + `find_package(ECM 5.XX.X ...)`. + +3. To run tests: + + ```bash + make test + ``` + + The tests are located in the **autotests** directory. + This command can be used to check changes to units test after modifying some + syntax definition file. To add a unit test or update the references, see the + section ["Adding unit tests for a syntax definition"](#adding-unit-tests-for-a-syntax-definition). + +## How to contribute + +KDE uses a GitLab instance at **invent.kde.org** for code review. The official +repository of the KSyntaxHighlighting framework is [here](https://invent.kde.org/frameworks/syntax-highlighting). + +All the necessary information to send contributions is [here](https://community.kde.org/Infrastructure/GitLab). + +### Licensing + +Contributions to KSyntaxHighlighting shall be licensed under [MIT](LICENSES/MIT.txt). + +All files shall contain a proper "SPDX-License-Identifier: MIT" identifier inside a header like: + +```cpp +/* + SPDX-FileCopyrightText: 2020 Christoph Cullmann + + SPDX-License-Identifier: MIT +*/ +``` + +### What you should know before working with syntax definition files and sending a patch + +* If you are modifying an existing syntax definition XML file, you must increase + the version number of the language. + +* Do not use hard-coded colors, as they may not look good or be illegible in some color + themes. Prefer to use the default color styles. + + For more information, see: + + * [Available Default Styles (Working with Syntax Highlighting, KDE Documentation)](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html#kate-highlight-default-styles) + * [Kate Part (KF5): New Default Styles for better Color Schemes (Kate Editor Website)](https://kate-editor.org/2014/03/07/kate-part-kf5-new-default-styles-for-better-color-schemes/) + +* Important: add test files, these are found in **autotests/input/**. + If you are going to add a new syntax XML file, create a new test file; if you + are going to modify a XML file, adds examples to existing test files. + + Then, it is necessary to generate and update the files in **autotests/folding/**, + **autotests/html/** and **autotests/reference/**, which must be included in the + patches. The instructions are in the [next section](#adding-unit-tests-for-a-syntax-definition). + ## Adding unit tests for a syntax definition -* add an input file into the autotests/input/ folder, lets call it test. +1. Add an input file into the **autotests/input/** folder, lets call it + **test.<language-extension>**. -* if the file extension is not sufficient to trigger the right syntax definition, you can add an - second file testname..syntax that contains the syntax definition name - to enforce the use of the right extension +2. If the file extension is not sufficient to trigger the right syntax definition, you can add an + second file **testname.<language-extension>.syntax** that contains the syntax definition name + to enforce the use of the right extension. -* do "make && make test" +3. Do `make && make test`. -* inspect the outputs found in your binary directory autotests/folding.out, autotests/html.output and autotests/output + Note that after adding or modifying something in + **<source-directory>/autotests/input/**, an error will be showed when + running `make test`, because the references in the source directory do not + match the ones now generated. -* if ok, run in the binary folder "./autotests/update-reference-data.sh" to copy the results to the right location +4. Inspect the outputs found in your binary directory **autotests/folding.out/**, + **autotests/html.output/** and **autotests/output/**. -* add the result references after the copying to the git +5. If OK, run in the binary folder `./autotests/update-reference-data.sh` + to copy the results to the right location. + That script updates the references in the source directory in + **autotest/folding/**, **autotest/html/** and **autotest/reference/**. +6. Add the result references after the copying to the git. + +## Report bug or help to fix them + +KDE uses Bugzilla to management of bugs at **bugs.kde.org**. You can see the bugs +reported of **frameworks-syntax-highlighting** [here](https://bugs.kde.org/describecomponents.cgi?product=frameworks-syntax-highlighting). + +Also, you can report a bug [here](https://bugs.kde.org/enter_bug.cgi?product=frameworks-syntax-highlighting). + +However, some users often report bugs related to syntax highlighting in +[kate/syntax](https://bugs.kde.org/buglist.cgi?component=syntax&product=kate&resolution=---) +and [kile/editor](https://bugs.kde.org/buglist.cgi?component=editor&product=kile&resolution=---). + +## Updating the kate-editor.org/syntax website + +To update the [kate-editor.org/syntax](https://kate-editor.org/syntax/) website +including the update site & all linked examples/files, +please run after successful **build** & **test** the following make target: + +```bash +make update_kate_editor_org +``` + +This will clone the [kate-editor.org git](https://invent.kde.org/websites/kate-editor-org) +from *invent.kde.org* into **kate-editor-org** inside the build directory and update the needed things. + +You can afterwards step into **kate-editor-org** and commit & push the change after review. + +The [kate-editor.org](https://kate-editor.org) webserver will update itself periodically from the repository on *invent.kde.org*. diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h index 9f87fd1beb2..df0317ed7cf 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.73.0" +#define SyntaxHighlighting_VERSION_STRING "5.75.0" #define SyntaxHighlighting_VERSION_MAJOR 5 -#define SyntaxHighlighting_VERSION_MINOR 73 +#define SyntaxHighlighting_VERSION_MINOR 75 #define SyntaxHighlighting_VERSION_PATCH 0 -#define SyntaxHighlighting_VERSION ((5<<16)|(73<<8)|(0)) +#define SyntaxHighlighting_VERSION ((5<<16)|(75<<8)|(0)) #endif 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 f52084c569e..be60d199595 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl @@ -4,35 +4,20 @@ ]> + + {%- for var in deprecated_or_internal_variables.kw %} + {{var}} + {%- endfor %} + + {%- for var in environment_variables.kw %} {{var}} @@ -95,11 +86,9 @@ {% for command in commands -%} - + {% endfor -%} - - - + @@ -192,11 +181,15 @@ + + {%- for var in deprecated_or_internal_variables.re %} + + {%- endfor %} {%- for var in variables.re %} {%- endfor %} @@ -204,24 +197,19 @@ - + - - - - - - {%- for var in environment_variables.re %} {%- endfor %} - + + @@ -232,6 +220,7 @@ + @@ -244,11 +233,13 @@ - + + + + - - - + + @@ -257,42 +248,62 @@ - - + + + + + - + + + + + + + + + + + + - + - + + - + + + + + + - + @@ -321,9 +332,10 @@ - + - + + @@ -339,10 +351,11 @@ - + + - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml index 3b1e8327ca1..e776c2508f6 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml @@ -148,6 +148,7 @@ target-properties: - _OUTPUT_NAME - _POSTFIX - CROSSCOMPILING_EMULATOR + - CUDA_ARCHITECTURES # Since 3.18 - CUDA_PTX_COMPILATION - CUDA_SEPARABLE_COMPILATION - CUDA_RESOLVE_DEVICE_SYMBOLS @@ -176,7 +177,9 @@ target-properties: - FOLDER - Fortran_FORMAT - Fortran_MODULE_DIRECTORY + - Fortran_PREPROCESS # Since 3.18 - FRAMEWORK + - FRAMEWORK_MULTI_CONFIG_POSTFIX_ # Since 3.18 - FRAMEWORK_VERSION - GENERATOR_FILE_NAME - GNUtoMS @@ -259,6 +262,8 @@ target-properties: - LINK_WHAT_YOU_USE - LOCATION_ - LOCATION + - MACHO_COMPATIBILITY_VERSION # Since 3.17 + - MACHO_CURRENT_VERSION # Since 3.17 - MACOSX_BUNDLE_INFO_PLIST - MACOSX_BUNDLE - MACOSX_FRAMEWORK_INFO_PLIST @@ -275,6 +280,7 @@ target-properties: - OSX_COMPATIBILITY_VERSION # Since 3.17 - OUTPUT_NAME_ - OUTPUT_NAME + - PCH_WARN_INVALID # Since 3.18 - PDB_NAME_ - PDB_NAME - PDB_OUTPUT_DIRECTORY_ @@ -310,6 +316,7 @@ target-properties: - UNITY_BUILD_BATCH_SIZE # Since 3.16 - UNITY_BUILD_CODE_AFTER_INCLUDE # Since 3.16 - UNITY_BUILD_CODE_BEFORE_INCLUDE # Since 3.16 + - UNITY_BUILD_MODE # Since 3.18 - VERSION - VISIBILITY_INLINES_HIDDEN - VS_CONFIGURATION_TYPE @@ -336,13 +343,15 @@ target-properties: - VS_MOBILE_EXTENSIONS_VERSION - VS_NO_SOLUTION_DEPLOY # Since 3.15 - VS_PACKAGE_REFERENCES # Since 3.15 + - VS_PLATFORM_TOOLSET # Since 3.18 - VS_PROJECT_IMPORT # Since 3.15 - - VS_PACKAGE_REFERENCES - VS_SCC_AUXPATH - VS_SCC_LOCALPATH - VS_SCC_PROJECTNAME - VS_SCC_PROVIDER - VS_SDK_REFERENCES + - VS_SOLUTION_DEPLOY # Since 3.18 + - VS_SOURCE_SETTINGS_ # Since 3.18 - VS_USER_PROPS - VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION - VS_WINRT_COMPONENT @@ -412,6 +421,7 @@ source-properties: - COMPILE_OPTIONS # Since 3.11 - EXTERNAL_OBJECT - Fortran_FORMAT + - Fortran_PREPROCESS # Since 3.18 - GENERATED - HEADER_FILE_ONLY - INCLUDE_DIRECTORIES # Since 3.11 @@ -437,6 +447,7 @@ source-properties: - VS_DEPLOYMENT_LOCATION - VS_INCLUDE_IN_VSIX - VS_RESOURCE_GENERATOR + - VS_SETTINGS # Since 3.18 - VS_SHADER_DISABLE_OPTIMIZATIONS # Since 3.11 - VS_SHADER_ENABLE_DEBUG # Since 3.11 - VS_SHADER_ENTRYPOINT @@ -503,6 +514,10 @@ generator-expressions: - COMPILE_FEATURES - COMPILE_LANG_AND_ID # Since 3.15 - COMPILE_LANGUAGE + - LINK_LANG_AND_ID # Since 3.18 + - LINK_LANGUAGE # Since 3.18 + - DEVICE_LINK # Since 3.18 + - HOST_LINK # Since 3.18 # String-Valued Generator Expressions # * Escaped Characters - ANGLE-R @@ -555,7 +570,7 @@ generator-expressions: - SHELL_PATH variables: - # Variables that Provide Information + # Variables that Provide Information - CMAKE_AR - CMAKE_ARGC - CMAKE_ARGV @@ -596,7 +611,6 @@ variables: - CMAKE_GENERATOR_NO_COMPILER_ENV # "Professional CMake" §17.4 - CMAKE_GENERATOR_PLATFORM - CMAKE_GENERATOR_TOOLSET - - CMAKE_HOME_DIRECTORY - CMAKE_IMPORT_LIBRARY_PREFIX - CMAKE_IMPORT_LIBRARY_SUFFIX - CMAKE_JOB_POOL_COMPILE @@ -648,7 +662,6 @@ variables: - CMAKE_VERBOSE_MAKEFILE - CMAKE_VERSION - CMAKE_VS_DEVENV_COMMAND - - CMAKE_VS_INTEL_Fortran_PROJECT_VERSION - CMAKE_VS_MSBUILD_COMMAND - CMAKE_VS_NsightTegra_VERSION - CMAKE_VS_PLATFORM_NAME @@ -739,7 +752,6 @@ variables: - CMAKE_MAXIMUM_RECURSION_DEPTH # Since 3.14 - CMAKE_MFC_FLAG - CMAKE_MODULE_PATH - - CMAKE_NOT_USING_CONFIG_FLAGS - CMAKE_POLICY_DEFAULT_CMP - CMAKE_POLICY_WARNING_CMP - CMAKE_PREFIX_PATH @@ -768,7 +780,7 @@ variables: - CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13 - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 - - CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.1? + - CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17 - CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16 - CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 - CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 @@ -784,8 +796,6 @@ variables: - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER # Since 3.13 - CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13 - CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13 - - CMAKE_SUPPRESS_DEVELOPER_WARNINGS # Undocumented yet (CMake <= 3.10) - - CMAKE_SUPPRESS_DEVELOPER_ERRORS # Undocumented yet (CMake <= 3.10) # Variables that Describe the System - ANDROID - APPLE @@ -896,8 +906,10 @@ variables: - CMAKE_EXE_LINKER_FLAGS_INIT - CMAKE_FOLDER # Since 3.12 - CMAKE_FRAMEWORK # Since 3.15 + - CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_ # Since 3.18 - CMAKE_Fortran_FORMAT - CMAKE_Fortran_MODULE_DIRECTORY + - CMAKE_Fortran_PREPROCESS # Since 3.18 - CMAKE_GLOBAL_AUTOGEN_TARGET # Since 3.14 - CMAKE_GLOBAL_AUTOGEN_TARGET_NAME # Since 3.14 - CMAKE_GLOBAL_AUTORCC_TARGET # Since 3.14 @@ -942,6 +954,7 @@ variables: - CMAKE_OSX_ARCHITECTURES - CMAKE_OSX_DEPLOYMENT_TARGET - CMAKE_OSX_SYSROOT + - CMAKE_PCH_WARN_INVALID # Since 3.18 - CMAKE_PDB_OUTPUT_DIRECTORY - CMAKE_PDB_OUTPUT_DIRECTORY_ - CMAKE_POSITION_INDEPENDENT_CODE @@ -984,6 +997,7 @@ variables: - CMAKE_COMPILER_IS_GNUCC - CMAKE_COMPILER_IS_GNUCXX - CMAKE_COMPILER_IS_GNUG77 + - CMAKE_CUDA_ARCHITECTURES # Since 3.18 - CMAKE_CUDA_COMPILE_FEATURES # Since 3.17 - CMAKE_CUDA_HOST_COMPILER # Since 3.17 - CMAKE_CUDA_EXTENSIONS @@ -1001,7 +1015,6 @@ variables: - CMAKE_Fortran_MODDIR_DEFAULT - CMAKE_Fortran_MODDIR_FLAG - CMAKE_Fortran_MODOUT_FLAG - - CMAKE_INTERNAL_PLATFORM_ABI - CMAKE__ANDROID_TOOLCHAIN_MACHINE - CMAKE__ANDROID_TOOLCHAIN_PREFIX - CMAKE__ANDROID_TOOLCHAIN_SUFFIX @@ -1009,7 +1022,6 @@ variables: - CMAKE__ARCHIVE_CREATE - CMAKE__ARCHIVE_FINISH - CMAKE__COMPILER - - CMAKE__COMPILER_ABI - CMAKE__COMPILER_EXTERNAL_TOOLCHAIN - CMAKE__COMPILER_ID - CMAKE__COMPILER_LOADED @@ -1045,7 +1057,6 @@ variables: - CMAKE__LINKER_WRAPPER_FLAG_SEP # Since 3.13 - CMAKE__LINK_EXECUTABLE - CMAKE__OUTPUT_EXTENSION - - CMAKE__PLATFORM_ID - CMAKE__SIMULATE_ID - CMAKE__SIMULATE_VERSION - CMAKE__SIZEOF_DATA_PTR @@ -1111,6 +1122,8 @@ variables: - CTEST_P4_COMMAND - CTEST_P4_OPTIONS - CTEST_P4_UPDATE_OPTIONS + - CTEST_RESOURCE_SPEC_FILE # Since 3.18 + - CTEST_RUN_CURRENT_SCRIPT # Since 3.11 - CTEST_SCP_COMMAND - CTEST_SITE - CTEST_SUBMIT_URL # Since 3.14 @@ -1132,7 +1145,6 @@ variables: - CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION - CPACK_INCLUDE_TOPLEVEL_DIRECTORY - CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS # Since 3.11 - - CPACK_INSTALL_SCRIPT # Deprecated since 3.16 - CPACK_INSTALL_SCRIPTS # Since 3.16 - CPACK_PACKAGING_INSTALL_PREFIX - CPACK_SET_DESTDIR @@ -1169,6 +1181,14 @@ variables: # Other standard variables/patterns # - `try_run` - __TRYRUN_OUTPUT + # - `function` + - ARGC + - ARGN + - ARGV + - ARGV + # - `cmake_parse_arguments` + - _UNPARSED_ARGUMENTS + - _KEYWORDS_MISSING_VALUES # Well known CMake's official module's variables # - CheckCCompilerFlag # - CheckCSourceCompiles @@ -1221,6 +1241,7 @@ variables: - CPACK_ARCHIVE_FILE_NAME - CPACK_ARCHIVE__FILE_NAME - CPACK_ARCHIVE_COMPONENT_INSTALL + - CPACK_ARCHIVE_THREADS # Since 3.18 # - CPackBundle - CPACK_BUNDLE_NAME - CPACK_BUNDLE_PLIST @@ -1313,9 +1334,9 @@ variables: - CPACK_COMMAND_SETFILE - CPACK_COMMAND_REZ # -CPackExt (Since 3.13) - - CPACK_EXT_REQUESTED_VERSIONS - - CPACK_EXT_ENABLE_STAGING - - CPACK_EXT_PACKAGE_SCRIPT + - CPACK_EXTERNAL_REQUESTED_VERSIONS + - CPACK_EXTERNAL_ENABLE_STAGING + - CPACK_EXTERNAL_PACKAGE_SCRIPT # - CPackIFW - CPACK_IFW_ROOT - QTIFWDIR @@ -1386,6 +1407,7 @@ variables: - CPACK_NSIS_FINISH_TITLE # Since 3.17 - CPACK_NSIS_FINISH_TITLE_3LINES # Since 3.17 - CPACK_NSIS_MUI_HEADERIMAGE # Since 3.17 + - CPACK_NSIS_MANIFEST_DPI_AWARE # Since 3.18 # - CPackNuGet (since 3.12) - CPACK_NUGET_COMPONENT_INSTALL - CPACK_NUGET_PACKAGE_NAME @@ -1497,8 +1519,10 @@ variables: - CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - CPACK_RPM_PRE_INSTALL_SCRIPT_FILE - CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE + - CPACK_RPM_PRE_TRANS_SCRIPT_FILE # Since 3.18 - CPACK_RPM_POST_INSTALL_SCRIPT_FILE - CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE + - CPACK_RPM_POST_TRANS_SCRIPT_FILE # Since 3.18 - CPACK_RPM_USER_FILELIST - CPACK_RPM__USER_FILELIST - CPACK_RPM_CHANGELOG_FILE @@ -1536,7 +1560,6 @@ variables: # - CPack - CPACK_PACKAGE_NAME - CPACK_PACKAGE_VENDOR - - CPACK_PACKAGE_CONTACT - CPACK_PACKAGE_DIRECTORY - CPACK_PACKAGE_VERSION_MAJOR - CPACK_PACKAGE_VERSION_MINOR @@ -1574,12 +1597,6 @@ variables: - CPACK_PACKAGE_INSTALL_REGISTRY_KEY - CPACK_CREATE_DESKTOP_LINKS - CPACK_BINARY_ - # The following variables used by CPack and some CMake modules, - # but not documented (yet): - # used by some modules like Deb and NSIS - - CPACK_PACKAGE_CONTACT - # - used in CPack.cmake as default value for `CPACK_RPM_PACKAGE_RELOCATABLE` - - CPACK_PACKAGE_RELOCATABLE # - CPackWIX - CPACK_WIX_UPGRADE_GUID - CPACK_WIX_PRODUCT_GUID @@ -1705,6 +1722,30 @@ variables: - SWIG_MODULE__EXTRA_DEPS - SWIG_SOURCE_FILE_EXTENSIONS # Since 3.14 +deprecated-or-internal-variables: + - CMAKE_HOME_DIRECTORY + - CMAKE_INTERNAL_PLATFORM_ABI + - CMAKE__COMPILER_ABI + - CMAKE__COMPILER_ARCHITECTURE_ID + - CMAKE__COMPILER_VERSION_INTERNAL + - CMAKE__PLATFORM_ID + - CMAKE_NOT_USING_CONFIG_FLAGS + - CMAKE_VS_INTEL_Fortran_PROJECT_VERSION + - CPACK_INSTALL_SCRIPT # Deprecated since 3.16 + # Various undocumented variables (yet) + - CMAKE_SUPPRESS_DEVELOPER_WARNINGS # CMake <= 3.10 + - CMAKE_SUPPRESS_DEVELOPER_ERRORS # CMake <= 3.10 + # The following variables used by CPack and some CMake modules, + # but not documented (yet): + # used by some modules like Deb and NSIS + - CPACK_PACKAGE_CONTACT + # used in CPack.cmake as default value for `CPACK_RPM_PACKAGE_RELOCATABLE` + - CPACK_PACKAGE_RELOCATABLE + # mentioned in CPack External generator but not documented (yet) + - CPACK_TEMPORARY_DIRECTORY + - CPACK_TOPLEVEL_DIRECTORY + - CPACK_INSTALL_PREFIX + # 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 environment-variables: @@ -1794,6 +1835,9 @@ scripting-commands: , OS_VERSION , OS_PLATFORM ] + - + name: cmake_language + named-args: [CALL, EVAL, CODE] - name: cmake_minimum_required named-args: [VERSION, FATAL_ERROR] @@ -1817,12 +1861,12 @@ scripting-commands: NOT , AND , OR + , COMMAND , POLICY , TARGET , TEST , EXISTS , IS_NEWER_THAN - , IS_NEWER_THAN , IS_DIRECTORY , IS_SYMLINK , IS_ABSOLUTE @@ -1852,18 +1896,23 @@ scripting-commands: - name: endforeach nulary?: true + end-region: foreach - name: endfunction nulary?: true + end-region: function - name: endif nulary?: true + end-region: if - name: endmacro nulary?: true + end-region: macro - name: endwhile nulary?: true + end-region: while - name: execute_process named-args: [ @@ -1883,6 +1932,8 @@ scripting-commands: , OUTPUT_STRIP_TRAILING_WHITESPACE , ERROR_STRIP_TRAILING_WHITESPACE , ENCODING + , ECHO_OUTPUT_VARIABLE # Since 3.18 + , ECHO_ERROR_VARIABLE # Since 3.18 ] special-args: [ NONE @@ -1985,6 +2036,19 @@ scripting-commands: , SIZE # New sub-options since 3.16 , GET_RUNTIME_DEPENDENCIES + # New sub-options since 3.18 + , ARCHIVE_CREATE + , FILES + , FORMAT + , TYPE + , MTIME + , VERBOSE + , ARCHIVE_EXTRACT + , LIST_ONLY + , CONFIGURE + , ESCAPE_QUOTES + , "@ONLY" + , NEWLINE_STYLE ] special-args: [ UTF-8 @@ -2006,9 +2070,29 @@ scripting-commands: , WORLD_EXECUTE , SETUID , SETGID - , IGNORED # NETRC options since 3.11 + # Special args for NETRC options since 3.11 + , IGNORED , OPTIONAL , REQUIRED + # Special args for `FORMAT` named argument since 3.18 + , 7zip + , gnutar + , pax + , paxr + , raw + , zip + # Special args for `TYPE` named argument since 3.18 + , None + , BZip2 + , GZip + , XZ + , Zstd + # Special args for `NEWLINE_STYLE` named argument since 3.18 + , UNIX + , DOS + , WIN32 + , LF + , CRLF ] - name: find_file @@ -2018,6 +2102,7 @@ scripting-commands: , PATHS , PATH_SUFFIXES , DOC + , REQUIRED # Since 3.18 , NO_DEFAULT_PATH , NO_PACKAGE_ROOT_PATH , NO_CMAKE_PATH @@ -2037,6 +2122,7 @@ scripting-commands: , PATHS , PATH_SUFFIXES , DOC + , REQUIRED # Since 3.18 , NO_DEFAULT_PATH , NO_PACKAGE_ROOT_PATH , NO_CMAKE_PATH @@ -2091,8 +2177,10 @@ scripting-commands: , ITEMS , ZIP_LISTS # Since 3.17 ] + start-region: foreach - name: function + start-region: function - name: get_cmake_property property-args: [global-properties] @@ -2126,7 +2214,23 @@ scripting-commands: ] - name: get_property - named-args: [GLOBAL, DIRECTORY, TARGET, SOURCE, INSTALL, TEST, CACHE, VARIABLE, PROPERTY, SET, DEFINED, BRIEF_DOCS, FULL_DOCS] + named-args: [ + GLOBAL + , DIRECTORY + , TARGET + , SOURCE + , TARGET_DIRECTORY # `SOURCE` sub-option since 3.18 + , DIRECTORY # `SOURCE` sub-option since 3.18 + , INSTALL + , TEST + , CACHE + , VARIABLE + , PROPERTY + , SET + , DEFINED + , BRIEF_DOCS + , FULL_DOCS + ] property-args: &get-property [ global-properties , directory-properties @@ -2140,6 +2244,7 @@ scripting-commands: name: if named-args: *if nested-parentheses?: true + start-region: if - name: include named-args: [OPTIONAL, RESULT_VARIABLE, NO_POLICY_SCOPE] @@ -2191,9 +2296,18 @@ scripting-commands: , POP_BACK ] # Since 3.13 - special-args: [STRING, FILE_BASENAME, SENSITIVE, INSENSITIVE, ASCENDING, DESCENDING] + special-args: [ + STRING + , FILE_BASENAME + , SENSITIVE + , INSENSITIVE + , ASCENDING + , DESCENDING + , NATURAL # Since 3.18 + ] - name: macro + start-region: macro - name: mark_as_advanced named-args: [CLEAR, FORCE] @@ -2238,7 +2352,22 @@ scripting-commands: property-args: *get-property - name: set_property - named-args: [GLOBAL, DIRECTORY, TARGET, DIRECTORY, SOURCE, INSTALL, TEST, CACHE, VARIABLE, APPEND, APPEND_STRING, PROPERTY] + named-args: [ + GLOBAL + , DIRECTORY + , TARGET + , DIRECTORY + , SOURCE + , TARGET_DIRECTORY # `SOURCE` sub-option since 3.18 + , DIRECTORY # `SOURCE` sub-option since 3.18 + , INSTALL + , TEST + , CACHE + , VARIABLE + , APPEND + , APPEND_STRING + , PROPERTY + ] property-args: *get-property - name: set @@ -2284,6 +2413,7 @@ scripting-commands: , SHA3_384 , SHA3_512 , ASCII + , HEX # Since 3.18 , CONFIGURE , "@ONLY" , ESCAPE_QUOTES @@ -2309,6 +2439,7 @@ scripting-commands: name: while named-args: *if nested-parentheses?: true + start-region: while project-commands: - @@ -2417,6 +2548,11 @@ project-commands: name: fltk_wrap_ui - name: get_source_file_property + named-args: [ + # Sice 3.18 + TARGET_DIRECTORY + , DIRECTORY + ] property-args: &get_source_file_property [source-properties] - name: get_target_property @@ -2536,7 +2672,11 @@ project-commands: name: remove_definitions - name: set_source_files_properties - named-args: [PROPERTIES] + named-args: [ + PROPERTIES + , TARGET_DIRECTORY # Since 3.18 + , DIRECTORY # Since 3.18 + ] property-args: *get_source_file_property - name: set_target_properties @@ -2766,6 +2906,7 @@ ctest-commands: , PARALLEL_LEVEL , TEST_LOAD , SCHEDULE_RANDOM + , STOP_ON_FAILURE # Since 3.18 , STOP_TIME , RETURN_VALUE , CAPTURE_CMAKE_ERROR diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py index c092d27f8f5..0dd04a44be2 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-cmake-syntax.py @@ -3,7 +3,7 @@ # # Generate Kate syntax file for CMake # -# Copyright (c) 2017-2019 Alex Turbov +# SPDX-FileCopyrightText: 2017-2019 Alex Turbov # # To install prerequisites: # @@ -33,7 +33,7 @@ _PROPERTY_KEYS = [ , 'install-properties' ] _KW_RE_LIST = ['kw', 're'] -_VAR_KIND_LIST = ['variables', 'environment-variables'] +_VAR_KIND_LIST = ['variables', 'deprecated-or-internal-variables', 'environment-variables'] def try_transform_placeholder_string_to_regex(name): @@ -54,6 +54,9 @@ def try_transform_placeholder_string_to_regex(name): if 'CMAKE_POLICY_WARNING_CMP' in m: return '\\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\\b' + if 'ARGV' in m: + return '\\bARGV[0-9]+\\b' + return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name @@ -101,6 +104,12 @@ def transform_command(cmd): if 'nulary?' in cmd and cmd['nulary?'] and not can_be_nulary: raise RuntimeError('Command `{}` w/ args declared nulary!?'.format(cmd['name'])) + if 'start-region' in cmd: + cmd['start_region'] = cmd['start-region'] + + if 'end-region' in cmd: + cmd['end_region'] = cmd['end-region'] + return cmd @@ -159,8 +168,10 @@ def cli(input_yaml, template): # Fix node names to be accessible from Jinja template data['generator_expressions'] = data['generator-expressions'] + data['deprecated_or_internal_variables'] = data['deprecated-or-internal-variables'] data['environment_variables'] = data['environment-variables'] del data['generator-expressions'] + del data['deprecated-or-internal-variables'] del data['environment-variables'] env = jinja2.Environment( 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 f034bcada72..04c9fcdb360 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/generate-php.pl @@ -14,7 +14,7 @@ # Generated languages need a language named 'PHP/PHP', which shall take care of PHP hl itself # and which will be called every time something like +# SPDX-FileCopyrightText: Jan Villat # License: LGPL my $file = ""; diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-classes.sh b/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-classes.sh index f2735c88a5e..fcfddd1a9df 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-classes.sh +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-classes.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2012-2013 by Alex Turbov +# SPDX-FileCopyrightText: 2012-2013 Alex Turbov # # Grab a documented (officially) class list from Qt project web site: # http://qt-project.org/doc/qt-${version}/classes.html diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-macros.sh b/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-macros.sh index db2a32d7a3b..c6275e52cbc 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-macros.sh +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/get-Qt-macros.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2011-2012 by Alex Turbov +# SPDX-FileCopyrightText: 2011-2012 Alex Turbov # # Simplest (and stupid) way to get #defines from a header file(s) # diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/qmake-gen.py b/src/libs/3rdparty/syntax-highlighting/data/generators/qmake-gen.py index 3b203617082..a16d5fd5d44 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/qmake-gen.py +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/qmake-gen.py @@ -1,19 +1,8 @@ #!/usr/bin/env python -# Copyright (C) 2016 Kevin Funk +# SPDX-FileCopyrightText: 2016 Kevin Funk # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU Library General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# SPDX-License-Identifier: LGPL-2.0-or-later # This script will print XML-like code you can put into the qmake.xml # syntax definition file diff --git a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd index 9a03ef2b780..5fdbbb07dfd 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd +++ b/src/libs/3rdparty/syntax-highlighting/data/schema/language.xsd @@ -1,10 +1,10 @@ + + + + + - - - - - - - - + @@ -4134,11 +4117,13 @@ - + + + + - - - + + @@ -4147,42 +4132,62 @@ - - + + + + + - + + + + + + + + + + + + - + - + + - + + + + + + - + @@ -4211,10 +4216,10 @@ - + - - + + @@ -4230,11 +4235,12 @@ - + + - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml index 228bb45b854..3a2aa3dc91d 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/css.xml @@ -38,7 +38,7 @@ Changelog: --> - + @@ -1585,6 +1585,7 @@ Changelog: + @@ -1731,8 +1732,9 @@ Changelog: - + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml index a434f0f263a..6f3172570c7 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/doxygen.xml @@ -6,7 +6,7 @@ ]> - + @@ -382,16 +382,16 @@ - - + + - - + + @@ -401,7 +401,7 @@ - + @@ -409,8 +409,8 @@ - - + + @@ -514,7 +514,7 @@ - + @@ -532,8 +532,8 @@ - - + + @@ -549,7 +549,7 @@ - + @@ -594,7 +594,7 @@ - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml index 5c39c1b5970..be6bed734e5 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/dtd.xml @@ -3,7 +3,7 @@ ]> - + @@ -46,6 +46,7 @@ + @@ -101,10 +102,9 @@ - + - - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml index ecbd46624c3..2a9a3bc4f44 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/html.xml @@ -5,7 +5,7 @@ ]> - + @@ -91,9 +91,10 @@ - - + + + @@ -193,6 +194,7 @@ + @@ -314,3 +316,4 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml index ce300fff477..0a6730977f0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/ini.xml @@ -1,6 +1,6 @@ - + @@ -49,6 +49,7 @@ + @@ -69,10 +70,10 @@ - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml index 938b25a0f35..273e899f739 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/java.xml @@ -4,7 +4,7 @@ ]> - + ACTIVE @@ -3826,11 +3826,15 @@ + + + + @@ -3858,8 +3862,9 @@ - + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml index e9f80a534ea..a7ab85e0bb0 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/json.xml @@ -12,7 +12,7 @@ ** http://tools.ietf.org/html/rfc4627 *************************************************************************** --> - + null diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml index db158d532f7..7df18db5df7 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/makefile.xml @@ -9,8 +9,10 @@ improve comments handling --> + @@ -177,7 +179,7 @@ - + @@ -512,4 +514,4 @@ - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/modelines.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/modelines.xml index b39c136acc3..43b49f3388c 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/modelines.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/modelines.xml @@ -8,7 +8,7 @@ Copyright (c) 2012-2014 by Alex Turbov (i.zaufi@gmail.com) --> - - + - + @@ -139,7 +138,6 @@ - @@ -147,28 +145,24 @@ - - - - diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl.xml index 964e31b67ae..1b5ca943bed 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 @@ -534,7 +534,7 @@ - + @@ -552,8 +552,12 @@ + + + + - + @@ -570,7 +574,7 @@ - + @@ -592,7 +596,7 @@ - + @@ -658,7 +662,7 @@ - + @@ -838,30 +842,33 @@ - + + + + - + - + - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml deleted file mode 100644 index 71ea0a80e81..00000000000 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/perl6.xml +++ /dev/null @@ -1,1785 +0,0 @@ - - - - - - - - - - - - - - - - - ]+|[&podfmt;](<(?:<*(?=<))|(?![<«])))+"> - - ]+|[&podfmt;](?![<«])|>(?!>)|<(?!<))+"> - - - 」\]}a-zA-Z0-9]|$))"> - - - - - - - - - «»"> - - - - ][+=]|[-&+.<>|^]|cont|elem)\))"> - ]+|&bracehyperoperator;)[«»]"> - - - - - - - ]|&extrasymboloperators;)[&symboloperators;]*|\(&innerbraceoperator;\)|\[&innerbraceoperator;\]|<[&safesymboloperators;'"]+>)"> - - - -]> - - - - - begin - end - finish - for - podtypename - - - - pod - podtypename - - - - True - False - - - - head1 - head2 - head3 - head4 - head5 - head6 - item - item1 - item2 - item3 - item4 - item5 - item6 - para - code - defn - comment - table - input - output - - - - exec - words - quotewords - scalar - array - hash - function - closure - backslash - heredoc - val - - - - macro - sub - submethod - method - multi - proto - only - category - - - - rule - token - regex - - - - podvalue - self - - - - let - my - our - state - temp - has - constant - - - - - if - else - elsif - unless - - for - loop - repeat - while - until - gather - given - - take - do - when - next - last - redo - return - contend - maybe - defer - default - exit - make - continue - break - goto - leave - async - lift - - die - fail - try - warn - - - - - no - use - require - - is - as - but - trusts - of - returns - handles - where - augment - supersede - - module - class - role - package - enum - grammar - slang - subset - - BEGIN - CHECK - INIT - START - FIRST - ENTER - LEAVE - KEEP - UNDO - NEXT - LAST - PRE - POST - END - CATCH - CONTROL - TEMP - - - - prec - irs - ofs - ors - export - deep - binary - unary - reparsed - rw - parsed - cached - readonly - defequiv - will - ref - copy - inline - tighter - looser - equiv - assoc - required - - - - property - signature - context - also - shape - - - - NaN - Inf - - - - Object - Any - Junction - Whatever - Capture - Match - Signature - Proxy - Matcher - Package - Module - Class - Grammar - Scalar - Array - Hash - KeyHash - KeySet - KeyBag - Pair - List - Seq - Range - Set - Bag - Mapping - Void - Undef - Failure - Exception - Code - Block - Routine - Sub - Macro - Method - Submethod - Regex - Str - Blob - Char - Byte - Codepoint - Grapheme - StrPos - StrLen - Version - Num - Complex - num - complex - Bit - bit - bool - True - False - Increasing - Decreasing - Ordered - Callable - AnyChar - Positional - Associative - Ordering - KeyExtractor - Comparator - OrderingPair - IO - KitchenSink - Role - Int - int - int1 - int2 - int4 - int8 - int16 - int32 - int64 - Rat - rat - rat1 - rat2 - rat4 - rat8 - rat16 - rat32 - rat64 - Buf - buf - buf1 - buf2 - buf4 - buf8 - buf16 - buf32 - buf64 - UInt - uint - uint1 - uint2 - uint4 - uint8 - uint16 - uint32 - uint64 - Abstraction - utf8 - utf16 - utf32 - - - - X - gcd - ge - gt - lcm - le - leg - let - lt - map - max - min - minmax - mod - ne - not - notandthen - o - or - orelse - print - push - say - so - substr - temp - unicmp - x - xor - xx - Xeqv - Z - and - andthen - any - but - cmp - coll - die - div - does - eq - eqv - ff - fff - - - - L Letter - LC Cased_Letter - Lu Uppercase_Letter - Ll Lowercase_Letter - Lt Titlecase_Letter - Lm Modifier_Letter - Lo Other_Letter - M Mark - Mn Nonspacing_Mark - Mc Spacing_Mark - Me Enclosing_Mark - N Number - Nd Decimal_Number digit - Nl Letter_Number - No Other_Number - P Punctuation punct - Pc Connector_Punctuation - Pd Dash_Punctuation - Ps Open_Punctuation - Pe Close_Punctuation - Pi Initial_Punctuation - Pf Final_Punctuation - Po Other_Punctuation - S Symbol - Sm Math_Symbol - Sc Currency_Symbol - Sk Modifier_Symbol - So Other_Symbol - Z Separator - Zs Space_Separator - Zl Line_Separator - Zp Paragraph_Separator - C Other - Cc Control cntrl - Cf Format - Cs Surrogate - Co Private_Use - Cn Unassigned - - - - before - after - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml index 03acb0f5a91..29ec21e286e 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/powershell.xml @@ -1,7 +1,7 @@ - @@ -907,9 +906,16 @@ - + + + + + + + + @@ -938,3 +944,4 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml index 2c0c24bf00d..2cdde881c9a 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/python.xml @@ -19,7 +19,7 @@ - + import @@ -447,6 +447,7 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml index 0efd6edc3f6..4504016d0af 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/qdocconf.xml @@ -1,7 +1,7 @@ - + @@ -112,7 +112,9 @@ + + @@ -134,3 +136,4 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml index a451e1442f2..a6d44b4246f 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/ruby.xml @@ -31,7 +31,7 @@ + @@ -431,7 +432,9 @@ + + @@ -891,24 +894,24 @@ - + - - - - - + + + + + - - - + + + - - - + + + @@ -916,15 +919,15 @@ - + - - + + - + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml index 7fe3dd474ef..d30fc775826 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/valgrind-suppression.xml @@ -1,6 +1,6 @@ - + @@ -26,6 +26,7 @@ + @@ -49,3 +50,4 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml index ddfc4e705f0..bb88366c865 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/xml.xml @@ -147,3 +147,4 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml b/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml index ecb1a0d6a22..996d36df627 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml +++ b/src/libs/3rdparty/syntax-highlighting/data/syntax/yacc.xml @@ -32,7 +32,7 @@ This code is released under the LGPL as part of kdelibs/kate. ======================================================================== --> - + @@ -199,11 +199,13 @@ This code is released under the LGPL as part of kdelibs/kate. + + diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme new file mode 100644 index 00000000000..9c84e5af5d5 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-dark.theme @@ -0,0 +1,180 @@ +{ + "_comments": [ + "Last update: Sep 21, 2020 (revision 2)", + "This file has been converted from: https://github.com/dempfi/ayu", + "Also see: https://github.com/ayu-theme" + ], + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Ike Ku", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "ayu Dark", + "revision": 2 + }, + "editor-colors": { + "BackgroundColor": "#0a0e14", + "BracketMatching": "#1e232d", + "CodeFolding": "#121a23", + "CurrentLine": "#00010a", + "CurrentLineNumber": "#414857", + "IconBorder": "#0e1218", + "IndentationLine": "#252b35", + "LineNumbers": "#323844", + "MarkBookmark": "#59c2ff", + "MarkBreakpointActive": "#f07178", + "MarkBreakpointDisabled": "#ffee99", + "MarkBreakpointReached": "#e6b673", + "MarkError": "#ff3333", + "MarkExecution": "#95e6cb", + "MarkWarning": "#c2d94c", + "ModifiedLines": "#6994bf", + "ReplaceHighlight": "#705728", + "SavedLines": "#91b362", + "SearchHighlight": "#414857", + "Separator": "#151a1e", + "SpellChecking": "#d96c75", + "TabMarker": "#1d222b", + "TemplateBackground": "#030810", + "TemplateFocusedPlaceholder": "#3c4250", + "TemplatePlaceholder": "#2b303a", + "TemplateReadOnlyPlaceholder": "#0d1016", + "TextSelection": "#273747", + "WordWrapMarker": "#1e222b" + }, + "text-styles": { + "Alert": { + "background-color": "#2a0f15", + "bold": true, + "selected-text-color": "#ff3333", + "text-color": "#ff3333" + }, + "Annotation": { + "selected-text-color": "#e6b673", + "text-color": "#e6b673" + }, + "Attribute": { + "selected-text-color": "#59c2ff", + "text-color": "#59c2ff" + }, + "BaseN": { + "selected-text-color": "#e6b450", + "text-color": "#e6b450" + }, + "BuiltIn": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "Char": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "Comment": { + "italic": true, + "selected-text-color": "#626a73", + "text-color": "#626a73" + }, + "CommentVar": { + "selected-text-color": "#ffee99", + "text-color": "#ffee99" + }, + "Constant": { + "selected-text-color": "#ffee99", + "text-color": "#ffee99" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#ff8f40", + "text-color": "#ff8f40" + }, + "DataType": { + "selected-text-color": "#ff8f40", + "text-color": "#ff8f40" + }, + "DecVal": { + "selected-text-color": "#e6b450", + "text-color": "#e6b450" + }, + "Documentation": { + "selected-text-color": "#626a73", + "text-color": "#626a73" + }, + "Error": { + "selected-text-color": "#ff3333", + "text-color": "#ff3333", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#59c2ff", + "text-color": "#59c2ff" + }, + "Float": { + "selected-text-color": "#e6b450", + "text-color": "#e6b450" + }, + "Function": { + "selected-text-color": "#ffb454", + "text-color": "#ffb454" + }, + "Import": { + "selected-text-color": "#c2d94c", + "text-color": "#c2d94c" + }, + "Information": { + "selected-text-color": "#e6b450", + "text-color": "#e6b450" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#ff8f40", + "text-color": "#ff8f40" + }, + "Normal": { + "selected-text-color": "#b3b1ad", + "text-color": "#b3b1ad" + }, + "Operator": { + "selected-text-color": "#f29668", + "text-color": "#f29668" + }, + "Others": { + "selected-text-color": "#39bae6", + "text-color": "#39bae6" + }, + "Preprocessor": { + "selected-text-color": "#f07178", + "text-color": "#f07178" + }, + "RegionMarker": { + "background-color": "#173649", + "selected-text-color": "#59c2ff", + "text-color": "#59c2ff" + }, + "SpecialChar": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "SpecialString": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "String": { + "selected-text-color": "#c2d94c", + "text-color": "#c2d94c" + }, + "Variable": { + "selected-text-color": "#39bae6", + "text-color": "#39bae6" + }, + "VerbatimString": { + "selected-text-color": "#c2d94c", + "text-color": "#c2d94c" + }, + "Warning": { + "selected-text-color": "#f07178", + "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 new file mode 100644 index 00000000000..c93e414457e --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-light.theme @@ -0,0 +1,180 @@ +{ + "_comments": [ + "Last update: Sep 21, 2020 (revision 2)", + "This file has been converted from: https://github.com/dempfi/ayu", + "Also see: https://github.com/ayu-theme" + ], + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Ike Ku", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "ayu Light", + "revision": 2 + }, + "editor-colors": { + "BackgroundColor": "#fafafa", + "BracketMatching": "#d9dbdd", + "CodeFolding": "#ffe6dc", + "CurrentLine": "#eff0f2", + "CurrentLineNumber": "#767676", + "IconBorder": "#f3f3f3", + "IndentationLine": "#dcdee1", + "LineNumbers": "#9f9f9f", + "MarkBookmark": "#399ee6", + "MarkBreakpointActive": "#f07171", + "MarkBreakpointDisabled": "#a37acc", + "MarkBreakpointReached": "#e6ba7e", + "MarkError": "#f51818", + "MarkExecution": "#4cbf99", + "MarkWarning": "#86b300", + "ModifiedLines": "#709ecc", + "ReplaceHighlight": "#b0d4e4", + "SavedLines": "#99bf4d", + "SearchHighlight": "#fdd1bc", + "Separator": "#e0dfdf", + "SpellChecking": "#f27983", + "TabMarker": "#dcdee1", + "TemplateBackground": "#f7f7f7", + "TemplateFocusedPlaceholder": "#bec1c6", + "TemplatePlaceholder": "#dddfe1", + "TemplateReadOnlyPlaceholder": "#ffffff", + "TextSelection": "#d1e4f4", + "WordWrapMarker": "#e9eaeb" + }, + "text-styles": { + "Alert": { + "background-color": "#faefef", + "bold": true, + "selected-text-color": "#f51818", + "text-color": "#f51818" + }, + "Annotation": { + "selected-text-color": "#e6ba7e", + "text-color": "#e6ba7e" + }, + "Attribute": { + "selected-text-color": "#399ee6", + "text-color": "#399ee6" + }, + "BaseN": { + "selected-text-color": "#ff9940", + "text-color": "#ff9940" + }, + "BuiltIn": { + "selected-text-color": "#4cbf99", + "text-color": "#4cbf99" + }, + "Char": { + "selected-text-color": "#4cbf99", + "text-color": "#4cbf99" + }, + "Comment": { + "italic": true, + "selected-text-color": "#607880", + "text-color": "#607880" + }, + "CommentVar": { + "selected-text-color": "#a37acc", + "text-color": "#a37acc" + }, + "Constant": { + "selected-text-color": "#a37acc", + "text-color": "#a37acc" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#fa8d3e", + "text-color": "#fa8d3e" + }, + "DataType": { + "selected-text-color": "#fa8d3e", + "text-color": "#fa8d3e" + }, + "DecVal": { + "selected-text-color": "#ff9940", + "text-color": "#ff9940" + }, + "Documentation": { + "selected-text-color": "#607880", + "text-color": "#607880" + }, + "Error": { + "selected-text-color": "#f51818", + "text-color": "#f51818", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#399ee6", + "text-color": "#399ee6" + }, + "Float": { + "selected-text-color": "#ff9940", + "text-color": "#ff9940" + }, + "Function": { + "selected-text-color": "#f2ae49", + "text-color": "#f2ae49" + }, + "Import": { + "selected-text-color": "#86b300", + "text-color": "#86b300" + }, + "Information": { + "selected-text-color": "#ff9940", + "text-color": "#ff9940" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#fa8d3e", + "text-color": "#fa8d3e" + }, + "Normal": { + "selected-text-color": "#575f66", + "text-color": "#575f66" + }, + "Operator": { + "selected-text-color": "#ed9366", + "text-color": "#ed9366" + }, + "Others": { + "selected-text-color": "#55b4d4", + "text-color": "#55b4d4" + }, + "Preprocessor": { + "selected-text-color": "#f07171", + "text-color": "#f07171" + }, + "RegionMarker": { + "background-color": "#ddecf3", + "selected-text-color": "#399ee6", + "text-color": "#399ee6" + }, + "SpecialChar": { + "selected-text-color": "#4cbf99", + "text-color": "#4cbf99" + }, + "SpecialString": { + "selected-text-color": "#4cbf99", + "text-color": "#4cbf99" + }, + "String": { + "selected-text-color": "#86b300", + "text-color": "#86b300" + }, + "Variable": { + "selected-text-color": "#55b4d4", + "text-color": "#55b4d4" + }, + "VerbatimString": { + "selected-text-color": "#86b300", + "text-color": "#86b300" + }, + "Warning": { + "selected-text-color": "#f07171", + "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 new file mode 100644 index 00000000000..cd9ff7488e8 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/ayu-mirage.theme @@ -0,0 +1,180 @@ +{ + "_comments": [ + "Last update: Sep 21, 2020 (revision 2)", + "This file has been converted from: https://github.com/dempfi/ayu", + "Also see: https://github.com/ayu-theme" + ], + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Ike Ku", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "ayu Mirage", + "revision": 2 + }, + "editor-colors": { + "BackgroundColor": "#1f2430", + "BracketMatching": "#383e4c", + "CodeFolding": "#252c3e", + "CurrentLine": "#191e2a", + "CurrentLineNumber": "#606979", + "IconBorder": "#222733", + "IndentationLine": "#383f4c", + "LineNumbers": "#444b59", + "MarkBookmark": "#73d0ff", + "MarkBreakpointActive": "#f28779", + "MarkBreakpointDisabled": "#d4bfff", + "MarkBreakpointReached": "#ffe6b3", + "MarkError": "#ff3333", + "MarkExecution": "#95e6cb", + "MarkWarning": "#bae67e", + "ModifiedLines": "#77a8d9", + "ReplaceHighlight": "#7f553b", + "SavedLines": "#a6cc70", + "SearchHighlight": "#606979", + "Separator": "#2c313d", + "SpellChecking": "#f27983", + "TabMarker": "#303642", + "TemplateBackground": "#1d222e", + "TemplateFocusedPlaceholder": "#596171", + "TemplatePlaceholder": "#434957", + "TemplateReadOnlyPlaceholder": "#232834", + "TextSelection": "#33415e", + "WordWrapMarker": "#303642" + }, + "text-styles": { + "Alert": { + "background-color": "#332430", + "bold": true, + "selected-text-color": "#ff3333", + "text-color": "#ff3333" + }, + "Annotation": { + "selected-text-color": "#ffe6b3", + "text-color": "#ffe6b3" + }, + "Attribute": { + "selected-text-color": "#73d0ff", + "text-color": "#73d0ff" + }, + "BaseN": { + "selected-text-color": "#ffcc66", + "text-color": "#ffcc66" + }, + "BuiltIn": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "Char": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "Comment": { + "italic": true, + "selected-text-color": "#5c6773", + "text-color": "#5c6773" + }, + "CommentVar": { + "selected-text-color": "#d4bfff", + "text-color": "#d4bfff" + }, + "Constant": { + "selected-text-color": "#d4bfff", + "text-color": "#d4bfff" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#ffa759", + "text-color": "#ffa759" + }, + "DataType": { + "selected-text-color": "#ffa759", + "text-color": "#ffa759" + }, + "DecVal": { + "selected-text-color": "#ffcc66", + "text-color": "#ffcc66" + }, + "Documentation": { + "selected-text-color": "#5c6773", + "text-color": "#5c6773" + }, + "Error": { + "selected-text-color": "#ff3333", + "text-color": "#ff3333", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#73d0ff", + "text-color": "#73d0ff" + }, + "Float": { + "selected-text-color": "#ffcc66", + "text-color": "#ffcc66" + }, + "Function": { + "selected-text-color": "#ffd580", + "text-color": "#ffd580" + }, + "Import": { + "selected-text-color": "#bae67e", + "text-color": "#bae67e" + }, + "Information": { + "selected-text-color": "#ffcc66", + "text-color": "#ffcc66" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#ffa759", + "text-color": "#ffa759" + }, + "Normal": { + "selected-text-color": "#cbccc6", + "text-color": "#cbccc6" + }, + "Operator": { + "selected-text-color": "#f29e74", + "text-color": "#f29e74" + }, + "Others": { + "selected-text-color": "#5ccfe6", + "text-color": "#5ccfe6" + }, + "Preprocessor": { + "selected-text-color": "#f28779", + "text-color": "#f28779" + }, + "RegionMarker": { + "background-color": "#2a4254", + "selected-text-color": "#73d0ff", + "text-color": "#73d0ff" + }, + "SpecialChar": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "SpecialString": { + "selected-text-color": "#95e6cb", + "text-color": "#95e6cb" + }, + "String": { + "selected-text-color": "#bae67e", + "text-color": "#bae67e" + }, + "Variable": { + "selected-text-color": "#5ccfe6", + "text-color": "#5ccfe6" + }, + "VerbatimString": { + "selected-text-color": "#bae67e", + "text-color": "#bae67e" + }, + "Warning": { + "selected-text-color": "#f28779", + "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 8147948eeb0..93f8fa9cac7 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-dark.theme @@ -1,5 +1,10 @@ { "metadata" : { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Volker Krause ", + "SPDX-FileCopyrightText: 2016 Dominik Haumann " + ], + "license": "SPDX-License-Identifier: MIT", "revision" : 2, "name" : "Breeze Dark" }, @@ -142,33 +147,33 @@ } }, "editor-colors": { - "background-color" : "#232629", - "code-folding" : "#224e65", - "bracket-matching" : "#8e44ad", - "current-line" : "#2A2E32", - "icon-border" : "#31363b", - "indentation-line" : "#3a3f44", - "line-numbers" : "#7a7c7d", - "current-line-number" : "#a5a6a8", - "mark-bookmark" : "#0404bf", - "mark-breakpoint-active" : "#8b0607", - "mark-breakpoint-reached" : "#6d6e07", - "mark-breakpoint-disabled" : "#820683", - "mark-execution" : "#4d4e50", - "mark-warning" : "#f67400", - "mark-error" : "#da4453", - "modified-lines" : "#c04900", - "replace-highlight" : "#808021", - "saved-lines" : "#1c8042", - "search-highlight" : "#218058", - "selection" : "#2d5c76", - "separator" : "#7a7c7d", - "spell-checking" : "#c0392b", - "tab-marker" : "#4d4d4d", - "template-background" : "#31363b", - "template-placeholder" : "#123723", - "template-focused-placeholder" : "#123723", - "template-read-only-placeholder" : "#4d1f24", - "word-wrap-marker" : "#3a3f44" + "BackgroundColor" : "#232629", + "CodeFolding" : "#224e65", + "BracketMatching" : "#8e44ad", + "CurrentLine" : "#2A2E32", + "IconBorder" : "#31363b", + "IndentationLine" : "#3a3f44", + "LineNumbers" : "#7a7c7d", + "CurrentLineNumber" : "#a5a6a8", + "MarkBookmark" : "#0404bf", + "MarkBreakpointActive" : "#8b0607", + "MarkBreakpointReached" : "#6d6e07", + "MarkBreakpointDisabled" : "#820683", + "MarkExecution" : "#4d4e50", + "MarkWarning" : "#f67400", + "MarkError" : "#da4453", + "ModifiedLines" : "#c04900", + "ReplaceHighlight" : "#808021", + "SavedLines" : "#1c8042", + "SearchHighlight" : "#218058", + "TextSelection" : "#2d5c76", + "Separator" : "#7a7c7d", + "SpellChecking" : "#c0392b", + "TabMarker" : "#4d4d4d", + "TemplateBackground" : "#31363b", + "TemplatePlaceholder" : "#123723", + "TemplateFocusedPlaceholder" : "#123723", + "TemplateReadOnlyPlaceholder" : "#4d1f24", + "WordWrapMarker" : "#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 new file mode 100644 index 00000000000..0a27e2d3548 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/breeze-light.theme @@ -0,0 +1,179 @@ +{ + "metadata" : { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Volker Krause ", + "SPDX-FileCopyrightText: 2016 Dominik Haumann " + ], + "license": "SPDX-License-Identifier: MIT", + "revision" : 4, + "name" : "Breeze Light" + }, + "text-styles": { + "Normal" : { + "text-color" : "#1f1c1b", + "selected-text-color" : "#ffffff", + "bold" : false, + "italic" : false, + "underline" : false, + "strike-through" : false + }, + "Keyword" : { + "text-color" : "#1f1c1b", + "selected-text-color" : "#ffffff", + "bold" : true + }, + "Function" : { + "text-color" : "#644a9b", + "selected-text-color" : "#452886" + }, + "Variable" : { + "text-color" : "#0057ae", + "selected-text-color" : "#00316e" + }, + "ControlFlow" : { + "text-color" : "#1f1c1b", + "selected-text-color" : "#ffffff", + "bold" : true + }, + "Operator" : { + "text-color" : "#1f1c1b", + "selected-text-color" : "#ffffff" + }, + "BuiltIn" : { + "text-color" : "#644a9b", + "selected-text-color" : "#452886", + "bold" : true + }, + "Extension" : { + "text-color" : "#0095ff", + "selected-text-color" : "#ffffff", + "bold" : true + }, + "Preprocessor" : { + "text-color" : "#006e28", + "selected-text-color" : "#006e28" + }, + "Attribute" : { + "text-color" : "#0057ae", + "selected-text-color" : "#00316e" + }, + "Char" : { + "text-color" : "#924c9d", + "selected-text-color" : "#6c2477" + }, + "SpecialChar" : { + "text-color" : "#3daee9", + "selected-text-color" : "#fcfcfc" + }, + "String" : { + "text-color" : "#bf0303", + "selected-text-color" : "#9c0e0e" + }, + "VerbatimString" : { + "text-color" : "#bf0303", + "selected-text-color" : "#9c0e0e" + }, + "SpecialString" : { + "text-color" : "#ff5500", + "selected-text-color" : "#ff5500" + }, + "Import" : { + "text-color" : "#ff5500", + "selected-text-color" : "#ff5500" + }, + "DataType" : { + "text-color" : "#0057ae", + "selected-text-color" : "#00316e" + }, + "DecVal" : { + "text-color" : "#b08000", + "selected-text-color" : "#805c00" + }, + "BaseN" : { + "text-color" : "#b08000", + "selected-text-color" : "#805c00" + }, + "Float" : { + "text-color" : "#b08000", + "selected-text-color" : "#805c00" + }, + "Constant" : { + "text-color" : "#aa5500", + "selected-text-color" : "#5e2f00" + }, + "Comment" : { + "text-color" : "#898887", + "selected-text-color" : "#5e5d5d" + }, + "Documentation" : { + "text-color" : "#607880", + "selected-text-color" : "#46585e" + }, + "Annotation" : { + "text-color" : "#ca60ca", + "selected-text-color" : "#a44ea4" + }, + "CommentVar" : { + "text-color" : "#0095ff", + "selected-text-color" : "#ffffff" + }, + "RegionMarker" : { + "text-color" : "#0057ae", + "selected-text-color" : "#00316e", + "background-color" : "#e0e9f8" + }, + "Information" : { + "text-color" : "#b08000", + "selected-text-color" : "#805c00" + }, + "Warning" : { + "text-color" : "#bf0303", + "selected-text-color" : "#9c0e0e" + }, + "Alert" : { + "text-color" : "#bf0303", + "selected-text-color" : "#9c0e0e", + "background-color" : "#f7e6e6", + "bold" : true + }, + "Error" : { + "text-color" : "#bf0303", + "selected-text-color" : "#9c0e0e", + "underline" : true + }, + "Others" : { + "text-color" : "#006e28", + "selected-text-color" : "#006e28" + } + }, + "editor-colors": { + "BackgroundColor" : "#ffffff", + "CodeFolding" : "#94caef", + "BracketMatching" : "#ffff00", + "CurrentLine" : "#f8f7f6", + "IconBorder" : "#f0f0f0", + "IndentationLine" : "#d2d2d2", + "LineNumbers" : "#a0a0a0", + "CurrentLineNumber" : "#1e1e1e", + "MarkBookmark" : "#0000ff", + "MarkBreakpointActive" : "#ff0000", + "MarkBreakpointReached" : "#ffff00", + "MarkBreakpointDisabled" : "#ff00ff", + "MarkExecution" : "#a0a0a4", + "MarkWarning" : "#00ff00", + "MarkError" : "#ff0000", + "ModifiedLines" : "#fdbc4b", + "ReplaceHighlight" : "#00ff00", + "SavedLines" : "#2ecc71", + "SearchHighlight" : "#ffff00", + "TextSelection" : "#94caef", + "Separator" : "#a0a0a0", + "SpellChecking" : "#bf0303", + "TabMarker" : "#d2d2d2", + "TemplateBackground" : "#d6d2d0", + "TemplatePlaceholder" : "#baf8ce", + "TemplateFocusedPlaceholder" : "#76da98", + "TemplateReadOnlyPlaceholder" : "#f6e6e6", + "WordWrapMarker" : "#ededed" + } +} diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme new file mode 100644 index 00000000000..82786160b8f --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/dracula.theme @@ -0,0 +1,173 @@ +{ + "editor-colors": { + "BackgroundColor": "#282a36", + "BracketMatching": "#55007f", + "CodeFolding": "#8be9fd", + "CurrentLine": "#282a36", + "CurrentLineNumber": "#f8f8f2", + "IconBorder": "#282a36", + "IndentationLine": "#6272a4", + "LineNumbers": "#909194", + "MarkBookmark": "#8be9fd", + "MarkBreakpointActive": "#ff5555", + "MarkBreakpointDisabled": "#bd93f9", + "MarkBreakpointReached": "#f1fa8c", + "MarkError": "#ff5555", + "MarkExecution": "#44475a", + "MarkWarning": "#ffb86c", + "ModifiedLines": "#ff79c6", + "ReplaceHighlight": "#50fa7b", + "SavedLines": "#50fa7b", + "SearchHighlight": "#b39800", + "Separator": "#909194", + "SpellChecking": "#ff5555", + "TabMarker": "#6272a4", + "TemplateBackground": "#282a36", + "TemplateFocusedPlaceholder": "#282a36", + "TemplatePlaceholder": "#282a36", + "TemplateReadOnlyPlaceholder": "#44475a", + "TextSelection": "#44475a", + "WordWrapMarker": "#282a36" + }, + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Dracula Theme", + "SPDX-FileCopyrightText: 2020 Christoph Cullmann " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "Dracula", + "revision": 1 + }, + "text-styles": { + "Alert": { + "bold": true, + "selected-text-color": "#ff5555", + "text-color": "#ff5555" + }, + "Annotation": { + "selected-text-color": "#ff79c6", + "text-color": "#ff79c6" + }, + "Attribute": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "BaseN": { + "selected-text-color": "#ffb86c", + "text-color": "#ffb86c" + }, + "BuiltIn": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "Char": { + "selected-text-color": "#ff79c6", + "text-color": "#ff79c6" + }, + "Comment": { + "selected-text-color": "#6272a4", + "text-color": "#6272a4" + }, + "CommentVar": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "Constant": { + "bold": true, + "selected-text-color": "#bd93f9", + "text-color": "#bd93f9" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#ffb86c", + "text-color": "#ffb86c" + }, + "DataType": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "DecVal": { + "selected-text-color": "#ffb86c", + "text-color": "#ffb86c" + }, + "Documentation": { + "selected-text-color": "#ffb86c", + "text-color": "#ffb86c" + }, + "Error": { + "selected-text-color": "#ff5555", + "text-color": "#ff5555", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#0095ff", + "text-color": "#0095ff" + }, + "Float": { + "selected-text-color": "#ffb86c", + "text-color": "#ffb86c" + }, + "Function": { + "selected-text-color": "#50fa7b", + "text-color": "#50fa7b" + }, + "Import": { + "selected-text-color": "#ff79c6", + "text-color": "#ff79c6" + }, + "Information": { + "selected-text-color": "#f67400", + "text-color": "#f67400" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#ff79c6", + "text-color": "#ff79c6" + }, + "Normal": { + "selected-text-color": "#f8f8f2", + "text-color": "#f8f8f2" + }, + "Operator": { + "selected-text-color": "#f8f8f2", + "text-color": "#f8f8f2" + }, + "Others": { + "selected-text-color": "#50fa7b", + "text-color": "#50fa7b" + }, + "Preprocessor": { + "selected-text-color": "#50fa7b", + "text-color": "#50fa7b" + }, + "RegionMarker": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "SpecialChar": { + "selected-text-color": "#ff79c6", + "text-color": "#ff79c6" + }, + "SpecialString": { + "selected-text-color": "#f1fa8c", + "text-color": "#f1fa8c" + }, + "String": { + "selected-text-color": "#f1fa8c", + "text-color": "#f1fa8c" + }, + "Variable": { + "selected-text-color": "#8be9fd", + "text-color": "#8be9fd" + }, + "VerbatimString": { + "selected-text-color": "#f1fa8c", + "text-color": "#f1fa8c" + }, + "Warning": { + "selected-text-color": "#ff5555", + "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 new file mode 100644 index 00000000000..66c6c9afb7e --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-dark.theme @@ -0,0 +1,185 @@ +{ + "_comments": [ + "Last update: Sep 17, 2020 (revision 2)", + "This file has been converted from: https://github.com/morhetz/gruvbox" + ], + "metadata" : { + "copyright": [ + "SPDX-FileCopyrightText: 2017 Pavel Pertsev ", + "SPDX-FileCopyrightText: 2020 Frederik Banning " + ], + "license": "SPDX-License-Identifier: MIT", + "name" : "gruvbox Dark", + "revision" : 2 + }, + "text-styles": { + "Normal" : { + "text-color" : "#ebdbb2", + "selected-text-color" : "#ebdbb2", + "bold" : false, + "italic" : false, + "underline" : false, + "strike-through" : false + }, + "Keyword" : { + "text-color" : "#ebdbb2", + "selected-text-color" : "#ebdbb2", + "bold" : true + }, + "Function" : { + "text-color" : "#689d6a", + "selected-text-color" : "#8ec07c" + }, + "Variable" : { + "text-color" : "#458588", + "selected-text-color" : "#83a598" + }, + "ControlFlow" : { + "text-color" : "#cc241d", + "selected-text-color" : "#fb4934", + "bold" : true + }, + "Operator" : { + "text-color" : "#ebdbb2", + "selected-text-color" : "#ebdbb2" + }, + "BuiltIn" : { + "text-color" : "#d65d0e", + "selected-text-color" : "#fe8019" + }, + "Extension" : { + "text-color" : "#689d6a", + "selected-text-color" : "#8ec07c", + "bold" : true + }, + "Preprocessor" : { + "text-color" : "#d65d0e", + "selected-text-color" : "#fe8019" + }, + "Attribute" : { + "text-color" : "#d79921", + "selected-text-color" : "#fabd2f" + }, + "Char" : { + "text-color" : "#b16286", + "selected-text-color" : "#d3869b" + }, + "SpecialChar" : { + "text-color" : "#b16286", + "selected-text-color" : "#d3869b" + }, + "String" : { + "text-color" : "#98971a", + "selected-text-color" : "#b8bb26" + }, + "VerbatimString" : { + "text-color" : "#98971a", + "selected-text-color" : "#b8bb26" + }, + "SpecialString" : { + "text-color" : "#98971a", + "selected-text-color" : "#b8bb26" + }, + "Import" : { + "text-color" : "#689d6a", + "selected-text-color" : "#8ec07c" + }, + "DataType" : { + "text-color" : "#d79921", + "selected-text-color" : "#fabd2f" + }, + "DecVal" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "BaseN" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "Float" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "Constant" : { + "text-color" : "#b16286", + "selected-text-color" : "#d3869b", + "bold" : true + }, + "Comment" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984" + }, + "Documentation" : { + "text-color" : "#98971a", + "selected-text-color" : "#b8bb26" + }, + "Annotation" : { + "text-color" : "#98971a", + "selected-text-color" : "#b8bb26" + }, + "CommentVar" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984" + }, + "RegionMarker" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984", + "background-color" : "#1d2021" + }, + "Information" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#83a598" + }, + "Warning" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#fabd2f" + }, + "Alert" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#cc241d", + "bold" : true + }, + "Error" : { + "text-color" : "#cc241d", + "selected-text-color" : "#fb4934", + "underline" : true + }, + "Others" : { + "text-color" : "#689d6a", + "selected-text-color" : "#8ec07c" + } + }, + "editor-colors": { + "BackgroundColor" : "#282828", + "CodeFolding" : "#1d2021", + "BracketMatching" : "#a89984", + "CurrentLine" : "#32302f", + "IconBorder" : "#282828", + "IndentationLine" : "#504945", + "LineNumbers" : "#ebdbb2", + "CurrentLineNumber" : "#ebdbb2", + "MarkBookmark" : "#458588", + "MarkBreakpointActive" : "#cc241d", + "MarkBreakpointReached" : "#98971a", + "MarkBreakpointDisabled" : "#b16286", + "MarkExecution" : "#ebdbb2", + "MarkWarning" : "#d65d0e", + "MarkError" : "#cc241d", + "ModifiedLines" : "#fe8019", + "ReplaceHighlight" : "#b8bb26", + "SavedLines" : "#689d6a", + "SearchHighlight" : "#8ec07c", + "TextSelection" : "#504945", + "Separator" : "#504945", + "SpellChecking" : "#cc241d", + "TabMarker" : "#504945", + "TemplateBackground" : "#282828", + "TemplatePlaceholder" : "#98971a", + "TemplateFocusedPlaceholder" : "#b8bb26", + "TemplateReadOnlyPlaceholder" : "#fb4934", + "WordWrapMarker" : "#a89984" + } +} diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme new file mode 100644 index 00000000000..6038c70e94f --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/gruvbox-light.theme @@ -0,0 +1,185 @@ +{ + "_comments": [ + "Last update: Sep 17, 2020 (revision 2)", + "This file has been converted from: https://github.com/morhetz/gruvbox" + ], + "metadata" : { + "copyright": [ + "SPDX-FileCopyrightText: 2017 Pavel Pertsev ", + "SPDX-FileCopyrightText: 2020 Frederik Banning " + ], + "license": "SPDX-License-Identifier: MIT", + "name" : "gruvbox Light", + "revision" : 2 + }, + "text-styles": { + "Normal" : { + "text-color" : "#3c3836", + "selected-text-color" : "#3c3836", + "bold" : false, + "italic" : false, + "underline" : false, + "strike-through" : false + }, + "Keyword" : { + "text-color" : "#3c3836", + "selected-text-color" : "#3c3836", + "bold" : true + }, + "Function" : { + "text-color" : "#689d6a", + "selected-text-color" : "#427b58" + }, + "Variable" : { + "text-color" : "#458588", + "selected-text-color" : "#076678" + }, + "ControlFlow" : { + "text-color" : "#cc241d", + "selected-text-color" : "#9d0006", + "bold" : true + }, + "Operator" : { + "text-color" : "#3c3836", + "selected-text-color" : "#3c3836" + }, + "BuiltIn" : { + "text-color" : "#d65d0e", + "selected-text-color" : "#af3a03" + }, + "Extension" : { + "text-color" : "#689d6a", + "selected-text-color" : "#427b58", + "bold" : true + }, + "Preprocessor" : { + "text-color" : "#d65d0e", + "selected-text-color" : "#af3a03" + }, + "Attribute" : { + "text-color" : "#d79921", + "selected-text-color" : "#b57614" + }, + "Char" : { + "text-color" : "#b16286", + "selected-text-color" : "#8f3f71" + }, + "SpecialChar" : { + "text-color" : "#b16286", + "selected-text-color" : "#8f3f71" + }, + "String" : { + "text-color" : "#98971a", + "selected-text-color" : "#79740e" + }, + "VerbatimString" : { + "text-color" : "#98971a", + "selected-text-color" : "#79740e" + }, + "SpecialString" : { + "text-color" : "#98971a", + "selected-text-color" : "#79740e" + }, + "Import" : { + "text-color" : "#689d6a", + "selected-text-color" : "#427b58" + }, + "DataType" : { + "text-color" : "#d79921", + "selected-text-color" : "#b57614" + }, + "DecVal" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "BaseN" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "Float" : { + "text-color" : "#f67400", + "selected-text-color" : "#f67400" + }, + "Constant" : { + "text-color" : "#b16286", + "selected-text-color" : "#8f3f71", + "bold" : true + }, + "Comment" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984" + }, + "Documentation" : { + "text-color" : "#98971a", + "selected-text-color" : "#79740e" + }, + "Annotation" : { + "text-color" : "#98971a", + "selected-text-color" : "#79740e" + }, + "CommentVar" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984" + }, + "RegionMarker" : { + "text-color" : "#928374", + "selected-text-color" : "#a89984", + "background-color" : "#f9f5d7" + }, + "Information" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#83a598" + }, + "Warning" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#fabd2f" + }, + "Alert" : { + "text-color" : "#282828", + "selected-text-color" : "#282828", + "background-color" : "#cc241d", + "bold" : true + }, + "Error" : { + "text-color" : "#cc241d", + "selected-text-color" : "#9d0006", + "underline" : true + }, + "Others" : { + "text-color" : "#689d6a", + "selected-text-color" : "#427b58" + } + }, + "editor-colors": { + "BackgroundColor" : "#fbf1c7", + "CodeFolding" : "#f9f5d7", + "BracketMatching" : "#a89984", + "CurrentLine" : "#f2e5bc", + "IconBorder" : "#fbf1c7", + "IndentationLine" : "#d5c4a1", + "LineNumbers" : "#3c3836", + "CurrentLineNumber" : "#3c3836", + "MarkBookmark" : "#458588", + "MarkBreakpointActive" : "#cc241d", + "MarkBreakpointReached" : "#98971a", + "MarkBreakpointDisabled" : "#b16286", + "MarkExecution" : "#3c3836", + "MarkWarning" : "#d65d0e", + "MarkError" : "#cc241d", + "ModifiedLines" : "#af3a03", + "ReplaceHighlight" : "#79740e", + "SavedLines" : "#689d6a", + "SearchHighlight" : "#427b58", + "TextSelection" : "#d5c4a1", + "Separator" : "#d5c4a1", + "SpellChecking" : "#cc241d", + "TabMarker" : "#d5c4a1", + "TemplateBackground" : "#fbf1c7", + "TemplatePlaceholder" : "#98971a", + "TemplateFocusedPlaceholder" : "#79740e", + "TemplateReadOnlyPlaceholder" : "#9d0006", + "WordWrapMarker" : "#a89984" + } +} diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme new file mode 100644 index 00000000000..6ad4d82e43c --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/nord.theme @@ -0,0 +1,181 @@ +{ + "_comments": [ + "Last update: Sep 21, 2020 (revision 2)", + "This theme has been adapted from: https://www.nordtheme.com" + ], + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2016 Arctic Ice Studio ", + "SPDX-FileCopyrightText: 2016 Sven Greb ", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "Nord", + "revision": 2 + }, + "editor-colors": { + "BackgroundColor": "#2e3440", + "BracketMatching": "#4c566a", + "CodeFolding": "#434c5e", + "CurrentLine": "#3b4252", + "CurrentLineNumber": "#616e88", + "IconBorder": "#2e3440", + "IndentationLine": "#434c5e", + "LineNumbers": "#4c566a", + "MarkBookmark": "#55749a", + "MarkBreakpointActive": "#79aab9", + "MarkBreakpointDisabled": "#b48ead", + "MarkBreakpointReached": "#91a97e", + "MarkError": "#a95862", + "MarkExecution": "#4c566a", + "MarkWarning": "#d0b47d", + "ModifiedLines": "#ebcb8b", + "ReplaceHighlight": "#8e6057", + "SavedLines": "#a3be8c", + "SearchHighlight": "#5f8491", + "Separator": "#3b4252", + "SpellChecking": "#bf616a", + "TabMarker": "#3e4656", + "TemplateBackground": "#3b4252", + "TemplateFocusedPlaceholder": "#81a1c1", + "TemplatePlaceholder": "#5e81ac", + "TemplateReadOnlyPlaceholder": "#4c566a", + "TextSelection": "#4c566a", + "WordWrapMarker": "#3f4859" + }, + "text-styles": { + "Alert": { + "background-color": "#3b4252", + "bold": true, + "selected-text-color": "#bf616a", + "text-color": "#bf616a" + }, + "Annotation": { + "selected-text-color": "#d08770", + "text-color": "#d08770" + }, + "Attribute": { + "selected-text-color": "#8fbcbb", + "text-color": "#8fbcbb" + }, + "BaseN": { + "selected-text-color": "#b48ead", + "text-color": "#b48ead" + }, + "BuiltIn": { + "italic": true, + "selected-text-color": "#88c0d0", + "text-color": "#88c0d0" + }, + "Char": { + "selected-text-color": "#ebcb8b", + "text-color": "#ebcb8b" + }, + "Comment": { + "selected-text-color": "#616e88", + "text-color": "#616e88" + }, + "CommentVar": { + "selected-text-color": "#e5e9f0", + "text-color": "#e5e9f0" + }, + "Constant": { + "bold": true, + "selected-text-color": "#eceff4", + "text-color": "#eceff4" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#81a1c1", + "text-color": "#81a1c1" + }, + "DataType": { + "selected-text-color": "#81a1c1", + "text-color": "#81a1c1" + }, + "DecVal": { + "selected-text-color": "#b48ead", + "text-color": "#b48ead" + }, + "Documentation": { + "selected-text-color": "#5e81ac", + "text-color": "#5e81ac" + }, + "Error": { + "selected-text-color": "#bf616a", + "text-color": "#bf616a", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#8fbcbb", + "text-color": "#8fbcbb" + }, + "Float": { + "selected-text-color": "#b48ead", + "text-color": "#b48ead" + }, + "Function": { + "selected-text-color": "#88c0d0", + "text-color": "#88c0d0" + }, + "Import": { + "selected-text-color": "#a3be8c", + "text-color": "#a3be8c" + }, + "Information": { + "selected-text-color": "#ebcb8b", + "text-color": "#ebcb8b" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#81a1c1", + "text-color": "#81a1c1" + }, + "Normal": { + "selected-text-color": "#d8dee9", + "text-color": "#d8dee9" + }, + "Operator": { + "selected-text-color": "#81a1c1", + "text-color": "#81a1c1" + }, + "Others": { + "selected-text-color": "#8fbcbb", + "text-color": "#8fbcbb" + }, + "Preprocessor": { + "selected-text-color": "#5e81ac", + "text-color": "#5e81ac" + }, + "RegionMarker": { + "background-color": "#3b4252", + "selected-text-color": "#88c0d0", + "text-color": "#88c0d0" + }, + "SpecialChar": { + "selected-text-color": "#ebcb8b", + "text-color": "#ebcb8b" + }, + "SpecialString": { + "selected-text-color": "#d08770", + "text-color": "#d08770" + }, + "String": { + "selected-text-color": "#a3be8c", + "text-color": "#a3be8c" + }, + "Variable": { + "selected-text-color": "#5e81ac", + "text-color": "#5e81ac" + }, + "VerbatimString": { + "selected-text-color": "#a3be8c", + "text-color": "#a3be8c" + }, + "Warning": { + "selected-text-color": "#bf616a", + "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 a6048ed01ab..26d779582d7 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/printing.theme @@ -1,6 +1,11 @@ { "metadata" : { - "revision" : 3, + "copyright": [ + "SPDX-FileCopyrightText: 2016 Volker Krause ", + "SPDX-FileCopyrightText: 2016 Dominik Haumann " + ], + "license": "SPDX-License-Identifier: MIT", + "revision" : 4, "name" : "Printing" }, "text-styles": { @@ -141,33 +146,33 @@ } }, "editor-colors": { - "background-color" : "#ffffff", - "code-folding" : "#94caef", - "bracket-matching" : "#edf9ff", - "current-line" : "#f8f7f6", - "icon-border" : "#d6d2d0", - "indentation-line" : "#d2d2d2", - "line-numbers" : "#221f1e", - "current-line-number" : "#221f1e", - "mark-bookmark" : "#0000ff", - "mark-breakpoint-active" : "#ff0000", - "mark-breakpoint-reached" : "#ffff00", - "mark-breakpoint-disabled" : "#ff00ff", - "mark-execution" : "#a0a0a4", - "mark-warning" : "#00ff00", - "mark-error" : "#ff0000", - "modified-lines" : "#f6e6e6", - "replace-highlight" : "#00ff00", - "saved-lines" : "#baf8ce", - "search-highlight" : "#ffff00", - "selection" : "#94caef", - "separator" : "#898887", - "spell-checking" : "#bf0303", - "tab-marker" : "#d2d2d2", - "template-background" : "#d6d2d0", - "template-placeholder" : "#baf8ce", - "template-focused-placeholder" : "#76da98", - "template-read-only-placeholder" : "#f6e6e6", - "word-wrap-marker" : "#ededed" + "BackgroundColor" : "#ffffff", + "CodeFolding" : "#94caef", + "BracketMatching" : "#edf9ff", + "CurrentLine" : "#f8f7f6", + "IconBorder" : "#d6d2d0", + "IndentationLine" : "#d2d2d2", + "LineNumbers" : "#221f1e", + "CurrentLineNumber" : "#221f1e", + "MarkBookmark" : "#0000ff", + "MarkBreakpointActive" : "#ff0000", + "MarkBreakpointReached" : "#ffff00", + "MarkBreakpointDisabled" : "#ff00ff", + "MarkExecution" : "#a0a0a4", + "MarkWarning" : "#00ff00", + "MarkError" : "#ff0000", + "ModifiedLines" : "#f6e6e6", + "ReplaceHighlight" : "#00ff00", + "SavedLines" : "#baf8ce", + "SearchHighlight" : "#ffff00", + "TextSelection" : "#94caef", + "Separator" : "#221f1e", + "SpellChecking" : "#bf0303", + "TabMarker" : "#d2d2d2", + "TemplateBackground" : "#d6d2d0", + "TemplatePlaceholder" : "#baf8ce", + "TemplateFocusedPlaceholder" : "#76da98", + "TemplateReadOnlyPlaceholder" : "#f6e6e6", + "WordWrapMarker" : "#ededed" } } diff --git a/src/libs/3rdparty/syntax-highlighting/data/themes/radical.theme b/src/libs/3rdparty/syntax-highlighting/data/themes/radical.theme new file mode 100644 index 00000000000..ec0eb8ca9f4 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/radical.theme @@ -0,0 +1,182 @@ +{ + "_comments": [ + "Last update: Sep 23, 2020 (revision 2)", + "This file has been converted from: https://github.com/dhedgecock/radical-vscode" + ], + "metadata": { + "copyright": [ + "SPDX-FileCopyrightText: 2018 Dan Hedgecock", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "name": "Radical", + "revision": 2 + }, + "editor-colors": { + "BackgroundColor": "#141322", + "BracketMatching": "#4f2e93", + "CodeFolding": "#1e1836", + "CurrentLine": "#231630", + "CurrentLineNumber": "#d0fff4", + "IconBorder": "#141322", + "IndentationLine": "#353541", + "LineNumbers": "#415e6c", + "MarkBookmark": "#391ab5", + "MarkBreakpointActive": "#fa61b8", + "MarkBreakpointDisabled": "#83fee8", + "MarkBreakpointReached": "#fffc7e", + "MarkError": "#fc0065", + "MarkExecution": "#c8ff00", + "MarkWarning": "#ffd000", + "ModifiedLines": "#a3ff57", + "ReplaceHighlight": "#ffb000", + "SavedLines": "#ffb000", + "SearchHighlight": "#642581", + "Separator": "#252531", + "SpellChecking": "#ff1767", + "TabMarker": "#2e2e3a", + "TemplateBackground": "#1c1a30", + "TemplateFocusedPlaceholder": "#ff428e", + "TemplatePlaceholder": "#242560", + "TemplateReadOnlyPlaceholder": "#1a1b46", + "TextSelection": "#4f2e93", + "WordWrapMarker": "#100f1a" + }, + "text-styles": { + "Alert": { + "background-color": "#2f183b", + "bold": true, + "selected-text-color": "#ff427b", + "text-color": "#ff427b" + }, + "Annotation": { + "selected-text-color": "#fda8bc", + "text-color": "#fda8bc" + }, + "Attribute": { + "selected-text-color": "#5af5f0", + "text-color": "#5af5f0" + }, + "BaseN": { + "selected-text-color": "#f834bb", + "text-color": "#f834bb" + }, + "BuiltIn": { + "selected-text-color": "#999ee1", + "text-color": "#999ee1" + }, + "Char": { + "selected-text-color": "#dff959", + "text-color": "#dff959" + }, + "Comment": { + "italic": true, + "selected-text-color": "#45898c", + "text-color": "#45898c" + }, + "CommentVar": { + "selected-text-color": "#a8c0c2", + "text-color": "#a8c0c2" + }, + "Constant": { + "bold": true, + "selected-text-color": "#fa61b8", + "text-color": "#fa61b8" + }, + "ControlFlow": { + "bold": true, + "selected-text-color": "#d5358f", + "text-color": "#d5358f" + }, + "DataType": { + "selected-text-color": "#ff85a1", + "text-color": "#ff85a1" + }, + "DecVal": { + "selected-text-color": "#fa61b8", + "text-color": "#fa61b8" + }, + "Documentation": { + "selected-text-color": "#75b7bb", + "text-color": "#75b7bb" + }, + "Error": { + "bold": true, + "italic": true, + "selected-text-color": "#ff427b", + "text-color": "#ff427b", + "underline": true + }, + "Extension": { + "bold": true, + "selected-text-color": "#a8ffdb", + "text-color": "#a8ffdb" + }, + "Float": { + "selected-text-color": "#f834bb", + "text-color": "#f834bb" + }, + "Function": { + "selected-text-color": "#a9fef7", + "text-color": "#a9fef7" + }, + "Import": { + "selected-text-color": "#a9fef7", + "text-color": "#a9fef7" + }, + "Information": { + "selected-text-color": "#ffd000", + "text-color": "#ffd000" + }, + "Keyword": { + "bold": true, + "selected-text-color": "#d5358f", + "text-color": "#d5358f" + }, + "Normal": { + "selected-text-color": "#7c9c9e", + "text-color": "#7c9c9e" + }, + "Operator": { + "selected-text-color": "#d5358f", + "text-color": "#d5358f" + }, + "Others": { + "selected-text-color": "#5effbd", + "text-color": "#5effbd" + }, + "Preprocessor": { + "selected-text-color": "#d5358f", + "text-color": "#d5358f" + }, + "RegionMarker": { + "background-color": "#242560", + "selected-text-color": "#baf7fc", + "text-color": "#baf7fc" + }, + "SpecialChar": { + "selected-text-color": "#c3f920", + "text-color": "#c3f920" + }, + "SpecialString": { + "selected-text-color": "#ff96aa", + "text-color": "#ff96aa" + }, + "String": { + "selected-text-color": "#a9fef7", + "text-color": "#a9fef7" + }, + "Variable": { + "selected-text-color": "#c7e3ee", + "text-color": "#c7e3ee" + }, + "VerbatimString": { + "selected-text-color": "#a8ffdb", + "text-color": "#a8ffdb" + }, + "Warning": { + "selected-text-color": "#ff427b", + "text-color": "#ff427b" + } + } +} 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 42a6eacbe8f..035e1db9c06 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-dark.theme @@ -1,6 +1,15 @@ { + "_comments": [ + "This theme has been adapted from: https://ethanschoonover.com/solarized/" + ], "metadata" : { - "revision" : 1, + "copyright": [ + "SPDX-FileCopyrightText: 2011 Ethan Schoonover", + "SPDX-FileCopyrightText: 2012 Dominik Haumann ", + "SPDX-FileCopyrightText: 2018 Andrew Crouthamel " + ], + "license": "SPDX-License-Identifier: MIT", + "revision" : 2, "name" : "Solarized Dark" }, "text-styles": { @@ -143,33 +152,33 @@ } }, "editor-colors": { - "background-color" : "#002b36", - "code-folding" : "#6c71c4", - "bracket-matching" : "#073642", - "current-line" : "#073642", - "icon-border" : "#073642", - "indentation-line" : "#073642", - "line-numbers" : "#586e75", - "current-line-number" : "#586e75", - "mark-bookmark" : "#268bd2", - "mark-breakpoint-active" : "#dc322f", - "mark-breakpoint-reached" : "#b58900", - "mark-breakpoint-disabled" : "#d33682", - "mark-execution" : "#586e75", - "mark-warning" : "#cb4b16", - "mark-error" : "#dc322f", - "modified-lines" : "#cb4b16", - "replace-highlight" : "#859900", - "saved-lines" : "#2aa198", - "search-highlight" : "#b58900", - "selection" : "#eee8d5", - "separator" : "#586e75", - "spell-checking" : "#dc322f", - "tab-marker" : "#586e75", - "template-background" : "#073642", - "template-placeholder" : "#073642", - "template-focused-placeholder" : "#073642", - "template-read-only-placeholder" : "#073642", - "word-wrap-marker" : "#586e75" + "BackgroundColor" : "#002b36", + "CodeFolding" : "#6c71c4", + "BracketMatching" : "#073642", + "CurrentLine" : "#073642", + "IconBorder" : "#073642", + "IndentationLine" : "#073642", + "LineNumbers" : "#586e75", + "CurrentLineNumber" : "#586e75", + "MarkBookmark" : "#268bd2", + "MarkBreakpointActive" : "#dc322f", + "MarkBreakpointReached" : "#b58900", + "MarkBreakpointDisabled" : "#d33682", + "MarkExecution" : "#586e75", + "MarkWarning" : "#cb4b16", + "MarkError" : "#dc322f", + "ModifiedLines" : "#cb4b16", + "ReplaceHighlight" : "#859900", + "SavedLines" : "#2aa198", + "SearchHighlight" : "#b58900", + "TextSelection" : "#eee8d5", + "Separator" : "#002b36", + "SpellChecking" : "#dc322f", + "TabMarker" : "#586e75", + "TemplateBackground" : "#073642", + "TemplatePlaceholder" : "#073642", + "TemplateFocusedPlaceholder" : "#073642", + "TemplateReadOnlyPlaceholder" : "#073642", + "WordWrapMarker" : "#586e75" } } 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 473f98add3c..8cab40db480 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/solarized-light.theme @@ -1,6 +1,15 @@ { + "_comments": [ + "This theme has been adapted from: https://ethanschoonover.com/solarized/" + ], "metadata" : { - "revision" : 1, + "copyright": [ + "SPDX-FileCopyrightText: 2011 Ethan Schoonover", + "SPDX-FileCopyrightText: 2012 Dominik Haumann ", + "SPDX-FileCopyrightText: 2018 Andrew Crouthamel " + ], + "license": "SPDX-License-Identifier: MIT", + "revision" : 2, "name" : "Solarized Light" }, "text-styles": { @@ -143,33 +152,33 @@ } }, "editor-colors": { - "background-color" : "#fdf6e3", - "code-folding" : "#6c71c4", - "bracket-matching" : "#eee8d5", - "current-line" : "#eee8d5", - "icon-border" : "#eee8d5", - "indentation-line" : "#eee8d5", - "line-numbers" : "#93a1a1", - "current-line-number" : "#93a1a1", - "mark-bookmark" : "#268bd2", - "mark-breakpoint-active" : "#dc322f", - "mark-breakpoint-reached" : "#b58900", - "mark-breakpoint-disabled" : "#d33682", - "mark-execution" : "#93a1a1", - "mark-warning" : "#cb4b16", - "mark-error" : "#dc322f", - "modified-lines" : "#cb4b16", - "replace-highlight" : "#859900", - "saved-lines" : "#2aa198", - "search-highlight" : "#b58900", - "selection" : "#073642", - "separator" : "#93a1a1", - "spell-checking" : "#dc322f", - "tab-marker" : "#93a1a1", - "template-background" : "#eee8d5", - "template-placeholder" : "#eee8d5", - "template-focused-placeholder" : "#eee8d5", - "template-read-only-placeholder" : "#eee8d5", - "word-wrap-marker" : "#93a1a1" + "BackgroundColor" : "#fdf6e3", + "CodeFolding" : "#6c71c4", + "BracketMatching" : "#eee8d5", + "CurrentLine" : "#eee8d5", + "IconBorder" : "#eee8d5", + "IndentationLine" : "#eee8d5", + "LineNumbers" : "#93a1a1", + "CurrentLineNumber" : "#93a1a1", + "MarkBookmark" : "#268bd2", + "MarkBreakpointActive" : "#dc322f", + "MarkBreakpointReached" : "#b58900", + "MarkBreakpointDisabled" : "#d33682", + "MarkExecution" : "#93a1a1", + "MarkWarning" : "#cb4b16", + "MarkError" : "#dc322f", + "ModifiedLines" : "#cb4b16", + "ReplaceHighlight" : "#859900", + "SavedLines" : "#2aa198", + "SearchHighlight" : "#b58900", + "TextSelection" : "#073642", + "Separator" : "#fdf6e3", + "SpellChecking" : "#dc322f", + "TabMarker" : "#93a1a1", + "TemplateBackground" : "#eee8d5", + "TemplatePlaceholder" : "#eee8d5", + "TemplateFocusedPlaceholder" : "#eee8d5", + "TemplateReadOnlyPlaceholder" : "#eee8d5", + "WordWrapMarker" : "#93a1a1" } } 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 46af4213b58..0a6f24385ac 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/theme-data.qrc @@ -1,10 +1,19 @@ - default.theme - breeze-dark.theme - printing.theme - solarized-dark.theme - solarized-light.theme + breeze-dark.theme + breeze-light.theme + ayu-dark.theme + ayu-light.theme + ayu-mirage.theme + dracula.theme + gruvbox-dark.theme + gruvbox-light.theme + nord.theme + printing.theme + radical.theme + solarized-dark.theme + solarized-light.theme + vim-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 new file mode 100644 index 00000000000..1a2c7785ac7 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/data/themes/vim-dark.theme @@ -0,0 +1,180 @@ +{ + "metadata" : { + "copyright": [ + "SPDX-FileCopyrightText: 2012 Dominik Haumann ", + "SPDX-FileCopyrightText: 2020 Nibaldo González " + ], + "license": "SPDX-License-Identifier: MIT", + "revision" : 3, + "name" : "Vim Dark" + }, + "text-styles": { + "Normal" : { + "text-color" : "#b2b2b2", + "selected-text-color" : "#b2b2b2", + "bold" : false, + "italic" : false, + "underline" : false, + "strike-through" : false + }, + "Keyword" : { + "text-color" : "#5fd7ff", + "selected-text-color" : "#e0ffff", + "bold" : true + }, + "Function" : { + "text-color" : "#cd00cd", + "selected-text-color" : "#cd00cd" + }, + "Variable" : { + "text-color" : "#06989a", + "selected-text-color" : "#06989a" + }, + "ControlFlow" : { + "text-color" : "#ffff54", + "selected-text-color" : "#ffff54", + "bold" : true + }, + "Operator" : { + "text-color" : "#b2b2b2", + "selected-text-color" : "#b2b2b2" + }, + "BuiltIn" : { + "text-color" : "#87ffaf", + "selected-text-color" : "#87ffaf", + "bold" : true + }, + "Extension" : { + "text-color" : "#0095ff", + "selected-text-color" : "#0095ff", + "bold" : true + }, + "Preprocessor" : { + "text-color" : "#87ffaf", + "selected-text-color" : "#87ffaf" + }, + "Attribute" : { + "text-color" : "#ffffaf", + "selected-text-color" : "#ffffaf" + }, + "Char" : { + "text-color" : "#ff5454", + "selected-text-color" : "#ff5454" + }, + "SpecialChar" : { + "text-color" : "#0095ff", + "selected-text-color" : "#0095ff" + }, + "String" : { + "text-color" : "#ff54ff", + "selected-text-color" : "#ff54ff" + }, + "VerbatimString" : { + "text-color" : "#ff54ff", + "selected-text-color" : "#ff54ff" + }, + "SpecialString" : { + "text-color" : "#ff5500", + "selected-text-color" : "#ff5500" + }, + "Import" : { + "text-color" : "#ff54ff", + "selected-text-color" : "#ff54ff" + }, + "DataType" : { + "text-color" : "#ffff54", + "selected-text-color" : "#ffff54" + }, + "DecVal" : { + "text-color" : "#ff8b8b", + "selected-text-color" : "#ff8b8b" + }, + "BaseN" : { + "text-color" : "#ff8b8b", + "selected-text-color" : "#ff8b8b" + }, + "Float" : { + "text-color" : "#ff8b8b", + "selected-text-color" : "#ff8b8b" + }, + "Constant" : { + "text-color" : "#af7f00", + "selected-text-color" : "#af7f00", + "bold" : true + }, + "Comment" : { + "text-color" : "#54ffff", + "selected-text-color" : "#54ffff" + }, + "Documentation" : { + "text-color" : "#e0ffff", + "selected-text-color" : "#e0ffff" + }, + "Annotation" : { + "text-color" : "#ff00ff", + "selected-text-color" : "#ff00ff" + }, + "CommentVar" : { + "text-color" : "#0095ff", + "selected-text-color" : "#0095ff" + }, + "RegionMarker" : { + "text-color" : "#0095ff", + "selected-text-color" : "#0095ff", + "background-color" : "#22226d" + }, + "Information" : { + "text-color" : "#ffaa00", + "selected-text-color" : "#ffaa00" + }, + "Warning" : { + "text-color" : "#ff0000", + "selected-text-color" : "#ed1515" + }, + "Alert" : { + "text-color" : "#ff0000", + "selected-text-color" : "#bf0303", + "background-color" : "#3f0000", + "bold" : true + }, + "Error" : { + "text-color" : "#ff5500", + "selected-text-color" : "#ff5500", + "underline" : true + }, + "Others" : { + "text-color" : "#54ff54", + "selected-text-color" : "#54ff54" + } + }, + "editor-colors": { + "BackgroundColor" : "#000000", + "CodeFolding" : "#002b26", + "BracketMatching" : "#4400aa", + "CurrentLine" : "#17003b", + "IconBorder" : "#000000", + "IndentationLine" : "#2a00d2", + "LineNumbers" : "#005d7a", + "CurrentLineNumber" : "#005d7a", + "MarkBookmark" : "#0000ff", + "MarkBreakpointActive" : "#ff0000", + "MarkBreakpointReached" : "#ffff00", + "MarkBreakpointDisabled" : "#ff00ff", + "MarkExecution" : "#a0a0a4", + "MarkWarning" : "#00ff00", + "MarkError" : "#ff0000", + "ModifiedLines" : "#54ff54", + "ReplaceHighlight" : "#54ff54", + "SavedLines" : "#5454ff", + "SearchHighlight" : "#ffff00", + "TextSelection" : "#232323", + "Separator" : "#003344", + "SpellChecking" : "#ff0000", + "TabMarker" : "#414141", + "TemplateBackground" : "#cccccc", + "TemplatePlaceholder" : "#ccffcc", + "TemplateFocusedPlaceholder" : "#66ff66", + "TemplateReadOnlyPlaceholder" : "#ffcccc", + "WordWrapMarker" : "#262626" + } +} 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 82207c00999..a178c1ba277 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 @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "ksyntaxhighlighting_version.h" @@ -26,6 +9,7 @@ #include #include #include +#include #include #include @@ -37,6 +21,25 @@ using namespace KSyntaxHighlighting; +template +static void applyHighlighter(Highlighter &highlighter, QCommandLineParser &parser, bool fromFileName, const QString &inFileName, const QCommandLineOption &stdinOption, const QCommandLineOption &outputName, const Ts &...highlightParams) +{ + if (parser.isSet(outputName)) + highlighter.setOutputFile(parser.value(outputName)); + else + highlighter.setOutputFile(stdout); + + if (fromFileName) { + highlighter.highlightFile(inFileName, highlightParams...); + } else if (parser.isSet(stdinOption)) { + QFile inFile; + inFile.open(stdin, QIODevice::ReadOnly); + highlighter.highlightData(&inFile, highlightParams...); + } else { + parser.showHelp(1); + } +} + int main(int argc, char **argv) { QCoreApplication app(argc, argv); @@ -45,6 +48,8 @@ int main(int argc, char **argv) QCoreApplication::setOrganizationName(QStringLiteral("KDE")); QCoreApplication::setApplicationVersion(QStringLiteral(SyntaxHighlighting_VERSION_STRING)); + Repository repo; + QCommandLineParser parser; parser.setApplicationDescription(app.translate("SyntaxHighlightingCLI", "Command line syntax highlighter using Kate syntax definitions.")); parser.addHelpOption(); @@ -69,9 +74,24 @@ int main(int argc, char **argv) parser.addOption(syntaxName); QCommandLineOption themeName( - QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), QStringLiteral("Default")); + QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), repo.defaultTheme(Repository::LightTheme).name()); parser.addOption(themeName); + QCommandLineOption outputFormatOption(QStringList() << QStringLiteral("f") << QStringLiteral("output-format"), + app.translate("SyntaxHighlightingCLI", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."), + app.translate("SyntaxHighlightingCLI", "format"), + QStringLiteral("html")); + parser.addOption(outputFormatOption); + + QCommandLineOption traceOption(QStringList() << QStringLiteral("syntax-trace"), + app.translate("SyntaxHighlightingCLI", "Add information to debug a syntax file. Only works with --output-format=ansi or ansi256Colors. Possible values are format, region and context."), + app.translate("SyntaxHighlightingCLI", "type")); + parser.addOption(traceOption); + + QCommandLineOption noAnsiEditorBg(QStringList() << QStringLiteral("b") << QStringLiteral("no-ansi-background"), + app.translate("SyntaxHighlightingCLI", "Disable ANSI background for the default color.")); + parser.addOption(noAnsiEditorBg); + QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"), app.translate("SyntaxHighlightingCLI", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."), app.translate("SyntaxHighlightingCLI", "title")); @@ -82,7 +102,6 @@ int main(int argc, char **argv) parser.process(app); - Repository repo; if (parser.isSet(listDefs)) { for (const auto &def : repo.definitions()) { std::cout << qPrintable(def.name()) << std::endl; @@ -113,41 +132,70 @@ int main(int argc, char **argv) Definition def; if (parser.isSet(syntaxName)) { - def = repo.definitionForName(parser.value(syntaxName)); - if (!def.isValid()) + const QString syntax = parser.value(syntaxName); + def = repo.definitionForName(syntax); + if (!def.isValid()) { /* see if it's a mimetype instead */ - def = repo.definitionForMimeType(parser.value(syntaxName)); + def = repo.definitionForMimeType(syntax); + if (!def.isValid()) { + /* see if it's a extension instead */ + def = repo.definitionForFileName(QLatin1String("f.")+syntax); + if (!def.isValid()) + /* see if it's a filename instead */ + def = repo.definitionForFileName(syntax); + } + } } else if (fromFileName) { def = repo.definitionForFileName(inFileName); } else { parser.showHelp(1); } - QString title; - if (parser.isSet(titleOption)) - title = parser.value(titleOption); - if (!def.isValid()) { std::cerr << "Unknown syntax." << std::endl; return 1; } - HtmlHighlighter highlighter; - highlighter.setDefinition(def); - if (parser.isSet(outputName)) - highlighter.setOutputFile(parser.value(outputName)); - else - highlighter.setOutputFile(stdout); - highlighter.setTheme(repo.theme(parser.value(themeName))); + QString outputFormat = parser.value(outputFormatOption); + if (0 == outputFormat.compare(QLatin1String("html"), Qt::CaseInsensitive)) { + QString title; + if (parser.isSet(titleOption)) + title = parser.value(titleOption); - if (fromFileName) { - highlighter.highlightFile(inFileName, title); - } else if (parser.isSet(stdinOption)) { - QFile inFile; - inFile.open(stdin, QIODevice::ReadOnly); - highlighter.highlightData(&inFile, title); + HtmlHighlighter highlighter; + highlighter.setDefinition(def); + highlighter.setTheme(repo.theme(parser.value(themeName))); + applyHighlighter(highlighter, parser, fromFileName, inFileName, stdinOption, outputName, title); } else { - parser.showHelp(1); + auto AnsiFormat = AnsiHighlighter::AnsiFormat::TrueColor; + if (0 == outputFormat.compare(QLatin1String("ansi256Colors"), Qt::CaseInsensitive)) { + AnsiFormat = AnsiHighlighter::AnsiFormat::XTerm256Color; + } else if (0 != outputFormat.compare(QLatin1String("ansi"), Qt::CaseInsensitive)) { + std::cerr << "Unknown output format." << std::endl; + return 2; + } + + auto debugOptions = AnsiHighlighter::TraceOptions(); + if (parser.isSet(traceOption)) { + const auto options = parser.values(traceOption); + for (auto const& option : options) { + if (option == QStringLiteral("format")) { + debugOptions |= AnsiHighlighter::TraceOption::Format; + } else if (option == QStringLiteral("region")) { + debugOptions |= AnsiHighlighter::TraceOption::Region; + } else if (option == QStringLiteral("context")) { + debugOptions |= AnsiHighlighter::TraceOption::Context; + } else { + std::cerr << "Unknown trace name." << std::endl; + return 2; + } + } + } + + AnsiHighlighter highlighter; + highlighter.setDefinition(def); + highlighter.setTheme(repo.theme(parser.value(themeName))); + applyHighlighter(highlighter, parser, fromFileName, inFileName, stdinOption, outputName, AnsiFormat, !parser.isSet(noAnsiEditorBg), debugOptions); } return 0; diff --git a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp index aeb4c2db557..b5d04934e6b 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/indexer/katehighlightingindexer.cpp @@ -1,24 +1,7 @@ /* - Copyright (C) 2014 Christoph Cullmann + SPDX-FileCopyrightText: 2014 Christoph Cullmann - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include @@ -35,6 +18,10 @@ #include #endif +#include "../lib/xml_p.h" + +using KSyntaxHighlighting::Xml::attrToBool; + namespace { QStringList readListing(const QString &fileName) @@ -138,7 +125,7 @@ bool checkRegularExpression(const QString &hlFilename, QXmlStreamReader &xml) } // dynamic == true and no place holder? - if (xml.name() == QLatin1String("RegExpr") && xml.attributes().value(QStringLiteral("dynamic")) == QStringLiteral("true")) { + if (xml.name() == QLatin1String("RegExpr") && attrToBool(xml.attributes().value(QStringLiteral("dynamic")))) { static const QRegularExpression placeHolder(QStringLiteral("%\\d+")); if (!string.contains(placeHolder)) { qWarning() << hlFilename << "line" << xml.lineNumber() << "broken regex:" << string << "problem: dynamic=true but no %\\d+ placeholder"; @@ -197,7 +184,7 @@ bool checkLookAhead(const QString &hlFilename, QXmlStreamReader &xml) { if (xml.attributes().hasAttribute(QStringLiteral("lookAhead"))) { auto lookAhead = xml.attributes().value(QStringLiteral("lookAhead")); - if (lookAhead == QStringLiteral("true")) { + if (attrToBool(lookAhead)) { auto context = xml.attributes().value(QStringLiteral("context")); if (context == QStringLiteral("#stay")) { qWarning() << hlFilename << "line" << xml.lineNumber() << "Infinite loop: lookAhead with context #stay"; @@ -368,9 +355,18 @@ public: language.existingContextNames.insert(name); } - if (xml.attributes().value(QLatin1String("fallthroughContext")).toString() == QLatin1String("#stay")) { - qWarning() << hlFilename << "possible infinite loop due to fallthroughContext=\"#stay\" in context " << name; - m_success = false; + auto fallthroughContext = xml.attributes().value(QLatin1String("fallthroughContext")); + if (!fallthroughContext.isEmpty()) { + if (fallthroughContext == QLatin1String("#stay")) { + qWarning() << hlFilename << "possible infinite loop due to fallthroughContext=\"#stay\" in context " << name; + m_success = false; + } + + auto fallthrough = xml.attributes().value(QLatin1String("fallthrough")); + if (fallthrough.isEmpty() && language.version < Version{5, 62}) { + qWarning() << hlFilename << "fallthroughContext attribute without fallthrough attribute is only valid with kateversion >= 5.62 in context " << name; + m_success = false; + } } processContext(hlName, xml.attributes().value(QLatin1String("lineEndContext")).toString()); @@ -692,8 +688,7 @@ int main(int argc, char *argv[]) hl[QStringLiteral("priority")] = xml.attributes().value(QLatin1String("priority")).toInt(); // add boolean one - const QString hidden = xml.attributes().value(QLatin1String("hidden")).toString(); - hl[QStringLiteral("hidden")] = (hidden == QLatin1String("true") || hidden == QLatin1String("1")); + hl[QStringLiteral("hidden")] = attrToBool(xml.attributes().value(QLatin1String("hidden"))); // remember hl hls[QFileInfo(hlFile).fileName()] = hl; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt index d208d48f5c4..97aeee3dbcf 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/CMakeLists.txt @@ -8,6 +8,7 @@ set(syntax_highlighting_srcs foldingregion.cpp format.cpp htmlhighlighter.cpp + ansihighlighter.cpp keywordlist.cpp rule.cpp definition.cpp @@ -17,6 +18,7 @@ set(syntax_highlighting_srcs theme.cpp wildcardmatcher.cpp themedata.cpp + worddelimiters.cpp ${syntax_highlighting_QM_LOADER} ) ecm_qt_declare_logging_category(syntax_highlighting_srcs diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp index fc5c6278120..5eefc3a48df 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.cpp @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "abstracthighlighter.h" diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h index 575a7235270..5e85873ce03 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_ABSTRACTHIGHLIGHTERM_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h index f1492df786b..6128beccfa0 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/abstracthighlighter_p.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_ABSTRACTHIGHLIGHTER_P_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp new file mode 100644 index 00000000000..abe5e8d2be5 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.cpp @@ -0,0 +1,1291 @@ +/* + SPDX-FileCopyrightText: 2020 Jonathan Poelen + + SPDX-License-Identifier: MIT +*/ + +#include "ansihighlighter.h" +#include "definition.h" +#include "format.h" +#include "ksyntaxhighlighting_logging.h" +#include "state.h" +#include "theme.h" +#include "state_p.h" +#include "context_p.h" +#include "definition_p.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace KSyntaxHighlighting; + +namespace +{ + struct CieLab + { + double l; + double a; + double b; + }; + + // xterm color reference + // constexpr Rgb888 xterm256Colors[] { + // {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x80, 0x00}, {0x80, 0x80, 0x00}, + // {0x00, 0x00, 0x80}, {0x80, 0x00, 0x80}, {0x00, 0x80, 0x80}, {0xc0, 0xc0, 0xc0}, + // {0x80, 0x80, 0x80}, {0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00}, + // {0x00, 0x00, 0xff}, {0xff, 0x00, 0xff}, {0x00, 0xff, 0xff}, {0xff, 0xff, 0xff}, + // {0x00, 0x00, 0x00}, {0x00, 0x00, 0x5f}, {0x00, 0x00, 0x87}, {0x00, 0x00, 0xaf}, + // {0x00, 0x00, 0xd7}, {0x00, 0x00, 0xff}, {0x00, 0x5f, 0x00}, {0x00, 0x5f, 0x5f}, + // {0x00, 0x5f, 0x87}, {0x00, 0x5f, 0xaf}, {0x00, 0x5f, 0xd7}, {0x00, 0x5f, 0xff}, + // {0x00, 0x87, 0x00}, {0x00, 0x87, 0x5f}, {0x00, 0x87, 0x87}, {0x00, 0x87, 0xaf}, + // {0x00, 0x87, 0xd7}, {0x00, 0x87, 0xff}, {0x00, 0xaf, 0x00}, {0x00, 0xaf, 0x5f}, + // {0x00, 0xaf, 0x87}, {0x00, 0xaf, 0xaf}, {0x00, 0xaf, 0xd7}, {0x00, 0xaf, 0xff}, + // {0x00, 0xd7, 0x00}, {0x00, 0xd7, 0x5f}, {0x00, 0xd7, 0x87}, {0x00, 0xd7, 0xaf}, + // {0x00, 0xd7, 0xd7}, {0x00, 0xd7, 0xff}, {0x00, 0xff, 0x00}, {0x00, 0xff, 0x5f}, + // {0x00, 0xff, 0x87}, {0x00, 0xff, 0xaf}, {0x00, 0xff, 0xd7}, {0x00, 0xff, 0xff}, + // {0x5f, 0x00, 0x00}, {0x5f, 0x00, 0x5f}, {0x5f, 0x00, 0x87}, {0x5f, 0x00, 0xaf}, + // {0x5f, 0x00, 0xd7}, {0x5f, 0x00, 0xff}, {0x5f, 0x5f, 0x00}, {0x5f, 0x5f, 0x5f}, + // {0x5f, 0x5f, 0x87}, {0x5f, 0x5f, 0xaf}, {0x5f, 0x5f, 0xd7}, {0x5f, 0x5f, 0xff}, + // {0x5f, 0x87, 0x00}, {0x5f, 0x87, 0x5f}, {0x5f, 0x87, 0x87}, {0x5f, 0x87, 0xaf}, + // {0x5f, 0x87, 0xd7}, {0x5f, 0x87, 0xff}, {0x5f, 0xaf, 0x00}, {0x5f, 0xaf, 0x5f}, + // {0x5f, 0xaf, 0x87}, {0x5f, 0xaf, 0xaf}, {0x5f, 0xaf, 0xd7}, {0x5f, 0xaf, 0xff}, + // {0x5f, 0xd7, 0x00}, {0x5f, 0xd7, 0x5f}, {0x5f, 0xd7, 0x87}, {0x5f, 0xd7, 0xaf}, + // {0x5f, 0xd7, 0xd7}, {0x5f, 0xd7, 0xff}, {0x5f, 0xff, 0x00}, {0x5f, 0xff, 0x5f}, + // {0x5f, 0xff, 0x87}, {0x5f, 0xff, 0xaf}, {0x5f, 0xff, 0xd7}, {0x5f, 0xff, 0xff}, + // {0x87, 0x00, 0x00}, {0x87, 0x00, 0x5f}, {0x87, 0x00, 0x87}, {0x87, 0x00, 0xaf}, + // {0x87, 0x00, 0xd7}, {0x87, 0x00, 0xff}, {0x87, 0x5f, 0x00}, {0x87, 0x5f, 0x5f}, + // {0x87, 0x5f, 0x87}, {0x87, 0x5f, 0xaf}, {0x87, 0x5f, 0xd7}, {0x87, 0x5f, 0xff}, + // {0x87, 0x87, 0x00}, {0x87, 0x87, 0x5f}, {0x87, 0x87, 0x87}, {0x87, 0x87, 0xaf}, + // {0x87, 0x87, 0xd7}, {0x87, 0x87, 0xff}, {0x87, 0xaf, 0x00}, {0x87, 0xaf, 0x5f}, + // {0x87, 0xaf, 0x87}, {0x87, 0xaf, 0xaf}, {0x87, 0xaf, 0xd7}, {0x87, 0xaf, 0xff}, + // {0x87, 0xd7, 0x00}, {0x87, 0xd7, 0x5f}, {0x87, 0xd7, 0x87}, {0x87, 0xd7, 0xaf}, + // {0x87, 0xd7, 0xd7}, {0x87, 0xd7, 0xff}, {0x87, 0xff, 0x00}, {0x87, 0xff, 0x5f}, + // {0x87, 0xff, 0x87}, {0x87, 0xff, 0xaf}, {0x87, 0xff, 0xd7}, {0x87, 0xff, 0xff}, + // {0xaf, 0x00, 0x00}, {0xaf, 0x00, 0x5f}, {0xaf, 0x00, 0x87}, {0xaf, 0x00, 0xaf}, + // {0xaf, 0x00, 0xd7}, {0xaf, 0x00, 0xff}, {0xaf, 0x5f, 0x00}, {0xaf, 0x5f, 0x5f}, + // {0xaf, 0x5f, 0x87}, {0xaf, 0x5f, 0xaf}, {0xaf, 0x5f, 0xd7}, {0xaf, 0x5f, 0xff}, + // {0xaf, 0x87, 0x00}, {0xaf, 0x87, 0x5f}, {0xaf, 0x87, 0x87}, {0xaf, 0x87, 0xaf}, + // {0xaf, 0x87, 0xd7}, {0xaf, 0x87, 0xff}, {0xaf, 0xaf, 0x00}, {0xaf, 0xaf, 0x5f}, + // {0xaf, 0xaf, 0x87}, {0xaf, 0xaf, 0xaf}, {0xaf, 0xaf, 0xd7}, {0xaf, 0xaf, 0xff}, + // {0xaf, 0xd7, 0x00}, {0xaf, 0xd7, 0x5f}, {0xaf, 0xd7, 0x87}, {0xaf, 0xd7, 0xaf}, + // {0xaf, 0xd7, 0xd7}, {0xaf, 0xd7, 0xff}, {0xaf, 0xff, 0x00}, {0xaf, 0xff, 0x5f}, + // {0xaf, 0xff, 0x87}, {0xaf, 0xff, 0xaf}, {0xaf, 0xff, 0xd7}, {0xaf, 0xff, 0xff}, + // {0xd7, 0x00, 0x00}, {0xd7, 0x00, 0x5f}, {0xd7, 0x00, 0x87}, {0xd7, 0x00, 0xaf}, + // {0xd7, 0x00, 0xd7}, {0xd7, 0x00, 0xff}, {0xd7, 0x5f, 0x00}, {0xd7, 0x5f, 0x5f}, + // {0xd7, 0x5f, 0x87}, {0xd7, 0x5f, 0xaf}, {0xd7, 0x5f, 0xd7}, {0xd7, 0x5f, 0xff}, + // {0xd7, 0x87, 0x00}, {0xd7, 0x87, 0x5f}, {0xd7, 0x87, 0x87}, {0xd7, 0x87, 0xaf}, + // {0xd7, 0x87, 0xd7}, {0xd7, 0x87, 0xff}, {0xd7, 0xaf, 0x00}, {0xd7, 0xaf, 0x5f}, + // {0xd7, 0xaf, 0x87}, {0xd7, 0xaf, 0xaf}, {0xd7, 0xaf, 0xd7}, {0xd7, 0xaf, 0xff}, + // {0xd7, 0xd7, 0x00}, {0xd7, 0xd7, 0x5f}, {0xd7, 0xd7, 0x87}, {0xd7, 0xd7, 0xaf}, + // {0xd7, 0xd7, 0xd7}, {0xd7, 0xd7, 0xff}, {0xd7, 0xff, 0x00}, {0xd7, 0xff, 0x5f}, + // {0xd7, 0xff, 0x87}, {0xd7, 0xff, 0xaf}, {0xd7, 0xff, 0xd7}, {0xd7, 0xff, 0xff}, + // {0xff, 0x00, 0x00}, {0xff, 0x00, 0x5f}, {0xff, 0x00, 0x87}, {0xff, 0x00, 0xaf}, + // {0xff, 0x00, 0xd7}, {0xff, 0x00, 0xff}, {0xff, 0x5f, 0x00}, {0xff, 0x5f, 0x5f}, + // {0xff, 0x5f, 0x87}, {0xff, 0x5f, 0xaf}, {0xff, 0x5f, 0xd7}, {0xff, 0x5f, 0xff}, + // {0xff, 0x87, 0x00}, {0xff, 0x87, 0x5f}, {0xff, 0x87, 0x87}, {0xff, 0x87, 0xaf}, + // {0xff, 0x87, 0xd7}, {0xff, 0x87, 0xff}, {0xff, 0xaf, 0x00}, {0xff, 0xaf, 0x5f}, + // {0xff, 0xaf, 0x87}, {0xff, 0xaf, 0xaf}, {0xff, 0xaf, 0xd7}, {0xff, 0xaf, 0xff}, + // {0xff, 0xd7, 0x00}, {0xff, 0xd7, 0x5f}, {0xff, 0xd7, 0x87}, {0xff, 0xd7, 0xaf}, + // {0xff, 0xd7, 0xd7}, {0xff, 0xd7, 0xff}, {0xff, 0xff, 0x00}, {0xff, 0xff, 0x5f}, + // {0xff, 0xff, 0x87}, {0xff, 0xff, 0xaf}, {0xff, 0xff, 0xd7}, {0xff, 0xff, 0xff}, + // {0x08, 0x08, 0x08}, {0x12, 0x12, 0x12}, {0x1c, 0x1c, 0x1c}, {0x26, 0x26, 0x26}, + // {0x30, 0x30, 0x30}, {0x3a, 0x3a, 0x3a}, {0x44, 0x44, 0x44}, {0x4e, 0x4e, 0x4e}, + // {0x58, 0x58, 0x58}, {0x62, 0x62, 0x62}, {0x6c, 0x6c, 0x6c}, {0x76, 0x76, 0x76}, + // {0x80, 0x80, 0x80}, {0x8a, 0x8a, 0x8a}, {0x94, 0x94, 0x94}, {0x9e, 0x9e, 0x9e}, + // {0xa8, 0xa8, 0xa8}, {0xb2, 0xb2, 0xb2}, {0xbc, 0xbc, 0xbc}, {0xc6, 0xc6, 0xc6}, + // {0xd0, 0xd0, 0xd0}, {0xda, 0xda, 0xda}, {0xe4, 0xe4, 0xe4}, {0xee, 0xee, 0xee}, + // }; + + // xterm color represented in CIELAB (D65) + // see rgbToLab() + constexpr CieLab xterm240Labs[] { + // ignore the first 16 colors as they are unpredictable (user configurable) + // { 0.000000, 0.000000, 0.000000}, + // { 25.535531, 48.045128, 38.057321}, + // { 46.227431, -51.698496, 49.896846}, + // { 51.868943, -12.929464, 56.674579}, + // { 12.971967, 47.502281, -64.702162}, + // { 29.784667, 58.927896, -36.487077}, + // { 48.254093, -28.846304, -8.476886}, + // { 77.704367, -0.000013, 0.000005}, + // { 53.585016, -0.000010, 0.000004}, + // { 53.240794, 80.092460, 67.203197}, + // { 87.734722, -86.182716, 83.179321}, + // { 97.139267, -21.553748, 94.477975}, + // { 32.297011, 79.187520, -107.860162}, + // { 60.324212, 98.234312, -60.824892}, + // { 91.113220, -48.087528, -14.131186}, + // { 100.000004, -0.000017, 0.000007}, + // 240 colors mode + { 0.000000, 0.000000, 0.000000}, + { 7.460661, 38.391030, -52.344094}, + { 14.108800, 49.366227, -67.241015}, + { 20.416780, 59.708756, -81.328423}, + { 26.461219, 69.619186, -94.827275}, + { 32.297011, 79.187520, -107.860162}, + { 34.362921, -41.841471, 40.383330}, + { 36.003172, -23.346362, -6.860652}, + { 37.721074, -8.280292, -28.838129}, + { 40.044712, 8.050351, -49.077929}, + { 42.896244, 24.232072, -67.665859}, + { 46.179103, 39.611555, -84.835619}, + { 48.669178, -53.727096, 51.854752}, + { 49.680825, -41.468213, 12.871276}, + { 50.775364, -29.978206, -8.809511}, + { 52.309747, -16.087685, -29.668380}, + { 54.271652, -0.984531, -49.346593}, + { 56.628677, 14.436593, -67.825764}, + { 62.217771, -64.983255, 62.718643}, + { 62.913963, -56.274791, 30.552786}, + { 63.677487, -47.533738, 9.989760}, + { 64.765216, -36.258826, -10.655158}, + { 66.184274, -23.179986, -30.659176}, + { 67.928678, -9.021871, -49.792238}, + { 75.200318, -75.769144, 73.128652}, + { 75.714081, -69.238116, 46.415771}, + { 76.281325, -62.437099, 27.358874}, + { 77.096125, -53.317791, 7.414754}, + { 78.170587, -42.277048, -12.423696}, + { 79.508487, -29.803889, -31.743841}, + { 87.734722, -86.182716, 83.179321}, + { 88.132543, -81.079314, 60.784276}, + { 88.573418, -75.649889, 43.369240}, + { 89.209664, -68.192330, 24.408752}, + { 90.053903, -58.903863, 5.054882}, + { 91.113220, -48.087528, -14.131186}, + { 17.616214, 38.884668, 27.208161}, + { 21.055194, 47.692487, -29.530317}, + { 24.265489, 55.109279, -50.109929}, + { 28.188460, 63.497258, -68.189398}, + { 32.565034, 72.278448, -84.495140}, + { 37.209055, 81.157734, -99.539334}, + { 38.928802, -10.464285, 45.868796}, + { 40.317682, -0.000008, 0.000003}, + { 41.792415, 9.716881, -22.184768}, + { 43.816568, 21.358548, -42.829511}, + { 46.341283, 33.910621, -61.915173}, + { 49.295490, 46.651030, -79.609352}, + { 51.565360, -31.106941, 55.362293}, + { 52.493892, -22.366057, 17.186391}, + { 53.502318, -13.755714, -4.459620}, + { 54.922246, -2.860324, -25.412901}, + { 56.747662, 9.522785, -45.263794}, + { 58.953975, 22.669708, -63.961919}, + { 64.235031, -48.203292, 65.170137}, + { 64.897084, -41.171043, 33.487406}, + { 65.624132, -33.963343, 13.012989}, + { 66.661569, -24.464553, -7.626328}, + { 68.017831, -13.189300, -27.680081}, + { 69.689139, -0.708182, -46.900093}, + { 76.698001, -62.880681, 74.951857}, + { 77.195429, -57.221495, 48.537298}, + { 77.744943, -51.270878, 29.570908}, + { 78.534816, -43.206116, 9.664419}, + { 79.577356, -33.321295, -10.175418}, + { 80.876952, -22.010117, -29.524777}, + { 88.898351, -75.968373, 84.597226}, + { 89.287443, -71.354717, 62.392493}, + { 89.718758, -66.422134, 45.055576}, + { 90.341414, -59.608536, 26.140485}, + { 91.167986, -51.063898, 6.804468}, + { 92.205709, -41.038767, -12.384583}, + { 27.165347, 49.930374, 40.136706}, + { 29.358410, 55.725044, -15.903001}, + { 31.581214, 61.240172, -37.918796}, + { 34.491549, 68.043425, -57.611837}, + { 37.945003, 75.652936, -75.432962}, + { 41.798486, 83.706896, -91.791834}, + { 43.266004, 9.134592, 50.930049}, + { 44.465039, 16.311047, 6.512751}, + { 45.750668, 23.372978, -15.766712}, + { 47.534439, 32.300943, -36.702982}, + { 49.787278, 42.444465, -56.184495}, + { 52.457917, 53.224022, -74.320646}, + { 54.532058, -13.436804, 58.898437}, + { 55.385516, -6.768114, 21.580884}, + { 56.315467, -0.000010, 0.000004}, + { 57.630008, 8.825705, -21.021347}, + { 59.328134, 19.179536, -41.022229}, + { 61.391858, 30.508200, -59.920728}, + { 66.374922, -33.335627, 67.745825}, + { 67.003415, -27.527170, 36.582861}, + { 67.694487, -21.482419, 16.212526}, + { 68.682127, -13.384693, -4.410654}, + { 69.975892, -3.594073, -24.507224}, + { 71.574010, 7.447858, -43.809975}, + { 78.315904, -50.585277, 76.909139}, + { 78.796543, -45.651434, 50.818542}, + { 79.327805, -40.421790, 31.953767}, + { 80.091978, -33.269832, 12.092110}, + { 81.101528, -24.409844, -7.745063}, + { 82.361425, -14.154994, -27.121909}, + { 90.168532, -65.770182, 86.138290}, + { 90.548420, -61.599052, 64.141611}, + { 90.969646, -57.119911, 46.891522}, + { 91.577948, -50.900805, 28.027875}, + { 92.385840, -43.052445, 8.713289}, + { 93.400696, -33.779293, -10.477090}, + { 36.208754, 60.391097, 50.573778}, + { 37.739975, 64.495259, -2.438323}, + { 39.353431, 68.650313, -25.128730}, + { 41.549773, 74.070366, -45.863018}, + { 44.264011, 80.458448, -64.848646}, + { 47.410429, 87.520359, -82.356598}, + { 48.637025, 27.330267, 57.029239}, + { 49.649655, 32.345900, 14.536338}, + { 50.745209, 37.483199, -7.743369}, + { 52.280931, 44.249599, -28.930913}, + { 54.244425, 52.280310, -48.806029}, + { 56.603189, 61.178271, -67.411894}, + { 58.455996, 5.073270, 63.495100}, + { 59.223239, 10.069966, 27.347971}, + { 60.062286, 15.267320, 5.894811}, + { 61.253487, 22.225763, -15.176012}, + { 62.800706, 30.633519, -35.336720}, + { 64.692889, 40.111206, -54.465103}, + { 69.308960, -16.251898, 71.238024}, + { 69.895406, -11.599340, 40.796840}, + { 70.541246, -6.687200, 20.584981}, + { 71.466005, -0.000013, 0.000005}, + { 72.680407, 8.238495, -20.139565}, + { 74.184959, 17.716313, -39.540668}, + { 80.579920, -35.513903, 79.627400}, + { 81.038448, -31.346986, 53.992269}, + { 81.545637, -26.892900, 35.276028}, + { 82.275842, -20.742163, 15.484099}, + { 83.241675, -13.032556, -4.342368}, + { 84.448794, -3.993322, -23.750841}, + { 91.967824, -52.701251, 88.309654}, + { 92.335220, -49.036719, 66.608006}, + { 92.742744, -45.081868, 49.483561}, + { 93.331530, -39.558175, 30.696050}, + { 94.113989, -32.535991, 11.415203}, + { 95.097663, -24.169464, -7.773705}, + { 44.874337, 70.414781, 59.082945}, + { 46.012582, 73.488282, 10.528988}, + { 47.236695, 76.706186, -12.348562}, + { 48.940884, 81.051413, -33.681818}, + { 51.101856, 86.364529, -53.475339}, + { 53.674597, 92.446330, -71.879038}, + { 54.695304, 43.548940, 63.726908}, + { 55.544895, 47.195327, 23.494868}, + { 56.470786, 51.029166, 1.345906}, + { 57.779848, 56.225393, -20.000213}, + { 59.471313, 62.597129, -40.204567}, + { 61.527524, 69.897355, -59.241373}, + { 63.159654, 22.859865, 68.897396}, + { 63.839588, 26.634208, 34.185583}, + { 64.585756, 30.632858, 12.941230}, + { 65.649581, 36.098152, -8.134153}, + { 67.038832, 42.864229, -28.433915}, + { 68.748596, 50.691293, -47.788927}, + { 72.964214, 1.430076, 75.529188}, + { 73.503895, 5.119471, 45.996429}, + { 74.099224, 9.062101, 26.005435}, + { 74.953413, 14.504783, 5.492273}, + { 76.078172, 21.324042, -14.677149}, + { 77.476211, 29.315742, -34.177868}, + { 83.468499, -18.949380, 83.062075}, + { 83.900955, -15.492587, 58.010021}, + { 84.379703, -11.768724, 39.493278}, + { 85.069678, -6.579078, 19.801555}, + { 85.983569, -0.000015, 0.000006}, + { 87.127728, 7.813055, -19.437771}, + { 94.298345, -37.668200, 91.102418}, + { 94.650453, -34.512373, 69.782914}, + { 95.041192, -31.089517, 52.825519}, + { 95.606040, -26.280220, 34.142079}, + { 96.357251, -20.119939, 14.910613}, + { 97.302528, -12.715984, -4.270744}, + { 53.240794, 80.092460, 67.203197}, + { 54.125781, 82.492192, 22.910970}, + { 55.088767, 85.054618, 0.168144}, + { 56.447798, 88.591017, -21.450672}, + { 58.199846, 93.025112, -41.765998}, + { 60.324212, 98.234312, -60.824892}, + { 61.177753, 58.007184, 70.725237}, + { 61.892577, 60.769076, 32.940064}, + { 62.675958, 63.722867, 11.059157}, + { 63.790979, 67.805180, -10.333124}, + { 65.243976, 72.929281, -30.773134}, + { 67.027700, 78.950491, -50.165199}, + { 68.456202, 39.347025, 74.858462}, + { 69.054426, 42.256401, 41.778310}, + { 69.712953, 45.379691, 20.832601}, + { 70.655381, 49.714784, -0.184657}, + { 71.892132, 55.183573, -20.579895}, + { 73.423104, 61.643523, -40.132156}, + { 77.236080, 18.715563, 80.467683}, + { 77.727829, 21.651859, 52.000981}, + { 78.271171, 24.819797, 32.297655}, + { 79.052359, 29.242703, 11.899654}, + { 80.083760, 34.862654, -8.273975}, + { 81.369962, 41.554730, -27.861347}, + { 86.930570, -1.923749, 87.132036}, + { 87.334594, 0.925621, 62.778902}, + { 87.782260, 4.015632, 44.514668}, + { 88.428154, 8.356443, 24.958589}, + { 89.284922, 13.915222, 5.202570}, + { 90.359536, 20.594187, -14.254942}, + { 97.139267, -21.553748, 94.477975}, + { 97.473993, -18.866927, 73.623332}, + { 97.845623, -15.939407, 56.875584}, + { 98.383182, -11.803189, 38.326889}, + { 99.098697, -6.467219, 19.163906}, + { 100.000004, -0.000017, 0.000007}, + { 2.193399, -0.000001, 0.000000}, + { 5.463889, -0.000002, 0.000001}, + { 10.268185, -0.000004, 0.000002}, + { 15.159721, -0.000004, 0.000002}, + { 19.865535, -0.000005, 0.000002}, + { 24.421321, -0.000006, 0.000002}, + { 28.851904, -0.000006, 0.000003}, + { 33.175474, -0.000007, 0.000003}, + { 37.405892, -0.000008, 0.000003}, + { 41.554045, -0.000008, 0.000003}, + { 45.628691, -0.000009, 0.000004}, + { 49.637017, -0.000009, 0.000004}, + { 53.585016, -0.000010, 0.000004}, + { 57.477759, -0.000011, 0.000004}, + { 61.319585, -0.000011, 0.000004}, + { 65.114248, -0.000012, 0.000005}, + { 68.865021, -0.000012, 0.000005}, + { 72.574786, -0.000013, 0.000005}, + { 76.246094, -0.000013, 0.000005}, + { 79.881220, -0.000014, 0.000006}, + { 83.482203, -0.000014, 0.000006}, + { 87.050883, -0.000015, 0.000006}, + { 90.588923, -0.000015, 0.000006}, + { 94.097838, -0.000016, 0.000006}, + }; + + // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + constexpr double sRGB_D65[] { + 0.4124564, 0.3575761, 0.1804375, + 0.2126729, 0.7151522, 0.0721750, + 0.0193339, 0.1191920, 0.9503041, + }; + + // http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html + constexpr double illuminant_D65[] { + 0.95047, 1.00000, 1.08883, + }; + + // convert a sRGB (D65) color to CIELAB (D65) + 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) + return c / (255.0 * 12.92); + else + return std::pow((c / 255.0 + 0.055) / 1.055, 2.4); + }; + + const double r = inverseGammaCompanding(qRed(rgb)); + const double g = inverseGammaCompanding(qGreen(rgb)); + const double b = inverseGammaCompanding(qBlue(rgb)); + + const double x = (r * sRGB_D65[0] + g * sRGB_D65[1] + b * sRGB_D65[2]); + const double y = (r * sRGB_D65[3] + g * sRGB_D65[4] + b * sRGB_D65[5]); + const double z = (r * sRGB_D65[6] + g * sRGB_D65[7] + b * sRGB_D65[8]); + + // http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_Lab.html + auto f = [](double t) { + if (t > 216.0 / 24389.0) + return std::cbrt(t); + else + return t * (24389.0 / (27.0 * 116.0)) + 4.0 / 29.0; + }; + + const double f_x = f(x / illuminant_D65[0]); + const double f_y = f(y / illuminant_D65[1]); + const double f_z = f(z / illuminant_D65[2]); + + return CieLab{ + 116.0 * f_y - 16.0, + 500.0 * (f_x - f_y), + 200.0 * (f_y - f_z), + }; + } + + + constexpr double epsilon = 1e-15; + + inline double sinDegree(double x) { return std::sin(x * M_PI / 180.0); } + + inline double cosDegree(double x) { return std::cos(x * M_PI / 180.0); } + + inline double pow2(double x) { return x * x; } + + inline double computeHPrime(double a_prime, double b) + { + 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; + } + + inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime) + { + if (C1_prime * C2_prime < epsilon) + return 0.0; + + const double diff = h2_prime - h1_prime; + + if (std::abs(diff) <= 180.0) + return diff; + else if (diff > 180.0) + return diff - 360.0; + 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) + return sum; + + const double dist = std::abs(h1_prime - h2_prime); + + if (dist <= 180.0) + return 0.5 * sum; + else if (sum < 360.0) + return 0.5 * (sum + 360.0); + else + return 0.5 * (sum - 360.0); + } + + /// Calculate the perceptual color difference based on CIEDE2000. + /// https://en.wikipedia.org/wiki/Color_difference#CIEDE2000 + /// \return The color difference of the two colors. + double calculate_CIEDE2000(const CieLab& color1, const CieLab& color2) + { + const double L1 = color1.l; + const double a1 = color1.a; + const double b1 = color1.b; + const double L2 = color2.l; + const double a2 = color2.a; + const double b2 = color2.b; + + const double _25_pow_7 = /*std::pow(25.0, 7.0) = */6103515625.0; + + const double C1_ab = std::sqrt(a1 * a1 + b1 * b1); + const double C2_ab = std::sqrt(a2 * a2 + b2 * b2); + const double C_ab_bar = 0.5 * (C1_ab + C2_ab); + const double c_ab_bar_pow_7 = std::pow(C_ab_bar, 7.0); + const double G = 0.5 * (1.0 - std::sqrt(c_ab_bar_pow_7 / (c_ab_bar_pow_7 + _25_pow_7))); + const double a1_prime = (1.0 + G) * a1; + const double a2_prime = (1.0 + G) * a2; + const double C1_prime = std::sqrt(a1_prime * a1_prime + b1 * b1); + const double C2_prime = std::sqrt(a2_prime * a2_prime + b2 * b2); + const double h1_prime = computeHPrime(a1_prime, b1); + const double h2_prime = computeHPrime(a2_prime, b2); + + const double deltaL_prime = L2 - L1; + const double deltaC_prime = C2_prime - C1_prime; + const double deltah_prime = computeDeltaHPrime(C1_prime, C2_prime, h1_prime, h2_prime); + const double deltaH_prime = 2.0 * std::sqrt(C1_prime * C2_prime) * sinDegree(0.5 * deltah_prime); + + const double L_primeBar = 0.5 * (L1 + L2); + const double C_primeBar = 0.5 * (C1_prime + C2_prime); + const double h_primeBar = computeHPrimeBar(C1_prime, C2_prime, h1_prime, h2_prime); + + const double T = 1.0 + - 0.17 * cosDegree(h_primeBar - 30.0) + + 0.24 * cosDegree(2.0 * h_primeBar) + + 0.32 * cosDegree(3.0 * h_primeBar + 6.0) + - 0.20 * cosDegree(4.0 * h_primeBar - 63.0); + + const double C_primeBar_pow7 = std::pow(C_primeBar, 7.0); + const double R_C = 2.0 * std::sqrt(C_primeBar_pow7 / (C_primeBar_pow7 + _25_pow_7)); + const double S_L = 1.0 + (0.015 * pow2(L_primeBar - 50.0)) + / std::sqrt(20.0 + pow2(L_primeBar - 50.0)); + const double S_C = 1.0 + 0.045 * C_primeBar; + const double S_H = 1.0 + 0.015 * C_primeBar * T; + const double R_T = -R_C * sinDegree(60.0 * std::exp(-pow2((h_primeBar - 275) / 25.0))); + + constexpr double kL = 1.0; + constexpr double kC = 1.0; + constexpr double kH = 1.0; + + const double deltaL = deltaL_prime / (kL * S_L); + const double deltaC = deltaC_prime / (kC * S_C); + const double deltaH = deltaH_prime / (kH * S_H); + + return /*std::sqrt*/( deltaL * deltaL + + deltaC * deltaC + + deltaH * deltaH + + R_T * deltaC * deltaH); + } + + struct AnsiBuffer + { + using ColorCache = QMap; + + void append(char c) + { + Q_ASSERT(remaining() >= 1); + m_data[m_size] = c; + ++m_size; + } + + void append(QLatin1String str) + { + Q_ASSERT(remaining() >= str.size()); + memcpy(m_data + m_size, str.data(), str.size()); + m_size += str.size(); + } + + void appendForeground(QRgb rgb, bool is256Colors, ColorCache& colorCache) + { + append(QLatin1String("38;")); + append(rgb, is256Colors, colorCache); + } + + void appendBackground(QRgb rgb, bool is256Colors, ColorCache& colorCache) + { + append(QLatin1String("48;")); + append(rgb, is256Colors, colorCache); + } + + void append(QRgb rgb, bool is256Colors, ColorCache& colorCache) + { + auto appendUInt8 = [&](int x){ + Q_ASSERT(x <= 255 && x >= 0); + if (x > 99) { + if (x >= 200) { + append('2'); + x -= 200; + } + else { + append('1'); + x -= 100; + } + } else if (x < 10) { + append(char('0' + x)); + return ; + } + + constexpr char const* tb2digits = + "00" "01" "02" "03" "04" "05" "06" "07" "08" "09" + "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" + "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" + "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" + "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" + "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" + "60" "61" "62" "63" "64" "65" "66" "67" "68" "69" + "70" "71" "72" "73" "74" "75" "76" "77" "78" "79" + "80" "81" "82" "83" "84" "85" "86" "87" "88" "89" + "90" "91" "92" "93" "94" "95" "96" "97" "98" "99" + ; + auto* p = tb2digits + x * 2; + append(p[0]); + append(p[1]); + }; + + if (is256Colors) { + double dist = 1e24; + int idx = 0; + auto it = colorCache.find(rgb); + if (it == colorCache.end()) { + const auto lab = rgbToLab(rgb); + // find the nearest xterm color + for (CieLab const& xtermLab : xterm240Labs) { + auto dist2 = calculate_CIEDE2000(lab, xtermLab); + if (dist2 < dist) { + dist = dist2; + idx = &xtermLab - xterm240Labs; + } + } + // add 16 to convert 240 colors mode to 256 colors mode + idx += 16; + colorCache.insert(rgb, idx); + } + else { + idx = it.value(); + } + + append('5'); + append(';'); + appendUInt8(idx); + } else { + append('2'); + append(';'); + appendUInt8(qRed(rgb)); + append(';'); + appendUInt8(qGreen(rgb)); + append(';'); + appendUInt8(qBlue(rgb)); + } + append(';'); + } + + // Replace last character with 'm'. Last character must be ';' + void setFinalStyle() + { + Q_ASSERT(m_data[m_size-1] == ';'); + m_data[m_size-1] = 'm'; + } + + void clear() + { + m_size = 0; + } + + QLatin1String latin1() const + { + return QLatin1String(m_data, m_size); + } + + private: + char m_data[128]; + int m_size = 0; + + int remaining() const noexcept + { + return 128 - m_size; + } + }; + + void fillString(QString &s, int n, const QString &fill) + { + if (n > 0) { + for (; n > fill.size(); n -= fill.size()) { + s += fill; + } + s += fill.left(n); + } + } + + struct GraphLine + { + QString graphLine; + QString labelLine; + int graphLineLength = 0; + int labelLineLength = 0; + int nextLabelOffset = 0; + + template + void pushLabel(int offset, String const& s, int charCounter) + { + Q_ASSERT(offset >= labelLineLength); + const int n = offset - labelLineLength; + labelLineLength += charCounter + n; + fillLine(labelLine, n); + labelLine += s; + nextLabelOffset = labelLineLength; + } + + template + void pushGraph(int offset, String const& s, int charCounter) + { + Q_ASSERT(offset >= graphLineLength); + const int n = offset - graphLineLength; + graphLineLength += charCounter + n; + fillLine(graphLine, n); + const int ps1 = graphLine.size(); + graphLine += s; + if (offset >= labelLineLength) { + const int n2 = offset - labelLineLength; + labelLineLength += n2 + 1; + fillLine(labelLine, n2); + labelLine += graphLine.rightRef(graphLine.size() - ps1); + } + } + + private: + static void fillLine(QString& s, int n) + { + Q_ASSERT(n >= 0); + fillString(s, n, QStringLiteral( + " " + " " + " " + )); + } + }; + + /** + * Returns the first free line at a given position or create a new one + */ + GraphLine& lineAtOffset(std::vector &graphLines, int offset) + { + const auto last = graphLines.end(); + auto p = std::find_if(graphLines.begin(), last, [=](GraphLine const& line) { + return line.nextLabelOffset < offset; + }); + if (p == last) { + graphLines.emplace_back(); + return graphLines.back(); + } + return *p; + } + + // disable bold, italic and underline on | + const QLatin1String graphSymbol("\x1b[21;23;24m|"); + // reverse video + const QLatin1String nameStyle("\x1b[7m"); + + /** + * ANSI Highlighter dedicated to traces + */ + class DebugSyntaxHighlighter : public KSyntaxHighlighting::AbstractHighlighter + { + public: + using TraceOption = KSyntaxHighlighting::AnsiHighlighter::TraceOption; + using TraceOptions = KSyntaxHighlighting::AnsiHighlighter::TraceOptions; + + void setDefinition(const KSyntaxHighlighting::Definition & def) override + { + AbstractHighlighter::setDefinition(def); + m_defData = DefinitionData::get(def); + m_contextCapture.setDefinition(def); + } + + void highlightData(QTextStream &in, QTextStream &out, QLatin1String infoStyle, QLatin1String editorBackground, const std::vector> &ansiStyles, TraceOptions traceOptions) + { + initRegionStyles(ansiStyles); + + m_hasFormatTrace = traceOptions.testFlag(TraceOption::Format); + m_hasRegionTrace = traceOptions.testFlag(TraceOption::Region); + const bool hasContextTrace = traceOptions.testFlag(TraceOption::Context); + const bool hasFormatOrContextTrace = m_hasFormatTrace || hasContextTrace; + + const bool hasSeparator = hasFormatOrContextTrace && m_hasRegionTrace; + const QString resetBgColor = (editorBackground.isEmpty() ? QStringLiteral("\x1b[0m") : editorBackground); + + bool firstLine = true; + State state; + while (!in.atEnd()) { + const QString currentLine = in.readLine(); + auto oldState = state; + state = highlightLine(currentLine, state); + + if (hasSeparator) { + if (!firstLine) + out << QStringLiteral("\x1b[0m────────────────────────────────────────────────────\x1b[K\n"); + firstLine = false; + } + + if (!m_regions.empty()) { + printRegions(out, infoStyle, currentLine.size()); + out << resetBgColor; + } + + for (const auto &fragment : m_highlightedFragments) { + auto const& ansiStyle = ansiStyles[fragment.formatId]; + out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second; + } + + out << QStringLiteral("\x1b[K\n"); + + if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) { + if (hasContextTrace) + appendContextNames(oldState, currentLine); + + printFormats(out, infoStyle, ansiStyles); + out << resetBgColor; + } + + m_highlightedFragments.clear(); + } + } + + void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &format) override + { + m_highlightedFragments.push_back({m_hasFormatTrace ? format.name() : QString(), offset, length, format.id()}); + } + + void applyFolding(int offset, int /*length*/, FoldingRegion region) override + { + if (!m_hasRegionTrace) return; + + const auto id = region.id(); + + if (region.type() == FoldingRegion::Begin) { + m_regions.push_back(Region{m_regionDepth, offset, -1, id, Region::State::Open}); + ++m_regionDepth; + } else { + // find open region + auto it = m_regions.rbegin(); + 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) + ++depth; + else if (--depth < 0) + break; + } + } + + if (it != eit) { + it->bindIndex = int(m_regions.size()); + int bindIndex = int(&*it - m_regions.data()); + m_regions.push_back(Region{it->depth, offset, bindIndex, id, Region::State::Close}); + } else { + m_regions.push_back(Region{-1, offset, -1, id, Region::State::Close}); + } + + m_regionDepth = std::max(m_regionDepth-1, 0); + } + } + + using KSyntaxHighlighting::AbstractHighlighter::highlightLine; + + private: + /** + * Initializes with colors of \p ansiStyle without duplicate. + */ + void initRegionStyles(const std::vector> &ansiStyles) + { + m_regionStyles.resize(ansiStyles.size()); + 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()); + } + + /** + * Append the context name in front of the format name. + */ + void appendContextNames(State &state, const QString ¤tLine) + { + auto newState = state; + for (auto &fragment : m_highlightedFragments) { + QString contextName = extractContextName(StateData::get(newState)); + + m_contextCapture.offsetNext = 0; + m_contextCapture.lengthNext = 0; + // truncate the line to deduce the context from the format + const auto lineFragment = currentLine.mid(0, fragment.offset + fragment.length + 1); + newState = m_contextCapture.highlightLine(lineFragment, state); + + // Deduced context does not start at the position of the format. + // This can happen because of lookAhead/fallthrought attribute, + // assertion in regex, etc. + if (m_contextCapture.offset != fragment.offset && m_contextCapture.length != fragment.length) { + contextName.insert(0, QLatin1Char('~')); + } + fragment.name.insert(0, contextName); + } + } + + /** + * \return Current context name with definition name if different + * from the current definition name + */ + QString extractContextName(StateData *stateData) const + { + // first state is empty + if (stateData->isEmpty()) { + return QStringLiteral("[???]"); + } + + const auto context = stateData->topContext(); + const auto defData = DefinitionData::get(context->definition()); + const auto contextName = (defData != m_defData) + ? QString(QLatin1Char('<') % defData->name % QLatin1Char('>')) + : QString(); + return QString(contextName % QLatin1Char('[') % context->name() % QLatin1Char(']')); + } + + void printFormats(QTextStream &out, QLatin1String regionStyle, const std::vector> &ansiStyles) + { + // init graph + m_formatGraph.clear(); + for (auto const& fragment : m_highlightedFragments) { + GraphLine& line = lineAtOffset(m_formatGraph, fragment.offset); + auto const& style = ansiStyles[fragment.formatId].first; + line.pushLabel(fragment.offset, style % nameStyle % fragment.name % regionStyle, fragment.name.size()); + + for (GraphLine* pline = m_formatGraph.data(); pline <= &line; ++pline) { + pline->pushGraph(fragment.offset, style % graphSymbol % regionStyle, 1); + } + } + + // display graph + out << regionStyle; + auto first = m_formatGraph.begin(); + auto last = m_formatGraph.end(); + --last; + for (; first != last; ++first) { + out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\n"; + } + out << first->graphLine << "\x1b[K\n" << first->labelLine << "\x1b[K\x1b[0m\n"; + } + + void printRegions(QTextStream &out, QLatin1String regionStyle, int lineLength) + { + const QString continuationLine = QStringLiteral( + "------------------------------" + "------------------------------" + "------------------------------"); + + bool hasContinuation = false; + + m_regionGraph.clear(); + QString label; + QString numStr; + + // init graph + for (Region& region : m_regions) { + if (region.state == Region::State::Continuation) { + hasContinuation = true; + continue; + } + + auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style){ + for (GraphLine* pline = m_regionGraph.data(); pline <= endline; ++pline) { + // a label can hide a graph + if (pline->graphLineLength <= offset) { + pline->pushGraph(offset, style % graphSymbol % regionStyle, 1); + } + } + }; + + QChar openChar; + QChar closeChar; + int lpad = 0; + int rpad = 0; + + int offsetLabel = region.offset; + + numStr.setNum(region.regionId); + + if (region.state == Region::State::Open) { + openChar = QLatin1Char('('); + if (region.bindIndex == -1) { + rpad = lineLength - region.offset - numStr.size(); + } else { + rpad = m_regions[region.bindIndex].offset - region.offset - 2; + closeChar = QLatin1Char(')'); + } + // close without open + } else if (region.bindIndex == -1) { + closeChar = QLatin1Char('>'); + // label already present, we only display the graph + } else if (m_regions[region.bindIndex].state == Region::State::Open) { + const auto &openRegion = m_regions[region.bindIndex]; + // here offset is a graph index + const GraphLine &line = m_regionGraph[openRegion.offset]; + const auto &style = m_regionStyles[openRegion.depth % m_regionStyles.size()]; + pushGraphs(region.offset, &line, style); + continue; + } else { + closeChar = QLatin1Char(')'); + lpad = region.offset - numStr.size(); + offsetLabel = 0; + } + + const QStringView openS(&openChar, openChar.unicode() ? 1 : 0); + const QStringView closeS(&closeChar, closeChar.unicode() ? 1 : 0); + + label.clear(); + fillString(label, lpad, continuationLine); + label += numStr; + fillString(label, rpad, continuationLine); + + GraphLine &line = lineAtOffset(m_regionGraph, offsetLabel); + const auto &style = m_regionStyles[region.depth % m_regionStyles.size()]; + line.pushLabel(offsetLabel, style % nameStyle % openS % label % closeS % regionStyle, label.size() + openS.size() + closeS.size()); + pushGraphs(region.offset, &line, style); + + // transforms offset into graph index when region is on 1 line + if (region.state == Region::State::Open && region.bindIndex != -1) { + region.offset = &line - m_regionGraph.data(); + } + } + + out << regionStyle; + + // display regions which are neither closed nor open + if (hasContinuation) { + label.clear(); + fillString(label, lineLength ? lineLength : 5, continuationLine); + for (const auto ®ion : m_regions) { + if (region.state == Region::State::Continuation && region.bindIndex == -1) { + const auto &style = m_regionStyles[region.depth % m_regionStyles.size()]; + out << style << nameStyle << label << regionStyle << "\x1b[K\n"; + } + } + } + + // display graph + if (!m_regionGraph.empty()) { + auto first = m_regionGraph.rbegin(); + auto last = m_regionGraph.rend(); + --last; + for (; first != last; ++first) { + out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\n"; + } + out << first->labelLine << "\x1b[K\n" << first->graphLine << "\x1b[K\x1b[0m\n"; + } + + // keep regions that are not closed + m_regions.erase(std::remove_if(m_regions.begin(), m_regions.end(), [](Region const& region){ + return region.bindIndex != -1 || region.state == Region::State::Close; + }), m_regions.end()); + // all remaining regions become Continuation + for (auto& region : m_regions) { + region.offset = 0; + region.state = Region::State::Continuation; + } + } + + struct HighlightFragment + { + QString name; + int offset; + int length; + quint16 formatId; + }; + + struct ContextCaptureHighlighter : KSyntaxHighlighting::AbstractHighlighter + { + int offset; + int length; + int offsetNext; + int lengthNext; + + void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &/*format*/) override + { + offset = offsetNext; + length = lengthNext; + offsetNext = offset; + lengthNext = length; + } + + using KSyntaxHighlighting::AbstractHighlighter::highlightLine; + }; + + struct Region + { + enum class State : int8_t + { + Open, + Close, + Continuation, + }; + + int depth; + int offset; + int bindIndex; + quint16 regionId; + State state; + }; + + bool m_hasFormatTrace; + bool m_hasRegionTrace; + + std::vector m_highlightedFragments; + std::vector m_formatGraph; + ContextCaptureHighlighter m_contextCapture; + DefinitionData* m_defData; + + int m_regionDepth = 0; + std::vector m_regions; + std::vector m_regionGraph; + std::vector m_regionStyles; + }; +} // anonymous namespace + +class KSyntaxHighlighting::AnsiHighlighterPrivate +{ +public: + QTextStream out; + QFile file; + QString currentLine; + // pairs of startColor / resetColor + std::vector> ansiStyles; +}; + +AnsiHighlighter::AnsiHighlighter() + : d(new AnsiHighlighterPrivate()) +{ +} + +AnsiHighlighter::~AnsiHighlighter() = default; + +void AnsiHighlighter::setOutputFile(const QString &fileName) +{ + if (d->file.isOpen()) { + d->file.close(); + } + d->file.setFileName(fileName); + if (!d->file.open(QFile::WriteOnly | QFile::Truncate)) { + qCWarning(Log) << "Failed to open output file" << fileName << ":" << d->file.errorString(); + return; + } + d->out.setDevice(&d->file); + d->out.setCodec("UTF-8"); +} + +void AnsiHighlighter::setOutputFile(FILE *fileHandle) +{ + d->file.open(fileHandle, QIODevice::WriteOnly); + d->out.setDevice(&d->file); + d->out.setCodec("UTF-8"); +} + +void AnsiHighlighter::highlightFile(const QString &fileName, AnsiFormat format, bool useEditorBackground, TraceOptions traceOptions) +{ + QFileInfo fi(fileName); + QFile f(fileName); + if (!f.open(QFile::ReadOnly)) { + qCWarning(Log) << "Failed to open input file" << fileName << ":" << f.errorString(); + return; + } + + highlightData(&f, format, useEditorBackground, traceOptions); +} + +void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useEditorBackground, TraceOptions traceOptions) +{ + if (!d->out.device()) { + qCWarning(Log) << "No output stream defined!"; + return; + } + + const auto is256Colors = (format == AnsiFormat::XTerm256Color); + const auto theme = this->theme(); + const auto definition = this->definition(); + + auto definitions = definition.includedDefinitions(); + definitions.append(definition); + + AnsiBuffer::ColorCache colorCache; + + AnsiBuffer foregroundColorBuffer; + AnsiBuffer backgroundColorBuffer; + QLatin1String foregroundDefaultColor; + QLatin1String backgroundDefaultColor; + + // https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters + + if (useEditorBackground) { + const QRgb foregroundColor = theme.textColor(Theme::Normal); + const QRgb backgroundColor = theme.editorColor(Theme::BackgroundColor); + foregroundColorBuffer.appendForeground(foregroundColor, is256Colors, colorCache); + backgroundColorBuffer.append(QLatin1String("\x1b[")); + backgroundColorBuffer.appendBackground(backgroundColor, is256Colors, colorCache); + foregroundDefaultColor = foregroundColorBuffer.latin1(); + backgroundDefaultColor = backgroundColorBuffer.latin1().mid(2); + } + + // initialize ansiStyles + for (auto&& definition : qAsConst(definitions)) { + const auto formats = definition.formats(); + for (auto&& format : formats) { + const auto id = format.id(); + if (id >= d->ansiStyles.size()) { + // better than id + 1 to avoid successive allocations + d->ansiStyles.resize(std::max(std::size_t(id*2), std::size_t(32))); + } + + AnsiBuffer buffer; + + buffer.append(QLatin1String("\x1b[")); + + const bool hasFg = format.hasTextColor(theme); + const bool hasBg = format.hasBackgroundColor(theme); + const bool hasBold = format.isBold(theme); + const bool hasItalic = format.isItalic(theme); + const bool hasUnderline = format.isUnderline(theme); + const bool hasStrikeThrough = format.isStrikeThrough(theme); + + if (hasFg) + buffer.appendForeground(format.textColor(theme).rgb(), is256Colors, colorCache); + else + buffer.append(foregroundDefaultColor); + if (hasBg) buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache); + if (hasBold) buffer.append(QLatin1String("1;")); + if (hasItalic) buffer.append(QLatin1String("3;")); + if (hasUnderline) buffer.append(QLatin1String("4;")); + if (hasStrikeThrough) buffer.append(QLatin1String("9;")); + + // if there is ANSI style + if (buffer.latin1().size() > 2) { + buffer.setFinalStyle(); + d->ansiStyles[id].first = buffer.latin1(); + + if (useEditorBackground) { + buffer.clear(); + const bool hasEffect = hasBold || hasItalic || hasUnderline || hasStrikeThrough; + if (hasBg) { + buffer.append(hasEffect ? QLatin1String("\x1b[0;") : QLatin1String("\x1b[")); + buffer.append(backgroundDefaultColor); + buffer.setFinalStyle(); + d->ansiStyles[id].second = buffer.latin1(); + } else if (hasEffect) { + buffer.append(QLatin1String("\x1b[")); + if (hasBold) buffer.append(QLatin1String("21;")); + if (hasItalic) buffer.append(QLatin1String("23;")); + if (hasUnderline) buffer.append(QLatin1String("24;")); + if (hasStrikeThrough) buffer.append(QLatin1String("29;")); + buffer.setFinalStyle(); + d->ansiStyles[id].second = buffer.latin1(); + } + } else { + d->ansiStyles[id].second = QStringLiteral("\x1b[0m"); + } + } + } + } + + if (useEditorBackground) { + backgroundColorBuffer.setFinalStyle(); + backgroundDefaultColor = backgroundColorBuffer.latin1(); + d->out << backgroundDefaultColor; + } + + QTextStream in(dev); + in.setCodec("UTF-8"); + + if (!traceOptions) { + State state; + while (!in.atEnd()) { + d->currentLine = in.readLine(); + state = highlightLine(d->currentLine, state); + + if (useEditorBackground) + d->out << QStringLiteral("\x1b[K\n"); + else + d->out << QLatin1Char('\n'); + } + } else { + AnsiBuffer buffer; + buffer.append(QLatin1String("\x1b[0;")); + buffer.appendBackground(theme.editorColor(useEditorBackground ? Theme::TemplateBackground : Theme::BackgroundColor), is256Colors, colorCache); + buffer.setFinalStyle(); + DebugSyntaxHighlighter debugHighlighter; + debugHighlighter.setDefinition(definition); + debugHighlighter.highlightData(in, d->out, buffer.latin1(), backgroundDefaultColor, d->ansiStyles, traceOptions); + } + + if (useEditorBackground) { + d->out << QStringLiteral("\x1b[0m"); + } + + d->out.setDevice(nullptr); + d->file.close(); + d->ansiStyles.clear(); +} + +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; +} diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h new file mode 100644 index 00000000000..65937992340 --- /dev/null +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h @@ -0,0 +1,60 @@ +/* + SPDX-FileCopyrightText: 2020 Jonathan Poelen + + SPDX-License-Identifier: MIT +*/ + +#ifndef KSYNTAXHIGHLIGHTING_ANSIHIGHLIGHTER_H +#define KSYNTAXHIGHLIGHTING_ANSIHIGHLIGHTER_H + +#include "abstracthighlighter.h" +#include "ksyntaxhighlighting_export.h" + +#include +#include +#include + +#include + +namespace KSyntaxHighlighting +{ +class AnsiHighlighterPrivate; + +class KSYNTAXHIGHLIGHTING_EXPORT AnsiHighlighter final : public AbstractHighlighter +{ +public: + enum class AnsiFormat + { + TrueColor, + XTerm256Color, + }; + + enum class TraceOption + { + NoOptions, + Format = 1 << 0, + Region = 1 << 1, + Context = 1 << 2, + }; + Q_DECLARE_FLAGS(TraceOptions, TraceOption) + + AnsiHighlighter(); + ~AnsiHighlighter() override; + + void highlightFile(const QString &fileName, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions()); + void highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions()); + + void setOutputFile(const QString &fileName); + void setOutputFile(FILE *fileHandle); + +protected: + void applyFormat(int offset, int length, const Format &format) override; + +private: + std::unique_ptr d; +}; +} + +Q_DECLARE_OPERATORS_FOR_FLAGS(KSyntaxHighlighting::AnsiHighlighter::TraceOptions) + +#endif // KSYNTAXHIGHLIGHTING_ANSIHIGHLIGHTER_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp index 2327cfe584e..4d83da3d05a 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context.cpp @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "context_p.h" @@ -57,13 +41,13 @@ void Context::load(QXmlStreamReader &reader) Q_ASSERT(reader.name() == QLatin1String("context")); Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement); - m_name = reader.attributes().value(QStringLiteral("name")).toString(); - m_attribute = reader.attributes().value(QStringLiteral("attribute")).toString(); - m_lineEndContext.parse(reader.attributes().value(QStringLiteral("lineEndContext"))); - m_lineEmptyContext.parse(reader.attributes().value(QStringLiteral("lineEmptyContext"))); - m_fallthroughContext.parse(reader.attributes().value(QStringLiteral("fallthroughContext"))); + m_name = reader.attributes().value(QLatin1String("name")).toString(); + m_attribute = reader.attributes().value(QLatin1String("attribute")).toString(); + m_lineEndContext.parse(reader.attributes().value(QLatin1String("lineEndContext"))); + m_lineEmptyContext.parse(reader.attributes().value(QLatin1String("lineEmptyContext"))); + m_fallthroughContext.parse(reader.attributes().value(QLatin1String("fallthroughContext"))); m_fallthrough = !m_fallthroughContext.isStay(); - m_noIndentationBasedFolding = Xml::attrToBool(reader.attributes().value(QStringLiteral("noIndentationBasedFolding"))); + m_noIndentationBasedFolding = Xml::attrToBool(reader.attributes().value(QLatin1String("noIndentationBasedFolding"))); reader.readNext(); while (!reader.atEnd()) { @@ -73,7 +57,7 @@ void Context::load(QXmlStreamReader &reader) if (rule) { rule->setDefinition(m_def.definition()); if (rule->load(reader)) - m_rules.push_back(rule); + m_rules.push_back(std::move(rule)); } else { reader.skipCurrentElement(); } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/context_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/context_p.h index 5d23ee24001..62630455370 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/context_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/context_p.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_CONTEXT_P_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp index 8d353b91745..1ec47591038 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch.cpp @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "contextswitch_p.h" diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h index 46579fcb613..e861cbaded4 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/contextswitch_p.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_CONTEXTSWITCH_P_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp index c0fa860dc93..0b6975d7756 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.cpp @@ -1,26 +1,10 @@ /* - Copyright (C) 2016 Volker Krause - Copyright (C) 2018 Dominik Haumann - Copyright (C) 2018 Christoph Cullmann + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2018 Dominik Haumann + SPDX-FileCopyrightText: 2018 Christoph Cullmann + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "definition.h" @@ -36,6 +20,7 @@ #include "repository_p.h" #include "rule_p.h" #include "xml_p.h" +#include "worddelimiters_p.h" #include #include @@ -50,7 +35,7 @@ using namespace KSyntaxHighlighting; DefinitionData::DefinitionData() - : wordDelimiters(QStringLiteral("\t !%&()*+,-./:;<=>?[\\]^{|}~")) // must be sorted! + : wordDelimiters() , wordWrapDelimiters(wordDelimiters) { } @@ -76,8 +61,8 @@ Definition::Definition(const Definition &other) d->q = *this; } -Definition::Definition(const std::shared_ptr &dd) - : d(dd) +Definition::Definition(std::shared_ptr &&dd) + : d(std::move(dd)) { } @@ -179,13 +164,13 @@ QString Definition::license() const bool Definition::isWordDelimiter(QChar c) const { d->load(); - return d->isWordDelimiter(c); + return d->wordDelimiters.contains(c); } bool Definition::isWordWrapDelimiter(QChar c) const { d->load(); - return std::binary_search(d->wordWrapDelimiters.constBegin(), d->wordWrapDelimiters.constEnd(), c); + return d->wordWrapDelimiters.contains(c); } bool Definition::foldingEnabled() const @@ -346,11 +331,6 @@ KeywordList *DefinitionData::keywordList(const QString &wantedName) return (it == keywordLists.end()) ? nullptr : &it.value(); } -bool DefinitionData::isWordDelimiter(QChar c) const -{ - return std::binary_search(wordDelimiters.constBegin(), wordDelimiters.constEnd(), c); -} - Format DefinitionData::formatByName(const QString &wantedName) const { const auto it = formats.constFind(wantedName); @@ -407,7 +387,6 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords) context->resolveAttributeFormat(); } - Q_ASSERT(std::is_sorted(wordDelimiters.constBegin(), wordDelimiters.constEnd())); return true; } @@ -427,7 +406,7 @@ void DefinitionData::clear() license.clear(); mimetypes.clear(); extensions.clear(); - wordDelimiters = QStringLiteral("\t !%&()*+,-./:;<=>?[\\]^{|}~"); // must be sorted! + wordDelimiters = WordDelimiters(); wordWrapDelimiters = wordDelimiters; caseSensitive = Qt::CaseSensitive; version = 0.0f; @@ -470,10 +449,18 @@ bool DefinitionData::loadMetaData(const QString &file, const QCborMap &obj) fileName = file; const auto exts = obj.value(QLatin1String("extensions")).toString(); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts)) +#else for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) +#endif extensions.push_back(ext); const auto mts = obj.value(QLatin1String("mimetype")).toString(); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts)) +#else for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) +#endif mimetypes.push_back(mt); return true; @@ -484,27 +471,35 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader) Q_ASSERT(reader.name() == QLatin1String("language")); Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement); - if (!checkKateVersion(reader.attributes().value(QStringLiteral("kateversion")))) + if (!checkKateVersion(reader.attributes().value(QLatin1String("kateversion")))) return false; - name = reader.attributes().value(QStringLiteral("name")).toString(); - section = reader.attributes().value(QStringLiteral("section")).toString(); + name = reader.attributes().value(QLatin1String("name")).toString(); + section = reader.attributes().value(QLatin1String("section")).toString(); // toFloat instead of toInt for backward compatibility with old Kate files - version = reader.attributes().value(QStringLiteral("version")).toFloat(); - priority = reader.attributes().value(QStringLiteral("priority")).toInt(); - hidden = Xml::attrToBool(reader.attributes().value(QStringLiteral("hidden"))); - style = reader.attributes().value(QStringLiteral("style")).toString(); - indenter = reader.attributes().value(QStringLiteral("indenter")).toString(); - author = reader.attributes().value(QStringLiteral("author")).toString(); - license = reader.attributes().value(QStringLiteral("license")).toString(); - const auto exts = reader.attributes().value(QStringLiteral("extensions")).toString(); + version = reader.attributes().value(QLatin1String("version")).toFloat(); + priority = reader.attributes().value(QLatin1String("priority")).toInt(); + hidden = Xml::attrToBool(reader.attributes().value(QLatin1String("hidden"))); + style = reader.attributes().value(QLatin1String("style")).toString(); + indenter = reader.attributes().value(QLatin1String("indenter")).toString(); + author = reader.attributes().value(QLatin1String("author")).toString(); + license = reader.attributes().value(QLatin1String("license")).toString(); + const auto exts = reader.attributes().value(QLatin1String("extensions")).toString(); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts)) +#else for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) +#endif extensions.push_back(ext); - const auto mts = reader.attributes().value(QStringLiteral("mimetype")).toString(); + const auto mts = reader.attributes().value(QLatin1String("mimetype")).toString(); +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts)) +#else for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts)) +#endif mimetypes.push_back(mt); - if (reader.attributes().hasAttribute(QStringLiteral("casesensitive"))) - caseSensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; + if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) + caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; return true; } @@ -631,25 +626,27 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader) ++elementRefCounter; if (reader.name() == QLatin1String("keywords")) { - if (reader.attributes().hasAttribute(QStringLiteral("casesensitive"))) - caseSensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; + if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) + caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; - // adapt sorted wordDelimiters - wordDelimiters += reader.attributes().value(QStringLiteral("additionalDeliminator")); - std::sort(wordDelimiters.begin(), wordDelimiters.end()); - auto it = std::unique(wordDelimiters.begin(), wordDelimiters.end()); - wordDelimiters.truncate(std::distance(wordDelimiters.begin(), it)); - for (const auto c : reader.attributes().value(QLatin1String("weakDeliminator"))) + // adapt wordDelimiters + for (QChar c : reader.attributes().value(QLatin1String("additionalDeliminator"))) + wordDelimiters.append(c); + for (QChar c : reader.attributes().value(QLatin1String("weakDeliminator"))) wordDelimiters.remove(c); - // adaptWordWrapDelimiters, and sort - wordWrapDelimiters = reader.attributes().value(QStringLiteral("wordWrapDeliminator")).toString(); - std::sort(wordWrapDelimiters.begin(), wordWrapDelimiters.end()); - if (wordWrapDelimiters.isEmpty()) + // adapt WordWrapDelimiters + auto wordWrapDeliminatorAttr = reader.attributes().value( + QLatin1String("wordWrapDeliminator")); + if (wordWrapDeliminatorAttr.isEmpty()) wordWrapDelimiters = wordDelimiters; + else { + for (QChar c : wordWrapDeliminatorAttr) + wordWrapDelimiters.append(c); + } } else if (reader.name() == QLatin1String("folding")) { - if (reader.attributes().hasAttribute(QStringLiteral("indentationsensitive"))) - indentationBasedFolding = Xml::attrToBool(reader.attributes().value(QStringLiteral("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")) { @@ -688,14 +685,14 @@ void DefinitionData::loadComments(QXmlStreamReader &reader) case QXmlStreamReader::StartElement: ++elementRefCounter; if (reader.name() == QLatin1String("comment")) { - const bool isSingleLine = reader.attributes().value(QStringLiteral("name")) == QStringLiteral("singleLine"); + const bool isSingleLine = reader.attributes().value(QLatin1String("name")) == QLatin1String("singleLine"); if (isSingleLine) { - singleLineCommentMarker = reader.attributes().value(QStringLiteral("start")).toString(); - const bool afterWhiteSpace = reader.attributes().value(QStringLiteral("position")).toString() == QStringLiteral("afterwhitespace"); + singleLineCommentMarker = reader.attributes().value(QLatin1String("start")).toString(); + const bool afterWhiteSpace = reader.attributes().value(QLatin1String("position")).toString() == QLatin1String("afterwhitespace"); singleLineCommentPosition = afterWhiteSpace ? CommentPosition::AfterWhitespace : CommentPosition::StartOfLine; } else { - multiLineCommentStartMarker = reader.attributes().value(QStringLiteral("start")).toString(); - multiLineCommentEndMarker = reader.attributes().value(QStringLiteral("end")).toString(); + multiLineCommentStartMarker = reader.attributes().value(QLatin1String("start")).toString(); + multiLineCommentEndMarker = reader.attributes().value(QLatin1String("end")).toString(); } } reader.readNext(); @@ -727,7 +724,7 @@ void DefinitionData::loadFoldingIgnoreList(QXmlStreamReader &reader) case QXmlStreamReader::StartElement: ++elementRefCounter; if (reader.name() == QLatin1String("emptyLine")) { - foldingIgnoreList << reader.attributes().value(QStringLiteral("regexpr")).toString(); + foldingIgnoreList << reader.attributes().value(QLatin1String("regexpr")).toString(); } reader.readNext(); break; @@ -758,9 +755,9 @@ void DefinitionData::loadSpellchecking(QXmlStreamReader &reader) case QXmlStreamReader::StartElement: ++elementRefCounter; if (reader.name() == QLatin1String("encoding")) { - const auto charRef = reader.attributes().value(QStringLiteral("char")); + const auto charRef = reader.attributes().value(QLatin1String("char")); if (!charRef.isEmpty()) { - const auto str = reader.attributes().value(QStringLiteral("string")).toString(); + const auto str = reader.attributes().value(QLatin1String("string")).toString(); characterEncodings.push_back({charRef[0], str}); } } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h index 3219bf03b9e..8226fbdd24f 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition.h @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_DEFINITION_H @@ -401,7 +385,7 @@ public: private: friend class DefinitionData; friend class DefinitionRef; - explicit Definition(const std::shared_ptr &dd); + explicit Definition(std::shared_ptr &&dd); std::shared_ptr d; }; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h index 9e707908ba6..274f7640b51 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definition_p.h @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_DEFINITION_P_H @@ -26,6 +10,7 @@ #include "definition.h" #include "definitionref_p.h" +#include "worddelimiters_p.h" #include #include @@ -73,7 +58,6 @@ public: void resolveIncludeKeywords(); KeywordList *keywordList(const QString &name); - bool isWordDelimiter(QChar c) const; Context *initialContext() const; Context *contextByName(const QString &name) const; @@ -88,8 +72,8 @@ public: QHash keywordLists; QVector contexts; QHash formats; - QString wordDelimiters; - QString wordWrapDelimiters; + WordDelimiters wordDelimiters; + WordDelimiters wordWrapDelimiters; bool keywordIsLoaded = false; bool hasFoldingRegions = false; bool indentationBasedFolding = false; diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp index b76e2157787..35bb29f82f1 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "definitiondownloader.h" diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.h b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.h index a1300d57e61..db0c6ee68ae 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_DEFINITIONDOWNLOADER_H 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 0e072db415f..25a1a749e49 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitionref_p.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_DEFINITIONREF_P_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.cpp index 72a410cb2a7..3bca63eecda 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.cpp @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "foldingregion.h" diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h index ea26aba9b22..ca4cacafb25 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/foldingregion.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_FOLDINGREGION_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp index adc78e2e634..716ff197af2 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.cpp @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "format.h" @@ -113,14 +97,14 @@ Theme::TextStyle Format::textStyle() const bool Format::isDefaultTextStyle(const Theme &theme) const { - return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal)) && (selectedBackgroundColor(theme) == theme.selectedBackgroundColor(Theme::Normal)) && + // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! + return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal)) && (selectedBackgroundColor(theme) == QColor::fromRgba(theme.selectedBackgroundColor(Theme::Normal))) && (isBold(theme) == theme.isBold(Theme::Normal)) && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal)) && (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal)); } bool Format::hasTextColor(const Theme &theme) const { - const auto overrideStyle = d->styleOverride(theme); - return textColor(theme) != theme.textColor(Theme::Normal) && (d->style.textColor || theme.textColor(d->defaultStyle) || overrideStyle.textColor); + return textColor(theme) != theme.textColor(Theme::Normal) && (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor); } QColor Format::textColor(const Theme &theme) const @@ -141,8 +125,8 @@ QColor Format::selectedTextColor(const Theme &theme) const bool Format::hasBackgroundColor(const Theme &theme) const { - const auto overrideStyle = d->styleOverride(theme); - return backgroundColor(theme) != theme.backgroundColor(Theme::Normal) && (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || overrideStyle.backgroundColor); + // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! + return backgroundColor(theme) != QColor::fromRgba(theme.backgroundColor(Theme::Normal)) && (d->style.backgroundColor || theme.backgroundColor(d->defaultStyle) || d->styleOverride(theme).backgroundColor); } QColor Format::backgroundColor(const Theme &theme) const @@ -150,7 +134,9 @@ QColor Format::backgroundColor(const Theme &theme) const const auto overrideStyle = d->styleOverride(theme); if (overrideStyle.backgroundColor) return overrideStyle.backgroundColor; - return d->style.backgroundColor ? d->style.backgroundColor : theme.backgroundColor(d->defaultStyle); + + // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! + return d->style.backgroundColor ? d->style.backgroundColor : QColor::fromRgba(theme.backgroundColor(d->defaultStyle)); } QColor Format::selectedBackgroundColor(const Theme &theme) const @@ -158,7 +144,9 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const const auto overrideStyle = d->styleOverride(theme); if (overrideStyle.selectedBackgroundColor) return overrideStyle.selectedBackgroundColor; - return d->style.selectedBackgroundColor ? d->style.selectedBackgroundColor : theme.selectedBackgroundColor(d->defaultStyle); + + // use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! + return d->style.selectedBackgroundColor ? d->style.selectedBackgroundColor : QColor::fromRgba(theme.selectedBackgroundColor(d->defaultStyle)); } bool Format::isBold(const Theme &theme) const @@ -240,54 +228,54 @@ bool Format::hasSelectedBackgroundColorOverride() const void FormatPrivate::load(QXmlStreamReader &reader) { - name = reader.attributes().value(QStringLiteral("name")).toString(); - defaultStyle = stringToDefaultFormat(reader.attributes().value(QStringLiteral("defStyleNum"))); + name = reader.attributes().value(QLatin1String("name")).toString(); + defaultStyle = stringToDefaultFormat(reader.attributes().value(QLatin1String("defStyleNum"))); - QStringView attribute = reader.attributes().value(QStringLiteral("color")); + QStringView attribute = reader.attributes().value(QLatin1String("color")); if (!attribute.isEmpty()) { style.textColor = QColor(attribute.toString()).rgba(); } - attribute = reader.attributes().value(QStringLiteral("selColor")); + attribute = reader.attributes().value(QLatin1String("selColor")); if (!attribute.isEmpty()) { style.selectedTextColor = QColor(attribute.toString()).rgba(); } - attribute = reader.attributes().value(QStringLiteral("backgroundColor")); + attribute = reader.attributes().value(QLatin1String("backgroundColor")); if (!attribute.isEmpty()) { style.backgroundColor = QColor(attribute.toString()).rgba(); } - attribute = reader.attributes().value(QStringLiteral("selBackgroundColor")); + attribute = reader.attributes().value(QLatin1String("selBackgroundColor")); if (!attribute.isEmpty()) { style.selectedBackgroundColor = QColor(attribute.toString()).rgba(); } - attribute = reader.attributes().value(QStringLiteral("italic")); + attribute = reader.attributes().value(QLatin1String("italic")); if (!attribute.isEmpty()) { style.hasItalic = true; style.italic = Xml::attrToBool(attribute); } - attribute = reader.attributes().value(QStringLiteral("bold")); + attribute = reader.attributes().value(QLatin1String("bold")); if (!attribute.isEmpty()) { style.hasBold = true; style.bold = Xml::attrToBool(attribute); } - attribute = reader.attributes().value(QStringLiteral("underline")); + attribute = reader.attributes().value(QLatin1String("underline")); if (!attribute.isEmpty()) { style.hasUnderline = true; style.underline = Xml::attrToBool(attribute); } - attribute = reader.attributes().value(QStringLiteral("strikeOut")); + attribute = reader.attributes().value(QLatin1String("strikeOut")); if (!attribute.isEmpty()) { style.hasStrikeThrough = true; style.strikeThrough = Xml::attrToBool(attribute); } - attribute = reader.attributes().value(QStringLiteral("spellChecking")); + attribute = reader.attributes().value(QLatin1String("spellChecking")); if (!attribute.isEmpty()) { spellCheck = Xml::attrToBool(attribute); } diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h index 25491809aee..496a54e42cb 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format.h @@ -1,24 +1,8 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2020 Jonathan Poelen - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_FORMAT_H @@ -37,7 +21,6 @@ QT_END_NAMESPACE namespace KSyntaxHighlighting { -class DefinitionRef; class FormatPrivate; /** Describes the format to be used for a specific text fragment. diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/format_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/format_p.h index 91a4f1e912b..e578d23e148 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/format_p.h +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/format_p.h @@ -1,24 +1,7 @@ /* - Copyright (C) 2016 Volker Krause + SPDX-FileCopyrightText: 2016 Volker Krause - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #ifndef KSYNTAXHIGHLIGHTING_FORMAT_P_H diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp index 3acade7f9da..a95888f40fc 100644 --- a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp +++ b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.cpp @@ -1,25 +1,8 @@ /* - Copyright (C) 2016 Volker Krause - Copyright (C) 2018 Christoph Cullmann + SPDX-FileCopyrightText: 2016 Volker Krause + SPDX-FileCopyrightText: 2018 Christoph Cullmann - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + SPDX-License-Identifier: MIT */ #include "htmlhighlighter.h" @@ -111,11 +94,12 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title) *d->out << "\n"; *d->out << "\n"; *d->out << "" << htmlTitle << "\n"; - *d->out << "\n"; + *d->out << "\n"; *d->out << "out << " style=\"background-color:" << QColor(theme().editorColor(Theme::BackgroundColor)).name(); if (theme().textColor(Theme::Normal)) - *d->out << " style=\"color:" << QColor(theme().textColor(Theme::Normal)).name() << "\""; - *d->out << ">
\n";
+        *d->out << ";color:" << QColor(theme().textColor(Theme::Normal)).name();
+    *d->out << "\">
\n";
 
     QTextStream in(dev);
 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.h
index 7479ee2b633..8754057345d 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/htmlhighlighter.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_HTMLHIGHLIGHTER_H
@@ -32,11 +15,6 @@
 
 #include 
 
-QT_BEGIN_NAMESPACE
-class QFile;
-class QTextStream;
-QT_END_NAMESPACE
-
 namespace KSyntaxHighlighting
 {
 class HtmlHighlighterPrivate;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
index d82408d8019..b599ce29a18 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist.cpp
@@ -1,24 +1,8 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "definition_p.h"
@@ -42,12 +26,7 @@ bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensi
     /**
      * search with right predicate
      */
-    return std::binary_search(vectorToSearch.begin(),
-                              vectorToSearch.end(),
-                              str,
-                              [caseSensitive](const QStringView &a, const QStringView &b) {
-                                  return a.compare(b, caseSensitive) < 0;
-                              });
+    return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](const QStringView &a, const QStringView &b) { return a.compare(b, caseSensitive) < 0; });
 }
 
 void KeywordList::load(QXmlStreamReader &reader)
@@ -55,7 +34,7 @@ void KeywordList::load(QXmlStreamReader &reader)
     Q_ASSERT(reader.name() == QLatin1String("list"));
     Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement);
 
-    m_name = reader.attributes().value(QStringLiteral("name")).toString();
+    m_name = reader.attributes().value(QLatin1String("name")).toString();
 
     while (!reader.atEnd()) {
         switch (reader.tokenType()) {
@@ -105,17 +84,13 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
      */
     vectorToSort.reserve(m_keywords.size());
     for (const auto &keyword : qAsConst(m_keywords)) {
-        vectorToSort.emplace_back(keyword);
+        vectorToSort.push_back(keyword);
     }
 
     /**
      * sort with right predicate
      */
-    std::sort(vectorToSort.begin(),
-              vectorToSort.end(),
-              [caseSensitive](const QStringView &a, const QStringView &b) {
-                  return a.compare(b, caseSensitive) < 0;
-              });
+    std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](const QStringView &a, const QStringView &b) { return a.compare(b, caseSensitive) < 0; });
 }
 
 void KeywordList::resolveIncludeKeywords(DefinitionData &def)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
index de39a8731ba..68b1ec6290e 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/keywordlist_p.h
@@ -1,30 +1,15 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
 #define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
 
 #include 
+#include 
 #include 
 
 #include 
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/matchresult_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/matchresult_p.h
index c79801dd3df..1e0f7c61027 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/matchresult_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/matchresult_p.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_MATCHRESULT_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
index c45dfa7d3cf..2252bc67d24 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.cpp
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "repository.h"
@@ -92,8 +75,9 @@ QVector Repository::definitionsForFileName(const QString &fileName)
     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_sortedDefs)) {
+    for (const Definition &def : qAsConst(d->m_defs)) {
         for (const auto &pattern : def.extensions()) {
             if (WildcardMatcher::exactMatch(name, pattern)) {
                 candidates.push_back(def);
@@ -113,8 +97,9 @@ Definition Repository::definitionForMimeType(const QString &mimeType) const
 
 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_sortedDefs)) {
+    for (const Definition &def : qAsConst(d->m_defs)) {
         for (const auto &matchType : def.mimeTypes()) {
             if (mimeType == matchType) {
                 candidates.push_back(def);
@@ -152,7 +137,7 @@ Theme Repository::defaultTheme(Repository::DefaultTheme t)
 {
     if (t == DarkTheme)
         return theme(QLatin1String("Breeze Dark"));
-    return theme(QLatin1String("Default"));
+    return theme(QLatin1String("Breeze Light"));
 }
 
 void RepositoryPrivate::load(Repository *repo)
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
index 555dbe983e9..9da44746852 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_H
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 81cba479429..447cfae6990 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/repository_p.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_P_H
@@ -58,7 +41,10 @@ public:
 
     QVector m_customSearchPaths;
 
-    QHash m_defs;
+    // sorted map to have deterministic iteration order for e.g. definitionsForFileName
+    QMap m_defs;
+
+    // this vector is sorted by translated sections/names
     QVector m_sortedDefs;
 
     QVector m_themes;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
index ad741469549..22f59e02114 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule.cpp
@@ -1,25 +1,9 @@
 /*
-    Copyright (C) 2016 Volker Krause 
-    Copyright (C) 2018 Christoph Cullmann 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2018 Christoph Cullmann 
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "context_p.h"
@@ -27,21 +11,29 @@
 #include "ksyntaxhighlighting_logging.h"
 #include "rule_p.h"
 #include "xml_p.h"
+#include "worddelimiters_p.h"
 
 #include 
 #include 
 
 using namespace KSyntaxHighlighting;
 
+// QChar::isDigit() match any digit in unicode (romain numeral, etc)
+static bool isDigit(QChar c)
+{
+    return (c <= QLatin1Char('9') && QLatin1Char('0') <= c);
+}
+
 static bool isOctalChar(QChar c)
 {
-    return c.isNumber() && c != QLatin1Char('9') && c != QLatin1Char('8');
+    return (c <= QLatin1Char('7') && QLatin1Char('0') <= c);
 }
 
 static bool isHexChar(QChar c)
 {
-    return c.isNumber() || c == QLatin1Char('a') || c == QLatin1Char('A') || c == QLatin1Char('b') || c == QLatin1Char('B') || c == QLatin1Char('c') || c == QLatin1Char('C') || c == QLatin1Char('d') || c == QLatin1Char('D') ||
-        c == QLatin1Char('e') || c == QLatin1Char('E') || c == QLatin1Char('f') || c == QLatin1Char('F');
+    return isDigit(c)
+        || (c <= QLatin1Char('f') && QLatin1Char('a') <= c)
+        || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
 }
 
 static int matchEscapedChar(const QString &text, int offset)
@@ -50,30 +42,31 @@ static int matchEscapedChar(const QString &text, int offset)
         return offset;
 
     const auto c = text.at(offset + 1);
-    static const auto controlChars = QStringLiteral("abefnrtv\"'?\\");
-    if (controlChars.contains(c))
+    switch (c.unicode()) {
+    // control chars
+    case 'a': case 'b': case 'e': case 'f':
+    case 'n': case 'r': case 't': case 'v':
+    case '"': case '\'': case '?': case '\\':
         return offset + 2;
 
     // hex encoded character
-    if (c == QLatin1Char('x')) {
-        auto newOffset = offset + 2;
-        for (int i = 0; i < 2 && newOffset + i < text.size(); ++i, ++newOffset) {
-            if (!isHexChar(text.at(newOffset)))
-                break;
+    case 'x':
+        if (offset + 2 < text.size() && isHexChar(text.at(offset + 2))) {
+            if (offset + 3 < text.size() && isHexChar(text.at(offset + 3)))
+                return offset + 4;
+            return offset + 3;
         }
-        if (newOffset == offset + 2)
-            return offset;
-        return newOffset;
-    }
+        return offset;
 
     // octal encoding, simple \0 is OK, too, unlike simple \x above
-    if (isOctalChar(c)) {
-        auto newOffset = offset + 2;
-        for (int i = 0; i < 2 && newOffset + i < text.size(); ++i, ++newOffset) {
-            if (!isOctalChar(text.at(newOffset)))
-                break;
+    case '0': case '1': case '2': case '3':
+    case '4': case '5': case '6': case '7':
+        if (offset + 2 < text.size() && isOctalChar(text.at(offset + 2))) {
+            if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3)))
+                return offset + 4;
+            return offset + 3;
         }
-        return newOffset;
+        return offset + 2;
     }
 
     return offset;
@@ -102,13 +95,13 @@ bool Rule::load(QXmlStreamReader &reader)
 {
     Q_ASSERT(reader.tokenType() == QXmlStreamReader::StartElement);
 
-    m_attribute = reader.attributes().value(QStringLiteral("attribute")).toString();
+    m_attribute = reader.attributes().value(QLatin1String("attribute")).toString();
     if (reader.name() != QLatin1String("IncludeRules")) // IncludeRules uses this with a different semantic
-        m_context.parse(reader.attributes().value(QStringLiteral("context")));
-    m_firstNonSpace = Xml::attrToBool(reader.attributes().value(QStringLiteral("firstNonSpace")));
-    m_lookAhead = Xml::attrToBool(reader.attributes().value(QStringLiteral("lookAhead")));
+        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(QStringLiteral("column")).toInt(&colOk);
+    m_column = reader.attributes().value(QLatin1String("column")).toInt(&colOk);
     if (!colOk)
         m_column = -1;
 
@@ -131,10 +124,12 @@ bool Rule::load(QXmlStreamReader &reader)
 
 void Rule::resolveContext()
 {
-    m_context.resolve(m_def.definition());
+    auto const& def = m_def.definition();
+
+    m_context.resolve(def);
 
     // cache for DefinitionData::wordDelimiters, is accessed VERY often
-    m_wordDelimiter = DefinitionData::get(m_def.definition())->wordDelimiters;
+    m_wordDelimiters = &DefinitionData::get(def)->wordDelimiters;
 }
 
 void Rule::resolveAttributeFormat(Context *lookupContext)
@@ -158,58 +153,55 @@ bool Rule::doLoad(QXmlStreamReader &reader)
 
 Rule::Ptr Rule::create(const QStringView &name)
 {
-    Rule *rule = nullptr;
     if (name == QLatin1String("AnyChar"))
-        rule = new AnyChar;
-    else if (name == QLatin1String("DetectChar"))
-        rule = new DetectChar;
-    else if (name == QLatin1String("Detect2Chars"))
-        rule = new Detect2Char;
-    else if (name == QLatin1String("DetectIdentifier"))
-        rule = new DetectIdentifier;
-    else if (name == QLatin1String("DetectSpaces"))
-        rule = new DetectSpaces;
-    else if (name == QLatin1String("Float"))
-        rule = new Float;
-    else if (name == QLatin1String("Int"))
-        rule = new Int;
-    else if (name == QLatin1String("HlCChar"))
-        rule = new HlCChar;
-    else if (name == QLatin1String("HlCHex"))
-        rule = new HlCHex;
-    else if (name == QLatin1String("HlCOct"))
-        rule = new HlCOct;
-    else if (name == QLatin1String("HlCStringChar"))
-        rule = new HlCStringChar;
-    else if (name == QLatin1String("IncludeRules"))
-        rule = new IncludeRules;
-    else if (name == QLatin1String("keyword"))
-        rule = new KeywordListRule;
-    else if (name == QLatin1String("LineContinue"))
-        rule = new LineContinue;
-    else if (name == QLatin1String("RangeDetect"))
-        rule = new RangeDetect;
-    else if (name == QLatin1String("RegExpr"))
-        rule = new RegExpr;
-    else if (name == QLatin1String("StringDetect"))
-        rule = new StringDetect;
-    else if (name == QLatin1String("WordDetect"))
-        rule = new WordDetect;
-    else
-        qCWarning(Log) << "Unknown rule type:" << name;
+        return std::make_shared();
+    if (name == QLatin1String("DetectChar"))
+        return std::make_shared();
+    if (name == QLatin1String("Detect2Chars"))
+        return std::make_shared();
+    if (name == QLatin1String("DetectIdentifier"))
+        return std::make_shared();
+    if (name == QLatin1String("DetectSpaces"))
+        return std::make_shared();
+    if (name == QLatin1String("Float"))
+        return std::make_shared();
+    if (name == QLatin1String("Int"))
+        return std::make_shared();
+    if (name == QLatin1String("HlCChar"))
+        return std::make_shared();
+    if (name == QLatin1String("HlCHex"))
+        return std::make_shared();
+    if (name == QLatin1String("HlCOct"))
+        return std::make_shared();
+    if (name == QLatin1String("HlCStringChar"))
+        return std::make_shared();
+    if (name == QLatin1String("IncludeRules"))
+        return std::make_shared();
+    if (name == QLatin1String("keyword"))
+        return std::make_shared();
+    if (name == QLatin1String("LineContinue"))
+        return std::make_shared();
+    if (name == QLatin1String("RangeDetect"))
+        return std::make_shared();
+    if (name == QLatin1String("RegExpr"))
+        return std::make_shared();
+    if (name == QLatin1String("StringDetect"))
+        return std::make_shared();
+    if (name == QLatin1String("WordDetect"))
+        return std::make_shared();
 
-    return Ptr(rule);
+    qCWarning(Log) << "Unknown rule type:" << name;
+    return Ptr(nullptr);
 }
 
 bool Rule::isWordDelimiter(QChar c) const
 {
-    // perf tells contains is MUCH faster than binary search here, very short array
-    return m_wordDelimiter.contains(c);
+    return m_wordDelimiters->contains(c);
 }
 
 bool AnyChar::doLoad(QXmlStreamReader &reader)
 {
-    m_chars = reader.attributes().value(QStringLiteral("String")).toString();
+    m_chars = reader.attributes().value(QLatin1String("String")).toString();
     if (m_chars.size() == 1)
         qCDebug(Log) << "AnyChar rule with just one char: use DetectChar instead.";
     return !m_chars.isEmpty();
@@ -224,11 +216,11 @@ MatchResult AnyChar::doMatch(const QString &text, int offset, const QStringList
 
 bool DetectChar::doLoad(QXmlStreamReader &reader)
 {
-    const auto s = reader.attributes().value(QStringLiteral("char"));
+    const auto s = reader.attributes().value(QLatin1String("char"));
     if (s.isEmpty())
         return false;
     m_char = s.at(0);
-    m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic")));
+    m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
     if (m_dynamic) {
         m_captureIndex = m_char.digitValue();
     }
@@ -252,8 +244,8 @@ MatchResult DetectChar::doMatch(const QString &text, int offset, const QStringLi
 
 bool Detect2Char::doLoad(QXmlStreamReader &reader)
 {
-    const auto s1 = reader.attributes().value(QStringLiteral("char"));
-    const auto s2 = reader.attributes().value(QStringLiteral("char1"));
+    const auto s1 = reader.attributes().value(QLatin1String("char"));
+    const auto s2 = reader.attributes().value(QLatin1String("char1"));
     if (s1.isEmpty() || s2.isEmpty())
         return false;
     m_char1 = s1.at(0);
@@ -297,14 +289,14 @@ MatchResult Float::doMatch(const QString &text, int offset, const QStringList &)
         return offset;
 
     auto newOffset = offset;
-    while (newOffset < text.size() && text.at(newOffset).isDigit())
+    while (newOffset < text.size() && isDigit(text.at(newOffset)))
         ++newOffset;
 
     if (newOffset >= text.size() || text.at(newOffset) != QLatin1Char('.'))
         return offset;
     ++newOffset;
 
-    while (newOffset < text.size() && text.at(newOffset).isDigit())
+    while (newOffset < text.size() && isDigit(text.at(newOffset)))
         ++newOffset;
 
     if (newOffset == offset + 1) // we only found a decimal point
@@ -318,7 +310,7 @@ MatchResult Float::doMatch(const QString &text, int offset, const QStringList &)
     if (expOffset < text.size() && (text.at(expOffset) == QLatin1Char('+') || text.at(expOffset) == QLatin1Char('-')))
         ++expOffset;
     bool foundExpDigit = false;
-    while (expOffset < text.size() && text.at(expOffset).isDigit()) {
+    while (expOffset < text.size() && isDigit(text.at(expOffset))) {
         ++expOffset;
         foundExpDigit = true;
     }
@@ -446,7 +438,7 @@ MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) c
     if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
         return offset;
 
-    while (offset < text.size() && text.at(offset).isDigit())
+    while (offset < text.size() && isDigit(text.at(offset)))
         ++offset;
     return offset;
 }
@@ -500,7 +492,7 @@ MatchResult KeywordListRule::doMatch(const QString &text, int offset, const QStr
 
 bool LineContinue::doLoad(QXmlStreamReader &reader)
 {
-    const auto s = reader.attributes().value(QStringLiteral("char"));
+    const auto s = reader.attributes().value(QLatin1String("char"));
     if (s.isEmpty())
         m_char = QLatin1Char('\\');
     else
@@ -517,8 +509,8 @@ MatchResult LineContinue::doMatch(const QString &text, int offset, const QString
 
 bool RangeDetect::doLoad(QXmlStreamReader &reader)
 {
-    const auto s1 = reader.attributes().value(QStringLiteral("char"));
-    const auto s2 = reader.attributes().value(QStringLiteral("char1"));
+    const auto s1 = reader.attributes().value(QLatin1String("char"));
+    const auto s2 = reader.attributes().value(QLatin1String("char1"));
     if (s1.isEmpty() || s2.isEmpty())
         return false;
     m_begin = s1.at(0);
@@ -544,14 +536,14 @@ MatchResult RangeDetect::doMatch(const QString &text, int offset, const QStringL
 
 bool RegExpr::doLoad(QXmlStreamReader &reader)
 {
-    m_regexp.setPattern(reader.attributes().value(QStringLiteral("String")).toString());
+    m_regexp.setPattern(reader.attributes().value(QLatin1String("String")).toString());
 
-    const auto isMinimal = Xml::attrToBool(reader.attributes().value(QStringLiteral("minimal")));
-    const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive")));
+    const auto isMinimal = Xml::attrToBool(reader.attributes().value(QLatin1String("minimal")));
+    const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive")));
     m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption) | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption));
 
     // optimize the pattern for the non-dynamic case, we use them OFTEN
-    m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic")));
+    m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
     if (!m_dynamic) {
         m_regexp.optimize();
     }
@@ -601,9 +593,9 @@ MatchResult RegExpr::doMatch(const QString &text, int offset, const QStringList
 
 bool StringDetect::doLoad(QXmlStreamReader &reader)
 {
-    m_string = reader.attributes().value(QStringLiteral("String")).toString();
-    m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
-    m_dynamic = Xml::attrToBool(reader.attributes().value(QStringLiteral("dynamic")));
+    m_string = reader.attributes().value(QLatin1String("String")).toString();
+    m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
+    m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
     return !m_string.isEmpty();
 }
 
@@ -622,8 +614,8 @@ MatchResult StringDetect::doMatch(const QString &text, int offset, const QString
 
 bool WordDetect::doLoad(QXmlStreamReader &reader)
 {
-    m_word = reader.attributes().value(QStringLiteral("String")).toString();
-    m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QStringLiteral("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
+    m_word = reader.attributes().value(QLatin1String("String")).toString();
+    m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
     return !m_word.isEmpty();
 }
 
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 484687bc0a0..788aecdad3f 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/rule_p.h
@@ -1,24 +1,8 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_RULE_P_H
@@ -43,6 +27,8 @@ QT_END_NAMESPACE
 
 namespace KSyntaxHighlighting
 {
+class WordDelimiters;
+
 class Rule
 {
 public:
@@ -121,7 +107,7 @@ private:
     bool m_lookAhead = false;
 
     // cache for DefinitionData::wordDelimiters, is accessed VERY often
-    QStringView m_wordDelimiter;
+    WordDelimiters* m_wordDelimiters = nullptr;
 
 protected:
     bool m_dynamic = false;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
index dfb4d0c24ad..f9b4f4b4ab0 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state.cpp
@@ -1,25 +1,8 @@
 /*
-    Copyright (C) 2016 Volker Krause 
-    Copyright (C) 2018 Christoph Cullmann 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2018 Christoph Cullmann 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "state.h"
@@ -33,7 +16,12 @@ using namespace KSyntaxHighlighting;
 
 StateData *StateData::get(State &state)
 {
-    state.d.detach();
+    // create state data on demand, to make default state construction cheap
+    if (!state.d) {
+        state.d = new StateData();
+    } else {
+        state.d.detach();
+    }
     return state.d.data();
 }
 
@@ -85,7 +73,6 @@ const QStringList &StateData::topCaptures() const
 }
 
 State::State()
-    : d(new StateData)
 {
 }
 
@@ -107,7 +94,7 @@ State &State::operator=(const State &other)
 bool State::operator==(const State &other) const
 {
     // use pointer equal as shortcut for shared states
-    return (d == other.d) || (d->m_contextStack == other.d->m_contextStack && d->m_defRef == other.d->m_defRef);
+    return (d == other.d) || (d && other.d && d->m_contextStack == other.d->m_contextStack && d->m_defRef == other.d->m_defRef);
 }
 
 bool State::operator!=(const State &other) const
@@ -117,7 +104,7 @@ bool State::operator!=(const State &other) const
 
 bool State::indentationBasedFoldingEnabled() const
 {
-    if (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/state.h b/src/libs/3rdparty/syntax-highlighting/src/lib/state.h
index ed632746958..726ff32a884 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_STATE_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
index 1156ce981a0..d76f84c93bb 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/state_p.h
@@ -1,25 +1,8 @@
 /*
-    Copyright (C) 2016 Volker Krause 
-    Copyright (C) 2018 Christoph Cullmann 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2018 Christoph Cullmann 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_STATE_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
index a6bccffdd42..d0c4ee98ae8 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.cpp
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "syntaxhighlighter.h"
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.h
index 7f5dadefebc..a57455d9baa 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/syntaxhighlighter.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_QSYNTAXHIGHLIGHTER_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h
index 4b6cef7e983..40c3da86a3b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/textstyledata_p.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_TEXTSTYLEDATA_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
index c6f31a5182b..beb1e877972 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.cpp
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "theme.h"
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
index 3379aec853c..076e8d0318b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/theme.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_THEME_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
index 03a5ea8e323..f8283b44565 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata.cpp
@@ -1,25 +1,9 @@
 /*
-    Copyright (C) 2016 Volker Krause 
-    Copyright (C) 2016 Dominik Haumann 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Dominik Haumann 
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "ksyntaxhighlighting_logging.h"
@@ -120,54 +104,64 @@ bool ThemeData::load(const QString &filePath)
     m_revision = metadata.value(QLatin1String("revision")).toInt();
 
     // read text styles
-    static const auto idx = Theme::staticMetaObject.indexOfEnumerator("TextStyle");
-    Q_ASSERT(idx >= 0);
-    const auto metaEnum = Theme::staticMetaObject.enumerator(idx);
+    static const auto styleIdx = Theme::staticMetaObject.indexOfEnumerator("TextStyle");
+    Q_ASSERT(styleIdx >= 0);
+    const auto metaEnumStyle = Theme::staticMetaObject.enumerator(styleIdx);
     const QJsonObject textStyles = obj.value(QLatin1String("text-styles")).toObject();
-    for (int i = 0; i < metaEnum.keyCount(); ++i) {
-        Q_ASSERT(i == metaEnum.value(i));
-        m_textStyles[i] = readThemeData(textStyles.value(QLatin1String(metaEnum.key(i))).toObject());
+    for (int i = 0; i < metaEnumStyle.keyCount(); ++i) {
+        Q_ASSERT(i == metaEnumStyle.value(i));
+        m_textStyles[i] = readThemeData(textStyles.value(QLatin1String(metaEnumStyle.key(i))).toObject());
     }
 
-    // read editor area colors
+    // read editor colors
+    static const auto colorIdx = Theme::staticMetaObject.indexOfEnumerator("EditorColorRole");
+    Q_ASSERT(colorIdx >= 0);
+    const auto metaEnumColor = Theme::staticMetaObject.enumerator(colorIdx);
     const QJsonObject editorColors = obj.value(QLatin1String("editor-colors")).toObject();
-    m_editorColors[Theme::BackgroundColor] = readColor(editorColors.value(QLatin1String("background-color")));
-    m_editorColors[Theme::TextSelection] = readColor(editorColors.value(QLatin1String("selection")));
-    m_editorColors[Theme::CurrentLine] = readColor(editorColors.value(QLatin1String("current-line")));
-    m_editorColors[Theme::SearchHighlight] = readColor(editorColors.value(QLatin1String("search-highlight")));
-    m_editorColors[Theme::ReplaceHighlight] = readColor(editorColors.value(QLatin1String("replace-highlight")));
-    m_editorColors[Theme::BracketMatching] = readColor(editorColors.value(QLatin1String("bracket-matching")));
-    m_editorColors[Theme::TabMarker] = readColor(editorColors.value(QLatin1String("tab-marker")));
-    m_editorColors[Theme::SpellChecking] = readColor(editorColors.value(QLatin1String("spell-checking")));
-    m_editorColors[Theme::IndentationLine] = readColor(editorColors.value(QLatin1String("indentation-line")));
-    m_editorColors[Theme::IconBorder] = readColor(editorColors.value(QLatin1String("icon-border")));
-    m_editorColors[Theme::CodeFolding] = readColor(editorColors.value(QLatin1String("code-folding")));
-    m_editorColors[Theme::LineNumbers] = readColor(editorColors.value(QLatin1String("line-numbers")));
-    m_editorColors[Theme::CurrentLineNumber] = readColor(editorColors.value(QLatin1String("current-line-number")));
-    m_editorColors[Theme::WordWrapMarker] = readColor(editorColors.value(QLatin1String("word-wrap-marker")));
-    m_editorColors[Theme::ModifiedLines] = readColor(editorColors.value(QLatin1String("modified-lines")));
-    m_editorColors[Theme::SavedLines] = readColor(editorColors.value(QLatin1String("saved-lines")));
-    m_editorColors[Theme::Separator] = readColor(editorColors.value(QLatin1String("separator")));
-    m_editorColors[Theme::MarkBookmark] = readColor(editorColors.value(QLatin1String("mark-bookmark")));
-    m_editorColors[Theme::MarkBreakpointActive] = readColor(editorColors.value(QLatin1String("mark-breakpoint-active")));
-    m_editorColors[Theme::MarkBreakpointReached] = readColor(editorColors.value(QLatin1String("mark-breakpoint-reached")));
-    m_editorColors[Theme::MarkBreakpointDisabled] = readColor(editorColors.value(QLatin1String("mark-breakpoint-disabled")));
-    m_editorColors[Theme::MarkExecution] = readColor(editorColors.value(QLatin1String("mark-execution")));
-    m_editorColors[Theme::MarkWarning] = readColor(editorColors.value(QLatin1String("mark-warning")));
-    m_editorColors[Theme::MarkError] = readColor(editorColors.value(QLatin1String("mark-error")));
-    m_editorColors[Theme::TemplateBackground] = readColor(editorColors.value(QLatin1String("template-background")));
-    m_editorColors[Theme::TemplatePlaceholder] = readColor(editorColors.value(QLatin1String("template-placeholder")));
-    m_editorColors[Theme::TemplateFocusedPlaceholder] = readColor(editorColors.value(QLatin1String("template-focused-placeholder")));
-    m_editorColors[Theme::TemplateReadOnlyPlaceholder] = readColor(editorColors.value(QLatin1String("template-read-only-placeholder")));
+    for (int i = 0; i < metaEnumColor.keyCount(); ++i) {
+        Q_ASSERT(i == metaEnumColor.value(i));
+        m_editorColors[i] = readColor(editorColors.value(QLatin1String(metaEnumColor.key(i))));
+    }
+
+    // if we have no new key around for Theme::BackgroundColor => use old variants to be compatible
+    if (!editorColors.contains(QLatin1String(metaEnumColor.key(Theme::BackgroundColor)))) {
+        m_editorColors[Theme::BackgroundColor] = readColor(editorColors.value(QLatin1String("background-color")));
+        m_editorColors[Theme::TextSelection] = readColor(editorColors.value(QLatin1String("selection")));
+        m_editorColors[Theme::CurrentLine] = readColor(editorColors.value(QLatin1String("current-line")));
+        m_editorColors[Theme::SearchHighlight] = readColor(editorColors.value(QLatin1String("search-highlight")));
+        m_editorColors[Theme::ReplaceHighlight] = readColor(editorColors.value(QLatin1String("replace-highlight")));
+        m_editorColors[Theme::BracketMatching] = readColor(editorColors.value(QLatin1String("bracket-matching")));
+        m_editorColors[Theme::TabMarker] = readColor(editorColors.value(QLatin1String("tab-marker")));
+        m_editorColors[Theme::SpellChecking] = readColor(editorColors.value(QLatin1String("spell-checking")));
+        m_editorColors[Theme::IndentationLine] = readColor(editorColors.value(QLatin1String("indentation-line")));
+        m_editorColors[Theme::IconBorder] = readColor(editorColors.value(QLatin1String("icon-border")));
+        m_editorColors[Theme::CodeFolding] = readColor(editorColors.value(QLatin1String("code-folding")));
+        m_editorColors[Theme::LineNumbers] = readColor(editorColors.value(QLatin1String("line-numbers")));
+        m_editorColors[Theme::CurrentLineNumber] = readColor(editorColors.value(QLatin1String("current-line-number")));
+        m_editorColors[Theme::WordWrapMarker] = readColor(editorColors.value(QLatin1String("word-wrap-marker")));
+        m_editorColors[Theme::ModifiedLines] = readColor(editorColors.value(QLatin1String("modified-lines")));
+        m_editorColors[Theme::SavedLines] = readColor(editorColors.value(QLatin1String("saved-lines")));
+        m_editorColors[Theme::Separator] = readColor(editorColors.value(QLatin1String("separator")));
+        m_editorColors[Theme::MarkBookmark] = readColor(editorColors.value(QLatin1String("mark-bookmark")));
+        m_editorColors[Theme::MarkBreakpointActive] = readColor(editorColors.value(QLatin1String("mark-breakpoint-active")));
+        m_editorColors[Theme::MarkBreakpointReached] = readColor(editorColors.value(QLatin1String("mark-breakpoint-reached")));
+        m_editorColors[Theme::MarkBreakpointDisabled] = readColor(editorColors.value(QLatin1String("mark-breakpoint-disabled")));
+        m_editorColors[Theme::MarkExecution] = readColor(editorColors.value(QLatin1String("mark-execution")));
+        m_editorColors[Theme::MarkWarning] = readColor(editorColors.value(QLatin1String("mark-warning")));
+        m_editorColors[Theme::MarkError] = readColor(editorColors.value(QLatin1String("mark-error")));
+        m_editorColors[Theme::TemplateBackground] = readColor(editorColors.value(QLatin1String("template-background")));
+        m_editorColors[Theme::TemplatePlaceholder] = readColor(editorColors.value(QLatin1String("template-placeholder")));
+        m_editorColors[Theme::TemplateFocusedPlaceholder] = readColor(editorColors.value(QLatin1String("template-focused-placeholder")));
+        m_editorColors[Theme::TemplateReadOnlyPlaceholder] = readColor(editorColors.value(QLatin1String("template-read-only-placeholder")));
+    }
 
     // read per-definition style overrides
     const auto customStyles = obj.value(QLatin1String("custom-styles")).toObject();
     for (auto it = customStyles.begin(); it != customStyles.end(); ++it) {
         const auto obj = it.value().toObject();
-        QHash overrideStyle;
+        auto &overrideStyle = m_textStyleOverrides[it.key()];
         for (auto it2 = obj.begin(); it2 != obj.end(); ++it2)
             overrideStyle.insert(it2.key(), readThemeData(it2.value().toObject()));
-        m_textStyleOverrides.insert(it.key(), overrideStyle);
     }
 
     return true;
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata_p.h
index 052d297599b..7a9772f1044 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/themedata_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/themedata_p.h
@@ -1,25 +1,8 @@
 /*
-    Copyright (C) 2016 Volker Krause 
-    Copyright (C) 2016 Dominik Haumann 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Dominik Haumann 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_THEMEDATA_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
index 604318200b0..82d3e4ea80b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher.cpp
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2007 Sebastian Pipping 
+    SPDX-FileCopyrightText: 2007 Sebastian Pipping 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #include "wildcardmatcher_p.h"
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher_p.h b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher_p.h
index feeca662174..0b92e4c1d6e 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/wildcardmatcher_p.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2007 Sebastian Pipping 
+    SPDX-FileCopyrightText: 2007 Sebastian Pipping 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_WILDCARDMATCHER_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
new file mode 100644
index 00000000000..71cf73ca337
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters.cpp
@@ -0,0 +1,43 @@
+/*
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
+
+    SPDX-License-Identifier: MIT
+*/
+
+#include "worddelimiters_p.h"
+
+using namespace KSyntaxHighlighting;
+
+WordDelimiters::WordDelimiters()
+    : asciiDelimiters{}
+{
+    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)
+        return asciiDelimiters[c.unicode()];
+    // perf tells contains is MUCH faster than binary search here, very short array
+    return notAsciiDelimiters.contains(c);
+}
+
+void WordDelimiters::append(QChar c)
+{
+    if (c.unicode() < 128) {
+        asciiDelimiters[c.unicode()] = true;
+    } else {
+        notAsciiDelimiters.append(c);
+    }
+}
+
+void WordDelimiters::remove(QChar c)
+{
+    if (c.unicode() < 128) {
+        asciiDelimiters[c.unicode()] = false;
+    } else {
+        notAsciiDelimiters.remove(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
new file mode 100644
index 00000000000..51708fc13f8
--- /dev/null
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/worddelimiters_p.h
@@ -0,0 +1,56 @@
+/*
+    SPDX-FileCopyrightText: 2020 Jonathan Poelen 
+
+    SPDX-License-Identifier: MIT
+*/
+
+#ifndef KSYNTAXHIGHLIGHTING_WORDDELIMITERS_P_H
+#define KSYNTAXHIGHLIGHTING_WORDDELIMITERS_P_H
+
+#include 
+
+namespace KSyntaxHighlighting
+{
+/**
+ * Repesents a list of character that separates 2 words.
+ *
+ * Default delimiters are .():!+*,-<=>%&/;?[]^{|}~\, space (' ') and tabulator ('\t').
+ *
+ * @see Rule
+ * @since 5.74
+ */
+class WordDelimiters
+{
+public:
+    WordDelimiters();
+
+    /**
+     * Returns @c true if @p c is a word delimiter; otherwise returns @c false.
+     */
+    bool contains(QChar c) const;
+
+    /**
+     * Appends the character @p c to word delimiter.
+     */
+    void append(QChar c);
+
+    /**
+     * Removes the character @p c from word delimiters.
+     */
+    void remove(QChar c);
+
+private:
+    /**
+     * An array which represents ascii characters for very fast lookup.
+     * The character is used as an index and the value @c true indicates a word delimiter.
+     */
+    bool asciiDelimiters[128];
+
+    /**
+     * Contains characters that are not ascii and is empty for most syntax definition.
+     */
+    QString notAsciiDelimiters;
+};
+}
+
+#endif
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 da14a6cc26e..eddf97f2183 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/xml_p.h
@@ -1,24 +1,7 @@
 /*
-    Copyright (C) 2016 Volker Krause 
+    SPDX-FileCopyrightText: 2016 Volker Krause 
 
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, sublicense, and/or sell copies of the Software, and to
-    permit persons to whom the Software is furnished to do so, subject to
-    the following conditions:
-
-    The above copyright notice and this permission notice shall be included
-    in all copies or substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+    SPDX-License-Identifier: MIT
 */
 
 #ifndef KSYNTAXHIGHLIGHTING_XML_P_H
diff --git a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
index 38127e1cfe0..333af297a84 100644
--- a/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
+++ b/src/libs/3rdparty/syntax-highlighting/syntax-highlighting.pro
@@ -34,6 +34,7 @@ HEADERS += \
     src/lib/theme.h \
     src/lib/themedata_p.h \
     src/lib/wildcardmatcher_p.h \
+    src/lib/worddelimiters_p.h \
     src/lib/xml_p.h \
 
 SOURCES += \
@@ -53,3 +54,4 @@ SOURCES += \
     src/lib/theme.cpp \
     src/lib/themedata.cpp \
     src/lib/wildcardmatcher.cpp \
+    src/lib/worddelimiters.cpp \
diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp
index e405fd3ab59..2bcf4246a5b 100644
--- a/src/libs/qmljs/qmljsbind.cpp
+++ b/src/libs/qmljs/qmljsbind.cpp
@@ -228,7 +228,12 @@ bool Bind::visit(UiImport *ast)
                     _doc->setLanguage(Dialect::QmlQtQuick2);
             }
         }
-        _imports += import;
+
+        // Make sure QtQuick import is in the list before imports that might depend on it
+        if (import.name() == QLatin1String("QtQuick"))
+            _imports.prepend(import);
+        else
+            _imports += import;
     } else if (!ast->fileName.isEmpty()) {
         _imports += ImportInfo::pathImport(_doc->path(), ast->fileName.toString(),
                                            version, ast->importId.toString(), ast);
diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp
index e6bb3363726..0317f3c5ed0 100644
--- a/src/plugins/autotest/testnavigationwidget.cpp
+++ b/src/plugins/autotest/testnavigationwidget.cpp
@@ -118,6 +118,8 @@ TestNavigationWidget::TestNavigationWidget(QWidget *parent) :
             this, &TestNavigationWidget::reapplyCachedExpandedState);
     connect(m_progressTimer, &QTimer::timeout,
             m_progressIndicator, &Utils::ProgressIndicator::show);
+    connect(m_view, &TestTreeView::expanded, this, &TestNavigationWidget::updateExpandedStateCache);
+    connect(m_view, &TestTreeView::collapsed, this, &TestNavigationWidget::updateExpandedStateCache);
 }
 
 void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
@@ -230,8 +232,18 @@ QList TestNavigationWidget::createToolButtons()
     collapse->setIcon(Utils::Icons::COLLAPSE_TOOLBAR.icon());
     collapse->setToolTip(tr("Collapse All"));
 
-    connect(expand, &QToolButton::clicked, m_view, &TestTreeView::expandAll);
-    connect(collapse, &QToolButton::clicked, m_view, &TestTreeView::collapseAll);
+    connect(expand, &QToolButton::clicked, m_view, [this]() {
+        m_view->blockSignals(true);
+        m_view->expandAll();
+        m_view->blockSignals(false);
+        updateExpandedStateCache();
+    });
+    connect(collapse, &QToolButton::clicked, m_view, [this]() {
+        m_view->blockSignals(true);
+        m_view->collapseAll();
+        m_view->blockSignals(false);
+        updateExpandedStateCache();
+    });
     connect(m_sort, &QToolButton::clicked, this, &TestNavigationWidget::onSortClicked);
 
     list << m_filterButton << m_sort << expand << collapse;
diff --git a/src/plugins/qmldesigner/components/componentcore/theme.h b/src/plugins/qmldesigner/components/componentcore/theme.h
index b7241fa8905..659162d8005 100644
--- a/src/plugins/qmldesigner/components/componentcore/theme.h
+++ b/src/plugins/qmldesigner/components/componentcore/theme.h
@@ -99,6 +99,8 @@ public:
         distributeSpacingVertical,
         distributeTop,
         edit,
+        flowAction,
+        flowTransition,
         fontStyleBold,
         fontStyleItalic,
         fontStyleStrikethrough,
@@ -115,6 +117,7 @@ public:
         plus,
         redo,
         rotation,
+        search,
         splitColumns,
         splitRows,
         startNode,
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
index 4684ca087f6..66752e27e3e 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
@@ -973,7 +973,7 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
 {
     qCInfo(rewriterBenchmark) << Q_FUNC_INFO;
 
-    const bool justSanityCheck = !differenceHandler.isValidator();
+    const bool justSanityCheck = !differenceHandler.isAmender();
 
     QElapsedTimer time;
     if (rewriterBenchmark().isInfoEnabled())
@@ -1135,10 +1135,10 @@ void TextToModelMerger::syncNode(ModelNode &modelNode,
     }
 
     if (isComponentType(typeName) || isImplicitComponent)
-        setupComponentDelayed(modelNode, differenceHandler.isValidator());
+        setupComponentDelayed(modelNode, differenceHandler.isAmender());
 
     if (isCustomParserType(typeName))
-        setupCustomParserNodeDelayed(modelNode, differenceHandler.isValidator());
+        setupCustomParserNodeDelayed(modelNode, differenceHandler.isAmender());
 
     context->enterScope(astNode);
 
@@ -1245,7 +1245,7 @@ void TextToModelMerger::syncNode(ModelNode &modelNode,
 
     if (!defaultPropertyItems.isEmpty()) {
         if (isComponentType(modelNode.type()))
-            setupComponentDelayed(modelNode, differenceHandler.isValidator());
+            setupComponentDelayed(modelNode, differenceHandler.isAmender());
         if (defaultPropertyName.isEmpty()) {
             qWarning() << "No default property for node type" << modelNode.type() << ", ignoring child items.";
         } else {
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h
index c729d2aeddc..71856eff320 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.h
@@ -210,7 +210,7 @@ public:
                              ReadingContext *context) = 0;
     virtual void propertyAbsentFromQml(AbstractProperty &modelProperty) = 0;
     virtual void idsDiffer(ModelNode &modelNode, const QString &qmlId) = 0;
-    virtual bool isValidator() const = 0;
+    virtual bool isAmender() const = 0;
 
 protected:
     TextToModelMerger *m_merger;
@@ -262,7 +262,7 @@ public:
                      ReadingContext *context) override;
     void propertyAbsentFromQml(AbstractProperty &modelProperty) override;
     void idsDiffer(ModelNode &modelNode, const QString &qmlId) override;
-    bool isValidator() const override {return false; }
+    bool isAmender() const override {return false; }
 };
 
 class ModelAmender: public DifferenceHandler
@@ -311,7 +311,7 @@ public:
                      ReadingContext *context) override;
     void propertyAbsentFromQml(AbstractProperty &modelProperty) override;
     void idsDiffer(ModelNode &modelNode, const QString &qmlId) override;
-    bool isValidator() const override {return true; }
+    bool isAmender() const override {return true; }
 };
 
 } //Internal
diff --git a/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp b/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
index c5c324c81c3..8bd3339de62 100644
--- a/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
+++ b/src/plugins/qmlprofiler/tests/flamegraphview_test.cpp
@@ -64,7 +64,7 @@ void FlameGraphViewTest::testSelection()
     });
 
     QSignalSpy spy(&view, SIGNAL(typeSelected(int)));
-    QTest::mouseClick(view.childAt(250, 250), Qt::LeftButton, Qt::NoModifier, QPoint(5, 495));
+    QTest::mouseClick(view.childAt(250, 250), Qt::LeftButton, Qt::NoModifier, QPoint(15, 485));
     if (spy.isEmpty())
         QVERIFY(spy.wait());
 
@@ -74,7 +74,7 @@ void FlameGraphViewTest::testSelection()
 
     // Click in empty area deselects
     expectedType = -1;
-    QTest::mouseClick(view.childAt(250, 250), Qt::LeftButton, Qt::NoModifier, QPoint(495, 50));
+    QTest::mouseClick(view.childAt(250, 250), Qt::LeftButton, Qt::NoModifier, QPoint(485, 50));
     QCOMPARE(spy.count(), 2);
 
     view.onVisibleFeaturesChanged(1 << ProfileBinding);