diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index c8aae39677f..2a2e02fd172 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,7 +1,7 @@ -set(IDE_VERSION "9.0.82") # The IDE version. -set(IDE_VERSION_COMPAT "9.0.82") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "10.0.0-beta1") # The IDE display version. -set(IDE_COPYRIGHT_YEAR "2022") # The IDE current copyright year. +set(IDE_VERSION "9.0.83") # The IDE version. +set(IDE_VERSION_COMPAT "9.0.83") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "10.0.0-beta2") # The IDE display version. +set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name. diff --git a/cmake/QtCreatorTranslations.cmake b/cmake/QtCreatorTranslations.cmake index 3c35f2f9126..80286602ad3 100644 --- a/cmake/QtCreatorTranslations.cmake +++ b/cmake/QtCreatorTranslations.cmake @@ -91,9 +91,16 @@ function(_create_ts_custom_target name) file(WRITE "${ts_file_list}" "${_sources_str}\n${_includes_str}\n") add_custom_target("${_arg_TS_TARGET_PREFIX}${name}" - COMMAND Qt::lupdate -locations relative -no-ui-lines -no-sort "@${ts_file_list}" -ts ${ts_files} + COMMAND Qt::lupdate -locations relative -no-ui-lines "@${ts_file_list}" -ts ${ts_files} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - COMMENT "Generate .ts files" + COMMENT "Generate .ts files, with obsolete translations and files and line numbers" + DEPENDS ${_sources} + VERBATIM) + + add_custom_target("${_arg_TS_TARGET_PREFIX}${name}_no_locations" + COMMAND Qt::lupdate -locations none -no-ui-lines "@${ts_file_list}" -ts ${ts_files} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generate .ts files, with obsolete translations, without files and line numbers" DEPENDS ${_sources} VERBATIM) @@ -107,7 +114,7 @@ function(_create_ts_custom_target name) get_filename_component(_bin_dir ${_lupdate_binary} DIRECTORY) add_custom_target("${_arg_TS_TARGET_PREFIX}${name}_cleaned" - COMMAND Qt::lupdate -locations relative -no-ui-lines -no-sort "@${ts_file_list}" -ts ${ts_files} + COMMAND Qt::lupdate -locations relative -no-ui-lines "@${ts_file_list}" -ts ${ts_files} COMMAND ${_bin_dir}/lconvert -locations none -no-ui-lines -no-obsolete ${ts_files} -o ${ts_files} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Generate .ts files, remove obsolete and vanished translations, and do not add files and line number" diff --git a/dist/changelog/changes-10.0.0.md b/dist/changelog/changes-10.0.0.md index 2650ffa2a3d..db90fc30e59 100644 --- a/dist/changelog/changes-10.0.0.md +++ b/dist/changelog/changes-10.0.0.md @@ -14,95 +14,99 @@ General ------- * Added support for temporarily dragging progress details out of the way - (QTCREATORBUG-28078) + in addition to hiding them with the button below them (QTCREATORBUG-28078) Editing ------- * Added `Follow Symbol` for `http(s)` string literals (QTCREATORBUG-14967) -* Added environment expansion to file system locator filter (QTCREATORBUG-242) +* Added environment expansion to the file system locator filter (QTCREATORBUG-242) * Added `Temporarily hide inline annotations` for types of annotations * Improved cursor visibility with indentation visualization (QTCREATORBUG-28645) -* Fixed editor scrolling when pressing backspace (QTCREATORBUG-28316) -* Fixed performance of rendering many search results (QTCREATORBUG-21056) +* Fixed the editor so that it scrolls to cursor position when pressing backspace + (QTCREATORBUG-28316) +* Fixed the performance of rendering many search results (QTCREATORBUG-21056) ### C++ * Added renaming of includes when renaming `.ui` files (QTCREATORBUG-14259) * Added automatic refactoring of C++ code when forms in `.ui` files are renamed (QTCREATORBUG-1179) -* Added option for ignoring files for indexing (QTCREATORBUG-28313) +* Added the option to ignore files for indexing (QTCREATORBUG-28313) * Added `Tools > C++ > Find Unused Functions`, and `Find Unused C/C++ Functions` - to the project context menu (QTCREATORBUG-6772) + to the `Projects` view context menu (QTCREATORBUG-6772) * Fixed text codec when rewriting headers as part of renaming (QTCREATORBUG-28164) -* Fixed color of whitespace visualization in string literals +* Fixed the color of whitespace visualization in string literals (QTCREATORBUG-26693, QTCREATORBUG-28284) * Fixed `Move Definition` for template functions (QTCREATORBUG-28186) * Clangd - * Made temporary disabling of global indexing possibly by cancelling in the + * Made temporary disabling of global indexing possible by canceling it in the progress indicator * Added support for highlighting angle brackets * Built-in - * Added support for spaceship operator (QTCREATORBUG-27503) - * Fixed handling of `= default` (QTCREATORBUG-28102) + * Added support for the spaceship operator (QTCREATORBUG-27503) + * Fixed the handling of `= default` (QTCREATORBUG-28102) * ClangFormat * Enabled by default - * Added project setting for `ClangFormat` (QTCREATORBUG-28188) + * Added the option to disable `ClangFormat` for a project in + `Edit > Preferences > C++ > Formatting mode` (QTCREATORBUG-28188) ### Language Server Protocol -* Added `Restart` action to menu in editor tool bar +* Added the `Restart` action to the menu in the editor tool bar * Added `Call Hierarchy` (QTCREATORBUG-11660) ### QML * Updated code model to Qt 6.5 -* Added experimental support for QML language server -* Added color preview tooltip (QTCREATORBUG-28446) -* Added option for applying `qmlformat` on file save (QTCREATORBUG-28192, +* Added experimental support for the QML language server +* Added a color preview tooltip (QTCREATORBUG-28446) +* Added the option to apply `qmlformat` on file save (QTCREATORBUG-28192, QTCREATORBUG-26602) * Added `Follow Symbol` for QRC paths in string literals (QTCREATORBUG-28087) -* Adapted wizard to new features in Qt 6.4 and Qt 6.5 (QTBUG-47996) -* Fixed freeze when closing file (QTCREATORBUG-28206) +* Adapted the Qt Quick Application wizard template to new features in Qt 6.4 + and Qt 6.5 (QTBUG-47996) +* Fixed a freeze when closing files (QTCREATORBUG-28206) * Fixed that `QtObject` was not recognized (QTCREATORBUG-28287, QTCREATORBUG-28375) ### Python -* Added interpreter selector to editor toolbar (PYSIDE-2154) +* Added an interpreter selector to the editor toolbar (PYSIDE-2154) Projects -------- * Added `Build > Run Generator` for exporting projects to other build systems (QTCREATORBUG-28149) -* Added option for browsing remote file system for remote builds and targets -* Added support for opening remote terminal +* Added the option to browse remote file systems for remote builds and targets +* Added support for opening remote terminals * Fixed that wizards did not create target directories (QTCREATORBUG-28346) * Fixed that absolute paths could be shown when relative paths would be preferable (QTCREATORBUG-288) ### CMake -* Added deployment method with `cmake --install` (QTCREATORBUG-25880) -* Added option for using `cmake-format` for CMake files +* Added a deployment method with `cmake --install` (QTCREATORBUG-25880) +* Added the option to use `cmake-format` for CMake files ([cmake-format Documentation](https://cmake-format.readthedocs.io/en/latest/)) -* Added option for showing advanced configure items by default +* Added the option to show advanced configure items by default * Moved `Autorun CMake` to global settings -* Changed environment for running CMake to be based on build environment by - default (QTCREATORBUG-28513) -* Fixed that `Package manager auto setup` created dependency of project build to - Qt Creator installation +* Changed the environment for running CMake to be based on the build environment + by default (QTCREATORBUG-28513) +* Fixed that `Package manager auto setup` created a dependency of the project + build to the Qt Creator installation ### Qbs -* Added `Profile` build variant (QTCREATORBUG-27206) +* Added the `Profile` build variant (QTCREATORBUG-27206) * Fixed that generated files were not made known to the code model ### Python -* Removed wizard for dynamically loaded `.ui` projects (QTCREATORBUG-25807) +* Removed the wizard template for dynamically loaded `.ui` projects + (QTCREATORBUG-25807) ### Qt Quick UI Prototype @@ -115,7 +119,7 @@ Debugging * Added pretty printers for `variant`, `optional` and `tuple` from `libcpp` (QTCREATORBUG-25865) -* Fixed highlighting in disassembly view +* Fixed highlighting in the `Disassembler` view * Fixed skipping `std::function` details when stepping Analyzer @@ -128,51 +132,52 @@ Analyzer Version Control Systems ----------------------- -* Moved support for `Fossil` SCM into mainline repository +* Moved support for the `Fossil` SCM into the mainline repository * Removed settings for prompting to submit (QTCREATORBUG-22233) * Added links to file names in diff output (QTCREATORBUG-27309) * Fixed blame on symbolic links (QTCREATORBUG-20792) -* Fixed saving of files before applying action on chunks (QTCREATORBUG-22506) +* Fixed the saving of files before applying an action on chunks + (QTCREATORBUG-22506) * Fixed line ending preservation when reverting chunks (QTCREATORBUG-12690) ### Git * Improved tracking of external changes (QTCREATORBUG-21089) -* Added editor annotation for blame information (instant blame), with setting - (opt-out), and action to show it manually for the current line +* Added editor annotation for blame information (instant blame) with a setting + (opt-out) and an action to show it manually for the current line (QTCREATORBUG-23299) Test Integration ---------------- * Improved `Run` and `Debug Test Under Cursor` (QTCREATORBUG-28496) -* Improved number of files that are scanned for tests +* Improved the number of files that are scanned for tests * Improved output handling (QTCREATORBUG-28706) -* Made expensive checking for tests in derived `TestCase` objects optional +* Made the expensive checking for tests in derived `TestCase` objects optional Platforms --------- ### macOS -* Changed kits to prefer Xcode toolchain over the wrappers in `/bin` +* Changed kits to prefer Xcode toolchains over the wrappers in `/bin` ### Android -* Removed service management from manifest editor (QTCREATORBUG-28024) +* Removed service management from the manifest editor (QTCREATORBUG-28024) ### Remote Linux -* Fixed that opening file dialog unnecessarily queried for password for remote - devices +* Fixed that opening a file dialog unnecessarily asks for passwords for + remote devices ### Docker -* Added support for remote code model via remote Clangd +* Added support for the remote code model via a remote Clangd * Added support for loading and attaching to core dumps from remote devices * Added support for using ClangFormat on remote files -* Added option to enable necessary capabilities for debugging with LLDB -* Fixed issue with space in file paths (QTCREATORBUG-28476) +* Added an option to enable necessary capabilities for debugging with LLDB +* Fixed an issue with space in file paths (QTCREATORBUG-28476) * Fixed that auto-detection controls were shown for devices registered by the installer diff --git a/doc/qtcreator/images/creator-toggle-progress-bar.png b/doc/qtcreator/images/creator-toggle-progress-bar.png deleted file mode 100644 index 4d041e363cb..00000000000 Binary files a/doc/qtcreator/images/creator-toggle-progress-bar.png and /dev/null differ diff --git a/doc/qtcreator/images/icons/languageclient.png b/doc/qtcreator/images/icons/languageclient.png new file mode 100644 index 00000000000..878b4df4b98 Binary files /dev/null and b/doc/qtcreator/images/icons/languageclient.png differ diff --git a/doc/qtcreator/images/qtcreator-call-hierarchy-view.png b/doc/qtcreator/images/qtcreator-call-hierarchy-view.png new file mode 100644 index 00000000000..95f0c87dd31 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-call-hierarchy-view.png differ diff --git a/doc/qtcreator/images/qtcreator-clang-code-model-options.png b/doc/qtcreator/images/qtcreator-clang-code-model-options.png deleted file mode 100644 index 7bc9edcafdf..00000000000 Binary files a/doc/qtcreator/images/qtcreator-clang-code-model-options.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-editortoolbar-symbols.png b/doc/qtcreator/images/qtcreator-editortoolbar-symbols.png deleted file mode 100644 index 8128c7ae13b..00000000000 Binary files a/doc/qtcreator/images/qtcreator-editortoolbar-symbols.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp b/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp new file mode 100644 index 00000000000..4c26207b89c Binary files /dev/null and b/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-code-model.webp b/doc/qtcreator/images/qtcreator-preferences-code-model.webp new file mode 100644 index 00000000000..9cd9458fe57 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-code-model.webp differ diff --git a/doc/qtcreator/images/qtcreator-toggle-progress-bar.webp b/doc/qtcreator/images/qtcreator-toggle-progress-bar.webp new file mode 100644 index 00000000000..c8438ae0026 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-toggle-progress-bar.webp differ diff --git a/doc/qtcreator/images/qtcreator-typo-clang.png b/doc/qtcreator/images/qtcreator-typo-clang.png index 76722d658ed..2d0b6bd5d11 100644 Binary files a/doc/qtcreator/images/qtcreator-typo-clang.png and b/doc/qtcreator/images/qtcreator-typo-clang.png differ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index ac746926e3d..1359eceda1e 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -393,6 +393,13 @@ CMake script that installs dependencies from a \c conanfile.txt, \c conanfile.py, or \c vcpkg.json file in the project source directory. + \section1 QTC_RUN Environment Variable + + \QC sets the environment variable \c QTC_RUN to \c 1 when executing + the \c cmake process. + + This enables the CMake code to detect if it's being executed from \QC. + \section1 CMake Clean Steps When building with CMake, you can add arguments to pass to CMake and the diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 504eaa9087b..d775a87d58f 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -775,9 +775,6 @@ but this option should be used with care, as it is slow and unstable on the GDB side. For more information, see \l{Specifying GDB Settings}. - \include creator-debugger-common.qdocinc debugger-expressions-cpp - \include creator-debugger-common.qdocinc debugger-qt-basic-objects - \section1 Debugging C++ Based Applications The following sections describe additional debugging functions that apply diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index deb2e3b7d9f..609e2837915 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -21,7 +21,7 @@ In the following screenshot, \QC annotates an error because a semicolon is missing at the end of the line: - \image qtcreator-syntaxerror.png + \image qtcreator-syntaxerror.png {Syntax error in the Edit mode} In the following screenshot, \QC issues a warning because the variable is not used: @@ -30,10 +30,11 @@ In the following screenshot, a Qt class name has a typo: - \image qtcreator-typo-clang.png + \image qtcreator-typo-clang.png {Annotation tooltip in the Edit mode} You can use the icons in the tooltip popup to copy the error or - warning message to the clipboard or to ignore and hide it. Select + warning message to the clipboard, to hide messages of a particular type, + or to \l{Configuring clangd}{change the diagnostics settings}. Select the \uicontrol {Annotation Settings} link to specify the position of the line annotations. @@ -745,7 +746,8 @@ \uicontrol {Code Model}, this action also expands all \c {"#include "} statements to their actual contents. - \image qtcreator-clang-code-model-options.png "C++ Code Model preferences" + \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} + \endif diff --git a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc index 72d4595a081..82d3530d2bc 100644 --- a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc @@ -28,7 +28,7 @@ open in the editor. \if defined(qtcreator) - \image qtcreator-editortoolbar-symbols.png + \image qtcreator-editortoolbar-symbols.webp {Edit mode toolbar} \else \image studio-edit-mode.png \endif @@ -116,6 +116,16 @@ \uicontrol {Project Settings} > \uicontrol Editor. \if defined(qtcreator) For more information, see \l {Specifying Editor Settings}. + + \section2 Managing Language Servers + + Select the \inlineimage icons/languageclient.png + icon on the editor toolbar (7) to view the \l{Using Language Servers} + {language server} for the current project. You can restart the language + server or select another one in the menu. Also, you can + \l{Inspecting Language Clients}{inspect the communication} between \QC + and language servers and view server capabilities, as well as + \l{Specifying Settings for Language Clients}{set language server preferences}. \endif \section1 Editing Selected Lines diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index cefef039c4f..232b5587274 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -87,7 +87,10 @@ \li Locating any open document (\c {o}) - \li Locating files anywhere on your file system (\c {f}) + \li Locating files anywhere on your file system (\c {f}). You can use + environment variables in the \c {f} filter. For example, use + \c {f $ENVVAR} to expand the environment variable \c ENVVAR on Unix + systems and \c {f %ENVVAR%} to expand it on Windows systems. \li Locating files belonging to your project (\c {p}), such as source, header, resource, and \c {.ui} files, or to any project (\c {a}) diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index fc761984f2e..45ca8060925 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -104,7 +104,7 @@ \li Select \uicontrol Edit > \uicontrol Preferences > \uicontrol C++ > \uicontrol {Code Model}. - \image qtcreator-clang-code-model-options.png "C++ Code Model preferences" + \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} \li To instruct the code model to interpret ambiguous header files as C language files if you develop mainly using C, select the @@ -127,6 +127,10 @@ edit the value for the \uicontrol {Do not index files greater than} check box. To index all files, deselect the check box. + \li To ignore files that match wildcard patterns, select the + \uicontrol {Ignore files} check box and enter each wildcard pattern + on a separate line in the field. + \endlist \section1 Configuring clangd @@ -139,6 +143,12 @@ re-scanning is incremental, so nothing is lost by closing and re-starting \QC. + To temporarily disable global indexing, select + \uicontrol {Toggle Progress Details} (1), and then select \uicontrol X on + the progress bar. + + \image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button} + By default, \QC runs one clangd process per project. If you have created \l{Managing Sessions}{sessions} that have related projects, you can specify that the projects in the session should be managed by a single diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 358a4b33b46..99dcfb69eac 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -32,6 +32,8 @@ \l{Viewing Defined Types and Symbols}{Outline} view or in the \uicontrol Symbols list on the \l{Using the Editor Toolbar} {editor toolbar} + \li \l{Viewing Call Hierarchy} + {Viewing the callers and callees of a function} \li \l{Finding Symbols}{Finding references to symbols} \li \l{Renaming Symbols}{Renaming the symbol under cursor} \li Code actions @@ -120,7 +122,9 @@ name. For more information, see \l{Using Qt Creator Variables}. \li In the \uicontrol Java field, enter the path to the Java executable. \li In the \uicontrol {Java Language Server} field, enter the path to - the Java language server \c .jar file. + the Java language server \c .jar file. You can download the Java + language server from \l{https://download.eclipse.org/jdtls/milestones/} + {Eclipse Downloads}. \endlist \section2 Python Language Server @@ -182,6 +186,10 @@ determines when the server is started. The information displayed depends on the language server. + Select the \inlineimage icons/languageclient.png + button on the \l{Managing Language Servers}{editor toolbar}, and then select + \uicontrol {Restart} to restart language servers. + \uicontrol Log displays additional information about the selected log entry. You can see the \uicontrol {Content length} and \uicontrol {MIME type} of a \uicontrol {Client Message} and \uicontrol {Server Message}, as well as diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc index 6563358d778..d06989e66fc 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-opening.qdoc @@ -97,6 +97,6 @@ To show or hide detailed progress information, select \uicontrol {Toggle Progress Details} (1). - \image creator-toggle-progress-bar.png "Toggle Progress Details button" + \image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button} */ diff --git a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc index 3541b706ca2..674a733357f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-toolbars.qdoc @@ -60,6 +60,9 @@ You can change the font family and size as well as text formatting, style, alignment, and color. + \note Move the mouse pointer over a color hex value in the code editor to + see the color as a tooltip. + If a property is assigned an expression instead of a value, you cannot use the toolbar to edit it. The button for editing the property is disabled. diff --git a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc index 85bdb4f1a51..b0a98a81635 100644 --- a/doc/qtcreator/src/user-interface/creator-projects-view.qdoc +++ b/doc/qtcreator/src/user-interface/creator-projects-view.qdoc @@ -68,7 +68,8 @@ \endif \li Rename or remove existing files. If you change the base name of a file, \QC displays a list of other files with the same base name - and offers to rename them as well. + and offers to rename them as well. If you rename a UI file (.ui), + \QC also changes corresponding include statements accordingly. \if defined(qtcreator) \li Remove existing directories from \l{Setting Up a Generic Project} {generic projects}. @@ -76,7 +77,9 @@ \li Add libraries. For more information, see \l{Adding Libraries to Projects}. \li Add and remove subprojects. + \li Find unused functions. \endif + \li Search from the selected directory. \li Open a terminal window in the project directory. To specify the terminal to use on Linux and \macos, select \uicontrol Edit > diff --git a/doc/qtcreator/src/user-interface/creator-views.qdoc b/doc/qtcreator/src/user-interface/creator-views.qdoc index 12faa3bb0d7..856dfd15eef 100644 --- a/doc/qtcreator/src/user-interface/creator-views.qdoc +++ b/doc/qtcreator/src/user-interface/creator-views.qdoc @@ -102,6 +102,21 @@ To visit all parts of a namespace, double-click on the namespace item multiple times. + \section1 Viewing Call Hierarchy + + The \uicontrol {Call Hierarchy} view shows information about incoming and + outgoing function calls from a \l{Using Language Servers}{language server}. + Place the cursor on a function definition in the code editor to see lists + of functions that call it and the functions it calls. This works recursively, + so you can also see the caller of the caller. However, Clangd only lists + incoming calls. + + Select the \inlineimage icons/languageclient.png + button on the \l{Managing Language Servers}{editor toolbar}, and then select + \uicontrol {Restart} to collect call hierarchy information for the function. + + \image qtcreator-call-hierarchy-view.png {Call Hierarchy view} + \section1 Viewing Type Hierarchy To view the base classes and derived classes of a class, right-click the diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 834bee02c4a..b4688986a35 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -6,20 +6,20 @@ import qbs.Utilities Module { Depends { name: "cpp"; required: false } - property string qtcreator_display_version: '10.0.0-beta1' + property string qtcreator_display_version: '10.0.0-beta2' property string ide_version_major: '9' property string ide_version_minor: '0' - property string ide_version_release: '82' + property string ide_version_release: '83' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release property string ide_compat_version_major: '9' property string ide_compat_version_minor: '0' - property string ide_compat_version_release: '82' + property string ide_compat_version_release: '83' property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release - property string qtcreator_copyright_year: '2022' + property string qtcreator_copyright_year: '2023' property string qtcreator_copyright_string: "(C) " + qtcreator_copyright_year + " The Qt Company Ltd" property string ide_display_name: 'Qt Creator' diff --git a/share/qtcreator/debugger/cdbbridge.py b/share/qtcreator/debugger/cdbbridge.py index bd96a8e15c5..8b0d323aa56 100644 --- a/share/qtcreator/debugger/cdbbridge.py +++ b/share/qtcreator/debugger/cdbbridge.py @@ -479,6 +479,10 @@ class Dumper(DumperBase): return None nativeValue = value.nativeValue + if nativeValue is None: + if not self.isExpanded(): + raise Exception("Casting not expanded values is to expensive") + nativeValue = self.nativeParseAndEvaluate('(%s)0x%x' % (value.type.name, value.pointer())) castVal = nativeVtCastValue(nativeValue) if castVal is not None: val = self.fromNativeValue(castVal) diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 1d11682ed75..f72ea04b38d 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -3309,13 +3309,13 @@ class DumperBase(): else: val = self.dumper.nativeValueDereferenceReference(self) elif self.type.code == TypeCode.Pointer: - if self.nativeValue is None: + try: + val = self.dumper.nativeValueDereferencePointer(self) + except: val.laddress = self.pointer() val._type = self.type.dereference() if self.dumper.useDynamicType: val._type = self.dumper.nativeDynamicType(val.laddress, val.type) - else: - val = self.dumper.nativeValueDereferencePointer(self) else: raise RuntimeError("WRONG: %s" % self.type.code) #DumperBase.warn("DEREFERENCING FROM: %s" % self) diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index e9da10b5014..031addb8530 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -2328,7 +2328,10 @@ def qdump_QWeakPointerHelper(d, value, isWeak, innerType=None): if innerType is None: innerType = value.type[0] with Children(d): - short = d.putSubItem('data', d.createValue(val, innerType)) + dataAddress = value.laddress + if isWeak: + dataAddress = dataAddress + d.ptrSize() + short = d.putSubItem('data', d.createValue(dataAddress, d.createPointerType(innerType))) d.putIntItem('weakref', weakref) d.putIntItem('strongref', strongref) d.putValue(short.value, short.encoding) diff --git a/share/qtcreator/translations/extract-customwizards.py b/share/qtcreator/translations/extract-customwizards.py index c5235b53628..7606a62606d 100644 --- a/share/qtcreator/translations/extract-customwizards.py +++ b/share/qtcreator/translations/extract-customwizards.py @@ -15,8 +15,8 @@ target_file = sys.argv[2] def fix_value(value): - value = value.replace('\"', '\\\"') - value = value.replace('\n', '\\\n') + value = value.replace('\"', '\\"') + value = value.replace('\n', '\\n') return value @@ -30,7 +30,7 @@ def parse_file(file_path): './/comboentrytext', './/message']: for e in root.findall(i): - result += 'const char *a{} = QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "{}"); // {}\n'.format(index, fix_value(e.text), file_path) + result += 'const char *a{} = QT_TRANSLATE_NOOP("QtC::ProjectExplorer", "{}"); // {}\n'.format(index, fix_value(e.text), file_path) index += 1 return result diff --git a/share/qtcreator/translations/extract-customwizards.xq b/share/qtcreator/translations/extract-customwizards.xq index 0ded98410b9..efc6fb60c14 100644 --- a/share/qtcreator/translations/extract-customwizards.xq +++ b/share/qtcreator/translations/extract-customwizards.xq @@ -1,4 +1,4 @@ -let $prefix := string("QT_TRANSLATE_NOOP("ProjectExplorer::CustomWizard", "") +let $prefix := string("QT_TRANSLATE_NOOP("QtC::ProjectExplorer", "") let $suffix := concat("")", codepoints-to-string(10)) for $file in tokenize($files, string("\|")) let $doc := doc($file) diff --git a/share/qtcreator/translations/extract-externaltools.py b/share/qtcreator/translations/extract-externaltools.py index 9af0de756ae..57f32869031 100644 --- a/share/qtcreator/translations/extract-externaltools.py +++ b/share/qtcreator/translations/extract-externaltools.py @@ -15,8 +15,8 @@ target_file = sys.argv[2] def fix_value(value): - value = value.replace('\"', '\\\"') - value = value.replace('\n', '\\\n') + value = value.replace('\"', '\\"') + value = value.replace('\n', '\\n') return value @@ -27,7 +27,7 @@ def parse_file(file_path): index = 0 for i in ['.//description', './/displayname', './/category']: for e in root.findall(i): - result += 'const char *a{} = QT_TRANSLATE_NOOP("Core::Internal::ExternalTool", "{}"); // {}\n'.format(index, fix_value(e.text), file_path) + result += 'const char *a{} = QT_TRANSLATE_NOOP("QtC::Core", "{}"); // {}\n'.format(index, fix_value(e.text), file_path) index += 1 return result diff --git a/share/qtcreator/translations/extract-externaltools.xq b/share/qtcreator/translations/extract-externaltools.xq index f15ce8ac676..894f31d56aa 100644 --- a/share/qtcreator/translations/extract-externaltools.xq +++ b/share/qtcreator/translations/extract-externaltools.xq @@ -1,4 +1,4 @@ -let $prefix := string("QT_TRANSLATE_NOOP("Core::Internal::ExternalTool", "") +let $prefix := string("QT_TRANSLATE_NOOP("QtC::Core", "") let $suffix := concat("")", codepoints-to-string(10)) for $file in tokenize($files, string("\|")) let $doc := doc($file) diff --git a/share/qtcreator/translations/extract-jsonwizards.py b/share/qtcreator/translations/extract-jsonwizards.py index 8a9cd7ade90..3ea3e72f58e 100644 --- a/share/qtcreator/translations/extract-jsonwizards.py +++ b/share/qtcreator/translations/extract-jsonwizards.py @@ -29,8 +29,8 @@ def recursive_iter(obj, key=''): def fix_value(value): - value = value.replace('\"', '\\\"') - value = value.replace('\n', '\\\n') + value = value.replace('\"', '\\"') + value = value.replace('\n', '\\n') return value @@ -44,7 +44,7 @@ def parse_file(file_path): for key, value in recursive_iter(root): if key.startswith('tr'): - result += 'const char *a{} = QT_TRANSLATE_NOOP("ProjectExplorer::JsonWizard", "{}"); // {}\n'.format(index, fix_value(value), file_path) + result += 'const char *a{} = QT_TRANSLATE_NOOP("QtC::ProjectExplorer", "{}"); // {}\n'.format(index, fix_value(value), file_path) index += 1 return result diff --git a/share/qtcreator/translations/extract-snippets.py b/share/qtcreator/translations/extract-snippets.py index 6dcbdb5aa3e..ffaafaff984 100644 --- a/share/qtcreator/translations/extract-snippets.py +++ b/share/qtcreator/translations/extract-snippets.py @@ -15,8 +15,8 @@ target_file = sys.argv[2] def fix_value(value): - value = value.replace('\"', '\\\"') - value = value.replace('\n', '\\\n') + value = value.replace('\"', '\\"') + value = value.replace('\n', '\\n') return value @@ -29,7 +29,7 @@ def parse_file(file_path): if 'complement' in e.attrib: text = fix_value(e.attrib['complement']) if text: - result += 'const char *a{} = QT_TRANSLATE_NOOP3("TextEditor::Internal::Snippets", "{}", "group:\'{}\' trigger:\'{}\'"); // {}\n' \ + result += 'const char *a{} = QT_TRANSLATE_NOOP3("QtC::TextEditor", "{}", "group:\'{}\' trigger:\'{}\'"); // {}\n' \ .format(index, text, e.attrib['group'], e.attrib['trigger'], file_path) index += 1 diff --git a/share/qtcreator/translations/extract-snippets.xq b/share/qtcreator/translations/extract-snippets.xq index 0b7e52d4766..fa9d28ffa88 100644 --- a/share/qtcreator/translations/extract-snippets.xq +++ b/share/qtcreator/translations/extract-snippets.xq @@ -1,4 +1,4 @@ -let $prefix := string("QT_TRANSLATE_NOOP3("TextEditor::Internal::Snippets", "") +let $prefix := string("QT_TRANSLATE_NOOP3("QtC::TextEditor", "") let $midfix := string("", "") let $suffix := concat("")", codepoints-to-string(10)) for $file in tokenize($files, string("\|")) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index 51f7bce0421..7f62f6a363e 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -15999,7 +15999,7 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás - OpenWith::Editors + QtC::Core Plain Text Editor Editor prostého textu @@ -16048,9 +16048,6 @@ Toho se dosáhne vložením této zkratky v zadávacím poli vyhledávače, nás Python Editor Editor Pythonu - - - QtC::Core Preferences Nastavení diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index d6a61620fef..cd68dfd26b1 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -19956,7 +19956,7 @@ Fejl: %5 - OpenWith::Editors + QtC::Core Binary Editor Binær-redigering diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index 40bfc710aef..11d5737cbfb 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -9470,9 +9470,6 @@ Leer lassen, um das Dateisystem zu durchsuchen. Locator Locator - - - OpenWith::Editors Plain Text Editor Texteditor @@ -32671,7 +32668,9 @@ Möchten Sie sie jetzt auschecken? Vollständig qualifizierter Name einschließlich Namensräumen - Creates a widget-based Qt application that contains a Qt Designer-based main window.Preselects a desktop Qt for building the application if available. + Creates a widget-based Qt application that contains a Qt Designer-based main window. + +Preselects a desktop Qt for building the application if available. Erstellt eine Widget-basierte Qt-Anwendung mit einem Qt Designer-basierten Hauptfenster. Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist. @@ -32745,7 +32744,9 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü C++-Bibliothek - Creates a project containing a single main.cpp file with a stub implementation.Preselects a desktop Qt for building the application if available. + Creates a project containing a single main.cpp file with a stub implementation. + +Preselects a desktop Qt for building the application if available. Erstellt ein Projekt, das aus einer main.cpp-Datei mit einem Implementationsrumpf besteht. Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist. @@ -32803,7 +32804,9 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü Qt 6 - Creates a Qt Quick 2 UI project with a QML entry point. To use it, you need to have a QML runtime environment.Use this only if you are prototyping. You cannot create a full application with this. Consider using a Qt Quick Application project instead. + Creates a Qt Quick 2 UI project with a QML entry point. To use it, you need to have a QML runtime environment. + +Use this only if you are prototyping. You cannot create a full application with this. Consider using a Qt Quick Application project instead. Erstellt ein Qt Quick 2 UI-Projekt mit QML-Einsprungpunkt. Um es zu verwenden, brauchen Sie eine QML-Laufzeitumgebung wie qmlscene. Benutzen Sie dies nur für Prototypen. Sie können damit keine vollständige Anwendung erstellen. Vielleicht ist ein Qt Quick-Anwendungsprojekt besser geeignet. @@ -51200,29 +51203,8 @@ in "%2" aus. Codemodell - If background indexing is enabled, global symbol searches will yield -more accurate results, at the cost of additional CPU load when -the project is first opened. -The indexing result is persisted in the project's build directory. - -If you disable background indexing, a faster, but less accurate, -built-in indexer is used instead. - -The thread priority for building the background index can be adjusted since clangd 15. -Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused. -Normal Priority: Reduced priority compared to interactive work. -Low Priority: Same priority as other clangd work. - Wenn sie das globale Indizieren aktivieren, liefert die globale Symbolsuche genauere Resultate, -es erhöht aber die CPU-Last beim ersten Öffnen von Projekten. -Das Resultat der Indizierung wird im Build-Verzeichnis des Projekts gespeichert. - -Wenn sie das globale Indizieren deaktivieren, wird stattdessen ein schnellerer, -aber weniger genauer, integrierter Indexer benutzt. - -Seit Clangd 15 können Sie die Priorität für die Indizierungs-Threads anpassen. -Hintergrund-Priorität: Niedrigste Priorität, läuft nur auf leerlaufenden CPUs. Kann "Performance"-Kerne ungenutzt lassen. -Normale Priorität: Geringere Priorität im Vergleich zu interaktiven Aktivitäten. -Niedrige Priorität: Dieselbe Priorität wie andere Clangd-Aktivitäten. + <p>If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when the project is first opened. The indexing result is persisted in the project's build directory. If you disable background indexing, a faster, but less accurate, built-in indexer is used instead. The thread priority for building the background index can be adjusted since clangd 15.</p><p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused.</p><p>Normal Priority: Reduced priority compared to interactive work.</p>Low Priority: Same priority as other clangd work. + <p>Wenn sie das globale Indizieren aktivieren, liefert die globale Symbolsuche genauere Resultate, es erhöht aber die CPU-Last beim ersten Öffnen von Projekten. Das Resultat der Indizierung wird im Build-Verzeichnis des Projekts gespeichert. Wenn sie das globale Indizieren deaktivieren, wird stattdessen ein schnellerer, aber weniger genauer, integrierter Indexer benutzt. Seit Clangd 15 können Sie die Priorität für die Indizierungs-Threads anpassen.</p><p>Hintergrund-Priorität: Niedrigste Priorität, läuft nur auf leerlaufenden CPUs. Kann "Performance"-Kerne ungenutzt lassen.</p><p>Normale Priorität: Geringere Priorität im Vergleich zu interaktiven Aktivitäten.</p>Niedrige Priorität: Dieselbe Priorität wie andere Clangd-Aktivitäten. Number of worker threads used by clangd. Background indexing also uses this many worker threads. diff --git a/share/qtcreator/translations/qtcreator_es.ts b/share/qtcreator/translations/qtcreator_es.ts index 3d863c41696..ff32f1a64cb 100644 --- a/share/qtcreator/translations/qtcreator_es.ts +++ b/share/qtcreator/translations/qtcreator_es.ts @@ -10782,7 +10782,7 @@ p, li { white-space: pre-wrap; } - OpenWith::Editors + QtC::Core Plain Text Editor @@ -10799,9 +10799,6 @@ p, li { white-space: pre-wrap; } .pro File Editor - - - QtC::Core Preferences diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 626ec6c8ec4..5ee57efddef 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -15614,7 +15614,7 @@ p, li { white-space: pre-wrap; } - OpenWith::Editors + QtC::Core Plain Text Editor Éditeur de texte @@ -15663,9 +15663,6 @@ p, li { white-space: pre-wrap; } Python Editor Éditeur Python - - - QtC::Core Preferences Préférences diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 246e1c3e634..86fd5ff6388 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -15282,7 +15282,7 @@ Check the test environment. - OpenWith::Editors + QtC::Core Binary Editor Binarni uređivač diff --git a/share/qtcreator/translations/qtcreator_hu.ts b/share/qtcreator/translations/qtcreator_hu.ts index 4ba28ad1b12..ad58a02fa31 100644 --- a/share/qtcreator/translations/qtcreator_hu.ts +++ b/share/qtcreator/translations/qtcreator_hu.ts @@ -8873,7 +8873,7 @@ SOURCES *= .../ide/main/bin/dumper/dumper.cpp(new line) - OpenWith::Editors + QtC::Core Plain Text Editor Egyszerű szöveg szerkesztő @@ -8890,9 +8890,6 @@ SOURCES *= .../ide/main/bin/dumper/dumper.cpp(new line) .pro File Editor .pro fájl szerkesztő - - - QtC::Core Open File With... Fájl megnyitása ezzel... diff --git a/share/qtcreator/translations/qtcreator_it.ts b/share/qtcreator/translations/qtcreator_it.ts index 4f4d56d6d5b..ccd8832a98b 100644 --- a/share/qtcreator/translations/qtcreator_it.ts +++ b/share/qtcreator/translations/qtcreator_it.ts @@ -10584,7 +10584,7 @@ p, li { white-space: pre-wrap; } - OpenWith::Editors + QtC::Core Plain Text Editor @@ -10601,9 +10601,6 @@ p, li { white-space: pre-wrap; } .pro File Editor - - - QtC::Core Preferences diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index 102bd9d5c30..2f55dfdb0d5 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -12126,7 +12126,7 @@ in the system's browser for manual download. - OpenWith::Editors + QtC::Core Binary Editor バイナリエディタ diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 2edfb640ad6..702550d9e55 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -2019,9 +2019,6 @@ Przyczyna: %3 Existing files Istniejące pliki - - - OpenWith::Editors Plain Text Editor Zwykły edytor tekstowy @@ -2078,9 +2075,6 @@ Przyczyna: %3 SCXML Editor Edytor SCXML - - - QtC::Core Open File With... Otwórz plik przy pomocy... diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index e6f7d92e1a9..24028b07f18 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -25527,9 +25527,6 @@ If set to false, the target will be moved straight to the current mouse position Alt+O Alt+O - - - OpenWith::Editors Plain Text Editor Текстовый редактор diff --git a/share/qtcreator/translations/qtcreator_sl.ts b/share/qtcreator/translations/qtcreator_sl.ts index dd8be439e7b..6d74be5bd7e 100644 --- a/share/qtcreator/translations/qtcreator_sl.ts +++ b/share/qtcreator/translations/qtcreator_sl.ts @@ -10707,7 +10707,7 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan - OpenWith::Editors + QtC::Core Plain Text Editor Urejevalniku navadnih besedil @@ -10752,9 +10752,6 @@ Za uporabo v polje Iskalnika vtipkajte to bližnjico in presledek ter nato iskan .qmlproject Editor Urejevalniku datotek *.qmlproject - - - QtC::Core Preferences Nastavitve diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 95025752c6c..50d1f85f5f9 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -11140,7 +11140,7 @@ Ids must begin with a lowercase letter. - OpenWith::Editors + QtC::Core Binary Editor Бінарний редактор diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 58e2d00ddd8..1d0b3bb0645 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -11523,18 +11523,7 @@ to version control (%2) - If background indexing is enabled, global symbol searches will yield -more accurate results, at the cost of additional CPU load when -the project is first opened. -The indexing result is persisted in the project's build directory. - -If you disable background indexing, a faster, but less accurate, -built-in indexer is used instead. - -The thread priority for building the background index can be adjusted since clangd 15. -Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused. -Normal Priority: Reduced priority compared to interactive work. -Low Priority: Same priority as other clangd work. + <p>If background indexing is enabled, global symbol searches will yield more accurate results, at the cost of additional CPU load when the project is first opened. The indexing result is persisted in the project's build directory. If you disable background indexing, a faster, but less accurate, built-in indexer is used instead. The thread priority for building the background index can be adjusted since clangd 15.</p><p>Background Priority: Minimum priority, runs on idle CPUs. May leave 'performance' cores unused.</p><p>Normal Priority: Reduced priority compared to interactive work.</p>Low Priority: Same priority as other clangd work. @@ -25259,9 +25248,6 @@ Error: Alt+O Alt+O - - - OpenWith::Editors Plain Text Editor 普通文本编辑器 diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index 3be3bff0ebd..9f7596be027 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -9836,7 +9836,7 @@ Will not be applied to whitespace in comments and strings. - OpenWith::Editors + QtC::Core Plain Text Editor 純文字編輯器 @@ -9877,9 +9877,6 @@ Will not be applied to whitespace in comments and strings. GLSL Editor GLSL 編輯器 - - - QtC::Core Preferences 喜好設定 diff --git a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt index 8130a0eb7c4..66c1d919512 100644 --- a/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/CMakeLists.txt @@ -39,7 +39,7 @@ add_qtc_library(KSyntaxHighlighting src/lib/textstyledata_p.h 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/wildcardmatcher.cpp src/lib/worddelimiters.cpp src/lib/worddelimiters_p.h src/lib/xml_p.h ) diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/ksyntaxhighlighting_version.h index 9d25202a4bb..007fe4acae3 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.95.0" +#define SyntaxHighlighting_VERSION_STRING "5.103.0" #define SyntaxHighlighting_VERSION_MAJOR 5 -#define SyntaxHighlighting_VERSION_MINOR 95 +#define SyntaxHighlighting_VERSION_MINOR 103 #define SyntaxHighlighting_VERSION_PATCH 0 -#define SyntaxHighlighting_VERSION ((5<<16)|(95<<8)|(0)) +#define SyntaxHighlighting_VERSION ((5<<16)|(103<<8)|(0)) #endif diff --git a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h index 6591b59e810..e376e94505e 100644 --- a/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h +++ b/src/libs/3rdparty/syntax-highlighting/autogenerated/src/lib/ksyntaxhighlighting_export.h @@ -88,7 +88,7 @@ #define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1 #ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED -# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55f00 +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x56700 #endif #ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS # define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0 @@ -98,7 +98,7 @@ # ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT # define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT # else -# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55f00 +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x56700 # endif #endif @@ -178,7 +178,7 @@ #define KSYNTAXHIGHLIGHTING_BUILD_DEPRECATED_SINCE(major, minor) 1 #ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED -# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x55f00 +# define KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT 0x56700 #endif #ifdef KSYNTAXHIGHLIGHTING_NO_DEPRECATED_WARNINGS # define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0 @@ -188,7 +188,7 @@ # ifdef KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT # define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE KSYNTAXHIGHLIGHTING_DISABLE_DEPRECATED_BEFORE_AND_AT # else -# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x55f00 +# define KSYNTAXHIGHLIGHTING_DEPRECATED_WARNINGS_SINCE 0x56700 # endif #endif diff --git a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt index 6e86a05e9e3..26a110d31b1 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt +++ b/src/libs/3rdparty/syntax-highlighting/data/CMakeLists.txt @@ -44,24 +44,25 @@ add_library(SyntaxHighlightingData OBJECT) # theme data resource target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc) -# do we want syntax files bundled in the library? -if (QRC_SYNTAX) - # generate the resource file - set(qrc_file ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc) - set(qrc_body "") - foreach(def ${defs}) - get_filename_component(def_name ${def} NAME) - string(APPEND qrc_body "${def}\n") - endforeach() - set(SYNTAX_DATA_QRC_FILES_STRING ${qrc_body}) - configure_file(syntax-data.qrc.in ${qrc_file} @ONLY) +# generate the resource file +set(qrc_file ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc) +set(qrc_body "") +foreach(def ${defs}) + get_filename_component(def_name ${def} NAME) + string(APPEND qrc_body "${def}\n") +endforeach() +set(SYNTAX_DATA_QRC_FILES_STRING ${qrc_body}) +configure_file(syntax-data.qrc.in ${qrc_file} @ONLY) - # generate the index file - add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" +# generate the index file +add_custom_target(katesyntax DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax") +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" COMMAND katehighlightingindexer "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" "${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc" DEPENDS katehighlightingindexer ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc - ) +) +# do we want syntax files bundled in the library? +if (QRC_SYNTAX) # generate the qrc file manually, to make dependencies on generated files work... add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" COMMAND Qt${QT_MAJOR_VERSION}::rcc --name syntax_data -o "${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc" @@ -71,8 +72,9 @@ if (QRC_SYNTAX) target_sources(SyntaxHighlightingData PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp) else() + add_dependencies(SyntaxHighlightingData katesyntax) # install the syntax files as normal files into the prefix - install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax) + install (FILES "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax-bundled) endif() # set PIC to allow use in static and shared libs diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl index 45057a8a054..5f57c8eeacc 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.xml.tpl @@ -113,12 +113,31 @@ + + + TRUE + ON + YES + Y + 0 + + + + + FALSE + OFF + NO + IGNORE + N + 0 + + - beginRegion="" endRegion="" /> + beginRegion="" endRegion="" /> @@ -126,7 +145,7 @@ - + @@ -136,16 +155,16 @@ + - - - - + + + _ctx_op" String="_nargs" lookAhead="true" /> - - - - - + + + + @@ -204,18 +222,20 @@ + - - + + - - + + + @@ -277,39 +297,45 @@ + - + - - + - - - - - + + + + + + + + + + + @@ -328,23 +354,13 @@ + - - - - - - - - - - - - - - + + + @@ -354,8 +370,10 @@ + + @@ -364,9 +382,10 @@ - + + @@ -382,6 +401,8 @@ + + @@ -408,6 +429,7 @@ + @@ -416,6 +438,7 @@ + diff --git a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml index e02b950765b..624299346f9 100644 --- a/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml +++ b/src/libs/3rdparty/syntax-highlighting/data/generators/cmake.yaml @@ -1,4 +1,4 @@ -version: 38 +version: 44 global-properties: - ALLOW_DUPLICATE_CUSTOM_TARGETS @@ -74,6 +74,7 @@ directory-properties: - RULE_LAUNCH_LINK - SOURCE_DIR - SUBDIRECTORIES + - SYSTEM # Since 3.25 - TESTS # Since 3.12 - TEST_INCLUDE_FILE - TEST_INCLUDE_FILES # Since 3.10 @@ -135,7 +136,7 @@ target-properties: - C_EXTENSIONS - C_STANDARD - C_STANDARD_REQUIRED - - COMMON_LANGUAGE_RUNTIME # Sine 3.12 + - COMMON_LANGUAGE_RUNTIME # Since 3.12 - COMPATIBLE_INTERFACE_BOOL - COMPATIBLE_INTERFACE_NUMBER_MAX - COMPATIBLE_INTERFACE_NUMBER_MIN @@ -148,6 +149,7 @@ target-properties: - COMPILE_PDB_NAME_ - COMPILE_PDB_OUTPUT_DIRECTORY - COMPILE_PDB_OUTPUT_DIRECTORY_ + - COMPILE_WARNING_AS_ERROR # Since 3.24 - _OUTPUT_NAME - _POSTFIX - CROSSCOMPILING_EMULATOR @@ -178,6 +180,7 @@ target-properties: - EXCLUDE_FROM_DEFAULT_BUILD - EXPORT_COMPILE_COMMANDS # Since 3.20 - EXPORT_NAME + - EXPORT_NO_SYSTEM # Since 3.25 - EXPORT_PROPERTIES # Since 3.12 - FOLDER - Fortran_FORMAT @@ -236,10 +239,13 @@ target-properties: - INTERFACE_COMPILE_FEATURES - INTERFACE_COMPILE_OPTIONS - INTERFACE_HEADER_SETS # Since 3.23 + - INTERFACE_HEADER_SETS_TO_VERIFY # Since 3.24 - INTERFACE_INCLUDE_DIRECTORIES - INTERFACE_LINK_DEPENDS # Since 3.13 - INTERFACE_LINK_DIRECTORIES # Since 3.13 - INTERFACE_LINK_LIBRARIES + - INTERFACE_LINK_LIBRARIES_DIRECT # Since 3.24 + - INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE # Since 3.24 - INTERFACE_LINK_OPTIONS # Since 3.13 - INTERFACE_PRECOMPILE_HEADERS # Since 3.16 - INTERFACE_POSITION_INDEPENDENT_CODE @@ -259,7 +265,7 @@ target-properties: - _CPPCHECK # Since 3.10 - _CPPLINT - _INCLUDE_WHAT_YOU_USE - - _LINKER_LAUNCHER # Sine 3.21 + - _LINKER_LAUNCHER # Since 3.21 - _VISIBILITY_PRESET - LIBRARY_OUTPUT_DIRECTORY_ - LIBRARY_OUTPUT_DIRECTORY @@ -291,6 +297,7 @@ target-properties: - MACOSX_RPATH - MANUALLY_ADDED_DEPENDENCIES - MAP_IMPORTED_CONFIG_ + - MSVC_DEBUG_INFORMATION_FORMAT # Since 3.25 - MSVC_RUNTIME_LIBRARY # Since 3.15 - NAME - NO_SONAME @@ -340,6 +347,7 @@ target-properties: - Swift_DEPENDENCIES_FILE # Since 3.15 - Swift_MODULE_DIRECTORY # Since 3.15 - Swift_MODULE_NAME # Since 3.15 + - SYSTEM # Since 3.25 - TYPE - UNITY_BUILD # Since 3.16 - UNITY_BUILD_BATCH_SIZE # Since 3.16 @@ -347,6 +355,7 @@ target-properties: - UNITY_BUILD_CODE_BEFORE_INCLUDE # Since 3.16 - UNITY_BUILD_MODE # Since 3.18 - UNITY_BUILD_UNIQUE_ID # Since 3.20 + - VERIFY_INTERFACE_HEADER_SETS # Since 3.24 - VERSION - VISIBILITY_INLINES_HIDDEN - VS_CONFIGURATION_TYPE @@ -359,6 +368,7 @@ target-properties: - VS_DOTNET_REFERENCEPROP__TAG_ # Since 3.10 - VS_DOTNET_REFERENCES - VS_DOTNET_REFERENCES_COPY_LOCAL + - VS_DOTNET_STARTUP_OBJECT # Since 3.24 - VS_DOTNET_TARGET_FRAMEWORK_VERSION - VS_DOTNET_DOCUMENTATION_FILE # Since 3.17 - VS_DPI_AWARE # Since 3.16 @@ -371,6 +381,7 @@ target-properties: - VS_JUST_MY_CODE_DEBUGGING # Since 3.15 - VS_KEYWORD - VS_MOBILE_EXTENSIONS_VERSION + - VS_NO_COMPILE_BATCHING - VS_NO_SOLUTION_DEPLOY # Since 3.15 - VS_PACKAGE_REFERENCES # Since 3.15 - VS_PLATFORM_TOOLSET # Since 3.18 @@ -387,6 +398,7 @@ target-properties: - VS_WINRT_COMPONENT - VS_WINRT_EXTENSIONS - VS_WINRT_REFERENCES + - WATCOM_RUNTIME_LIBRARY # Since 3.24 - WIN32_EXECUTABLE - WINDOWS_EXPORT_ALL_SYMBOLS - XCODE_ATTRIBUTE_ @@ -403,13 +415,17 @@ target-properties: - XCODE_SCHEME_ARGUMENTS # Since 3.13 - XCODE_SCHEME_DEBUG_AS_ROOT # Since 3.15 - XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16 - - XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23 - XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 - - XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 - XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 + - XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 + - XCODE_SCHEME_ENABLE_GPU_API_VALIDATION # Since 3.25 + - XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23 + - XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION # Since 3.25 - XCODE_SCHEME_EXECUTABLE # Since 3.13 - XCODE_SCHEME_ENVIRONMENT # Since 3.13 - XCODE_SCHEME_GUARD_MALLOC # Since 3.13 + - XCODE_SCHEME_LAUNCH_CONFIGURATION # Since 3.25 + - XCODE_SCHEME_LAUNCH_MODE # Since 3.25 - XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13 - XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13 - XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13 @@ -420,6 +436,7 @@ target-properties: - XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP # Since 3.13 - XCODE_SCHEME_WORKING_DIRECTORY # Since 3.1? - XCODE_SCHEME_ZOMBIE_OBJECTS # Since 3.13 + - XCODE_XCCONFIG # Since 3.24 - XCTEST test-properties: @@ -535,6 +552,13 @@ generator-expressions: - VERSION_EQUAL - VERSION_LESS_EQUAL - VERSION_GREATER_EQUAL + # * Path Comparisons + - PATH_EQUAL # Since 3.24 + # * Path Queries + # * Path Decomposition + # * Path Transformations + # TODO Need a bit deeper genex parsing to get sub-commands of `PATH` + - PATH # Since 3.24 # * Variable Queries - TARGET_EXISTS # Since 3.12 - CONFIG @@ -555,6 +579,8 @@ generator-expressions: - LINK_LANGUAGE # Since 3.18 - DEVICE_LINK # Since 3.18 - HOST_LINK # Since 3.18 + - LINK_LIBRARY # Since 3.24 + - LINK_GROUP # Since 3.24 # String-Valued Generator Expressions # * Escaped Characters - ANGLE-R @@ -593,6 +619,7 @@ generator-expressions: - TARGET_PDB_FILE_BASE_NAME # Since 3.15 - TARGET_PDB_FILE_NAME - TARGET_PDB_FILE_DIR + - TARGET_BUNDLE_DIR_NAME # Since 3.24 - TARGET_BUNDLE_DIR - TARGET_BUNDLE_CONTENT_DIR - TARGET_PROPERTY @@ -645,6 +672,7 @@ variables: - CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES - CMAKE_FIND_DEBUG_MODE # Since 3.17 - CMAKE_FIND_PACKAGE_NAME + - CMAKE_FIND_PACKAGE_REDIRECTS_DIR # Since 3.24 - CMAKE_FIND_PACKAGE_SORT_DIRECTION - CMAKE_FIND_PACKAGE_SORT_ORDER - CMAKE_GENERATOR @@ -746,6 +774,7 @@ variables: - CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11 - CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10 - CMAKE_CODELITE_USE_TARGETS + - CMAKE_COLOR_DIAGNOSTICS # Since 3.24 - CMAKE_COLOR_MAKEFILE - CMAKE_CONFIGURATION_TYPES - CMAKE_DEBUG_TARGET_PROPERTIES @@ -772,6 +801,7 @@ variables: - CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY - CMAKE_FIND_PACKAGE_PREFER_CONFIG # Since 3.15 - CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS # Since 3.14 + - CMAKE_FIND_PACKAGE_TARGETS_GLOBAL # Since 3.24 - CMAKE_FIND_PACKAGE_WARN_NO_MODULE - CMAKE_FIND_ROOT_PATH - CMAKE_FIND_ROOT_PATH_MODE_INCLUDE @@ -781,6 +811,7 @@ variables: - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH # Since 3.16 - CMAKE_FIND_USE_CMAKE_PATH # Since 3.16 - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH # Since 3.16 + - CMAKE_FIND_USE_INSTALL_PREFIX # Since 3.24 - CMAKE_FIND_USE_PACKAGE_ROOT_PATH # Since 3.16 - CMAKE_FIND_USE_PACKAGE_REGISTRY # Since 3.16 - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH # Since 3.16 @@ -809,6 +840,8 @@ variables: - CMAKE_PROJECT_INCLUDE # Since 3.15 - CMAKE_PROJECT_INCLUDE_BEFORE # Since 3.15 - CMAKE_PROJECT__INCLUDE + - CMAKE_PROJECT__INCLUDE_BEFORE # Since 3.17 + - CMAKE_PROJECT_TOP_LEVEL_INCLUDES # Since 3.24 - CMAKE_REQUIRE_FIND_PACKAGE_ # Since 3.22 - CMAKE_SKIP_INSTALL_ALL_DEPENDENCY - CMAKE_STAGING_PREFIX @@ -836,12 +869,16 @@ variables: - CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 - CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17 - CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING # Since 3.16 - - CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23 - CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER # Since 3.13 - CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE # Since 3.13 - CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS # Since 3.13 + - CMAKE_XCODE_SCHEME_ENABLE_GPU_API_VALIDATION # Since 3.25 + - CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE # Since 3.23 + - CMAKE_XCODE_SCHEME_ENABLE_GPU_SHADER_VALIDATION # Since 3.25 - CMAKE_XCODE_SCHEME_ENVIRONMENT # Since 3.17 - CMAKE_XCODE_SCHEME_GUARD_MALLOC # Since 3.13 + - CMAKE_XCODE_SCHEME_LAUNCH_CONFIGURATION # Since 3.25 + - CMAKE_XCODE_SCHEME_LAUNCH_MODE # Since 3.25 - CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP # Since 3.13 - CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES # Since 3.13 - CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE # Since 3.13 @@ -851,14 +888,18 @@ 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_XCODE_XCCONFIG # Since 3.24 # Variables that Describe the System - ANDROID - APPLE - BORLAND + - BSD # Since 3.25 - CMAKE_ANDROID_NDK_VERSION # Since 3.20 - CMAKE_CL_64 - CMAKE_COMPILER_2005 - CMAKE_HOST_APPLE + - CMAKE_HOST_BSD # Since 3.25 + - CMAKE_HOST_LINUX # Since 3.25 - CMAKE_HOST_SOLARIS - CMAKE_HOST_SYSTEM - CMAKE_HOST_SYSTEM_NAME @@ -876,7 +917,9 @@ variables: - CYGWIN # NOTE `ENV` not a variable in fact! # - ENV - - GHS-MULTI + - GHSMULTI + - IOS # Since 3.14 + - LINUX # Since 3.25 - MINGW - MSVC - MSVC10 @@ -946,6 +989,7 @@ variables: - CMAKE_BUILD_WITH_INSTALL_RPATH - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY - CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_ + - CMAKE_COMPILE_WARNING_AS_ERROR # Since 3.24 - CMAKE__POSTFIX - CMAKE_CROSS_CONFIGS # Since 3.17 - CMAKE_CTEST_ARGUMENTS # Since 3.17 @@ -986,9 +1030,13 @@ variables: - CMAKE__CPPCHECK # Since 3.10 - CMAKE__CPPLINT - CMAKE__INCLUDE_WHAT_YOU_USE - - CMAKE__LINKER_LAUNCHER # Sine 3.21 - - CMAKE__LINK_LIBRARY_FILE_FLAG # Sine 3.16 - - CMAKE__LINK_LIBRARY_FLAG # Sine 3.16 + - CMAKE__LINK_LIBRARY_USING_ # Since 3.24 + - CMAKE__LINK_LIBRARY_USING__SUPPORTED # Since 3.24 + - CMAKE__LINKER_LAUNCHER # Since 3.21 + - CMAKE__LINK_GROUP_USING_ # Since 3.24 + - CMAKE__LINK_GROUP_USING__SUPPORTED # Since 3.24 + - CMAKE__LINK_LIBRARY_FILE_FLAG # Since 3.16 + - CMAKE__LINK_LIBRARY_FLAG # Since 3.16 - CMAKE__LINK_WHAT_YOU_USE_FLAG # Since 3.22 - CMAKE__VISIBILITY_PRESET - CMAKE_LIBRARY_OUTPUT_DIRECTORY @@ -999,6 +1047,8 @@ variables: - CMAKE_LINK_INTERFACE_LIBRARIES - CMAKE_LINK_LIBRARY_FILE_FLAG - CMAKE_LINK_LIBRARY_FLAG + - CMAKE_LINK_LIBRARY_USING_ # Since 3.24 + - CMAKE_LINK_LIBRARY_USING__SUPPORTED # Since 3.24 - CMAKE_LINK_WHAT_YOU_USE - CMAKE_LINK_WHAT_YOU_USE_CHECK # Since 3.22 - CMAKE_MACOSX_BUNDLE @@ -1008,8 +1058,9 @@ variables: - CMAKE_MODULE_LINKER_FLAGS_ - CMAKE_MODULE_LINKER_FLAGS__INIT - CMAKE_MODULE_LINKER_FLAGS_INIT - - CMAKE_MSVCIDE_RUN_PATH # Since 3.15 + - CMAKE_MSVC_DEBUG_INFORMATION_FORMAT # Since 3.25 - CMAKE_MSVC_RUNTIME_LIBRARY # Since 3.15 + - CMAKE_MSVCIDE_RUN_PATH # Since 3.15 - CMAKE_NINJA_OUTPUT_PATH_PREFIX - CMAKE_NO_BUILTIN_CHRPATH - CMAKE_NO_SYSTEM_FROM_IMPORTED @@ -1034,12 +1085,15 @@ variables: - CMAKE_STATIC_LINKER_FLAGS_ - CMAKE_STATIC_LINKER_FLAGS__INIT - CMAKE_STATIC_LINKER_FLAGS_INIT + - CMAKE_TASKING_TOOLSET # Since 3.25 - CMAKE_TRY_COMPILE_CONFIGURATION + - CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES # Since 3.24 - CMAKE_TRY_COMPILE_PLATFORM_VARIABLES - CMAKE_TRY_COMPILE_TARGET_TYPE - CMAKE_UNITY_BUILD # Since 3.16 - CMAKE_UNITY_BUILD_BATCH_SIZE # Since 3.16 - CMAKE_USE_RELATIVE_PATHS + - CMAKE_VERIFY_INTERFACE_HEADER_SETS # Since 3.24 - CMAKE_VISIBILITY_INLINES_HIDDEN - CMAKE_VS_GLOBALS # Since 3.13 - CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD @@ -1052,6 +1106,8 @@ variables: - CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES # Since 3.12 - CMAKE_VS_SDK_REFERENCE_DIRECTORIES # Since 3.12 - CMAKE_VS_SDK_SOURCE_DIRECTORIES # Since 3.12 + - CMAKE_VS_WINRT_BY_DEFAULT # Since 3.13 + - CMAKE_WATCOM_RUNTIME_LIBRARY # Since 3.24 - CMAKE_WIN32_EXECUTABLE - CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS - CMAKE_XCODE_ATTRIBUTE_ @@ -1106,6 +1162,8 @@ variables: - CMAKE__EXTENSIONS - CMAKE__EXTENSIONS_DEFAULT # Since 3.22 - CMAKE__FLAGS + - CMAKE__FLAGS_ + - CMAKE__FLAGS__INIT - CMAKE__FLAGS_DEBUG - CMAKE__FLAGS_DEBUG_INIT - CMAKE__FLAGS_INIT @@ -1173,6 +1231,7 @@ variables: - CTEST_CUSTOM_PRE_MEMCHECK - CTEST_CUSTOM_PRE_TEST - CTEST_CUSTOM_TEST_IGNORE + - CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION # Since 3.24 - CTEST_CUSTOM_WARNING_EXCEPTION - CTEST_CUSTOM_WARNING_MATCH - CTEST_CVS_CHECKOUT @@ -1377,6 +1436,7 @@ variables: # - CPackArchive - CPACK_ARCHIVE_FILE_NAME - CPACK_ARCHIVE__FILE_NAME + - CPACK_ARCHIVE_FILE_EXTENSION # Since 3.25 - CPACK_ARCHIVE_COMPONENT_INSTALL - CPACK_ARCHIVE_THREADS # Since 3.18 # - CPackBundle @@ -1465,6 +1525,7 @@ variables: - CPACK_DMG_DS_STORE_SETUP_SCRIPT - CPACK_DMG_BACKGROUND_IMAGE - CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK + - CPACK_DMG_SLA_USE_RESOURCE_FILE_LICENSE # Since 3.23 - CPACK_DMG_SLA_DIR - CPACK_DMG_SLA_LANGUAGES - CPACK_DMG__FILE_NAME # Since 3.17 @@ -1561,6 +1622,8 @@ variables: - CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION # Since 3.20 - CPACK_NSIS_EXECUTABLE # Since 3.21 - CPACK_NSIS_IGNORE_LICENSE_PAGE # Since 3.22 + - CPACK_NSIS_EXECUTABLE_PRE_ARGUMENTS # Since 3.25 + - CPACK_NSIS_EXECUTABLE_POST_ARGUMENTS # Since 3.25 # - CPackNuGet (since 3.12) - CPACK_NUGET_COMPONENT_INSTALL - CPACK_NUGET_PACKAGE_NAME @@ -1603,6 +1666,7 @@ variables: - CPACK_NUGET__PACKAGE_DEPENDENCIES__VERSION - CPACK_NUGET_PACKAGE_DEBUG # - CPackPackageMaker is deprecated and gonna be removed in next versions of CPack + # NOTE CPackPackageMaker has been removed in 3.24 # - CPackProductBuild - CPACK_COMMAND_PRODUCTBUILD - CPACK_PRODUCTBUILD_IDENTIFIER # Since 3.23 @@ -1765,6 +1829,9 @@ variables: - CPACK_PACKAGE_INSTALL_REGISTRY_KEY - CPACK_CREATE_DESKTOP_LINKS - CPACK_BINARY_ + - CPACK_READELF_EXECUTABLE # Since 3.25 + - CPACK_OBJCOPY_EXECUTABLE # Since 3.25 + - CPACK_OBJDUMP_EXECUTABLE # Since 3.25 - CPACK_PRE_BUILD_SCRIPTS # Since 3.19 - CPACK_POST_BUILD_SCRIPTS # Since 3.19 - CPACK_PACKAGE_FILES # Since 3.19 @@ -1794,6 +1861,7 @@ variables: - CPACK_WIX_ROOT - CPACK_WIX_CUSTOM_XMLNS # Since 3.19 - CPACK_WIX_SKIP_WIX_UI_EXTENSION # Since 3.23 + - CPACK_WIX_ARCHITECTURE # Since 3.24 # - CTest # - Dart - BUILD_TESTING @@ -1820,6 +1888,7 @@ variables: - FETCHCONTENT_QUIET - FETCHCONTENT_FULLY_DISCONNECTED - FETCHCONTENT_UPDATES_DISCONNECTED + - FETCHCONTENT_TRY_FIND_PACKAGE_MODE # Since 3.24 - FETCHCONTENT_SOURCE_DIR_ - FETCHCONTENT_UPDATES_DISCONNECTED_ # - FindXXX module "standard" variables @@ -2233,6 +2302,12 @@ variables: - PKG_CONFIG_VERSION_STRING - PKG_CONFIG_USE_CMAKE_PREFIX_PATH - _MODULE_NAME # Since 3.16 + - _LINK_LIBRARIES + - _STATIC_LINK_LIBRARIES # Since 3.24 + - _LDFLAGS + - _LDFLAGS_OTHER + - _CFLAGS + - _CFLAGS_OTHER # - FindPNG - PNG_DEFINITIONS - PNG_LIBRARY @@ -2404,6 +2479,7 @@ variables: - XercesC_LIBRARY # - FindXMLRPC # - FindZLIB + - ZLIB_USE_STATIC_LIBS # Since 3.24 # - FortranCInterface # The following vars gonna match by regex # - FortranCInterface_GLOBAL_FOUND @@ -2507,6 +2583,7 @@ deprecated-or-internal-variables: # Various undocumented variables (yet) - CMAKE_SUPPRESS_DEVELOPER_WARNINGS # CMake <= 3.10 - CMAKE_SUPPRESS_DEVELOPER_ERRORS # CMake <= 3.10 + - CMAKE_FILES_DIRECTORY # The following variables used by CPack and some CMake modules, # but not documented (yet): # used by some modules like Deb and NSIS @@ -2525,10 +2602,16 @@ deprecated-or-internal-variables: # 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: + # Environment Variables that Change Behavior + - CMAKE_PREFIX_PATH + - SSL_CERT_DIR # Since 3.25 + - SSL_CERT_FILE # Since 3.25 # Environment Variables that Control the Build + - ADSP_ROOT # Since 3.24 - CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2 - CMAKE_BUILD_PARALLEL_LEVEL - CMAKE_BUILD_TYPE # Since 3.22 + - CMAKE_COLOR_DIAGNOSTICS # Since 3.24 - CMAKE_CONFIGURATION_TYPES # Since 3.22 - CMAKE_CONFIG_TYPE - CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17 @@ -2538,6 +2621,7 @@ environment-variables: - CMAKE_GENERATOR_TOOLSET - CMAKE_INSTALL_MODE # Since 3.22 - CMAKE__COMPILER_LAUNCHER # Since 3.17 + - CMAKE__LINKER_LAUNCHER # Since 3.21 - CMAKE_MSVCIDE_RUN_PATH - CMAKE_NO_VERBOSE - CMAKE_OSX_ARCHITECTURES @@ -2561,6 +2645,12 @@ environment-variables: - CXXFLAGS - FC - FFLAGS + - HIPCXX # Since 3.21 + - HIPFLAGS # Since 3.21 + - ISPC # Since 3.19 + - ISPCFLAGS # Since 3.19 + - OBJC # Since 3.16.7 + - OBJCXX # Since 3.16.7 - RC - RCFLAGS - SWIFTC @@ -2572,23 +2662,46 @@ environment-variables: - CTEST_PROGRESS_OUTPUT - CTEST_USE_LAUNCHERS_DEFAULT - DASHBOARD_TEST_FROM_CTEST + - CCMAKE_COLORS # Here are the `find_package` specific variables described at the # https://cmake.org/cmake/help/latest/command/find_package.html - _DIR - - CMAKE_PREFIX_PATH - CMAKE_FRAMEWORK_PATH - CMAKE_APPBUNDLE_PATH - PATH # Environment Variables recognized by some standard modules - QTIFWDIR + - CUDA_PATH # FindCUDAToolkit scripting-commands: + - + name: block # Since 3.25 + named-args: [ + SCOPE_FOR + , PROPAGATE + ] + special-args: [ + POLICIES + , VARIABLES + ] + start-region: block - name: break nulary?: true - name: cmake_host_system_information - named-args: [RESULT, QUERY] + named-args: [ + RESULT + , QUERY + # Since 3.24 + , WINDOWS_REGISTRY + , VALUE_NAMES + , SUBKEYS + , VALUE + , VIEW + , SEPARATOR + , ERROR_VARIABLE + ] special-args: [ NUMBER_OF_LOGICAL_CORES , NUMBER_OF_PHYSICAL_CORES @@ -2618,9 +2731,17 @@ scripting-commands: , OS_RELEASE , OS_VERSION , OS_PLATFORM - # Since 3.22 + # Since 3.22 , DISTRIB_INFO , DISTRIB_ + # Since 3.24 + , '64' + , '32' + , '64_32' + , '32_64' + , HOST + , TARGET + , BOTH ] - name: cmake_language @@ -2636,7 +2757,14 @@ scripting-commands: , GET_CALL_IDS , GET_CALL , CANCEL_CALL + # Since 3.24 + , SET_DEPENDENCY_PROVIDER + , SUPPORTED_METHODS + # Since 3.25 + , GET_MESSAGE_LOG_LEVEL ] + # Since 3.24 + special-args: [FIND_PACKAGE, FETCHCONTENT_MAKEAVAILABLE_SERIAL] - name: cmake_minimum_required named-args: [VERSION, FATAL_ERROR] @@ -2670,6 +2798,9 @@ scripting-commands: , IS_RELATIVE , IS_PREFIX , NORMALIZE + , COMPARE # Since 3.?? + , EQUAL # Since 3.?? + , NOT_EQUAL # Since 3.?? # Modification , SET , APPEND @@ -2744,12 +2875,17 @@ scripting-commands: , VERSION_GREATER_EQUAL , IN_LIST , DEFINED + , PATH_EQUAL # Since 3.24 ] has-target-name-after-kw: TARGET nested-parentheses?: true - name: else nulary?: true + - + name: endblock + nulary?: true + end-region: block - name: endforeach nulary?: true @@ -2860,6 +2996,8 @@ scripting-commands: , HTTPHEADER , EXPECTED_HASH , EXPECTED_MD5 + , RANGE_START # Since 3.24 + , RANGE_END # Since 3.24 , TLS_VERIFY , TLS_CAINFO , TIMESTAMP @@ -2999,7 +3137,12 @@ scripting-commands: , CMAKE_FIND_ROOT_PATH_BOTH , ONLY_CMAKE_FIND_ROOT_PATH , NO_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_INSTALL_PREFIX # Since 3.24 + , REGISTRY_VIEW # Since 3.24 + , VALIDATOR # Since 3.25 ] + # Since 3.24 + special-args: ®_view_special ['64', '32', '64_32', '32_64', HOST, TARGET, BOTH] - name: find_library named-args: &find_library [ @@ -3020,7 +3163,11 @@ scripting-commands: , CMAKE_FIND_ROOT_PATH_BOTH , ONLY_CMAKE_FIND_ROOT_PATH , NO_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_INSTALL_PREFIX # Since 3.24 + , REGISTRY_VIEW # Since 3.24 + , VALIDATOR # Since 3.25 ] + special-args: *reg_view_special # Since 3.24 - name: find_package named-args: [ @@ -3049,13 +3196,20 @@ scripting-commands: , CMAKE_FIND_ROOT_PATH_BOTH , ONLY_CMAKE_FIND_ROOT_PATH , NO_CMAKE_FIND_ROOT_PATH + , NO_CMAKE_INSTALL_PREFIX # Since 3.24 + , BYPASS_PROVIDER # Since 3.24 + , REGISTRY_VIEW # Since 3.24 + , GLOBAL # Since 3.24 ] + special-args: *reg_view_special # Since 3.24 - name: find_path named-args: *find_file + special-args: *reg_view_special # Since 3.24 - name: find_program named-args: *find_library + special-args: *reg_view_special # Since 3.24 - name: foreach named-args: [ @@ -3231,7 +3385,7 @@ scripting-commands: name: option - name: return - nulary?: true + named-args: [PROPAGATE] # Since 3.25 - name: separate_arguments named-args: [ @@ -3415,7 +3569,10 @@ project-commands: name: add_link_options - name: add_subdirectory - named-args: [EXCLUDE_FROM_ALL] + named-args: [ + EXCLUDE_FROM_ALL + , SYSTEM # Since 3.25 + ] - name: add_test named-args: [NAME, COMMAND, COMMAND_EXPAND_LISTS, CONFIGURATIONS, WORKING_DIRECTORY] @@ -3656,6 +3813,7 @@ project-commands: , cxx_std_17 , cxx_std_20 # Since 3.12 , cxx_std_23 # Since 3.20 + , cxx_std_26 # Since 3.25 , cxx_aggregate_default_initializers , cxx_alias_templates , cxx_alignas @@ -3781,8 +3939,7 @@ project-commands: - name: try_compile named-args: [ - RESULT_VAR - , CMAKE_FLAGS + CMAKE_FLAGS , OUTPUT_VARIABLE , SOURCES , COMPILE_DEFINITIONS @@ -3793,6 +3950,15 @@ project-commands: , _STANDARD , _STANDARD_REQUIRED , _EXTENSIONS + # Since 3.25 + , PROJECT + , SOURCE_DIR + , BINARY_DIR + , TARGET + , NO_CACHE + , SOURCE_FROM_CONTENT + , SOURCE_FROM_VAR + , SOURCE_FROM_FILE ] - name: try_run @@ -3804,10 +3970,23 @@ project-commands: , LINK_LIBRARIES , LINK_OPTIONS # Since 3.14 , COMPILE_OUTPUT_VARIABLE + , COPY_FILE + , COPY_FILE_ERROR + , _STANDARD + , _STANDARD_REQUIRED + , _EXTENSIONS , RUN_OUTPUT_VARIABLE , OUTPUT_VARIABLE , WORKING_DIRECTORY # Since 3.20 , ARGS + # Since 3.25 + , SOURCES + , SOURCE_FROM_CONTENT + , SOURCE_FROM_VAR + , SOURCE_FROM_FILE + , NO_CACHE + , RUN_OUTPUT_STDOUT_VARIABLE + , RUN_OUTPUT_STDERR_VARIABLE ] ctest-commands: @@ -4545,6 +4724,7 @@ standard-module-commands: - URL_HASH - URL_MD5 - DOWNLOAD_NAME + - DOWNLOAD_EXTRACT_TIMESTAMP # Since 3.24 - DOWNLOAD_NO_EXTRACT - DOWNLOAD_NO_PROGRESS - TIMEOUT @@ -4721,6 +4901,7 @@ standard-module-commands: - UPDATE_DISCONNECTED - PATCH_COMMAND - SOURCE_SUBDIR + - SYSTEM - name: FetchContent_Populate named-args: @@ -5047,8 +5228,10 @@ standard-module-commands: - OUTPUT_NAME - DOCUMENTATION - LINK_TO + - R2017b + - R2018a - EXCLUDE_FROM_ALL - special-args: [R2017b, R2018a] + - NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES # Since 3.24 # FindPkgConfig - name: pkg_check_modules @@ -5059,6 +5242,7 @@ standard-module-commands: - NO_CMAKE_ENVIRONMENT_PATH - IMPORTED_TARGET - GLOBAL + - STATIC_TARGET # Since 3.24 - name: pkg_search_module named-args: *pkgcm 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 dfe77e4627e..f500061f47e 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 @@ -7,7 +7,7 @@ # # To install prerequisites: # -# $ pip install --user click jinja2 yaml +# $ pip install --user click jinja2 pyyaml # # To use: # @@ -15,11 +15,10 @@ # import click import jinja2 -import pathlib import re import yaml -import pprint +from lxml import etree _TEMPLATED_NAME = re.compile('<[^>]+>') @@ -34,6 +33,19 @@ _PROPERTY_KEYS = [ ] _KW_RE_LIST = ['kw', 're'] _VAR_KIND_LIST = ['variables', 'deprecated-or-internal-variables', 'environment-variables'] +_CONTROL_FLOW_LIST = set(( + 'break' + , 'continue' + , 'elseif' + , 'else' + , 'endforeach' + , 'endif' + , 'endwhile' + , 'foreach' + , 'if' + , 'return' + , 'while' +)) def try_transform_placeholder_string_to_regex(name): @@ -107,7 +119,7 @@ def transform_command(cmd): assert new_cmd == cmd can_be_nulary = False - cmd['nested_parentheses'] = cmd['nested-parentheses?'] if 'nested-parentheses?' in cmd else False + cmd['nested_parentheses'] = cmd.get('nested-parentheses?', False) if 'first-arg-is-target?' in cmd: cmd['first_arg_is_target'] = cmd['first-arg-is-target?'] @@ -138,9 +150,89 @@ def transform_command(cmd): if 'end-region' in cmd: cmd['end_region'] = cmd['end-region'] + cmd['attribute'] = 'Control Flow' if cmd['name'] in _CONTROL_FLOW_LIST else 'Command' + return cmd +def remove_duplicate_list_nodes(contexts, highlighting): + remap = {} + + items_by_kws = {} + # extract duplicate keyword list + for items in highlighting: + if items.tag != 'list': + break + k = '<'.join(item.text for item in items) + name = items.attrib['name'] + rename = items_by_kws.get(k) + if rename: + remap[name] = rename + highlighting.remove(items) + else: + items_by_kws[k] = name + + # update keyword list name referenced by each rule + for context in contexts: + for rule in context: + if rule.tag == 'keyword': + name = rule.attrib['String'] + rule.attrib['String'] = remap.get(name, name) + + +def remove_duplicate_context_nodes(contexts): + # 3 levels: ctx, ctx_op and ctx_op_nested + for _ in range(3): + remap = {} + duplicated = {} + + # remove duplicate nodes + for context in contexts: + name = context.attrib['name'] + context.attrib['name'] = 'dummy' + ref = duplicated.setdefault(etree.tostring(context), []) + if ref: + contexts.remove(context) + else: + context.attrib['name'] = name + ref.append(name) + remap[name] = ref[0] + + # update context name referenced by each rule + for context in contexts: + for rule in context: + ref = remap.get(rule.attrib.get('context')) + if ref: + rule.attrib['context'] = ref + + +def remove_duplicate_nodes(xml_string): + parser = etree.XMLParser(resolve_entities=False, collect_ids=False) + root = etree.fromstring(xml_string.encode(), parser=parser) + highlighting = root[0] + + contexts = highlighting.find('contexts') + + remove_duplicate_list_nodes(contexts, highlighting) + remove_duplicate_context_nodes(contexts) + + # reformat comments + xml = etree.tostring(root) + xml = re.sub(b'(?=[^\n ])(?=[^ \n])', b'-->\n', xml) + + # extract DOCTYPE removed by etree.fromstring and reformat + doctype = xml_string[:xml_string.find(' + xml = xml[xml.find(b' -