Merge remote-tracking branch 'origin/4.15'

Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I309fe2a4ea7afac85481fc6466a9a6e58e340019
This commit is contained in:
Eike Ziller
2021-03-18 09:41:37 +01:00
98 changed files with 8105 additions and 3142 deletions

View File

@@ -247,6 +247,8 @@ function(add_qtc_library name)
set_target_properties(${name} PROPERTIES set_target_properties(${name} PROPERTIES
SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}"
PREFIX "" PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
) )
endif() endif()
@@ -500,6 +502,8 @@ function(add_qtc_plugin target_name)
set_target_properties(${target_name} PROPERTIES set_target_properties(${target_name} PROPERTIES
SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}"
PREFIX "" PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
) )
endif() endif()
enable_pch(${target_name}) enable_pch(${target_name})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -28,22 +28,22 @@
\section1 Creating UIs for MCUs \section1 Creating UIs for MCUs
\l{Qt for MCUs} enables you to use subsets of QML and Qt Quick Controls \l{Qt for MCUs} enables you to use subsets of components to create UIs for
types to create UIs for devices that are powered by microcontroller units devices that are powered by microcontroller units (MCU). The subset of
(MCU). The subset of supported types depends on the Qt for MCUs version supported components depends on the Qt for MCUs version that you use for
that you use for development. In this manual, we indicate which components development. In this manual, we indicate which components are supported at
are supported at the time of writing. the time of writing.
To develop for MCUs, \l{Using Project Wizards}{create an MCU project}. Only To develop for MCUs, \l{Using Project Wizards}{create an MCU project}. Only
the types available on MCUs are displayed in the \uicontrol {QML Types} tab the components available on MCUs are displayed in the \uicontrol Components
in \uicontrol Library. Only a subset of properties is supported for the tab in \l Library. Only a subset of properties is supported for the
supported types. The properties that are not available on MCUs are marked supported components. The properties that are not available on MCUs are
in the \uicontrol Properties view by enclosing them in square brackets. marked in the \l Properties view by enclosing them in square brackets.
\image qmldesigner-mcu-support.png "QML types and Image type properties supported for MCUs" \image qmldesigner-mcu-support.png "Components and Image properties supported for MCUs"
For more information about the supported QML types and their properties, see For more information about the supported components and their properties,
\l{Qt for MCUs - All QML Types}. see \l{Qt for MCUs - All QML Types}.
//! [mcu qtquick components] //! [mcu qtquick components]
*/ */

View File

@@ -58,6 +58,8 @@ bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
return QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName); return QQuickDesignerSupportProperties::isPropertyBlackListed(propertyName);
} }
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
static void addToPropertyNameListIfNotBlackListed( static void addToPropertyNameListIfNotBlackListed(
PropertyNameList *propertyNameList, const QQuickDesignerSupport::PropertyName &propertyName) PropertyNameList *propertyNameList, const QQuickDesignerSupport::PropertyName &propertyName)
{ {
@@ -132,12 +134,19 @@ PropertyNameList allPropertyNamesInline(QObject *object,
return propertyNameList; return propertyNameList;
} }
#endif
PropertyNameList allPropertyNames(QObject *object, PropertyNameList allPropertyNames(QObject *object,
const PropertyName &baseName, const PropertyName &baseName,
QObjectList *inspectedObjects) QObjectList *inspectedObjects)
{ {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QQuickDesignerSupportProperties::allPropertyNames(object, baseName, inspectedObjects);
#elif QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
return allPropertyNamesInline(object, baseName, inspectedObjects); return allPropertyNamesInline(object, baseName, inspectedObjects);
#else
return QQuickDesignerSupportProperties::allPropertyNames(object, baseName, inspectedObjects);
#endif
} }
PropertyNameList propertyNameListForWritableProperties(QObject *object, PropertyNameList propertyNameListForWritableProperties(QObject *object,

View File

@@ -44,6 +44,7 @@ set(PROJECT_SOURCES
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(%{ProjectName} qt_add_executable(%{ProjectName}
MANUAL_FINALIZATION
${PROJECT_SOURCES} ${PROJECT_SOURCES}
) )
@if %{HasTranslation} @if %{HasTranslation}
@@ -79,4 +80,5 @@ set_target_properties(%{ProjectName} PROPERTIES
if(QT_VERSION_MAJOR EQUAL 6) if(QT_VERSION_MAJOR EQUAL 6)
qt_import_qml_plugins(%{ProjectName}) qt_import_qml_plugins(%{ProjectName})
qt_finalize_executable(%{ProjectName})
endif() endif()

View File

@@ -48,6 +48,7 @@ set(PROJECT_SOURCES
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(%{ProjectName} qt_add_executable(%{ProjectName}
MANUAL_FINALIZATION
${PROJECT_SOURCES} ${PROJECT_SOURCES}
) )
@if %{HasTranslation} @if %{HasTranslation}
@@ -77,3 +78,7 @@ set_target_properties(%{ProjectName} PROPERTIES
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
) )
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(%{ProjectName})
endif()

View File

@@ -96,7 +96,7 @@ DSdockWidgetSplitter=ff595959
DSdockWidgetTitleBar=ffeaeaea DSdockWidgetTitleBar=ffeaeaea
DStitleBarText=ffdadada DStitleBarText=ffdadada
DStitleBarIcon=f4f5052 DStitleBarIcon=ff4f5052
DStitleBarButtonHover=40ffffff DStitleBarButtonHover=40ffffff
DStitleBarButtonPress=60ffffff DStitleBarButtonPress=60ffffff

View File

@@ -110,7 +110,7 @@ DSdockWidgetSplitter=ff595959
DSdockWidgetTitleBar=ffeaeaea DSdockWidgetTitleBar=ffeaeaea
DStitleBarText=ffdadada DStitleBarText=ffdadada
DStitleBarIcon=f4f5052 DStitleBarIcon=ff4f5052
DStitleBarButtonHover=40ffffff DStitleBarButtonHover=40ffffff
DStitleBarButtonPress=60ffffff DStitleBarButtonPress=60ffffff

View File

@@ -105,7 +105,7 @@ DSdockWidgetSplitter=ff595959
DSdockWidgetTitleBar=ffeaeaea DSdockWidgetTitleBar=ffeaeaea
DStitleBarText=ffdadada DStitleBarText=ffdadada
DStitleBarIcon=f4f5052 DStitleBarIcon=ff4f5052
DStitleBarButtonHover=40ffffff DStitleBarButtonHover=40ffffff
DStitleBarButtonPress=60ffffff DStitleBarButtonPress=60ffffff

View File

@@ -11,3 +11,4 @@ heaptrack.*
*.unc-backup* *.unc-backup*
.clang-format .clang-format
.cmake/ .cmake/
*.code-workspace

View File

@@ -6,12 +6,15 @@ Syntax highlighting engine for Kate syntax definitions
1. [Introduction](#introduction) 1. [Introduction](#introduction)
2. [Out of scope](#out-of-scope) 2. [Out of scope](#out-of-scope)
3. [Syntax Definition Files](#syntax-definition-files) 3. [Syntax definition files](#syntax-definition-files)
4. [Build it](#build-it) 4. [Color theme files](#color-theme-files)
5. [How to contribute](#how-to-contribute) 5. [Build it](#build-it)
6. [Adding unit tests for a syntax definition](#adding-unit-tests-for-a-syntax-definition) 6. [How to contribute](#how-to-contribute)
* [Licensing](#licensing)
* [Tips for contributing to syntax definition files](#tips-for-contributing-to-syntax-definition-files)
* [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) 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) 8. [Updating the syntax & themes pages of the kate-editor.org website](#updating-the-kate-editororgsyntax-website)
## Introduction ## Introduction
@@ -33,7 +36,7 @@ out of scope:
If you need any of this, check out [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/). If you need any of this, check out [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/).
## Syntax Definition Files ## Syntax definition files
This library uses Kate syntax definition files for the actual highlighting, 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). the file format is documented [here](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html).
@@ -62,7 +65,7 @@ Usually it is:
</tr> </tr>
<tr> <tr>
<td>On Windows®</td> <td>On Windows®</td>
<td>%USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\ </td> <td>&#37;USERPROFILE&#37;&#92;AppData&#92;Local&#92;org.kde.syntax-highlighting&#92;syntax&#92;</td>
</tr> </tr>
</table> </table>
@@ -71,6 +74,30 @@ For more details, see ["The Highlight Definition XML Format" (Working with Synta
Also, in **data/schema/** there is a script to validate the syntax definiton XML Also, in **data/schema/** there is a script to validate the syntax definiton XML
files. Use the command `validatehl.sh mySyntax.xml`. files. Use the command `validatehl.sh mySyntax.xml`.
## Color theme files
This library includes the color themes, the theme files use the **JSON**
format and are located in **data/themes/** with the **.theme** extension.
Additional ones are also picked up from the file system if present,
in the **org.kde.syntax-highlighting/themes/** folder of your user directory,
allowing you to easily add custom color theme files.
The location of **org.kde.syntax-highlighting/themes/** is the same
as shown in the table of the [previous section](#syntax-definition-files),
replacing the **syntax** folder with **themes**.
The [KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/) library
(used by Kate, Kile and KDevelop, for example) provides
a user interface for editing and creating KSyntaxHighlighting color themes, including
a tool for exporting and importing the JSON theme files.
The tool **utils/schema-converter/** and the script **utils/kateschema_to_theme_converter.py**
convert the old Kate schemas to KSyntaxHighlighting themes.
For more information, see:
* [Kate - Color Themes with Frameworks 5.75 (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-13-kate-color-themes-5.75/)
* [Submit a KSyntaxHighlighting Color Theme (Kate Editor Website)](https://kate-editor.org/post/2020/2020-09-18-submit-a-ksyntaxhighlighting-color-theme/)
## Build it ## Build it
1. Create and change into a build directory. Usually, a folder called **build** 1. Create and change into a build directory. Usually, a folder called **build**
@@ -88,6 +115,16 @@ files. Use the command `validatehl.sh mySyntax.xml`.
make make
``` ```
For example:
```bash
git clone git@invent.kde.org:frameworks/syntax-highlighting.git
mkdir ./syntax-highlighting/build
cd ./syntax-highlighting/build
cmake ../
make
```
For more details see ["Building Kate from Sources on Linux" (Kate Editor Website)](https://kate-editor.org/build-it/). 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 **NOTE:** If running *cmake* shows an error related to your version of KDE
@@ -126,7 +163,7 @@ All files shall contain a proper "SPDX-License-Identifier: MIT" identifier insid
*/ */
``` ```
### What you should know before working with syntax definition files and sending a patch ### Tips for contributing to syntax definition files
* If you are modifying an existing syntax definition XML file, you must increase * If you are modifying an existing syntax definition XML file, you must increase
the version number of the language. the version number of the language.
@@ -139,15 +176,15 @@ All files shall contain a proper "SPDX-License-Identifier: MIT" identifier insid
* [Available Default Styles (Working with Syntax Highlighting, KDE Documentation)](https://docs.kde.org/?application=katepart&branch=trunk5&path=highlight.html#kate-highlight-default-styles) * [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/) * [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/**. * 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 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. 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/**, Then, it is necessary to generate and update the files in **autotests/folding/**,
**autotests/html/** and **autotests/reference/**, which must be included in the **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). patches. Instructions are [below](#adding-unit-tests-for-a-syntax-definition).
## Adding unit tests for a syntax definition ### Adding unit tests for a syntax definition
1. Add an input file into the **autotests/input/** folder, lets call it 1. Add an input file into the **autotests/input/** folder, lets call it
**test.&lt;language-extension&gt;**. **test.&lt;language-extension&gt;**.
@@ -184,9 +221,10 @@ However, some users often report bugs related to syntax highlighting in
[kate/syntax](https://bugs.kde.org/buglist.cgi?component=syntax&product=kate&resolution=---) [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=---). and [kile/editor](https://bugs.kde.org/buglist.cgi?component=editor&product=kile&resolution=---).
## Updating the kate-editor.org/syntax website ## Updating the syntax & themes pages of the kate-editor.org website
To update the [kate-editor.org/syntax](https://kate-editor.org/syntax/) website To update the [kate-editor.org/syntax](https://kate-editor.org/syntax/) and
[kate-editor.org/themes](https://kate-editor.org/themes/) websites
including the update site & all linked examples/files, including the update site & all linked examples/files,
please run after successful **build** & **test** the following make target: please run after successful **build** & **test** the following make target:

View File

@@ -3,10 +3,10 @@
#ifndef SyntaxHighlighting_VERSION_H #ifndef SyntaxHighlighting_VERSION_H
#define SyntaxHighlighting_VERSION_H #define SyntaxHighlighting_VERSION_H
#define SyntaxHighlighting_VERSION_STRING "5.75.0" #define SyntaxHighlighting_VERSION_STRING "5.80.0"
#define SyntaxHighlighting_VERSION_MAJOR 5 #define SyntaxHighlighting_VERSION_MAJOR 5
#define SyntaxHighlighting_VERSION_MINOR 75 #define SyntaxHighlighting_VERSION_MINOR 80
#define SyntaxHighlighting_VERSION_PATCH 0 #define SyntaxHighlighting_VERSION_PATCH 0
#define SyntaxHighlighting_VERSION ((5<<16)|(75<<8)|(0)) #define SyntaxHighlighting_VERSION ((5<<16)|(80<<8)|(0))
#endif #endif

View File

@@ -1,9 +1,27 @@
# create a directory for generated definitions
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax)
macro(generate_syntax_definition generator targetFile srcFile)
add_custom_target(
${targetFile} ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/${generator}
${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generators/${generator}
${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
${ARGN}
VERBATIM
)
set(gen_defs ${gen_defs} ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
endmacro()
# generate PHP definitions # generate PHP definitions
macro(generate_php_syntax_definition targetFile srcFile) macro(generate_php_syntax_definition targetFile srcFile)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax) generate_syntax_definition(generate-php.pl ${targetFile} ${srcFile} ${CMAKE_CURRENT_SOURCE_DIR}/syntax/php.xml)
execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
endmacro() endmacro()
generate_php_syntax_definition(javascript-php.xml javascript.xml) generate_php_syntax_definition(javascript-php.xml javascript.xml)
@@ -13,17 +31,12 @@ generate_php_syntax_definition(javascript-react-php.xml javascript-react.xml)
generate_php_syntax_definition(typescript-php.xml typescript.xml) generate_php_syntax_definition(typescript-php.xml typescript.xml)
generate_php_syntax_definition(mustache-php.xml mustache.xml) generate_php_syntax_definition(mustache-php.xml mustache.xml)
# generate DoxygenLua definition
generate_syntax_definition(generate-doxygenlua.pl doxygenlua.xml doxygen.xml)
# find all definitions # find all definitions
file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml") file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml")
set(defs set(defs ${src_defs} ${gen_defs})
${src_defs}
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/html-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/css-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/javascript-react-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/typescript-php.xml
${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/mustache-php.xml
)
# theme data resource # theme data resource
qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc) qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc)
@@ -43,7 +56,7 @@ if (QRC_SYNTAX)
# generate the index file # generate the index file
add_custom_command(OUTPUT "${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" COMMAND katehighlightingindexer "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" "${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
DEPENDS ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc DEPENDS katehighlightingindexer ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc
) )
# generate the qrc file manually, to make dependencies on generated files work... # generate the qrc file manually, to make dependencies on generated files work...
@@ -57,7 +70,7 @@ if (QRC_SYNTAX)
add_library(SyntaxHighlightingData OBJECT ${themes_QRC} ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp) add_library(SyntaxHighlightingData OBJECT ${themes_QRC} ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp)
else() else()
# install the syntax files as normal files into the prefix # install the syntax files as normal files into the prefix
install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax) install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax)
# object library to make cross-folder dependencies work, only themes # object library to make cross-folder dependencies work, only themes
add_library(SyntaxHighlightingData OBJECT ${themes_QRC}) add_library(SyntaxHighlightingData OBJECT ${themes_QRC})

View File

@@ -14,9 +14,15 @@
SPDX-License-Identifier: LGPL-2.0-or-later SPDX-License-Identifier: LGPL-2.0-or-later
--> -->
<!-- ***** THIS FILE WAS GENERATED BY A SCRIPT - DO NOT EDIT *****
cd data/generators
# increase version of cmake.xml.tpl then
./generate-cmake-syntax.py cmake.yaml > ../syntax/cmake.xml
-->
<language <language
name="CMake" name="CMake"
version="25" version="31"
kateversion="5.0" kateversion="5.0"
section="Other" section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in" extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -28,66 +34,66 @@
<highlighting> <highlighting>
<list name="commands"> <list name="commands">
{%- for command in commands %} <!--[- for command in commands ]-->
<item>{{command.name}}</item> <item><!--{command.name}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
{% for command in commands -%} <!--[ for command in commands -]-->
{%- if command.named_args and command.named_args.kw %} <!--[- if command.named_args and command.named_args.kw ]-->
<list name="{{command.name}}_nargs"> <list name="<!--{command.name}-->_nargs">
{%- for arg in command.named_args.kw %} <!--[- for arg in command.named_args.kw ]-->
<item>{{arg}}</item> <item><!--{arg}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
{%- endif %} <!--[- endif ]-->
{%- if command.special_args and command.special_args.kw %} <!--[- if command.special_args and command.special_args.kw ]-->
<list name="{{command.name}}_sargs"> <list name="<!--{command.name}-->_sargs">
{%- for arg in command.special_args.kw %} <!--[- for arg in command.special_args.kw ]-->
<item>{{arg}}</item> <item><!--{arg}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
{%- endif %} <!--[- endif ]-->
{%- endfor %} <!--[- endfor ]-->
<list name="variables"> <list name="variables">
{%- for var in variables.kw %} <!--[- for var in variables.kw ]-->
<item>{{var}}</item> <item><!--{var}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
<list name="deprecated-or-internal-variables"> <list name="deprecated-or-internal-variables">
{%- for var in deprecated_or_internal_variables.kw %} <!--[- for var in deprecated_or_internal_variables.kw ]-->
<item>{{var}}</item> <item><!--{var}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
<list name="environment-variables"> <list name="environment-variables">
{%- for var in environment_variables.kw %} <!--[- for var in environment_variables.kw ]-->
<item>{{var}}</item> <item><!--{var}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
{%- for kind in properties.kinds %} <!--[- for kind in properties.kinds ]-->
<list name="{{ kind|replace('_', '-') }}"> <list name="<!--{ kind|replace('_', '-') }-->">
{%- for prop in properties[kind].kw %} <!--[- for prop in properties[kind].kw ]-->
<item>{{prop}}</item> <item><!--{prop}--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
{%- endfor %} <!--[- endfor ]-->
<list name="generator-expressions"> <list name="generator-expressions">
{%- for expr in generator_expressions %} <!--[- for expr in generator_expressions ]-->
<item>{{ expr }}</item> <item><!--{ expr }--></item>
{%- endfor %} <!--[- endfor ]-->
</list> </list>
<contexts> <contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text"> <context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
<DetectSpaces/> <DetectSpaces/>
{% for command in commands -%} <!--[ for command in commands -]-->
<WordDetect String="{{command.name}}" insensitive="true" attribute="Command" context="{{command.name}}_ctx"{% if command.start_region %} beginRegion="{{command.start_region}}"{% endif -%} {%- if command.end_region %} endRegion="{{command.end_region}}"{% endif %} /> <WordDetect String="<!--{command.name}-->" insensitive="true" attribute="Command" context="<!--{command.name}-->_ctx"<!--[ if command.start_region ]--> beginRegion="<!--{command.start_region}-->"<!--[ endif -]--> <!--[- if command.end_region ]--> endRegion="<!--{command.end_region}-->"<!--[ endif ]--> />
{% endfor -%} <!--[ endfor -]-->
<DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" /> <DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" />
<DetectIdentifier attribute="User Function/Macro" context="User Function" /> <DetectIdentifier attribute="User Function/Macro" context="User Function" />
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" /> <RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
@@ -95,71 +101,64 @@
<keyword attribute="Command" context="#stay" String="commands" /> <keyword attribute="Command" context="#stay" String="commands" />
</context> </context>
{% for command in commands -%} <!--[ for command in commands -]-->
{# <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx">
<!-- <DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op" char="(" />
{{ command|pprint }}
-->
-#}
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx">
<DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op" char="(" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op"> <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
{%- if command.nested_parentheses %} <!--[- if command.nested_parentheses ]-->
<DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op_nested" char="(" /> <DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
{%- endif %} <!--[- endif ]-->
<IncludeRules context="EndCmdPop2" /> <IncludeRules context="EndCmdPop2" />
{%- if command.named_args and command.named_args.kw %} <!--[- if command.named_args and command.named_args.kw ]-->
<keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" /> <keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
{%- endif %} <!--[- endif ]-->
{%- if command.special_args and command.special_args.kw %} <!--[- if command.special_args and command.special_args.kw ]-->
<keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" /> <keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
{%- endif %} <!--[- endif ]-->
{%- if command.property_args and command.property_args.kw %} <!--[- if command.property_args and command.property_args.kw ]-->
{%- for kind in command.property_args.kw %} <!--[- for kind in command.property_args.kw ]-->
<keyword attribute="Property" context="#stay" String="{{kind}}" /> <keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
{%- if properties[kind|replace('-', '_')].re %} <!--[- if properties[kind|replace('-', '_')].re ]-->
<IncludeRules context="Detect More {{kind}}" /> <IncludeRules context="Detect More <!--{kind}-->" />
{%- endif %} <!--[- endif ]-->
{%- endfor %} <!--[- endfor ]-->
{%- endif %} <!--[- endif ]-->
{%- if command is not nulary %} <!--[- if command is not nulary ]-->
<IncludeRules context="User Function Args" /> <IncludeRules context="User Function Args" />
{%- if command.name == 'cmake_policy' %} <!--[- if command.name == 'cmake_policy' ]-->
<!-- NOTE Handle CMP<NNN> as a special arg of `cmake_policy` command --> <!-- NOTE Handle CMP<NNN> as a special arg of `cmake_policy` command -->
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9]+\b" /> <RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9]+\b" />
{%- endif %} <!--[- endif ]-->
{%- endif %} <!--[- endif ]-->
</context> </context>
{%- if command.nested_parentheses %} <!--[- if command.nested_parentheses ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op_nested"> <context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
<IncludeRules context="EndCmdPop" /> <IncludeRules context="EndCmdPop" />
{%- if command.named_args and command.named_args.kw %} <!--[- if command.named_args and command.named_args.kw ]-->
<keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" /> <keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
{%- endif %} <!--[- endif ]-->
{%- if command.special_args and command.special_args.kw %} <!--[- if command.special_args and command.special_args.kw ]-->
<keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" /> <keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
{%- endif %} <!--[- endif ]-->
{%- if command.property_args and command.property_args.kw %} <!--[- if command.property_args and command.property_args.kw ]-->
{%- for kind in command.property_args.kw %} <!--[- for kind in command.property_args.kw ]-->
<keyword attribute="Property" context="#stay" String="{{kind}}" /> <keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
{%- if properties[kind|replace('-', '_')].re %} <!--[- if properties[kind|replace('-', '_')].re ]-->
<IncludeRules context="Detect More {{kind}}" /> <IncludeRules context="Detect More <!--{kind}-->" />
{%- endif %} <!--[- endif ]-->
{%- endfor %} <!--[- endfor ]-->
{%- endif %} <!--[- endif ]-->
<IncludeRules context="User Function Args" /> <IncludeRules context="User Function Args" />
</context> </context>
{%- endif %} <!--[- endif ]-->
{% endfor -%} <!--[ endfor -]-->
{% for kind in properties.kinds if properties[kind].re -%} <!--[ for kind in properties.kinds if properties[kind].re -]-->
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More {{ kind|replace('_', '-') }}"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect More <!--{ kind|replace('_', '-') }-->">
{%- for prop in properties[kind].re %} <RegExpr attribute="Property" context="#stay" String="<!--{properties[kind].re}-->" />
<RegExpr attribute="Property" context="#stay" String="{{prop}}" /> </context><!--{ '\n' }-->
{%- endfor %} <!--[ endfor -]-->
</context>{{ '\n' }}
{% endfor -%}
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop"> <context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop">
<DetectChar attribute="Normal Text" context="#pop" char=")" /> <DetectChar attribute="Normal Text" context="#pop" char=")" />
@@ -187,12 +186,12 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
{%- for var in deprecated_or_internal_variables.re %} <!--[- if deprecated_or_internal_variables.re ]-->
<RegExpr attribute="CMake Internal Variable" context="#stay" String="{{var}}" /> <RegExpr attribute="CMake Internal Variable" context="#stay" String="<!--{deprecated_or_internal_variables.re}-->" />
{%- endfor %} <!--[- endif ]-->
{%- for var in variables.re %} <!--[- if variables.re ]-->
<RegExpr attribute="Builtin Variable" context="#stay" String="{{var}}" /> <RegExpr attribute="Builtin Variable" context="#stay" String="<!--{variables.re}-->" />
{%- endfor %} <!--[- endif ]-->
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
@@ -204,9 +203,9 @@
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst"> <context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" /> <keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
{%- for var in environment_variables.re %} <!--[- if environment_variables.re ]-->
<RegExpr attribute="Standard Environment Variable" context="#stay" String="{{var}}" /> <RegExpr attribute="Standard Environment Variable" context="#stay" String="<!--{environment_variables.re}-->" />
{%- endfor %} <!--[- endif ]-->
<DetectIdentifier /> <DetectIdentifier />
<IncludeRules context="Detect Variable Substitutions" /> <IncludeRules context="Detect Variable Substitutions" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" /> <DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
@@ -248,10 +247,20 @@
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values"> <context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values">
<WordDetect attribute="True Special Arg" context="#stay" String="TRUE" /> <RegExpr attribute="Version Arg" context="#stay" String="\b[0-9]+(.[0-9]+)+\b" />
<WordDetect attribute="True Special Arg" context="#stay" String="ON" /> <!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<WordDetect attribute="False Special Arg" context="#stay" String="FALSE" /> <WordDetect attribute="True Special Arg" context="#stay" String="TRUE" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="OFF" /> <WordDetect attribute="True Special Arg" context="#stay" String="ON" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="YES" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="Y" insensitive="true" />
<WordDetect attribute="True Special Arg" context="#stay" String="1" />
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<WordDetect attribute="False Special Arg" context="#stay" String="FALSE" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="OFF" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="NO" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="N" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="IGNORE" insensitive="true" />
<WordDetect attribute="False Special Arg" context="#stay" String="0" />
<RegExpr attribute="False Special Arg" context="#stay" String="\b(?:&id_re;-)?NOTFOUND\b" /> <RegExpr attribute="False Special Arg" context="#stay" String="\b(?:&id_re;-)?NOTFOUND\b" />
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" /> <RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" />
</context> </context>
@@ -273,8 +282,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment"> <context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#pop" /> <LineContinue attribute="Comment" context="#pop" />
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true"> <context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
@@ -286,8 +294,7 @@
<LineContinue attribute="Comment" context="#stay" /> <LineContinue attribute="Comment" context="#stay" />
<DetectSpaces /> <DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BracketedComment" /> <StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BracketedComment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<context attribute="Strings" lineEndContext="#stay" name="String"> <context attribute="Strings" lineEndContext="#stay" name="String">
@@ -331,6 +338,7 @@
<itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" /> <itemData name="Special Args" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="True Special Arg" defStyleNum="dsOthers" color="#30a030" selColor="#30a030" spellChecking="false" /> <itemData name="True Special Arg" defStyleNum="dsOthers" color="#30a030" selColor="#30a030" spellChecking="false" />
<itemData name="False Special Arg" defStyleNum="dsOthers" color="#e05050" selColor="#e05050" spellChecking="false" /> <itemData name="False Special Arg" defStyleNum="dsOthers" color="#e05050" selColor="#e05050" spellChecking="false" />
<itemData name="Version Arg" defStyleNum="dsDataType" spellChecking="false" />
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" /> <itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsSpecialChar" spellChecking="false" /> <itemData name="Escapes" defStyleNum="dsSpecialChar" spellChecking="false" />
<itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" /> <itemData name="Builtin Variable" defStyleNum="dsDecVal" color="#c09050" selColor="#c09050" spellChecking="false" />
@@ -354,7 +362,7 @@
<comment name="singleLine" start="#" position="afterwhitespace" /> <comment name="singleLine" start="#" position="afterwhitespace" />
<comment name="multiLine" start="#[[" end="]]" region="BracketedComment"/> <comment name="multiLine" start="#[[" end="]]" region="BracketedComment"/>
</comments> </comments>
<keywords casesensitive="1" /> <keywords casesensitive="1" weakDeliminator="." />
</general> </general>
</language> </language>

View File

@@ -232,6 +232,9 @@ target-properties:
- INTERPROCEDURAL_OPTIMIZATION_<CONFIG> - INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
- INTERPROCEDURAL_OPTIMIZATION - INTERPROCEDURAL_OPTIMIZATION
- IOS_INSTALL_COMBINED - IOS_INSTALL_COMBINED
- ISPC_HEADER_DIRECTORY # Since 3.19
- ISPC_HEADER_SUFFIX # Since 3.19.2
- ISPC_INSTRUCTION_SETS # Since 3.19
- JOB_POOL_COMPILE - JOB_POOL_COMPILE
- JOB_POOL_LINK - JOB_POOL_LINK
- LABELS - LABELS
@@ -274,6 +277,14 @@ target-properties:
- NAME - NAME
- NO_SONAME - NO_SONAME
- NO_SYSTEM_FROM_IMPORTED - NO_SYSTEM_FROM_IMPORTED
- OBJC_EXTENSIONS # Since 3.16
- OBJC_STANDARD # Since 3.16
- OBJC_STANDARD_REQUIRED # Since 3.16
- OBJCXX_EXTENSIONS # Since 3.16
- OBJCXX_STANDARD # Since 3.16
- OBJCXX_STANDARD_REQUIRED # Since 3.16
- OPTIMIZE_DEPENDENCIES # Since 3.19
- OBJC_STANDARD
- OSX_ARCHITECTURES_<CONFIG> - OSX_ARCHITECTURES_<CONFIG>
- OSX_ARCHITECTURES - OSX_ARCHITECTURES
- OSX_CURRENT_VERSION # Since 3.17 - OSX_CURRENT_VERSION # Since 3.17
@@ -281,6 +292,7 @@ target-properties:
- OUTPUT_NAME_<CONFIG> - OUTPUT_NAME_<CONFIG>
- OUTPUT_NAME - OUTPUT_NAME
- PCH_WARN_INVALID # Since 3.18 - PCH_WARN_INVALID # Since 3.18
- PCH_INSTANTIATE_TEMPLATES # Since 3.19
- PDB_NAME_<CONFIG> - PDB_NAME_<CONFIG>
- PDB_NAME - PDB_NAME
- PDB_OUTPUT_DIRECTORY_<CONFIG> - PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -362,6 +374,7 @@ target-properties:
- XCODE_ATTRIBUTE_<an-attribute> - XCODE_ATTRIBUTE_<an-attribute>
- XCODE_EXPLICIT_FILE_TYPE - XCODE_EXPLICIT_FILE_TYPE
- XCODE_GENERATE_SCHEME # Since 3.15 - XCODE_GENERATE_SCHEME # Since 3.15
- XCODE_LINK_BUILD_PHASE_MODE # Since 3.19
- XCODE_PRODUCT_TYPE - XCODE_PRODUCT_TYPE
- XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13 - XCODE_SCHEME_ADDRESS_SANITIZER # Since 3.13
- XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13 - XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
@@ -669,9 +682,12 @@ variables:
- CMAKE_VS_PLATFORM_TOOLSET_CUDA - CMAKE_VS_PLATFORM_TOOLSET_CUDA
- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE - CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
- CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION - CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION
- CMAKE_XCODE_GENERATE_SCHEME - CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM # Since 3.19
- CMAKE_XCODE_BUILD_SYSTEM # Since 3.19
- CMAKE_XCODE_PLATFORM_TOOLSET - CMAKE_XCODE_PLATFORM_TOOLSET
- <PROJECT-NAME>_BINARY_DIR - <PROJECT-NAME>_BINARY_DIR
- <PROJECT-NAME>_DESCRIPTION # Since 3.12
- <PROJECT-NAME>_HOMEPAGE_URL # Since 3.12
- <PROJECT-NAME>_SOURCE_DIR - <PROJECT-NAME>_SOURCE_DIR
- <PROJECT-NAME>_VERSION - <PROJECT-NAME>_VERSION
- <PROJECT-NAME>_VERSION_MAJOR - <PROJECT-NAME>_VERSION_MAJOR
@@ -679,7 +695,7 @@ variables:
- <PROJECT-NAME>_VERSION_PATCH - <PROJECT-NAME>_VERSION_PATCH
- <PROJECT-NAME>_VERSION_TWEAK - <PROJECT-NAME>_VERSION_TWEAK
- PROJECT_BINARY_DIR - PROJECT_BINARY_DIR
- PROJECT_DESCRIPTION - PROJECT_DESCRIPTION # Since 3.9
- PROJECT_HOMEPAGE_URL # Since 3.12 - PROJECT_HOMEPAGE_URL # Since 3.12
- PROJECT_NAME - PROJECT_NAME
- PROJECT_SOURCE_DIR - PROJECT_SOURCE_DIR
@@ -695,6 +711,7 @@ variables:
- CMAKE_AUTOMOC_RELAXED_MODE - CMAKE_AUTOMOC_RELAXED_MODE
- CMAKE_BACKWARDS_COMPATIBILITY - CMAKE_BACKWARDS_COMPATIBILITY
- CMAKE_BUILD_TYPE - CMAKE_BUILD_TYPE
- CMAKE_CLANG_VFS_OVERLAY # Since 3.19
- CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11 - CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11
- CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10 - CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10
- CMAKE_CODELITE_USE_TARGETS - CMAKE_CODELITE_USE_TARGETS
@@ -777,7 +794,9 @@ variables:
- CMAKE_USER_MAKE_RULES_OVERRIDE - CMAKE_USER_MAKE_RULES_OVERRIDE
- CMAKE_WARN_DEPRECATED - CMAKE_WARN_DEPRECATED
- CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION - CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
- CMAKE_XCODE_GENERATE_SCHEME
- CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13 - CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY # Since 3.13
- CMAKE_XCODE_LINK_BUILD_PHASE_MODE # Since 3.19
- CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER # 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_ADDRESS_SANITIZER_USE_AFTER_RETURN # Since 3.13
- CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17 - CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17
@@ -869,6 +888,7 @@ variables:
- CMAKE_ANDROID_SKIP_ANT_STEP - CMAKE_ANDROID_SKIP_ANT_STEP
- CMAKE_ANDROID_STANDALONE_TOOLCHAIN - CMAKE_ANDROID_STANDALONE_TOOLCHAIN
- CMAKE_ANDROID_STL_TYPE - CMAKE_ANDROID_STL_TYPE
- CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY - CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> - CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14 - CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14
@@ -951,10 +971,12 @@ variables:
- CMAKE_NINJA_OUTPUT_PATH_PREFIX - CMAKE_NINJA_OUTPUT_PATH_PREFIX
- CMAKE_NO_BUILTIN_CHRPATH - CMAKE_NO_BUILTIN_CHRPATH
- CMAKE_NO_SYSTEM_FROM_IMPORTED - CMAKE_NO_SYSTEM_FROM_IMPORTED
- CMAKE_OPTIMIZE_DEPENDENCIES # Since 3.19
- CMAKE_OSX_ARCHITECTURES - CMAKE_OSX_ARCHITECTURES
- CMAKE_OSX_DEPLOYMENT_TARGET - CMAKE_OSX_DEPLOYMENT_TARGET
- CMAKE_OSX_SYSROOT - CMAKE_OSX_SYSROOT
- CMAKE_PCH_WARN_INVALID # Since 3.18 - CMAKE_PCH_WARN_INVALID # Since 3.18
- CMAKE_PCH_INSTANTIATE_TEMPLATES # Since 3.19
- CMAKE_PDB_OUTPUT_DIRECTORY - CMAKE_PDB_OUTPUT_DIRECTORY
- CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> - CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_POSITION_INDEPENDENT_CODE - CMAKE_POSITION_INDEPENDENT_CODE
@@ -1015,6 +1037,9 @@ variables:
- CMAKE_Fortran_MODDIR_DEFAULT - CMAKE_Fortran_MODDIR_DEFAULT
- CMAKE_Fortran_MODDIR_FLAG - CMAKE_Fortran_MODDIR_FLAG
- CMAKE_Fortran_MODOUT_FLAG - CMAKE_Fortran_MODOUT_FLAG
- CMAKE_ISPC_HEADER_DIRECTORY # Since 3.19
- CMAKE_ISPC_HEADER_SUFFIX # Since 3.19.2
- CMAKE_ISPC_INSTRUCTION_SETS # Since 3.19
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE - CMAKE_<LANG>_ANDROID_TOOLCHAIN_MACHINE
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX - CMAKE_<LANG>_ANDROID_TOOLCHAIN_PREFIX
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX - CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX
@@ -1063,6 +1088,12 @@ variables:
- CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS - CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
- CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES - CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES
- CMAKE_<LANG>_STANDARD_LIBRARIES - CMAKE_<LANG>_STANDARD_LIBRARIES
- CMAKE_OBJC_EXTENSIONS # Since 3.16
- CMAKE_OBJC_STANDARD # Since 3.16
- CMAKE_OBJC_STANDARD_REQUIRED # Since 3.16
- CMAKE_OBJCXX_EXTENSIONS # Since 3.16
- CMAKE_OBJCXX_STANDARD # Since 3.16
- CMAKE_OBJCXX_STANDARD_REQUIRED # Since 3.16
- CMAKE_Swift_LANGUAGE_VERSION - CMAKE_Swift_LANGUAGE_VERSION
- CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG> - CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG>
# Variables for CTest # Variables for CTest
@@ -1190,8 +1221,11 @@ variables:
- <pfx>_UNPARSED_ARGUMENTS - <pfx>_UNPARSED_ARGUMENTS
- <pfx>_KEYWORDS_MISSING_VALUES - <pfx>_KEYWORDS_MISSING_VALUES
# Well known CMake's official module's variables # Well known CMake's official module's variables
# - CheckCompilerFlag
# - CheckCCompilerFlag # - CheckCCompilerFlag
# - CheckSourceCompiles
# - CheckCSourceCompiles # - CheckCSourceCompiles
# - CheckSourceRuns
# - CheckCSourceRuns # - CheckCSourceRuns
# - CheckCxxCompilerFlag # - CheckCxxCompilerFlag
# - CheckCxxSourceCompiles # - CheckCxxSourceCompiles
@@ -1337,6 +1371,7 @@ variables:
- CPACK_EXTERNAL_REQUESTED_VERSIONS - CPACK_EXTERNAL_REQUESTED_VERSIONS
- CPACK_EXTERNAL_ENABLE_STAGING - CPACK_EXTERNAL_ENABLE_STAGING
- CPACK_EXTERNAL_PACKAGE_SCRIPT - CPACK_EXTERNAL_PACKAGE_SCRIPT
- CPACK_EXTERNAL_BUILT_PACKAGES # Since 3.19
# - CPackIFW # - CPackIFW
- CPACK_IFW_ROOT - CPACK_IFW_ROOT
- QTIFWDIR - QTIFWDIR
@@ -1597,6 +1632,9 @@ variables:
- CPACK_PACKAGE_INSTALL_REGISTRY_KEY - CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- CPACK_CREATE_DESKTOP_LINKS - CPACK_CREATE_DESKTOP_LINKS
- CPACK_BINARY_<GENNAME> - CPACK_BINARY_<GENNAME>
- CPACK_PRE_BUILD_SCRIPTS # Since 3.19
- CPACK_POST_BUILD_SCRIPTS # Since 3.19
- CPACK_PACKAGE_FILES # Since 3.19
# - CPackWIX # - CPackWIX
- CPACK_WIX_UPGRADE_GUID - CPACK_WIX_UPGRADE_GUID
- CPACK_WIX_PRODUCT_GUID - CPACK_WIX_PRODUCT_GUID
@@ -1621,6 +1659,7 @@ variables:
- CPACK_WIX_SKIP_PROGRAM_FOLDER - CPACK_WIX_SKIP_PROGRAM_FOLDER
- CPACK_WIX_ROOT_FOLDER_ID - CPACK_WIX_ROOT_FOLDER_ID
- CPACK_WIX_ROOT - CPACK_WIX_ROOT
- CPACK_WIX_CUSTOM_XMLNS # Since 3.19
# - CTest # - CTest
# - Dart # - Dart
- BUILD_TESTING - BUILD_TESTING
@@ -1750,6 +1789,7 @@ deprecated-or-internal-variables:
# NOTE Added to syntax file version 14 at 3.15.0 version of CMake # NOTE Added to syntax file version 14 at 3.15.0 version of CMake
environment-variables: environment-variables:
# Environment Variables that Control the Build # Environment Variables that Control the Build
- CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_BUILD_PARALLEL_LEVEL - CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_CONFIG_TYPE - CMAKE_CONFIG_TYPE
- CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17 - CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17
@@ -1837,7 +1877,19 @@ scripting-commands:
] ]
- -
name: cmake_language name: cmake_language
named-args: [CALL, EVAL, CODE] named-args: [
CALL
, EVAL
, CODE
# Since 3.19
, DEFER
, DIRECTORY
, ID
, ID_VAR
, GET_CALL_IDS
, GET_CALL
, CANCEL_CALL
]
- -
name: cmake_minimum_required name: cmake_minimum_required
named-args: [VERSION, FATAL_ERROR] named-args: [VERSION, FATAL_ERROR]
@@ -1850,7 +1902,13 @@ scripting-commands:
special-args: [OLD, NEW] special-args: [OLD, NEW]
- -
name: configure_file name: configure_file
named-args: [COPYONLY, ESCAPE_QUOTES, "@ONLY", NEWLINE_STYLE] named-args: [
COPYONLY
, ESCAPE_QUOTES
, NO_SOURCE_PERMISSIONS # Since 3.19
, "@ONLY"
, NEWLINE_STYLE
]
special-args: [UNIX, DOS, WIN32, LF, CRLF] special-args: [UNIX, DOS, WIN32, LF, CRLF]
- -
name: continue name: continue
@@ -1934,6 +1992,7 @@ scripting-commands:
, ENCODING , ENCODING
, ECHO_OUTPUT_VARIABLE # Since 3.18 , ECHO_OUTPUT_VARIABLE # Since 3.18
, ECHO_ERROR_VARIABLE # Since 3.18 , ECHO_ERROR_VARIABLE # Since 3.18
, COMMAND_ERROR_IS_FATAL # Since 3.19
] ]
special-args: [ special-args: [
NONE NONE
@@ -1943,6 +2002,8 @@ scripting-commands:
, UTF8 , UTF8
, STDERR # Since 3.15: the value for `COMMAND_ECHO` , STDERR # Since 3.15: the value for `COMMAND_ECHO`
, STDOUT # Since 3.15: the value for `COMMAND_ECHO` , STDOUT # Since 3.15: the value for `COMMAND_ECHO`
, ANY # Since 3.19: the value for `COMMAND_ERROR_IS_FATAL`
, LAST # Since 3.19: the value for `COMMAND_ERROR_IS_FATAL`
] ]
nested-parentheses?: true nested-parentheses?: true
- -
@@ -2009,6 +2070,7 @@ scripting-commands:
, INPUT , INPUT
, CONTENT , CONTENT
, CONDITION , CONDITION
, TARGET # Since 3.19
, COPY , COPY
, INSTALL , INSTALL
, DESTINATION , DESTINATION
@@ -2040,7 +2102,8 @@ scripting-commands:
, ARCHIVE_CREATE , ARCHIVE_CREATE
, FILES , FILES
, FORMAT , FORMAT
, TYPE , COMPRESSION
, COMPRESSION_LEVEL # Since 3.19
, MTIME , MTIME
, VERBOSE , VERBOSE
, ARCHIVE_EXTRACT , ARCHIVE_EXTRACT
@@ -2049,6 +2112,10 @@ scripting-commands:
, ESCAPE_QUOTES , ESCAPE_QUOTES
, "@ONLY" , "@ONLY"
, NEWLINE_STYLE , NEWLINE_STYLE
, CHMOD # Since 3.19
, CHMOD_RECURSE # Since 3.19
, REAL_PATH # Since 3.19
, BASE_DIRECTORY # Since 3.19
] ]
special-args: [ special-args: [
UTF-8 UTF-8
@@ -2345,7 +2412,13 @@ scripting-commands:
nulary?: true nulary?: true
- -
name: separate_arguments name: separate_arguments
named-args: [NATIVE_COMMAND, UNIX_COMMAND, WINDOWS_COMMAND] named-args: [
NATIVE_COMMAND
, UNIX_COMMAND
, WINDOWS_COMMAND
, PROGRAM # Since 3.19
, SEPARATE_ARGS # Since 3.19
]
- -
name: set_directory_properties name: set_directory_properties
named-args: [PROPERTIES] named-args: [PROPERTIES]
@@ -2429,6 +2502,16 @@ scripting-commands:
, NAME , NAME
, TYPE , TYPE
, UPPER , UPPER
# Since 3.19
, JSON
, ERROR_VARIABLE
, GET
, TYPE
, MEMBER
, LENGTH
, REMOVE
, SET
, EQUAL
] ]
- -
name: unset name: unset
@@ -2532,6 +2615,7 @@ project-commands:
, CSharp , CSharp
, CXX , CXX
, CUDA , CUDA
, ISPC # Since 3.19
, Java , Java
, OBJC # Since 3.16 , OBJC # Since 3.16
, OBJCXX # Since 3.16 , OBJCXX # Since 3.16
@@ -2656,6 +2740,7 @@ project-commands:
, CSharp , CSharp
, CXX , CXX
, CUDA , CUDA
, ISPC # Since 3.19
, Java , Java
, OBJC # Since 3.16 , OBJC # Since 3.16
, OBJCXX # Since 3.16 , OBJCXX # Since 3.16

View File

@@ -3,7 +3,7 @@
# #
# Generate Kate syntax file for CMake # Generate Kate syntax file for CMake
# #
# SPDX-FileCopyrightText: 2017-2019 Alex Turbov <i.zaufi@gmail.com> # SPDX-FileCopyrightText: 2017-2020 Alex Turbov <i.zaufi@gmail.com>
# #
# To install prerequisites: # To install prerequisites:
# #
@@ -43,21 +43,29 @@ def try_transform_placeholder_string_to_regex(name):
''' '''
m = _TEMPLATED_NAME.split(name) m = _TEMPLATED_NAME.split(name)
if 'CMAKE_MATCH_' in m: if 'CMAKE_MATCH_' in m:
return '\\bCMAKE_MATCH_[0-9]+\\b' return 'CMAKE_MATCH_[0-9]+'
if 'CMAKE_ARGV' in m: if 'CMAKE_ARGV' in m:
return '\\bCMAKE_ARGV[0-9]+\\b' return 'CMAKE_ARGV[0-9]+'
if 'CMAKE_POLICY_DEFAULT_CMP' in m: if 'CMAKE_POLICY_DEFAULT_CMP' in m:
return '\\bCMAKE_POLICY_DEFAULT_CMP[0-9]{4}\\b' return 'CMAKE_POLICY_DEFAULT_CMP[0-9]{4}'
if 'CMAKE_POLICY_WARNING_CMP' in m: if 'CMAKE_POLICY_WARNING_CMP' in m:
return '\\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\\b' return 'CMAKE_POLICY_WARNING_CMP[0-9]{4}'
if 'ARGV' in m: if 'ARGV' in m:
return '\\bARGV[0-9]+\\b' return 'ARGV[0-9]+'
return '\\b{}\\b'.format('&id_re;'.join(list(m))) if 1 < len(m) else name return '&id_re;'.join(m) if 1 < len(m) else name
def try_placeholders_to_regex(names):
if not names:
return None
l = map(try_transform_placeholder_string_to_regex, names)
l = sorted(l, reverse=True)
return '\\b(?:' + '|'.join(l) + ')\\b'
def partition_iterable(fn, iterable): def partition_iterable(fn, iterable):
@@ -73,7 +81,7 @@ def _transform_command_set(cmd, list_name):
list_name = list_name.replace('-', '_') list_name = list_name.replace('-', '_')
cmd[list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [args, args_re])} cmd[list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [args, args_re])}
cmd[list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), args_re)] cmd[list_name]['re'] = try_placeholders_to_regex(args_re)
return cmd return cmd
@@ -136,12 +144,7 @@ def cli(input_yaml, template):
, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])] , [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])]
) )
} }
data[var_key]['re'] = [ data[var_key]['re'] = try_placeholders_to_regex(data[var_key]['re'])
*map(
lambda x: try_transform_placeholder_string_to_regex(x)
, data[var_key]['re']
)
]
# Transform properties and make all-properties list # Transform properties and make all-properties list
data['properties'] = {} data['properties'] = {}
@@ -153,18 +156,16 @@ def cli(input_yaml, template):
data['properties'][python_prop_list_name] = { data['properties'][python_prop_list_name] = {
k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re]) k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])
} }
data['properties'][python_prop_list_name]['re'] = [ data['properties'][python_prop_list_name]['re'] = try_placeholders_to_regex(props_re)
*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)
]
data['properties']['kinds'] = [*map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS)] data['properties']['kinds'] = list(map(lambda name: name.replace('-', '_'), _PROPERTY_KEYS))
# Make all commands list # Make all commands list
data['commands'] = [ data['commands'] = list(
*map( map(
lambda cmd: transform_command(cmd) transform_command
, data['scripting-commands'] + data['project-commands'] + data['ctest-commands']) , data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])
] )
# Fix node names to be accessible from Jinja template # Fix node names to be accessible from Jinja template
data['generator_expressions'] = data['generator-expressions'] data['generator_expressions'] = data['generator-expressions']
@@ -177,6 +178,12 @@ def cli(input_yaml, template):
env = jinja2.Environment( env = jinja2.Environment(
keep_trailing_newline=True keep_trailing_newline=True
) )
env.block_start_string = '<!--['
env.block_end_string = ']-->'
env.variable_start_string = '<!--{'
env.variable_end_string = '}-->'
env.comment_start_string = '<!--#'
env.comment_end_string = '#-->'
# Register convenience filters # Register convenience filters
env.tests['nulary'] = cmd_is_nulary env.tests['nulary'] = cmd_is_nulary

View File

@@ -19,7 +19,13 @@
my $file = ""; my $file = "";
while (<>) open(my $input, '<:encoding(UTF-8)', $ARGV[0])
or die "Could not open file '$ARGV[0]': $!";
open(my $output, '>:encoding(UTF-8)', $ARGV[1])
or die "Could not open file '$ARGV[1]': $!";
while (<$input>)
{ {
$file .= $_; $file .= $_;
} }
@@ -55,12 +61,17 @@ else
$file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype=""/s; $file =~ s/<language([^>]+)mimetype="[^"]*"/<language$1mimetype=""/s;
} }
$findphp = "<context name=\"FindPHP\" attribute=\"Normal Text\" lineEndContext=\"#stay\">\n<RegExpr context=\"##PHP/PHP\" String=\"&lt;\\?(?:=|php)?\" lookAhead=\"true\" />\n</context>\n"; if ($root == 1 || $ARGV[0] =~ /mustache.xml$/)
{
$file =~ s/<(?:RegExpr (attribute="Processing Instruction" context="PI"|context="PI" attribute="Processing Instruction")|itemData name="Processing Instruction")[^\/]+\/>|<context name="PI".*?<\/context>//gs;
}
$file =~ s/<IncludeRules\s([^>]*)context="([^"#]*)##(?!Alerts|Doxygen|Modelines)([^"]+)"/<IncludeRules $1context="$2##$3\/PHP"/g; $findphp = "<context name=\"FindPHP\" attribute=\"Normal Text\" lineEndContext=\"#stay\">\n<Detect2Chars context=\"##PHP/PHP\" char=\"&lt;\" char1=\"?\" lookAhead=\"true\" />\n</context>\n";
$file =~ s/<IncludeRules\s([^>]*)context="([^"#]*)##(?!Alerts|Comments|Doxygen|Modelines)([^"]+)"/<IncludeRules $1context="$2##$3\/PHP"/g;
$file =~ s/(<context\s[^>]*[^>\/]>)/$1\n<IncludeRules context="FindPHP" \/>/g; $file =~ s/(<context\s[^>]*[^>\/]>)/$1\n<IncludeRules context="FindPHP" \/>/g;
$file =~ s/(<context\s[^>]*[^>\/])\s*\/>/$1>\n<IncludeRules context="FindPHP" \/>\n<\/context>/g; $file =~ s/(<context\s[^>]*[^>\/])\s*\/>/$1>\n<IncludeRules context="FindPHP" \/>\n<\/context>/g;
$file =~ s/(?=<\/contexts\s*>)/$findphp/; $file =~ s/(?=<\/contexts\s*>)/$findphp/;
print $file; print $output $file;
print $warning; print $output $warning;

View File

@@ -395,49 +395,61 @@
commonAttributes: Common attributes commonAttributes: Common attributes
insensitive: Is this list case-insensitive? [boolean, optional, see note] insensitive: Is this list case-insensitive? [boolean, optional, see note]
String: Name of the list String: Name of the list
weakDelimiter: Use weak deliminator weakDeliminator: Add weak deliminators [optional, see note]
additionalDeliminator: Add deliminators [optional, see note]
By default, case sensitivity is determined from <keywords casesensitive> in By default, case sensitivity is determined from <keywords casesensitive> in
<general> (default=true), but can be overridden per-list with 'insensitive'. <general> (default=true), but can be overridden per-list with 'insensitive'.
TODO: weakDeliminator and additionalDeliminator are accumulated to those defined in
- Should be weakDeliminator <keywords weakDeliminator additionalDeliminator> in <general>.
- Explain deliminator
- Doesn't seem to be supported in highligh.cpp
--> -->
<xs:element name="keyword"> <xs:element name="keyword">
<xs:complexType> <xs:complexType>
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="insensitive" type="xs:boolean"/> <xs:attribute name="insensitive" type="xs:boolean"/>
<xs:attribute name="String" use="required"/> <xs:attribute name="String" use="required"/>
<xs:attribute name="weakDelimiter"/> <xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--
Detect a floating point number Detect a floating point number
commonAttributes: Common attributes commonAttributes: Common attributes
weakDeliminator: Add weak deliminators [optional]
additionalDeliminator: Add deliminators [optional]
--> -->
<xs:element name="Float"> <xs:element name="Float">
<xs:complexType> <xs:complexType>
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--
Detect an octal number Detect an octal number
commonAttributes: Common attributes commonAttributes: Common attributes
weakDeliminator: Add weak deliminators [optional]
additionalDeliminator: Add deliminators [optional]
--> -->
<xs:element name="HlCOct"> <xs:element name="HlCOct">
<xs:complexType> <xs:complexType>
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--
Detect a hexadecimal number Detect a hexadecimal number
commonAttributes: Common attributes commonAttributes: Common attributes
weakDeliminator: Add weak deliminators [optional]
additionalDeliminator: Add deliminators [optional]
--> -->
<xs:element name="HlCHex"> <xs:element name="HlCHex">
<xs:complexType> <xs:complexType>
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--
@@ -455,10 +467,14 @@
<!-- <!--
Detect an integer number Detect an integer number
commonAttributes: Common attributes commonAttributes: Common attributes
weakDeliminator: Add weak deliminators [optional]
additionalDeliminator: Add deliminators [optional]
--> -->
<xs:element name="Int"> <xs:element name="Int">
<xs:complexType> <xs:complexType>
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--
@@ -524,6 +540,8 @@
commonAttributes: Common attributes commonAttributes: Common attributes
String: The string to look for String: The string to look for
insensitive: Whether the string is matched case INsensitive. [boolean, optional, default=false] insensitive: Whether the string is matched case INsensitive. [boolean, optional, default=false]
weakDeliminator: Add weak deliminators [optional]
additionalDeliminator: Add deliminators [optional]
TODO TODO
- What's default of insensitive? I'm not sure... - What's default of insensitive? I'm not sure...
@@ -533,6 +551,8 @@
<xs:attributeGroup ref="commonAttributes"/> <xs:attributeGroup ref="commonAttributes"/>
<xs:attribute name="String" use="required"/> <xs:attribute name="String" use="required"/>
<xs:attribute name="insensitive" type="xs:boolean"/> <xs:attribute name="insensitive" type="xs:boolean"/>
<xs:attribute name="weakDeliminator"/>
<xs:attribute name="additionalDeliminator"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<!-- <!--

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language version="5" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true"> <language version="6" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true">
<highlighting> <highlighting>
<list name="alerts_hi"> <list name="alerts_hi">
<item>ALERT</item> <item>ALERT</item>
@@ -19,6 +19,7 @@
<item>WARNING</item> <item>WARNING</item>
<item>CAUTION</item> <item>CAUTION</item>
<item>NOLINT</item> <item>NOLINT</item>
<item>NOQA</item>
</list> </list>
<list name="alerts_lo"> <list name="alerts_lo">
<item>###</item> <item>###</item>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -38,7 +38,7 @@ Changelog:
--> -->
<language name="CSS" version="10" kateversion="5.0" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10"> <language name="CSS" version="12" kateversion="5.53" section="Markup" extensions="*.css" indenter="cstyle" mimetype="text/css" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<!-- https://www.w3.org/Style/CSS/current-work --> <!-- https://www.w3.org/Style/CSS/current-work -->
<highlighting> <highlighting>
@@ -822,6 +822,7 @@ Changelog:
<item>static</item> <item>static</item>
<item>static-position</item> <item>static-position</item>
<item>status-bar</item> <item>status-bar</item>
<item>sticky</item>
<item>thick</item> <item>thick</item>
<item>thin</item> <item>thin</item>
<item>ultra-condensed</item> <item>ultra-condensed</item>
@@ -1584,8 +1585,7 @@ Changelog:
<context name="Comment" attribute="Comment" lineEndContext="#stay"> <context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="comment" /> <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="comment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd" <!DOCTYPE language SYSTEM "language.dtd"
[ [
<!ENTITY wordsep "([][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord --> <!ENTITY wordsep "(?:[][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord -->
<!ENTITY sl_word ".*?(?=&wordsep;)"> <!ENTITY sl_word ".*?(?=&wordsep;)">
<!ENTITY ml_word ".*?(?=&wordsep;|\*/)"> <!ENTITY ml_word ".*?(?=&wordsep;|\*/)">
]> ]>
<language name="Doxygen" <language name="Doxygen"
version="9" version="13"
kateversion="5.0" kateversion="5.0"
section="Markup" section="Markup"
extensions="*.dox;*.doxygen" extensions="*.dox;*.doxygen"
@@ -230,19 +230,17 @@
<context attribute="Comment" lineEndContext="#pop" name="LineComment"> <context attribute="Comment" lineEndContext="#pop" name="LineComment">
<LineContinue attribute="Comment" context="#stay" /> <LineContinue attribute="Comment" context="#stay" />
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<DetectIdentifier /> <DetectIdentifier />
<DetectChar attribute="Comment" context="SL_StartTag" char="\" lookAhead="true" /> <AnyChar attribute="Comment" context="SL_StartTag" String="\@" lookAhead="true" />
<DetectChar attribute="Comment" context="SL_StartTag" char="@" lookAhead="true" />
<DetectChar attribute="Comment" context="SL_StartHTMLTag" char="&lt;" lookAhead="true" /> <DetectChar attribute="Comment" context="SL_StartHTMLTag" char="&lt;" lookAhead="true" />
<DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" /> <DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
</context> </context>
<context attribute="Comment" lineEndContext="#stay" name="BlockComment"> <context attribute="Comment" lineEndContext="#stay" name="BlockComment">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<DetectIdentifier /> <DetectIdentifier />
<DetectChar attribute="Comment" context="ML_StartTag" char="\" lookAhead="true" /> <AnyChar attribute="Comment" context="ML_StartTag" String="\@" lookAhead="true" />
<DetectChar attribute="Comment" context="ML_StartTag" char="@" lookAhead="true" />
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment" /> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment" />
<DetectChar attribute="Comment" context="ML_StartHTMLTag" char="&lt;" lookAhead="true" /> <DetectChar attribute="Comment" context="ML_StartHTMLTag" char="&lt;" lookAhead="true" />
<DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" /> <DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
@@ -335,7 +333,7 @@
<context name="ML_htmlcomment" attribute="HTML Comment" lineEndContext="#stay"> <context name="ML_htmlcomment" attribute="HTML Comment" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" /> <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<DetectIdentifier /> <DetectIdentifier />
<StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" /> <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
</context> </context>
@@ -354,7 +352,7 @@
<DetectChar attribute="Types" context="#pop#pop" char="&quot;" /> <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
</context> </context>
<context name="ML_FindNextLine" attribute="Comment" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="ML_FindNextLine" attribute="Comment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop!ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/> <Detect2Chars attribute="Comment" context="#pop!ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
<Detect2Chars attribute="Comment" context="ML_VerbatimPrefix" char="*" char1="*" lookAhead="true" /> <Detect2Chars attribute="Comment" context="ML_VerbatimPrefix" char="*" char1="*" lookAhead="true" />
@@ -498,7 +496,7 @@
</context> </context>
<context name="SL_htmlcomment" attribute="HTML Comment" lineEndContext="#pop"> <context name="SL_htmlcomment" attribute="HTML Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<DetectIdentifier /> <DetectIdentifier />
<StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" /> <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
</context> </context>
@@ -590,8 +588,7 @@
<RegExpr attribute="Error" context="#pop" String="[@\\]f[]}]" /> <RegExpr attribute="Error" context="#pop" String="[@\\]f[]}]" />
<RegExpr attribute="Tags" context="#pop" String="[@\\](?:[#$%&amp;&lt;&gt;&quot;@\\.]|::|---?)(?=&wordsep;)" /> <RegExpr attribute="Tags" context="#pop" String="[@\\](?:[#$%&amp;&lt;&gt;&quot;@\\.]|::|---?)(?=&wordsep;)" />
<RegExpr attribute="Custom Tags" context="#pop" String="[@\\](?:[^@\\ \t\*]|\*(?!/))+" /> <RegExpr attribute="Custom Tags" context="#pop" String="[@\\](?:[^@\\ \t\*]|\*(?!/))+" />
<DetectChar attribute="Comment" context="#pop" char="\" /> <AnyChar attribute="Comment" context="#pop" String="\@" />
<DetectChar attribute="Comment" context="#pop" char="@" />
</context> </context>
<context name="LanguageId" attribute="Word" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="LanguageId" attribute="Word" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">

View File

@@ -3,7 +3,7 @@
<!ENTITY nmtoken "[\-\w\d\.:_]+"> <!ENTITY nmtoken "[\-\w\d\.:_]+">
<!ENTITY entref "(#[0-9]+|#[xX][0-9A-Fa-f]+|&nmtoken;);"> <!ENTITY entref "(#[0-9]+|#[xX][0-9A-Fa-f]+|&nmtoken;);">
]> ]>
<language name="DTD" version="3" kateversion="3.4" section="Markup" extensions="*.dtd" mimetype="application/xml-dtd" author="Andriy Lesyuk (s-andy@in.if.ua)" license="LGPL"> <language name="DTD" version="4" kateversion="5.0" section="Markup" extensions="*.dtd" mimetype="application/xml-dtd" author="Andriy Lesyuk (s-andy@in.if.ua)" license="LGPL">
<highlighting> <highlighting>
<list name="Category"> <list name="Category">
@@ -45,8 +45,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay"> <context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" /> <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
@@ -78,7 +77,7 @@
<context name="InlineComment" attribute="Comment" lineEndContext="#pop"> <context name="InlineComment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="-" char1="-" /> <Detect2Chars attribute="Comment" context="#pop" char="-" char1="-" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>

View File

@@ -5,7 +5,7 @@
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*"> <!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> <!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]> ]>
<language name="HTML" version="12" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10"> <language name="HTML" version="14" kateversion="5.53" section="Markup" extensions="*.htm;*.html;*.shtml;*.shtm" mimetype="text/html" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL" priority="10">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -79,8 +79,7 @@
</context> </context>
<context name="FindAttributes" attribute="Other Text" lineEndContext="#stay"> <context name="FindAttributes" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="Attribute" context="#stay" String="&attributeName;" column="0"/> <RegExpr attribute="Attribute" context="#stay" String="^&attributeName;|\s+&attributeName;" />
<RegExpr attribute="Attribute" context="#stay" String="\s+&attributeName;" />
<DetectChar attribute="Attribute" context="Value" char="=" /> <DetectChar attribute="Attribute" context="Value" char="=" />
</context> </context>
@@ -92,8 +91,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay"> <context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces/> <DetectSpaces/>
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" /> <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier/> <DetectIdentifier/>
<RegExpr attribute="Error" context="#stay" String="-(?:-(?!-&gt;))+" /> <RegExpr attribute="Error" context="#stay" String="-(?:-(?!-&gt;))+" />
</context> </context>
@@ -195,7 +193,7 @@
<context name="JS comment close" attribute="Comment" lineEndContext="#pop"> <context name="JS comment close" attribute="Comment" lineEndContext="#pop">
<RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" /> <RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" />
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<context name="Value" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ"> <context name="Value" attribute="Other Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
@@ -206,8 +204,7 @@
<context name="Value NQ" attribute="Other Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> <context name="Value NQ" attribute="Other Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
<IncludeRules context="FindEntityRefs" /> <IncludeRules context="FindEntityRefs" />
<RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" /> <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)|[^/&gt;&lt;&quot;&apos;\s]" />
<RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
</context> </context>
<context name="Value DQ" attribute="Value" lineEndContext="#stay"> <context name="Value DQ" attribute="Value" lineEndContext="#stay">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc" mimetype="" version="6" kateversion="2.4" author="Jan Janssen (medhefgo@web.de)" license="LGPL"> <language name="INI Files" section="Configuration" extensions="*.ini;*.pls;*.kcfgc" mimetype="" version="8" kateversion="5.0" author="Jan Janssen (medhefgo@web.de)" license="LGPL">
<highlighting> <highlighting>
<list name="keywords"> <list name="keywords">
@@ -36,8 +36,7 @@
<context name="ini" attribute="Normal Text" lineEndContext="#stay"> <context name="ini" attribute="Normal Text" lineEndContext="#stay">
<RangeDetect attribute="Section" context="#stay" char="[" char1="]" beginRegion="Section" endRegion="Section" /> <RangeDetect attribute="Section" context="#stay" char="[" char1="]" beginRegion="Section" endRegion="Section" />
<DetectChar attribute="Assignment" context="Value" char="=" /> <DetectChar attribute="Assignment" context="Value" char="=" />
<DetectChar char=";" attribute="Comment" context="Comment" firstNonSpace="true" /> <AnyChar String=";#" attribute="Comment" context="Comment" firstNonSpace="true" />
<DetectChar char="#" attribute="Comment" context="Comment" firstNonSpace="true" />
</context> </context>
<context name="Value" attribute="Value" lineEndContext="#pop" > <context name="Value" attribute="Value" lineEndContext="#pop" >
@@ -48,8 +47,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop"> <context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
</contexts> </contexts>

View File

@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd" <!DOCTYPE language SYSTEM "language.dtd"
[ [
<!ENTITY int "[0-9]([0-9_]*[0-9])?"> <!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
<!ENTITY hex "[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?"> <!ENTITY hex "(?:[0-9a-fA-F]++(_++[0-9a-fA-F]++)*+)">
<!ENTITY exp "(?:[eE][-+]?&int;)">
<!ENTITY float "(\b&int;(\.((&int;&exp;?+|&exp;)[fFdD]?\b|[fFdD]\b)?|&exp;[fFdD]?\b|[fFdD]\b)|\.&int;&exp;?[fFdD]?\b)">
<!ENTITY hexfloat "\b0[xX](&hex;\.?+&hex;?+|\.&hex;?)[pP][-+]?&int;[fFdD]?\b">
]> ]>
<language name="Java" version="7" kateversion="5.0" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)"> <language name="Java" version="9" kateversion="5.62" section="Sources" extensions="*.java" mimetype="text/x-java" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
<highlighting> <highlighting>
<list name="java15"> <list name="java15">
<item>ACTIVE</item> <item>ACTIVE</item>
@@ -3704,21 +3707,11 @@
</list> </list>
<list name="keywords"> <list name="keywords">
<item>abstract</item> <item>abstract</item>
<item>break</item>
<item>case</item>
<item>catch</item>
<item>class</item> <item>class</item>
<item>continue</item>
<item>default</item> <item>default</item>
<item>do</item>
<item>else</item>
<item>enum</item> <item>enum</item>
<item>extends</item> <item>extends</item>
<item>false</item> <item>false</item>
<item>finally</item>
<item>for</item>
<item>goto</item>
<item>if</item>
<item>implements</item> <item>implements</item>
<item>instanceof</item> <item>instanceof</item>
<item>@interface</item> <item>@interface</item>
@@ -3729,18 +3722,30 @@
<item>private</item> <item>private</item>
<item>protected</item> <item>protected</item>
<item>public</item> <item>public</item>
<item>return</item>
<item>super</item> <item>super</item>
<item>strictfp</item> <item>strictfp</item>
<item>switch</item>
<item>synchronized</item> <item>synchronized</item>
<item>this</item> <item>this</item>
<item>throws</item> <item>throws</item>
<item>throw</item>
<item>transient</item> <item>transient</item>
<item>true</item> <item>true</item>
<item>try</item>
<item>volatile</item> <item>volatile</item>
</list>
<list name="control flow">
<item>break</item>
<item>case</item>
<item>catch</item>
<item>continue</item>
<item>do</item>
<item>else</item>
<item>finally</item>
<item>for</item>
<item>goto</item>
<item>if</item>
<item>return</item>
<item>switch</item>
<item>throw</item>
<item>try</item>
<item>while</item> <item>while</item>
</list> </list>
<list name="types"> <list name="types">
@@ -3759,87 +3764,127 @@
</list> </list>
<contexts> <contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal"> <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<!-- Comment next line if you don't use Javadoc tool --> <DetectSpaces context="#stay"/>
<IncludeRules context="##Javadoc"/>
<keyword attribute="Keyword" context="#stay" String="keywords"/> <DetectChar attribute="Symbol" context="Dot" char="." lookAhead="1"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<keyword attribute="Java15" context="#stay" String="java15"/>
<RegExpr attribute="Float" context="#stay" String="(\b&int;\.?|(\b&int;)?\.&int;)([eE][\-\+]?&int;[fFdD]?|[fFdD])\b"/>
<RegExpr attribute="Float" context="#stay" String="(\b&int;\.|(\b&int;)?\.&int;\b)"/>
<RegExpr attribute="Float" context="#stay" String="\b0[xX](&hex;\.?|(&hex;)?\.&hex;)[pP][\-\+]?&int;[fFdD]?\b"/>
<RegExpr attribute="Hex" context="#stay" String="\b0[xX]&hex;[lL]?\b"/>
<RegExpr attribute="Binary" context="#stay" String="\b0[bB][01]([01_]*[01])?[lL]?\b"/>
<RegExpr attribute="Octal" context="#stay" String="\b0[0-7]([0-7_]*[0-7])?[lL]?\b"/>
<RegExpr attribute="Decimal" context="#stay" String="\b(0|[1-9]([0-9_]*[0-9])?)[lL]?\b"/>
<HlCChar attribute="Char" context="#stay"/>
<RegExpr attribute="Char" context="#stay" String="'\\u[0-9a-fA-F]{4}'"/>
<RegExpr attribute="Decimal" context="#stay" String="//\s*BEGIN.*$" beginRegion="Region1"/>
<RegExpr attribute="Decimal" context="#stay" String="//\s*END.*$" endRegion="Region1"/>
<DetectChar attribute="String" context="String" char="&quot;"/>
<RegExpr attribute="Function" context="EnterPrintf" String="\.(format|printf)\b"/>
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/> <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/> <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
<RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" /> <DetectChar attribute="Annotation" context="Annotation" char="@" />
<RegExpr attribute="Keyword" context="StaticImports" String="\b(import\s+static)\b" />
<RegExpr attribute="Keyword" context="Imports" String="\b(package|import)\b" />
<RegExpr attribute="Function" context="#stay" String="\b[_\w][_\w\d]*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
<RegExpr attribute="Annotation" context="#stay" String="@[_\w][_\w\d]*" />
<DetectChar attribute="Symbol" context="Member" char="." />
<DetectChar attribute="Symbol" context="InFunctionCall" char="("/> <DetectChar attribute="Symbol" context="InFunctionCall" char="("/>
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;+,-/*&lt;=&gt;?[]|~^&#59;"/>
<!-- Comment next line if you don't use Javadoc tool -->
<IncludeRules context="##Javadoc"/>
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
<AnyChar attribute="Symbol" context="#stay" String="[]&amp;|+,-/*&lt;=&gt;;!%?:~^"/>
<AnyChar context="Number" String="0123456789" lookAhead="1"/>
<DetectChar attribute="String" context="String" char="&quot;"/>
<DetectChar context="Char" char="'" lookAhead="1"/>
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<keyword attribute="Control Flow" context="#stay" String="control flow"/>
<keyword attribute="Data Type" context="#stay" String="types"/>
<keyword attribute="Java15" context="#stay" String="java15"/>
<WordDetect attribute="Keyword" context="Imports" String="package" />
<WordDetect attribute="Keyword" context="ImportsOrStaticImports" String="import" />
<RegExpr attribute="Function" context="#stay" String="\b[_a-zA-Z]\w*(?=[\s]*(/\*\s*\d+\s*\*/\s*)?[(])" />
<DetectIdentifier attribute="Normal Text"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Number">
<IncludeRules context="FindFloat"/>
<RegExpr attribute="Hex" context="#pop" String="\b0[xX]&hex;[lL]?\b"/>
<RegExpr attribute="Binary" context="#pop" String="\b0[bB][01]++(_++[01]++)*+[lL]?\b"/>
<RegExpr attribute="Octal" context="#pop" String="\b0_*+[0-7]++(_++[0-7_]++)*+[lL]?\b"/>
<RegExpr attribute="Decimal" context="#pop" String="\b(0|[1-9][0-9]*+(_++[0-9_]++)*+)[lL]?\b"/>
<AnyChar attribute="Error" context="#pop" String="0123456789"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="FindFloat">
<RegExpr attribute="Float" context="#pop" String="&float;|&hexfloat;"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Char">
<HlCChar attribute="Char" context="#pop"/>
<RegExpr attribute="Char" context="#pop" String="'\\u+[0-9a-fA-F]{4}'"/>
<RegExpr attribute="Error" context="#pop" String="'(\\(u+[0-9a-fA-F]*|.))?'?"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="InFunctionCall"> <context attribute="Normal Text" lineEndContext="#stay" name="InFunctionCall">
<IncludeRules context="Normal"/> <IncludeRules context="Normal"/>
<DetectChar attribute="Symbol" context="#pop" char=")"/> <DetectChar attribute="Symbol" context="#pop" char=")"/>
</context> </context>
<context attribute="String" lineEndContext="#pop" name="String"> <context attribute="String" lineEndContext="#pop" name="String">
<LineContinue attribute="String" context="#stay"/> <DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<RegExpr attribute="String Char" context="#stay" String="\\u[0-9a-fA-F]{4}"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/> <DetectChar attribute="String" context="#pop" char="&quot;"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="EnterPrintf" fallthrough="true" fallthroughContext="#pop"> <context attribute="String" lineEndContext="#pop" name="StringEscapedChar">
<DetectChar attribute="Symbol" context="Printf" char="("/> <HlCStringChar attribute="String Char" context="#pop"/>
<RegExpr attribute="String Char" context="#pop" String="\\u+[0-9a-fA-F]{4}"/>
<RegExpr attribute="Error" context="#pop" String="\\(u+[0-9a-fA-F]*|.)?"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Printf" fallthroughContext="#pop">
<DetectChar attribute="Symbol" context="#pop!InPrintf" char="("/>
<DetectSpaces attribute="Normal Text" context="#stay"/> <DetectSpaces attribute="Normal Text" context="#stay"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="Printf"> <context attribute="Normal Text" lineEndContext="#stay" name="InPrintf">
<DetectChar attribute="String" context="PrintfString" char="&quot;"/> <DetectChar attribute="String" context="PrintfString" char="&quot;"/>
<IncludeRules context="InFunctionCall"/> <IncludeRules context="InFunctionCall"/>
</context> </context>
<context attribute="PrintfString" lineEndContext="#pop" name="PrintfString"> <context attribute="PrintfString" lineEndContext="#pop" name="PrintfString">
<LineContinue attribute="String" context="#stay"/> <IncludeRules context="String"/>
<HlCStringChar attribute="String Char" context="#stay"/> <RegExpr attribute="String Char" context="#stay" String="%((\d+\$)?[-#+ 0,(]*\d*((\.\d+)?[a-hosxA-CEGHSX]|[tT][aAbBcCdDeFhHIjklLmMNpPQrRsSTyYzZ])|[%n])" />
<DetectChar attribute="String" context="#pop" char="&quot;"/>
<RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(\.\d+)?[a-hosxA-CEGHSX]" />
<RegExpr attribute="String Char" context="#stay" String="%(\d+\$)?(-|#|\+|\ |0|,|\()*\d*(t|T)(a|A|b|B|c|C|d|D|e|F|h|H|I|j|k|l|L|m|M|N|p|P|Q|r|R|s|S|T|y|Y|z|Z)" />
<RegExpr attribute="String Char" context="#stay" String="%(%|n)" />
</context> </context>
<context attribute="Normal Text" lineEndContext="#pop" name="Member" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Function" context="#pop" String="\b[_a-zA-Z]\w*(?=[\s]*)" /> <context attribute="Normal Text" lineEndContext="#stay" name="Dot">
<StringDetect attribute="Keyword" context="#pop" String="..." />
<IncludeRules context="FindFloat"/>
<DetectChar attribute="Symbol" context="#pop!Member" char="." />
</context> </context>
<context attribute="Normal Text" lineEndContext="#pop" name="StaticImports"> <context attribute="Normal Text" lineEndContext="#stay" name="Member" fallthroughContext="#pop">
<RegExpr attribute="StaticImports" context="#pop" String="\s*.*;" /> <DetectSpaces attribute="Normal Text" context="#stay"/>
<WordDetect attribute="Function" context="#pop!Printf" String="printf"/>
<WordDetect attribute="Function" context="#pop!Printf" String="format"/>
<DetectIdentifier attribute="Function" context="#pop"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#pop" name="Imports">
<RegExpr attribute="Imports" context="#pop" String="\s*.*;" /> <context attribute="Normal Text" lineEndContext="#pop" name="Annotation" fallthroughContext="#pop">
<DetectIdentifier attribute="Annotation" context="#pop"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#pop" name="ImportsOrStaticImports" fallthroughContext="#pop!Imports">
<DetectSpaces attribute="Normal Text"/>
<WordDetect attribute="Keyword" context="#pop!StaticImports" String="static"/>
</context>
<context attribute="StaticImports" lineEndContext="#pop" name="StaticImports">
<IncludeRules context="Imports"/>
</context>
<context attribute="Imports" lineEndContext="#pop" name="Imports">
<AnyChar attribute="Symbol" context="#stay" String=".*"/>
<DetectChar attribute="Symbol" context="#pop" char=";"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
</contexts> </contexts>
<itemDatas> <itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Control Flow" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Annotation" defStyleNum="dsAttribute" spellChecking="false"/> <itemData name="Annotation" defStyleNum="dsAttribute" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/> <itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="StaticImports" defStyleNum="dsImport" spellChecking="false"/> <itemData name="StaticImports" defStyleNum="dsImport" spellChecking="false"/>
@@ -3855,8 +3900,9 @@
<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/> <itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="PrintfString" defStyleNum="dsString"/> <itemData name="PrintfString" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/> <itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/> <itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Java15" defStyleNum="dsBuiltIn" spellChecking="false"/> <itemData name="Java15" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas> </itemDatas>
</highlighting> </highlighting>
<general> <general>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language name="Javadoc" version="3" kateversion="5.0" section="Markup" extensions="" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)"> <language name="Javadoc" version="6" kateversion="5.62" section="Markup" extensions="" license="LGPL" author="Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)">
<highlighting> <highlighting>
<contexts> <contexts>
<context name="Start" attribute="Normal Text" lineEndContext="#stay"> <context name="Start" attribute="Normal Text" lineEndContext="#stay">
@@ -12,74 +12,52 @@
</context> </context>
<context attribute="JavadocFS" lineEndContext="#stay" name="JavadocFSar"> <context attribute="JavadocFS" lineEndContext="#stay" name="JavadocFSar">
<Detect2Chars attribute="JavadocFS" context="#pop" char="*" char1="/" endRegion="Javadoc"/> <Detect2Chars attribute="JavadocFS" context="#pop" char="*" char1="/" endRegion="Javadoc"/>
<RegExpr attribute="JavadocFS" context="Javadocar" String="(!|\?)" /> <RegExpr attribute="JavadocFS" context="Javadocar" String="[!?.](\s*$|\s(?![\da-z]))|^\s*\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))"/>
<RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s*$)" /> <IncludeRules context="FindInlineTag"/>
<RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s)(?![\da-z])" /> <IncludeRules context="##Comments"/>
<RegExpr attribute="JavadocFS" context="Javadocar" String="\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))" firstNonSpace="true"/>
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
<StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
<StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
<StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
<IncludeRules context="##Alerts"/>
<IncludeRules context="##HTML"/> <IncludeRules context="##HTML"/>
</context> </context>
<context attribute="Javadoc" lineEndContext="#stay" name="FindInlineTag">
<WordDetect attribute="InlineTag" context="LiteralTagar" String="{@code"/>
<StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}"/>
<StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}"/>
<WordDetect attribute="InlineTag" context="InlineTagar" String="{@link"/>
<WordDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain"/>
<WordDetect attribute="InlineTag" context="LiteralTagar" String="{@literal"/>
<StringDetect attribute="InlineTag" context="#stay" String="{@value}"/>
<WordDetect attribute="InlineTag" context="InlineTagar" String="{@value"/>
<WordDetect attribute="InlineTag" context="LiteralTagar" String="{@summary"/>
<WordDetect attribute="InlineTag" context="LiteralTagar" String="{@systemProperty"/>
</context>
<context attribute="Javadoc" lineEndContext="#stay" name="Javadocar"> <context attribute="Javadoc" lineEndContext="#stay" name="Javadocar">
<Detect2Chars attribute="JavadocFS" context="#pop#pop" char="*" char1="/" endRegion="Javadoc"/> <Detect2Chars attribute="JavadocFS" context="#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
<RegExpr attribute="JavadocFS" context="#stay" String="\*+(?!/)" firstNonSpace="true"/> <DetectChar attribute="JavadocFS" context="JavadocFSStarPrefix" char="*" firstNonSpace="true"/>
<StringDetect attribute="BlockTag" context="#stay" String="@author " /> <WordDetect attribute="BlockTag" context="#stay" String="@author"/>
<StringDetect attribute="BlockTag" context="#stay" String="@deprecated " /> <WordDetect attribute="BlockTag" context="#stay" String="@deprecated"/>
<StringDetect attribute="BlockTag" context="JavadocParam" String="@exception " /> <WordDetect attribute="BlockTag" context="JavadocParam" String="@exception"/>
<StringDetect attribute="BlockTag" context="JavadocParam" String="@param " /> <WordDetect attribute="BlockTag" context="JavadocParam" String="@param"/>
<StringDetect attribute="BlockTag" context="#stay" String="@return " /> <WordDetect attribute="BlockTag" context="#stay" String="@return"/>
<StringDetect attribute="BlockTag" context="SeeTag" String="@see "/> <WordDetect attribute="BlockTag" context="SeeTag" String="@see"/>
<StringDetect attribute="BlockTag" context="#stay" String="@serial " /> <WordDetect attribute="BlockTag" context="#stay" String="@serial"/>
<StringDetect attribute="BlockTag" context="#stay" String="@serialData " /> <WordDetect attribute="BlockTag" context="#stay" String="@serialData"/>
<StringDetect attribute="BlockTag" context="#stay" String="@serialField " /> <WordDetect attribute="BlockTag" context="#stay" String="@serialField"/>
<StringDetect attribute="BlockTag" context="#stay" String="@since " /> <WordDetect attribute="BlockTag" context="#stay" String="@since"/>
<StringDetect attribute="BlockTag" context="JavadocParam" String="@throws " /> <WordDetect attribute="BlockTag" context="JavadocParam" String="@throws"/>
<StringDetect attribute="BlockTag" context="#stay" String="@version " /> <WordDetect attribute="BlockTag" context="#stay" String="@version"/>
<StringDetect attribute="BlockTag" context="#stay" String="@author&#009;" /> <IncludeRules context="FindInlineTag"/>
<StringDetect attribute="BlockTag" context="#stay" String="@deprecated&#009;" />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@exception&#009;" />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@param&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@return&#009;" />
<StringDetect attribute="BlockTag" context="SeeTag" String="@see&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@serial&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@serialData&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@serialField&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@since&#009;" />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@throws&#009;" />
<StringDetect attribute="BlockTag" context="#stay" String="@version&#009;" />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code " />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@code&#009;" />
<StringDetect attribute="InlineTag" context="#stay" String="{@docRoot}" />
<StringDetect attribute="InlineTag" context="#stay" String="{@inheritDoc}" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@link " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@link&#009;" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@linkplain&#009;" />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal " />
<StringDetect attribute="InlineTag" context="LiteralTagar" String="{@literal&#009;" />
<StringDetect attribute="InlineTag" context="#stay" String="{@value}" />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@value " />
<StringDetect attribute="InlineTag" context="InlineTagar" String="{@value&#009;" />
<IncludeRules context="##Alerts"/> <IncludeRules context="##Alerts"/>
<IncludeRules context="##HTML"/> <IncludeRules context="##HTML"/>
</context> </context>
<context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam"> <context attribute="Javadoc" lineEndContext="#pop" name="JavadocFSStarPrefix" fallthroughContext="#pop">
<DetectSpaces /> <Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
<RegExpr attribute="JavadocParam" context="#pop#pop" String="\S*(?=\*/)" /> <DetectChar attribute="JavadocFS" context="#stay" char="*"/>
<RegExpr attribute="JavadocParam" context="#pop" String="\S*(\s|$)" /> </context>
<IncludeRules context="##Alerts"/> <context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam" fallthroughContext="JavadocParamIdent">
<DetectSpaces context="JavadocParamIdent"/>
</context>
<context attribute="JavadocParam" lineEndContext="#pop#pop" name="JavadocParamIdent">
<DetectSpaces attribute="Javadoc" context="#pop#pop"/>
<Detect2Chars attribute="JavadocFS" context="#pop#pop#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
</context> </context>
<context attribute="InlineTag" name="InlineTagar" lineEndContext="#stay"> <context attribute="InlineTag" name="InlineTagar" lineEndContext="#stay">
<DetectChar attribute="InlineTag" context="#pop" char="}" /> <DetectChar attribute="InlineTag" context="#pop" char="}" />

View File

@@ -12,7 +12,7 @@
** http://tools.ietf.org/html/rfc4627 ** http://tools.ietf.org/html/rfc4627
*************************************************************************** ***************************************************************************
--> -->
<language name="JSON" section="Markup" version="5" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.geojson;*.gltf;*.theme" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL"> <language name="JSON" section="Markup" version="6" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.geojson;*.gltf;*.theme" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<highlighting> <highlighting>
<list name="Constants"> <list name="Constants">
<item>null</item> <item>null</item>
@@ -46,8 +46,7 @@
<DetectChar char="&quot;" context="String_Value" attribute="Style_String_Value" /> <DetectChar char="&quot;" context="String_Value" attribute="Style_String_Value" />
<DetectChar char="{" context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" /> <DetectChar char="{" context="Pair" beginRegion="Region_Object" attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" attribute="Style_Seperator_Array" /> <DetectChar char="[" context="Array" beginRegion="Region_Array" attribute="Style_Seperator_Array" />
<DetectChar char="}" context="#pop" lookAhead="true" /> <AnyChar String="}," context="#pop" lookAhead="true" />
<DetectChar char="," context="#pop" lookAhead="true" />
<DetectSpaces context="#stay" attribute="Style_Normal" /> <DetectSpaces context="#stay" attribute="Style_Normal" />

View File

@@ -12,7 +12,7 @@
<!-- v10 by Peter J. Mello <admin@petermello.net> <!-- v10 by Peter J. Mello <admin@petermello.net>
Add recognition of POSIX 2013 '::=' operator for variable assignment --> Add recognition of POSIX 2013 '::=' operator for variable assignment -->
<language name="Makefile" section="Other" <language name="Makefile" section="Other"
version="10" kateversion="3.4" version="13" kateversion="5.0"
extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk" extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk"
mimetype="text/x-makefile" priority="11" mimetype="text/x-makefile" priority="11"
author="Per Wigren (wigren@home.se)" license=""> author="Per Wigren (wigren@home.se)" license="">
@@ -384,6 +384,8 @@
TODO :[range] TODO :[range]
--> -->
<!-- Modifiers without arguments:--> <!-- Modifiers without arguments:-->
<!-- :Ox Randomize words in variable. -->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="O" char1="x"/>
<!-- <!--
:E Replaces each word in the variable with its suffix. :E Replaces each word in the variable with its suffix.
:H Replaces each word in the variable with everything but the last component. :H Replaces each word in the variable with everything but the last component.
@@ -398,8 +400,6 @@
<AnyChar attribute="Builtin" context="#pop!expect}" String="EHOQRTuLP"/> <AnyChar attribute="Builtin" context="#pop!expect}" String="EHOQRTuLP"/>
<!-- :sh If the variable is non-empty it is run as a command and the output becomes the new value. --> <!-- :sh If the variable is non-empty it is run as a command and the output becomes the new value. -->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="s" char1="h"/> <Detect2Chars attribute="Builtin" context="#pop!expect}" char="s" char1="h"/>
<!-- :Ox Randomize words in variable. -->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="O" char1="x"/>
<!-- :tA Attempt to convert variable to an absolute path using realpath(3),--> <!-- :tA Attempt to convert variable to an absolute path using realpath(3),-->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="A"/> <Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="A"/>
<!-- :tl Converts variable to lower-case letters.--> <!-- :tl Converts variable to lower-case letters.-->
@@ -417,12 +417,11 @@
:Dnewval If the variable is defined newval is the value. :Dnewval If the variable is defined newval is the value.
:Unewval If the variable is undefined newval is the value. :Unewval If the variable is undefined newval is the value.
--> -->
<AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="MNDU"/>
<!-- TODO: add new context to highligh old_string and new_string differently <!-- TODO: add new context to highligh old_string and new_string differently
:S/old_string/new_string/[1gW] :S/old_string/new_string/[1gW]
:C/pattern/replacement/[1gW] :C/pattern/replacement/[1gW]
--> -->
<AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="SC"/> <AnyChar attribute="Builtin" context="#pop!bmake_var_modifier_arg" String="MNDUSC"/>
<!-- ::=str The variable is assigned the value str after substitution. --> <!-- ::=str The variable is assigned the value str after substitution. -->
<Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char=":" char1="="/> <Detect2Chars attribute="Builtin" context="#pop!bmake_var_modifier_arg" char=":" char1="="/>
<!-- ::?=str As for ::= but only if the variable does not already have a value. --> <!-- ::?=str As for ::= but only if the variable does not already have a value. -->
@@ -477,8 +476,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment"> <context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#stay" /> <LineContinue attribute="Comment" context="#stay" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
</contexts> </contexts>

View File

@@ -90,14 +90,14 @@
<!ENTITY checkbox "\[[ x]\](?=\s)"> <!ENTITY checkbox "\[[ x]\](?=\s)">
]> ]>
<language name="Markdown" version="13" kateversion="5.53" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD"> <language name="Markdown" version="17" kateversion="5.79" section="Markup" extensions="*.md;*.mmd;*.markdown" priority="15" author="Darrin Yeager, Claes Holmerson" license="GPL,BSD">
<highlighting> <highlighting>
<contexts> <contexts>
<!-- Start of the Markdown document: find metadata or code block --> <!-- Start of the Markdown document: find metadata or code block -->
<context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthrough="true" fallthroughContext="Normal Text"> <context name="Start Document" attribute="Normal Text" lineEndContext="Normal Text" lineEmptyContext="Normal Text" fallthroughContext="Normal Text">
<!-- Some titles: (Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt) --> <!-- Some titles: (Title|Author|Date|Copyright|Revision|CSS|LaTeX\ XSLT|Categories|Tags|BaseName|Excerpt) -->
<!-- Metadata: Markdown format --> <!-- Metadata: Markdown format -->
<RegExpr attribute="Metadata" context="metadata" String="\-{3}&end;" column="0" beginRegion="metadata"/> <RegExpr attribute="Metadata" context="metadata" String="^\-{3}&end;" column="0" beginRegion="metadata"/>
<!-- Metadata: MultiMarkdown format --> <!-- Metadata: MultiMarkdown format -->
<RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/> <RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<!-- Code Block --> <!-- Code Block -->
@@ -109,12 +109,12 @@
<RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/> <RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/>
</context> </context>
<context name="metadata-mm-value" attribute="Metadata" lineEndContext="#pop!metadata-mm"/> <context name="metadata-mm-value" attribute="Metadata" lineEndContext="#pop!metadata-mm"/>
<context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthrough="true" fallthroughContext="#pop!Normal Text"> <context name="metadata-mm" attribute="Metadata" lineEndContext="#stay" lineEmptyContext="#pop!Normal Text" fallthroughContext="#pop!Normal Text">
<!-- Find Metadata key or value --> <!-- Find Metadata key or value -->
<RegExpr attribute="Metadata Title" context="#pop!metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/> <RegExpr attribute="Metadata Title" context="#pop!metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<RegExpr attribute="Metadata" context="#pop!metadata-mm-value" String="^(?:\s{4}|\t)" column="0"/> <RegExpr attribute="Metadata" context="#pop!metadata-mm-value" String="^(?:\s{4}|\t)" column="0"/>
</context> </context>
<context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop!Normal Text"> <context name="find-code-block-start" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop!Normal Text">
<IncludeRules context="find-code-block"/> <IncludeRules context="find-code-block"/>
</context> </context>
@@ -130,9 +130,9 @@
NOTE: The indentation of the lists is captured. --> NOTE: The indentation of the lists is captured. -->
<RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/> <RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/>
<DetectChar attribute="Blockquote" context="blockquote" char="&gt;" firstNonSpace="true"/> <DetectChar attribute="Blockquote" context="blockquote" char="&gt;" firstNonSpace="true"/>
<RegExpr attribute="List" context="list" String="(\s*)&listbullet;(\s+)" column="0"/> <RegExpr attribute="List" context="list" String="^(\s*)&listbullet;(\s+)" column="0"/>
<RegExpr attribute="Number List" context="numlist" String="(\s*)\d\.(\s+)" column="0"/> <RegExpr attribute="Number List" context="numlist" String="^(\s*)\d\.(\s+)" column="0"/>
<RegExpr attribute="Number List" context="numlist2" String="(\s*)\d\d+\.(\s+)" column="0"/> <RegExpr attribute="Number List" context="numlist2" String="^(\s*)\d\d+\.(\s+)" column="0"/>
<!-- Find Strong, Emphasis and Strikethrough Text --> <!-- Find Strong, Emphasis and Strikethrough Text -->
<DetectChar context="find-strong-normal" char="*" lookAhead="true"/> <DetectChar context="find-strong-normal" char="*" lookAhead="true"/>
<DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/> <DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/>
@@ -142,33 +142,30 @@
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/> <RegExpr attribute="Normal Text: Link" String="&implicitlink;"/>
</context> </context>
<!-- Find indented code blocks. These are only allowed after an empty line or on the first line --> <!-- Find indented code blocks. These are only allowed after an empty line or on the first line -->
<context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthrough="true" fallthroughContext="#pop"> <context name="find-code-block" attribute="Normal Text" lineEndContext="#stay" lineEmptyContext="#stay" fallthroughContext="#pop">
<RegExpr attribute="Code" String="^&indentedcodeblock;" column="0"/> <RegExpr attribute="Code" String="^&indentedcodeblock;" column="0"/>
<RegExpr attribute="Normal Text" String="&end;" /> <RegExpr attribute="Normal Text" String="&end;" />
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;" column="0" beginRegion="comment"/> <RegExpr attribute="Comment" context="comment" String="^\s*&startcomment;|\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
</context> </context>
<context name="find-header" attribute="Normal Text" lineEndContext="#pop"> <context name="find-header" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$"/> <RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$"/> <RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$"/> <RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$"/> <RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$"/> <RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$"/> <RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$" column="0"/>
<DetectChar attribute="Normal Text" context="#pop" char="#"/> <DetectChar attribute="Normal Text" context="#pop" char="#"/>
</context> </context>
<context name="find-strong-normal" attribute="Normal Text" lineEndContext="#pop"> <context name="find-strong-normal" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/> <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/> <RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/> <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/> <RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/>
<DetectChar attribute="Normal Text" context="#pop" char="*"/> <DetectChar attribute="Normal Text" context="#pop" char="*"/>
</context> </context>
<context name="find-emphasis-normal" attribute="Normal Text" lineEndContext="#pop"> <context name="find-emphasis-normal" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/> <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;|&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/> <RegExpr attribute="Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/> <RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/> <RegExpr attribute="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
@@ -195,7 +192,7 @@
<context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay"> <context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<DetectChar attribute="Blockquote" char="&gt;" firstNonSpace="true"/> <DetectChar attribute="Blockquote" char="&gt;" firstNonSpace="true"/>
<!-- End with header, horizontal rule or list/numlist --> <!-- End with header, horizontal rule or list/numlist -->
<RegExpr context="#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/> <RegExpr context="#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s|&rulerregex;)" column="0" lookAhead="true"/>
</context> </context>
<context name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay"> <context name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<!-- Strong, emphasis, strong-emphasis and strikethrough text --> <!-- Strong, emphasis, strong-emphasis and strikethrough text -->
@@ -206,16 +203,10 @@
<RegExpr attribute="Blockquote: Link" String="&implicitlink;"/> <RegExpr attribute="Blockquote: Link" String="&implicitlink;"/>
</context> </context>
<context name="find-strong-emphasis-blockquote" attribute="Blockquote: Normal Text" lineEndContext="#pop"> <context name="find-strong-emphasis-blockquote" attribute="Blockquote: Normal Text" lineEndContext="#pop">
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/> <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/> <RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/> <RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/> <RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="Blockquote: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
<AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/> <AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/>
</context> </context>
@@ -223,40 +214,40 @@
<!-- NOTE: The indentation of the lists is captured. New paragraphs, code blocks, blockquotes or <!-- NOTE: The indentation of the lists is captured. New paragraphs, code blocks, blockquotes or
horizontal rules must have an indentation equal to or greater than the list, to be part of it. --> horizontal rules must have an indentation equal to or greater than the list, to be part of it. -->
<!-- * list --> <!-- * list -->
<context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list"> <context name="list" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules --> <!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s&indentedcodeblock;" column="0" dynamic="true"/> <RegExpr attribute="Code" String="^%1%2\s&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s+&gt;" column="0" dynamic="true"/> <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s+&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s+&rulerregex;" column="0" dynamic="true"/> <RegExpr attribute="Horizontal Rule" String="^%1%2\s+&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/> <RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured corresponds to the item list --> <!-- Text with the same indentation captured corresponds to the item list -->
<RegExpr context="content-list" String="%1%2\s" column="0" lookAhead="true" dynamic="true"/> <RegExpr context="content-list" String="^%1%2\s" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list --> <!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> <RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
<!-- Highlight checkbox at the start of the item (task list) --> <!-- Highlight checkbox at the start of the item (task list) -->
<RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/> <RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/>
</context> </context>
<!-- 1. numlist (one digit) --> <!-- 1. numlist (one digit) -->
<context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list"> <context name="numlist" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules --> <!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/> <RegExpr attribute="Code" String="^%1%2\s{2}&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{2,}&gt;" column="0" dynamic="true"/> <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{2,}&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/> <RegExpr attribute="Horizontal Rule" String="^%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/> <RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured --> <!-- Text with the same indentation captured -->
<RegExpr context="content-list" String="%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/> <RegExpr context="content-list" String="^%1%2\s{2}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list --> <!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> <RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context> </context>
<!-- 10. numlist (two or more digits) --> <!-- 10. numlist (two or more digits) -->
<context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="content-list"> <context name="numlist2" attribute="List: Normal Text" lineEndContext="#stay" fallthroughContext="content-list">
<!-- Find indented code blocks, blockquotes and horizontal rules --> <!-- Find indented code blocks, blockquotes and horizontal rules -->
<RegExpr attribute="Code" String="%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/> <RegExpr attribute="Code" String="^%1%2\s{3}&indentedcodeblock;" column="0" dynamic="true"/>
<RegExpr attribute="Blockquote" context="blockquote-list" String="%1%2\s{3,}&gt;" column="0" dynamic="true"/> <RegExpr attribute="Blockquote" context="blockquote-list" String="^%1%2\s{3,}&gt;" column="0" dynamic="true"/>
<RegExpr attribute="Horizontal Rule" String="%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/> <RegExpr attribute="Horizontal Rule" String="^%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/> <RegExpr String="&emptyline;" column="0"/>
<!-- Text with the same indentation captured --> <!-- Text with the same indentation captured -->
<RegExpr context="content-list" String="%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/> <RegExpr context="content-list" String="^%1%2\s{3}" column="0" lookAhead="true" dynamic="true"/>
<!-- Finish when the text has a lower indentation than the list --> <!-- Finish when the text has a lower indentation than the list -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> <RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context> </context>
@@ -268,7 +259,7 @@
<!-- Blockquote and horzontal rule (check indentation) --> <!-- Blockquote and horzontal rule (check indentation) -->
<RegExpr context="#pop" String="^\s*(?:&gt;|&rulerregex;)" column="0" lookAhead="true"/> <RegExpr context="#pop" String="^\s*(?:&gt;|&rulerregex;)" column="0" lookAhead="true"/>
<!-- End with header or new list/numlist --> <!-- End with header or new list/numlist -->
<RegExpr context="#pop#pop" String="(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/> <RegExpr context="#pop#pop" String="^(?:\s*(?:&listbullet;|[\d]+\.)\s|#{1,6}\s)" column="0" lookAhead="true"/>
<!-- Strong, emphasis, strong-emphasis and strikethrough text --> <!-- Strong, emphasis, strong-emphasis and strikethrough text -->
<AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/> <AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/>
<RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/> <RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
@@ -277,24 +268,17 @@
<RegExpr attribute="List: Link" String="&implicitlink;"/> <RegExpr attribute="List: Link" String="&implicitlink;"/>
</context> </context>
<context name="find-strong-emphasis-list" attribute="List: Normal Text" lineEndContext="#pop"> <context name="find-strong-emphasis-list" attribute="List: Normal Text" lineEndContext="#pop">
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;"/> <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_und_ast;|&strongemphasisregex_ast_und2;|&strongemphasisregex_und_ast2;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;"/> <RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und2;"/> <RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast2;"/> <RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_ast;"/>
<RegExpr attribute="List: Strong Text" context="#pop" minimal="true" String="&strongregex_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und;"/>
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;" />
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
<AnyChar attribute="List: Normal Text" context="#pop" String="*_"/> <AnyChar attribute="List: Normal Text" context="#pop" String="*_"/>
</context> </context>
<!-- Comments --> <!-- Comments -->
<context name="comment" attribute="Comment" lineEndContext="#stay"> <context name="comment" attribute="Comment" lineEndContext="#stay">
<StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/> <StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/>
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
<!-- Fenced Code Blocks --> <!-- Fenced Code Blocks -->
@@ -337,7 +321,7 @@
<context name="code" attribute="Code" lineEndContext="#stay"> <!-- Unknown language --> <context name="code" attribute="Code" lineEndContext="#stay"> <!-- Unknown language -->
<RegExpr attribute="Fenced Code" context="#pop" String="%1[~`]*(?=&end;)" firstNonSpace="true" dynamic="true" endRegion="code-block"/> <RegExpr attribute="Fenced Code" context="#pop" String="%1[~`]*(?=&end;)" firstNonSpace="true" dynamic="true" endRegion="code-block"/>
</context> </context>
<context attribute="Normal Text" lineEndContext="#stay" name="bash-code"> <context attribute="Normal Text" lineEndContext="#stay" name="bash-code" fallthroughContext="Command##Bash">
<IncludeRules context="code"/> <IncludeRules context="code"/>
<IncludeRules context="##Bash" includeAttrib="true"/> <IncludeRules context="##Bash" includeAttrib="true"/>
</context> </context>
@@ -465,14 +449,9 @@
<!-- Common --> <!-- Common -->
<context name="inc" attribute="Normal Text" lineEndContext="#stay"> <context name="inc" attribute="Normal Text" lineEndContext="#stay">
<!-- Code --> <!-- Code -->
<RegExpr attribute="Code" String="`[^`]+`(?!`)"/> <RegExpr attribute="Code" String="`[^`]+`(?!`)|`{2}[^`](?:.*?[^`])?`{2}(?!`)|`{3}[^`](?:.*?[^`])?`{3}(?!`)|`{4}[^`](?:.*?[^`])?`{4}(?!`)|`{5,}[^`](?:.*?[^`])?`{5,}"/>
<RegExpr attribute="Code" minimal="true" String="`{2}[^`](?:.*[^`])?`{2}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{3}[^`](?:.*[^`])?`{3}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{4}[^`](?:.*[^`])?`{4}(?!`)"/>
<RegExpr attribute="Code" minimal="true" String="`{5,}[^`](?:.*[^`])?`{5,}"/>
<!-- Find Fenced Code Block --> <!-- Find Fenced Code Block -->
<RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/> <RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="`{3,}(?=[^`]*$)|~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
<RegExpr attribute="Fenced Code" context="find-lang-fenced-code" String="~{3,}(?=[^~]*$)" firstNonSpace="true" lookAhead="true" beginRegion="code-block"/>
<!-- Comment --> <!-- Comment -->
<StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/> <StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/>
<!-- Links and References --> <!-- Links and References -->
@@ -508,13 +487,13 @@
<RegExpr attribute="EntityRef" String="&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&htmlname;);"/> <RegExpr attribute="EntityRef" String="&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&htmlname;);"/>
<RegExpr context="find-html-block" String="&lt;/?&htmlname;(?:[\s&gt;]|/&gt;|$)" lookAhead="true"/> <RegExpr context="find-html-block" String="&lt;/?&htmlname;(?:[\s&gt;]|/&gt;|$)" lookAhead="true"/>
</context> </context>
<context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="find-html-block" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<IncludeRules context="FindSpecialHTMLTags##HTML"/> <IncludeRules context="FindSpecialHTMLTags##HTML"/>
<IncludeRules context="FindHTMLTags##HTML"/> <IncludeRules context="FindHTMLTags##HTML"/>
</context> </context>
<!-- Links and email: <https://example.com>, <example@kde.org> --> <!-- Links and email: <https://example.com>, <example@kde.org> -->
<context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="autolink" attribute="Auto-Link" lineEndContext="#pop" fallthroughContext="#pop">
<DetectChar attribute="Auto-Link" char="&lt;"/> <DetectChar attribute="Auto-Link" char="&lt;"/>
<DetectChar attribute="Auto-Link" context="#pop" char="&gt;"/> <DetectChar attribute="Auto-Link" context="#pop" char="&gt;"/>
<RegExpr attribute="Link" String="&startlink;[^&quot;&gt;\s]+"/> <RegExpr attribute="Link" String="&startlink;[^&quot;&gt;\s]+"/>
@@ -552,25 +531,23 @@
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\]\\])+"/> <RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\]\\])+"/>
</context> </context>
<!-- [an example][id] "title" --> <!-- [an example][id] "title" -->
<context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="reflink-title" attribute="Normal Text" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link" context="#pop" String="\s+&quot;(?:\\.|[^&quot;\\])*&quot;"/> <RegExpr attribute="Reference-Link" context="#pop" String="\s+&quot;(?:\\.|[^&quot;\\])*&quot;"/>
</context> </context>
<!-- Target Ref.: [foo]: http://example.com/ "Optional Title Here" --> <!-- Target Ref.: [foo]: http://example.com/ "Optional Title Here" -->
<context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="reflinktarget" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<RegExpr attribute="Reference-Link Target: Link" context="#pop!reflinktarget-title" String="\s*&link;(?=\s|$)"/> <RegExpr attribute="Reference-Link Target: Link" context="#pop!reflinktarget-title" String="\s*&link;(?=\s|$)"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-link" String="\s*&lt;(?=&link;&gt;(?:\s|$))"/> <RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-link" String="\s*&lt;(?=&link;&gt;(?:\s|$))"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/> <RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/>
</context> </context>
<context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="reflinktarget-link" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<DetectChar attribute="Reference-Link Target" context="#pop!reflinktarget-title" char="&gt;"/> <DetectChar attribute="Reference-Link Target" context="#pop!reflinktarget-title" char="&gt;"/>
<RegExpr attribute="Reference-Link Target: Link" String="&link;"/> <RegExpr attribute="Reference-Link Target: Link" String="&link;"/>
</context> </context>
<context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="reflinktarget-title" attribute="Reference-Link Target" lineEndContext="#pop" fallthroughContext="#pop">
<DetectSpaces attribute="Reference-Link Target"/> <DetectSpaces attribute="Reference-Link Target"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;"/> <RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;|&apos;(?:\\.|[^&apos;\\])*&apos;|\((?:\\.|[^\)\\])*\)"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&apos;(?:\\.|[^&apos;\\])*&apos;"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="\((?:\\.|[^\)\\])*\)"/>
</context> </context>
<!-- Image --> <!-- Image -->

View File

@@ -39,7 +39,7 @@
Enhance tr/// and y/// support. Enhance tr/// and y/// support.
--> -->
<language name="Perl" version="13" kateversion="5.0" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2"> <language name="Perl" version="17" kateversion="5.0" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
<highlighting> <highlighting>
<list name="keywords"> <list name="keywords">
<item>if</item> <item>if</item>
@@ -339,7 +339,7 @@
</list> </list>
<contexts> <contexts>
<context name="normal" attribute="Normal Text" lineEndContext="#stay"> <context name="normal" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Keyword" context="#stay" String="^#!\/.*" /> <RegExpr attribute="Keyword" context="#stay" String="^#!\/.*" column="0" />
<StringDetect attribute="Keyword" context="data_handle" String="__DATA__" firstNonSpace="true" /> <StringDetect attribute="Keyword" context="data_handle" String="__DATA__" firstNonSpace="true" />
<StringDetect attribute="Keyword" context="#stay" String="__END__" firstNonSpace="true"/> <StringDetect attribute="Keyword" context="#stay" String="__END__" firstNonSpace="true"/>
<RegExpr attribute="Keyword" context="sub_name_def" String="\bsub\s+" /> <RegExpr attribute="Keyword" context="sub_name_def" String="\bsub\s+" />
@@ -347,7 +347,7 @@
<keyword attribute="Operator" context="#stay" String="operators" /> <keyword attribute="Operator" context="#stay" String="operators" />
<keyword attribute="Function" context="#stay" String="functions" /> <keyword attribute="Function" context="#stay" String="functions" />
<keyword attribute="Pragma" context="#stay" String="pragmas" /> <keyword attribute="Pragma" context="#stay" String="pragmas" />
<RegExpr attribute="Pod" context="pod" String="\=\w+(\s|$)" column="0" beginRegion="POD"/> <RegExpr attribute="Pod" context="pod" String="^\=\w+(\s|$)" column="0" beginRegion="POD"/>
<DetectSpaces /> <DetectSpaces />
<DetectChar attribute="Comment" context="comment" char="#" /> <DetectChar attribute="Comment" context="comment" char="#" />
@@ -384,8 +384,7 @@
<RegExpr attribute="Operator" context="find_pattern" String="\b(?:m|qr)(?=\s*[^\w\s\]})])" /> <RegExpr attribute="Operator" context="find_pattern" String="\b(?:m|qr)(?=\s*[^\w\s\]})])" />
<RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*//?\=?" /> <RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*//?\=?|[&lt;&gt;&quot;':]//?\=?" />
<RegExpr attribute="Normal Text" context="#stay" String="[&lt;&gt;&quot;':]//?\=?" />
<!-- Avoid conflicts between operators / and // --> <!-- Avoid conflicts between operators / and // -->
<StringDetect attribute="Normal Text" context="#stay" String="//=" /> <StringDetect attribute="Normal Text" context="#stay" String="//=" />
<Detect2Chars attribute="Normal Text" context="#stay" char="/" char1="/" /> <Detect2Chars attribute="Normal Text" context="#stay" char="/" char1="/" />
@@ -428,15 +427,7 @@
<!-- ====== Contexts for strings ===== --> <!-- ====== Contexts for strings ===== -->
<context name="ipstring_internal" attribute="String (interpolated)" lineEndContext="#stay"> <context name="ipstring_internal" attribute="String (interpolated)" lineEndContext="#stay">
<DetectIdentifier /> <DetectIdentifier />
<RegExpr attribute="String Special Character" context="#stay" String="\\c[^\s\\]" /> <RegExpr attribute="String Special Character" context="#stay" String="\\c[^\s\\]|\\g(\{(\w+|\-\d+)\}|\d+)|\\k(\{\w+\}|&lt;\w+&gt;|'\w+')|\\N\{[^\{\}]*\}|\\o\{[0-7]+\}|\\[pP](\{\w+\}|P)|\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})|\\[0-7]{3}|\\[1aAbBdDeEfFGhHKlLnNQrRsStuUvVwWXzZ]" />
<RegExpr attribute="String Special Character" context="#stay" String="\\g(\{(\w+|\-\d+)\}|\d+)" />
<RegExpr attribute="String Special Character" context="#stay" String="\\k(\{\w+\}|&lt;\w+&gt;|'\w+')" />
<RegExpr attribute="String Special Character" context="#stay" String="\\N\{[^\{\}]*\}" />
<RegExpr attribute="String Special Character" context="#stay" String="\\o\{[0-7]+\}" />
<RegExpr attribute="String Special Character" context="#stay" String="\\[pP](\{\w+\}|P)" />
<RegExpr attribute="String Special Character" context="#stay" String="\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
<RegExpr attribute="String Special Character" context="#stay" String="\\[0-7]{3}" />
<RegExpr attribute="String Special Character" context="#stay" String="\\[1aAbBdDeEfFGhHKlLnNQrRsStuUvVwWXzZ]" />
<RegExpr attribute="String (interpolated)" context="#stay" String="\\." /> <RegExpr attribute="String (interpolated)" context="#stay" String="\\." />
<RegExpr attribute="Normal Text" context="find_variable_unsafe" String="(?:[\$@]\S|%([\w\{\-\+!]|\^H))" lookAhead="true" /> <RegExpr attribute="Normal Text" context="find_variable_unsafe" String="(?:[\$@]\S|%([\w\{\-\+!]|\^H))" lookAhead="true" />
</context> </context>
@@ -465,7 +456,7 @@
<IncludeRules context="ipstring_internal" /> <IncludeRules context="ipstring_internal" />
</context> </context>
<context name="ip_string_6" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true"> <context name="ip_string_6" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" /> <StringDetect attribute="String (interpolated)" context="#stay" String="\%1" dynamic="true" />
<DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="String"/> <DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="String"/>
<IncludeRules context="ipstring_internal" /> <IncludeRules context="ipstring_internal" />
</context> </context>
@@ -508,7 +499,7 @@
<context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true"> <context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true">
<DetectIdentifier /> <DetectIdentifier />
<Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" /> <Detect2Chars attribute="String Special Character" context="#stay" char="\" char1="\" />
<RegExpr attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/> <StringDetect attribute="String Special Character" context="#stay" String="\%1" dynamic="true"/>
<DetectChar attribute="Operator" context="#pop#pop" char="1" dynamic="true" endRegion="String" /> <DetectChar attribute="Operator" context="#pop#pop" char="1" dynamic="true" endRegion="String" />
</context> </context>
@@ -605,10 +596,7 @@
</context> </context>
<context name="tr" attribute="Pattern" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" > <context name="tr" attribute="Pattern" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<RegExpr attribute="Pattern" context="#pop" String="\([^)]*\)\s*\(?:[^)]*\)" /> <RegExpr attribute="Pattern" context="#pop" String="\([^)]*\)\s*\(?:[^)]*\)|\{[^}]*\}\s*\{[^}]*\}|\[[^]]*\]\s*\[[^\]]*\]|([^a-zA-Z0-9_\s[\]{}()]).*?\1.*?\1"/>
<RegExpr attribute="Pattern" context="#pop" String="\{[^}]*\}\s*\{[^}]*\}" />
<RegExpr attribute="Pattern" context="#pop" String="\[[^]]*\]\s*\[[^\]]*\]" />
<RegExpr attribute="Pattern" context="#pop" String="([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1" minimal="true"/>
</context> </context>
<!-- ====== PATTERNs ====== --> <!-- ====== PATTERNs ====== -->
@@ -629,7 +617,6 @@
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" /> <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />
<RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" /> <RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" />
<IncludeRules context="regex_pattern_internal_ip" /> <IncludeRules context="regex_pattern_internal_ip" />
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\%1)" dynamic="true" />
</context> </context>
<context name="pattern_brace" attribute="Pattern" lineEndContext="#stay"> <context name="pattern_brace" attribute="Pattern" lineEndContext="#stay">
<RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" /> <RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" />
@@ -663,13 +650,7 @@
<!-- rules internal stuff wrt regex patterns --> <!-- rules internal stuff wrt regex patterns -->
<context name="regex_pattern_internal_rules_1" attribute="Pattern" lineEndContext="#stay"> <context name="regex_pattern_internal_rules_1" attribute="Pattern" lineEndContext="#stay">
<DetectChar attribute="Comment" context="comment" char="#" firstNonSpace="true" /> <DetectChar attribute="Comment" context="comment" char="#" firstNonSpace="true" />
<RegExpr attribute="Special Variable" context="#stay" String="\\c[^\s\\]" /> <RegExpr attribute="Special Variable" context="#stay" String="\\c[^\s\\]|\\g(\{(\w+|\-\d+)\}|\d+)|\\k(\{\w+\}|&lt;\w+&gt;|'\w+')|\\N\{[^\{\}]*\}|\\o\{[0-7]+\}|\\[pP](\{\w+\}|P)|\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
<RegExpr attribute="Special Variable" context="#stay" String="\\g(\{(\w+|\-\d+)\}|\d+)" />
<RegExpr attribute="Special Variable" context="#stay" String="\\k(\{\w+\}|&lt;\w+&gt;|'\w+')" />
<RegExpr attribute="Special Variable" context="#stay" String="\\N\{[^\{\}]*\}" />
<RegExpr attribute="Special Variable" context="#stay" String="\\o\{[0-7]+\}" />
<RegExpr attribute="Special Variable" context="#stay" String="\\[pP](\{\w+\}|P)" />
<RegExpr attribute="Special Variable" context="#stay" String="\\x([0-9a-fA-F]{2}|\{[0-9a-fA-F]+\})" />
<RegExpr attribute="Pattern Character Class" context="#stay" String="\\[anDdSsWw]" /> <RegExpr attribute="Pattern Character Class" context="#stay" String="\\[anDdSsWw]" />
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[ABbEGLlNUuQdQZz]" /> <!-- Also?: efFhHKrRtvVX --> <RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[ABbEGLlNUuQdQZz]" /> <!-- Also?: efFhHKrRtvVX -->
<RegExpr attribute="Special Variable" context="#stay" String="\\[\d]+" /> <RegExpr attribute="Special Variable" context="#stay" String="\\[\d]+" />
@@ -713,17 +694,10 @@
<!-- ====== Variables ====== --> <!-- ====== Variables ====== -->
<context name="find_variable" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" > <context name="find_variable" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<RegExpr attribute="Data Type" context="var_detect" String="\$[#_][\w_]" /> <RegExpr attribute="Data Type" context="var_detect" String="\$[#_][\w_]" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$[0-9]+" /> <RegExpr attribute="Special Variable" context="var_detect" String="\$[0-9]+|[@\$](?:[\+\-_]\B|ARGV\b|INC\b)|[%\$](?:INC\b|ENV\b|SIG\b)|\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
<RegExpr attribute="Special Variable" context="var_detect" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" /> <RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="var_detect" String="[%\$](?:INC\b|ENV\b|SIG\b)" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]" />
<RegExpr attribute="Special Variable" context="var_detect" String="%([\-\+!]|\^H)" />
<RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]" />
<RegExpr attribute="Data Type" context="var_detect" String="\$+::" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$[^a-zA-Z0-9\s{][A-Z]?" /> <RegExpr attribute="Special Variable" context="var_detect" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
<RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}" /> <RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*[a-zA-Z_]+" />
<AnyChar attribute="Data Type" context="var_detect" String="$@%" />
<RegExpr attribute="Data Type" context="var_detect" String="\*[a-zA-Z_]+" />
<!-- Do not highlight brackets after *, Ex: (... @*) (see bug #391577) --> <!-- Do not highlight brackets after *, Ex: (... @*) (see bug #391577) -->
<RegExpr attribute="Special Variable" context="#stay" String="\*[^a-zA-Z0-9\s\{\(\)\[\]\}][A-Z]?" /> <RegExpr attribute="Special Variable" context="#stay" String="\*[^a-zA-Z0-9\s\{\(\)\[\]\}][A-Z]?" />
<!-- this should be a rare case! --> <!-- this should be a rare case! -->
@@ -732,17 +706,11 @@
<!-- This does not check fo a trailing slash, for usage in strings. --> <!-- This does not check fo a trailing slash, for usage in strings. -->
<context name="find_variable_unsafe" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" > <context name="find_variable_unsafe" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$[#_][\w_]" /> <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$[#_][\w_]" />
<RegExpr attribute="Special Variable" context="var_detect_unsafe" String="\$[0-9]+" /> <RegExpr attribute="Special Variable" context="var_detect_unsafe" String="\$[0-9]+|[@\$](?:[\+\-_]\B|ARGV\b|INC\b)|[%\$](?:INC\b|ENV\b|SIG\b)" />
<RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" /> <RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
<RegExpr attribute="Special Variable" context="var_detect_unsafe" String="[%\$](?:INC\b|ENV\b|SIG\b)" /> <RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$\^[A-Z_\]\[\^\?\\]" />
<RegExpr attribute="Special Variable" context="var_detect" String="%([\-\+!]|\^H)" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$+::" />
<RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" /> <RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}" /> <RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*\w+" />
<AnyChar attribute="Data Type" context="var_detect_unsafe" String="$@%" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\*\w+" />
<AnyChar attribute="Operator" context="#pop" String="$@%*" /> <AnyChar attribute="Operator" context="#pop" String="$@%*" />
</context> </context>
<context name="var_detect" attribute="Data Type" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop"> <context name="var_detect" attribute="Data Type" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
@@ -767,7 +735,7 @@
<context name="quote_word" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> <context name="quote_word" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
<DetectSpaces /> <DetectSpaces />
<DetectIdentifier /> <DetectIdentifier />
<RegExpr attribute="Normal Text" context="#stay" String="\\%1" dynamic="true" /> <StringDetect attribute="Normal Text" context="#stay" String="\%1" dynamic="true" />
<DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="Wordlist" /> <DetectChar attribute="Operator" context="#pop#pop#pop" char="1" dynamic="true" endRegion="Wordlist" />
</context> </context>
<context name="quote_word_paren" attribute="Normal Text" lineEndContext="#stay"> <context name="quote_word_paren" attribute="Normal Text" lineEndContext="#stay">
@@ -791,26 +759,24 @@
<!-- ====== Here Documents ====== --> <!-- ====== Here Documents ====== -->
<context name="find_here_document" attribute="Normal Text" lineEndContext="#pop" > <context name="find_here_document" attribute="Normal Text" lineEndContext="#pop" >
<RegExpr attribute="Keyword" context="here_document" String="(\w+)\s*;?" /> <RegExpr attribute="Keyword" context="here_document" String="(?|(\w+)\s*;?|\s*&quot;([^&quot;]+)&quot;\s*;?|\s*`([^`]+)`\s*;?)" />
<RegExpr attribute="Keyword" context="here_document" String="\s*&quot;([^&quot;]+)&quot;\s*;?" />
<RegExpr attribute="Keyword" context="here_document" String="\s*`([^`]+)`\s*;?" />
<RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" /> <RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" />
</context> </context>
<context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true"> <context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="Keyword" context="#pop#pop" String="%1\b" column="0" dynamic="true" endRegion="HereDocument"/> <RegExpr attribute="Keyword" context="#pop#pop" String="^%1\b" column="0" dynamic="true" endRegion="HereDocument"/>
<RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" /> <RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" />
<IncludeRules context="ipstring_internal" /> <IncludeRules context="ipstring_internal" />
<DetectSpaces /> <DetectSpaces />
</context> </context>
<context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> <context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/> <StringDetect attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
<DetectSpaces /> <DetectSpaces />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
<!-- ====== Misc ====== --> <!-- ====== Misc ====== -->
<context name="data_handle" attribute="Data" lineEndContext="#stay"> <context name="data_handle" attribute="Data" lineEndContext="#stay">
<RegExpr attribute="Pod" context="pod" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*" column="0" beginRegion="POD"/> <RegExpr attribute="Pod" context="pod" String="^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s+.*" column="0" beginRegion="POD"/>
<StringDetect attribute="Keyword" context="normal" String="__END__" firstNonSpace="true" /> <StringDetect attribute="Keyword" context="normal" String="__END__" firstNonSpace="true" />
</context> </context>
@@ -841,14 +807,13 @@
<context name="pod" attribute="Pod" lineEndContext="#stay"> <context name="pod" attribute="Pod" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<DetectIdentifier /> <DetectIdentifier />
<RegExpr attribute="Pod" context="#stay" String="\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*" column="0" beginRegion="POD" endRegion="POD"/> <RegExpr attribute="Pod" context="#stay" String="^\=(?:head[1-6]|over|back|item|for|begin|end|pod)\s*.*" column="0" beginRegion="POD" endRegion="POD"/>
<StringDetect attribute="Pod" context="Pod" String="=cut" column="0" endRegion="POD"/> <StringDetect attribute="Pod" context="Pod" String="=cut" column="0" endRegion="POD"/>
</context> </context>
<context name="comment" attribute="Comment" lineEndContext="#pop"> <context name="comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>

View File

@@ -1,9 +1,9 @@
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language <language
name="PowerShell" name="PowerShell"
version="7" version="11"
kateversion="5.0" kateversion="5.0"
extensions="*.ps1;*.ps1m;*.ps1d" extensions="*.ps1;*.psm1;*.psd1"
section="Scripts" section="Scripts"
author="Motoki Kashihara (motoki8791@gmail.com); Michael Lombardi (Michael.T.Lombardi@outlook.com)" author="Motoki Kashihara (motoki8791@gmail.com); Michael Lombardi (Michael.T.Lombardi@outlook.com)"
casesensitive="0" casesensitive="0"
@@ -884,16 +884,14 @@
<Detect2Chars attribute="Comment" context="Commentar 2" char="&lt;" char1="#" beginRegion="CommentRegion"/> <Detect2Chars attribute="Comment" context="Commentar 2" char="&lt;" char1="#" beginRegion="CommentRegion"/>
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="block1"/> <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="block1"/>
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="block1"/> <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="block1"/>
<RegExpr attribute="Keyword" context="#stay" String="\b\$global(?=\s+(:))"/> <RegExpr attribute="Keyword" context="#stay" String="\b\$(global|script)(?=\s+(:))"/>
<RegExpr attribute="Keyword" context="#stay" String="\b\$script(?=\s+(:))"/>
<RegExpr attribute="Variable" context="#stay" String="\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" /> <RegExpr attribute="Variable" context="#stay" String="\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" />
<keyword attribute="Special Variable" context="#stay" String="special-variables"/> <keyword attribute="Special Variable" context="#stay" String="special-variables"/>
<DetectChar attribute="Symbol" context="Member" char="." /> <DetectChar attribute="Symbol" context="Member" char="." />
<AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/*&lt;=&gt;?[]|~^&#59;"/> <AnyChar attribute="Symbol" context="#stay" String=":!%&amp;()+,-/*&lt;=&gt;?[]|~^&#59;"/>
</context> </context>
<context attribute="String Char" lineEndContext="#stay" name="StringEscape"> <context attribute="String Char" lineEndContext="#stay" name="StringEscape">
<RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]" context="#stay"/> <RegExpr attribute="String Char" String="`[`&quot;0abefnrtv]|`u\{[0-9A-Fa-f]+\}" context="#stay"/>
<RegExpr attribute="String Char" String="`u\{[0-9A-Fa-f]+\}" context="#stay"/>
</context> </context>
<context attribute="String" lineEndContext="#pop" name="String"> <context attribute="String" lineEndContext="#pop" name="String">
<IncludeRules context="StringEscape"/> <IncludeRules context="StringEscape"/>
@@ -908,14 +906,12 @@
</context> </context>
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> <context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> <context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="#" char1="&gt;" endRegion="CommentRegion"/> <Detect2Chars attribute="Comment" context="#pop" char="#" char1="&gt;" endRegion="CommentRegion"/>
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
<context attribute="Cmdlets" lineEndContext="#stay" name="Cmdlet"> <context attribute="Cmdlets" lineEndContext="#stay" name="Cmdlet">
<keyword attribute="Function" context="#stay" String="cmdlets"/> <keyword attribute="Function" context="#stay" String="cmdlets"/>
@@ -931,7 +927,7 @@
<itemData name="HereString" defStyleNum="dsVerbatimString"/> <itemData name="HereString" defStyleNum="dsVerbatimString"/>
<itemData name="Comment" defStyleNum="dsComment"/> <itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/> <itemData name="Cmdlets" defStyleNum="dsBuiltIn" spellChecking="false"/>
<itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/> <itemData name="Symbol" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/> <itemData name="Variable" defStyleNum="dsVariable" spellChecking="false"/>
<itemData name="Special Variable" defStyleNum="dsVariable" bold="1" spellChecking="false"/> <itemData name="Special Variable" defStyleNum="dsVariable" bold="1" spellChecking="false"/>
</itemDatas> </itemDatas>

View File

@@ -4,6 +4,35 @@
<!ENTITY digitPart "[0-9](?:_?[0-9])*"> <!ENTITY digitPart "[0-9](?:_?[0-9])*">
<!ENTITY beforeDigit "(?&lt;![\.\w[:^ascii:]])"> <!ENTITY beforeDigit "(?&lt;![\.\w[:^ascii:]])">
<!ENTITY beforePointFloat "(?&lt;![\w[:^ascii:]])"> <!ENTITY beforePointFloat "(?&lt;![\w[:^ascii:]])">
<!-- Python 2 style. Syntax:
1. start character '%'
2. [optional] Mapping key, e.g. '(foo)'
3. [optional] Conversion flags, one of '#0- +'
4. [optional] Minimum width, integer or '*'
5. [optional] Precision, '.' followed by integer or '*'
6. [optional] Length modifier, one of 'hlL'
7. conversion type, one of 'crsdiouxXeEfFgG%'
[Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
-->
<!ENTITY strsubstitution_py2 "&#37;(?:(?:\([a-zA-Z0-9_]+\))?[#0\- +]?(?:[1-9][0-9]*|\*)?(?:\.(?:[1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG&#37;]|prog|default)">
<!-- http://docs.python.org/2/library/string.html#format-string-syntax:
replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
arg_name ::= [identifier | integer]
attribute_name ::= identifier
element_index ::= integer | index_string
index_string ::= <any source character except "]"> +
conversion ::= "r" | "s"
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= integer
precision ::= integer
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
-->
<!ENTITY strsubstitution_py3 "\{(?:(?:[a-zA-Z0-9_]+|[0-9]+)(?:\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(?:![rs])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX&#37;]?)?\}">
]> ]>
<!-- Python syntax highlightning v0.9 by Per Wigren --> <!-- Python syntax highlightning v0.9 by Per Wigren -->
<!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) --> <!-- Python syntax highlighting v1.9 by Michael Bueker (improved keyword differentiation) -->
@@ -19,7 +48,7 @@
<!-- v2.07 add support for %prog and co, see bug 142832 --> <!-- v2.07 add support for %prog and co, see bug 142832 -->
<!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords --> <!-- v2.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
<!-- v2.29 recognize escape sequenzes correctly --> <!-- v2.29 recognize escape sequenzes correctly -->
<language name="Python" version="12" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license=""> <language name="Python" version="14" style="python" indenter="python" kateversion="5.0" section="Scripts" extensions="*.py;*.pyw;SConstruct;SConscript;*.FCMacro" mimetype="application/x-python;text/x-python;text/x-python3" casesensitive="1" author="Michael Bueker" license="">
<highlighting> <highlighting>
<list name="import"> <list name="import">
<item>import</item> <item>import</item>
@@ -355,8 +384,7 @@
<RegExpr attribute="Binary" String="&beforeDigit;0[bB](?:_?[01])+\b" context="#stay"/> <RegExpr attribute="Binary" String="&beforeDigit;0[bB](?:_?[01])+\b" context="#stay"/>
<RegExpr attribute="Octal" String="&beforeDigit;0[oO](?:_?[0-7])+\b" context="#stay"/> <RegExpr attribute="Octal" String="&beforeDigit;0[oO](?:_?[0-7])+\b" context="#stay"/>
<!-- Float: 1.1 ; 1. ; .1 ; 1e3 ; 1.1e3 ; 1.e3 ; .1e3 --> <!-- Float: 1.1 ; 1. ; .1 ; 1e3 ; 1.1e3 ; 1.e3 ; .1e3 -->
<RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b" context="#stay"/> <RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b|(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&digitPart;\b)" context="#stay"/>
<RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&digitPart;\b)" context="#stay"/>
<!-- Decimal: 123 ; 000 --> <!-- Decimal: 123 ; 000 -->
<RegExpr attribute="Int" String="&beforeDigit;(?:[1-9](?:_?\d)*|0(?:_?0)*)[lL]?\b" context="#stay"/> <RegExpr attribute="Int" String="&beforeDigit;(?:[1-9](?:_?\d)*|0(?:_?0)*)[lL]?\b" context="#stay"/>
@@ -393,20 +421,20 @@
<RegExpr attribute="String" String="u?'" insensitive="true" context="Single A-string"/> <RegExpr attribute="String" String="u?'" insensitive="true" context="Single A-string"/>
<RegExpr attribute="String" String="u?&quot;" insensitive="true" context="Single Q-string"/> <RegExpr attribute="String" String="u?&quot;" insensitive="true" context="Single Q-string"/>
<RegExpr attribute="Raw String" String="(u?r|ru)'''" insensitive="true" context="Raw Triple A-string" beginRegion="Triple A-region"/> <RegExpr attribute="Raw String" String="(?:u?r|ru)'''" insensitive="true" context="Raw Triple A-string" beginRegion="Triple A-region"/>
<RegExpr attribute="Raw String" String="(u?r|ru)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-string" beginRegion="Triple Q-region"/> <RegExpr attribute="Raw String" String="(?:u?r|ru)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-string" beginRegion="Triple Q-region"/>
<RegExpr attribute="Raw String" String="(u?r|ru)'" insensitive="true" context="Raw A-string"/> <RegExpr attribute="Raw String" String="(?:u?r|ru)'" insensitive="true" context="Raw A-string"/>
<RegExpr attribute="Raw String" String="(u?r|ru)&quot;" insensitive="true" context="Raw Q-string"/> <RegExpr attribute="Raw String" String="(?:u?r|ru)&quot;" insensitive="true" context="Raw Q-string"/>
<StringDetect attribute="F-String" String="f'''" insensitive="true" context="Triple A-F-String" beginRegion="Triple A-region"/> <StringDetect attribute="F-String" String="f'''" insensitive="true" context="Triple A-F-String" beginRegion="Triple A-region"/>
<StringDetect attribute="F-String" String="f&quot;&quot;&quot;" insensitive="true" context="Triple Q-F-String" beginRegion="Triple Q-region"/> <StringDetect attribute="F-String" String="f&quot;&quot;&quot;" insensitive="true" context="Triple Q-F-String" beginRegion="Triple Q-region"/>
<StringDetect attribute="F-String" String="f'" insensitive="true" context="Single A-F-String"/> <StringDetect attribute="F-String" String="f'" insensitive="true" context="Single A-F-String"/>
<StringDetect attribute="F-String" String="f&quot;" insensitive="true" context="Single Q-F-String"/> <StringDetect attribute="F-String" String="f&quot;" insensitive="true" context="Single Q-F-String"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)'''" insensitive="true" context="Raw Triple A-F-String" beginRegion="Triple A-region"/> <RegExpr attribute="Raw F-String" String="(?:fr|rf)'''" insensitive="true" context="Raw Triple A-F-String" beginRegion="Triple A-region"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-F-String" beginRegion="Triple Q-region"/> <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;&quot;&quot;" insensitive="true" context="Raw Triple Q-F-String" beginRegion="Triple Q-region"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)'" insensitive="true" context="Raw A-F-String"/> <RegExpr attribute="Raw F-String" String="(?:fr|rf)'" insensitive="true" context="Raw A-F-String"/>
<RegExpr attribute="Raw F-String" String="(fr|rf)&quot;" insensitive="true" context="Raw Q-F-String"/> <RegExpr attribute="Raw F-String" String="(?:fr|rf)&quot;" insensitive="true" context="Raw Q-F-String"/>
</context> </context>
<context name="CommentVariants" attribute="Normal Text" lineEndContext="#stay"> <context name="CommentVariants" attribute="Normal Text" lineEndContext="#stay">
@@ -417,10 +445,10 @@
<RegExpr attribute="Comment" String="u?'" insensitive="true" firstNonSpace="true" context="Single A-comment"/> <RegExpr attribute="Comment" String="u?'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
<RegExpr attribute="Comment" String="u?&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/> <RegExpr attribute="Comment" String="u?&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
<RegExpr attribute="Comment" String="(u?r|ru)'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/> <RegExpr attribute="Comment" String="(?:u?r|ru)'''" insensitive="true" firstNonSpace="true" context="Triple A-comment" beginRegion="Triple A-region"/>
<RegExpr attribute="Comment" String="(u?r|ru)&quot;&quot;&quot;" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/> <RegExpr attribute="Comment" String="(?:u?r|ru)&quot;&quot;&quot;" insensitive="true" firstNonSpace="true" context="Triple Q-comment" beginRegion="Triple Q-region"/>
<RegExpr attribute="Comment" String="(u?r|ru)'" insensitive="true" firstNonSpace="true" context="Single A-comment"/> <RegExpr attribute="Comment" String="(?:u?r|ru)'" insensitive="true" firstNonSpace="true" context="Single A-comment"/>
<RegExpr attribute="Comment" String="(u?r|ru)&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/> <RegExpr attribute="Comment" String="(?:u?r|ru)&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
</context> </context>
<context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
@@ -448,66 +476,38 @@
<context name="Hash comment" attribute="Comment" lineEndContext="#pop"> <context name="Hash comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/> <StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/>
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Triple Q-region"/> <StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Triple Q-region"/>
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<context name="Single A-comment" attribute="Comment" lineEndContext="#stay"> <context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="'" context="#pop"/> <DetectChar attribute="Comment" char="'" context="#pop"/>
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<context name="Single Q-comment" attribute="Comment" lineEndContext="#stay"> <context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="&quot;" context="#pop"/> <DetectChar attribute="Comment" char="&quot;" context="#pop"/>
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<!-- Strings --> <!-- Strings -->
<!-- format characters --> <!-- format characters -->
<context name="stringformat" attribute="String Substitution" lineEndContext="#stay"> <context name="stringformat" attribute="String Substitution" lineEndContext="#stay">
<!-- Python 2 style. Syntax: <RegExpr attribute="String Substitution" String="&strsubstitution_py2;|&strsubstitution_py3;" context="#stay"/>
1. start character '%'
2. [optional] Mapping key, e.g. '(foo)'
3. [optional] Conversion flags, one of '#0- +'
4. [optional] Minimum width, integer or '*'
5. [optional] Precision, '.' followed by integer or '*'
6. [optional] Length modifier, one of 'hlL'
7. conversion type, one of 'crsdiouxXeEfFgG%'
[Special cases: %prog and %default - see http://docs.python.org/library/optparse.html]
-->
<RegExpr attribute="String Substitution" String="%((\([a-zA-Z0-9_]+\))?[#0\- +]?([1-9][0-9]*|\*)?(\.([1-9][0-9]*|\*))?[hlL]?[crsdiouxXeEfFgG%]|prog|default)" context="#stay"/>
<!-- http://docs.python.org/2/library/string.html#format-string-syntax:
replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
arg_name ::= [identifier | integer]
attribute_name ::= identifier
element_index ::= integer | index_string
index_string ::= <any source character except "]"> +
conversion ::= "r" | "s"
format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= integer
precision ::= integer
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
-->
<RegExpr attribute="String Substitution" String="\{(([a-zA-Z0-9_]+|[0-9]+)(\.[a-zA-Z0-9_]+|\[[^ \]]+\])*)?(![rs])?(:([^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#stay"/>
<Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" /> <Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" />
<Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" /> <Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" />
</context> </context>
@@ -517,12 +517,7 @@
<!-- As this highlighting style is for both, Python 2 and 3, <!-- As this highlighting style is for both, Python 2 and 3,
we do not know if a normal string is “unicode” or not. So we we do not know if a normal string is “unicode” or not. So we
--> -->
<RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]" context="#stay"/> <RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]|\\[0-7]{1,3}|\\x[0-9A-Fa-f]{2}|\\u[0-9A-Fa-f]{4}|\\U[0-9A-Fa-f]{8}|\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
<RegExpr attribute="String Char" String="\\[0-7]{1,3}" context="#stay"/>
<RegExpr attribute="String Char" String="\\x[0-9A-Fa-f]{2}" context="#stay"/>
<RegExpr attribute="String Char" String="\\u[0-9A-Fa-f]{4}" context="#stay"/>
<RegExpr attribute="String Char" String="\\U[0-9A-Fa-f]{8}" context="#stay"/>
<RegExpr attribute="String Char" String="\\N\{[a-zA-Z0-9\- ]+\}" context="#stay"/>
</context> </context>
<!-- f-literals --> <!-- f-literals -->
@@ -532,7 +527,7 @@
</context> </context>
<context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay"> <context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay">
<DetectChar attribute="Error" char="\" context="#pop"/> <DetectChar attribute="Error" char="\" context="#pop"/>
<RegExpr attribute="String Substitution" String="(![rs])?(:([^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/> <RegExpr attribute="String Substitution" String="(?:![rs])?(?::(?:[^}]?[&lt;&gt;=^])?[ +-]?#?0?[0-9]*(?:\.[0-9]+)?[bcdeEfFgGnosxX%]?)?\}" context="#pop"/>
<IncludeRules context="Normal"/> <!-- TODO: create expression context instead --> <IncludeRules context="Normal"/> <!-- TODO: create expression context instead -->
</context> </context>
@@ -552,50 +547,50 @@
<context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<StringDetect attribute="String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/> <StringDetect attribute="String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context> </context>
<context name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/> <HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<StringDetect attribute="Raw String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/> <StringDetect attribute="Raw String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context> </context>
<context name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<StringDetect attribute="F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/> <StringDetect attribute="F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context> </context>
<context name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/> <HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<StringDetect attribute="Raw F-String" String="'''" context="#pop#CheckForString" endRegion="Triple A-region"/> <StringDetect attribute="Raw F-String" String="'''" context="#pop!#CheckForString" endRegion="Triple A-region"/>
</context> </context>
<!-- Triple-quoted Q-strings --> <!-- Triple-quoted Q-strings -->
<context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/> <StringDetect attribute="String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context> </context>
<context name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/> <HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<StringDetect attribute="Raw String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/> <StringDetect attribute="Raw String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context> </context>
<context name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<StringDetect attribute="F-String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/> <StringDetect attribute="F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context> </context>
<context name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true"> <context name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/> <HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<StringDetect attribute="Raw F-String" String="&quot;&quot;&quot;" context="#pop#CheckForString" endRegion="Triple Q-region"/> <StringDetect attribute="Raw F-String" String="&quot;&quot;&quot;" context="#pop!#CheckForString" endRegion="Triple Q-region"/>
</context> </context>
@@ -603,50 +598,50 @@
<context name="Single A-string" attribute="String" lineEndContext="#stay"> <context name="Single A-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<DetectChar attribute="String" char="'" context="#pop#CheckForString"/> <DetectChar attribute="String" char="'" context="#pop!#CheckForString"/>
</context> </context>
<context name="Raw A-string" attribute="Raw String" lineEndContext="#stay"> <context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/> <HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char="'" context="#pop#CheckForString"/> <DetectChar attribute="Raw String" char="'" context="#pop!#CheckForString"/>
</context> </context>
<context name="Single A-F-String" attribute="F-String" lineEndContext="#stay"> <context name="Single A-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char="'" context="#pop#CheckForString"/> <DetectChar attribute="F-String" char="'" context="#pop!#CheckForString"/>
</context> </context>
<context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#stay"> <context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/> <HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char="'" context="#pop#CheckForString"/> <DetectChar attribute="Raw F-String" char="'" context="#pop!#CheckForString"/>
</context> </context>
<!-- Single-quoted Q-strings --> <!-- Single-quoted Q-strings -->
<context name="Single Q-string" attribute="String" lineEndContext="#stay"> <context name="Single Q-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<DetectChar attribute="String" char="&quot;" context="#pop#CheckForString"/> <DetectChar attribute="String" char="&quot;" context="#pop!#CheckForString"/>
</context> </context>
<context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay"> <context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/> <HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/> <IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char="&quot;" context="#pop#CheckForString"/> <DetectChar attribute="Raw String" char="&quot;" context="#pop!#CheckForString"/>
</context> </context>
<context name="Single Q-F-String" attribute="F-String" lineEndContext="#stay"> <context name="Single Q-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/> <IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char="&quot;" context="#pop#CheckForString"/> <DetectChar attribute="F-String" char="&quot;" context="#pop!#CheckForString"/>
</context> </context>
<context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#stay"> <context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/> <HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/> <IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char="&quot;" context="#pop#CheckForString"/> <DetectChar attribute="Raw F-String" char="&quot;" context="#pop!#CheckForString"/>
</context> </context>
</contexts> </contexts>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language name="QDoc Configuration" <language name="QDoc Configuration"
version="2" version="3"
kateversion="5.0" kateversion="5.0"
section="Configuration" section="Configuration"
extensions="*.qdocconf" extensions="*.qdocconf"
@@ -113,8 +113,7 @@
<context name="comment-context" attribute="Comment" lineEndContext="#pop"> <context name="comment-context" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts"/> <IncludeRules context="##Comments"/>
<IncludeRules context="##Modelines"/>
</context> </context>
</contexts> </contexts>

View File

@@ -31,7 +31,7 @@
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
<language name="Ruby" section="Scripts" <language name="Ruby" section="Scripts"
version="12" kateversion="3.3" version="16" kateversion="5.0"
extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile" extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile"
mimetype="application/x-ruby" mimetype="application/x-ruby"
style="ruby" indenter="ruby" style="ruby" indenter="ruby"
@@ -191,19 +191,17 @@
<LineContinue attribute="Normal Text" context="Line Continue"/> <LineContinue attribute="Normal Text" context="Line Continue"/>
<!-- __END__ token on own line. --> <!-- __END__ token on own line. -->
<RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/> <RegExpr attribute="Keyword" String="^__END__$" context="DATA" column="0"/>
<!-- "shebang" line --> <!-- "shebang" line -->
<RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/> <RegExpr attribute="Keyword" String="^#!\/.*" context="#stay" column="0"/>
<!-- "def" - "end" blocks --> <!-- "def" - "end" blocks -->
<!-- check for statement modifiers with regexes --> <!-- check for statement modifiers with regexes -->
<DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/> <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/> <DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" /> <RegExpr attribute="Keyword" String="[=([]\s*(if|unless|while|until)\b|(while|until)\b(?!.*\bdo\b)|\;\s*(while|until)\b(?!.*\bdo\b)|\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/> <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
<RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="class" context="no_heredoc" beginRegion="def block"/> <WordDetect attribute="Keyword" String="class" context="no_heredoc" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/>
@@ -236,8 +234,7 @@
<!-- (global) vars starting with $ <!-- (global) vars starting with $
Match them before $_. Match them before $_.
--> -->
<RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="check_div_1"/> <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+|\$\-[a-zA-Z_]\b" context="check_div_1"/>
<RegExpr attribute="Global Variable" String="\$\-[a-zA-Z_]\b" context="check_div_1"/>
<!-- special-character globals --> <!-- special-character globals -->
<RegExpr attribute="Default globals" String="\$[\d_*`+@;,.~=\!\$:?'/\\\-\&amp;&quot;&gt;&lt;]" context="check_div_1"/> <RegExpr attribute="Default globals" String="\$[\d_*`+@;,.~=\!\$:?'/\\\-\&amp;&quot;&gt;&lt;]" context="check_div_1"/>
<RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="check_div_2"/> <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="check_div_2"/>
@@ -269,21 +266,16 @@
<DetectChar attribute="Operator" char="." context="#stay"/> <DetectChar attribute="Operator" char="." context="#stay"/>
<Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/> <Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
<Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/> <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
<RegExpr attribute="Operator" String="\s[\?\:\%]\s" context="#stay"/> <!-- \s! is regexp hack -->
<RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/> <RegExpr attribute="Operator" String="\s[\?\:\%]\s|[|&amp;&lt;&gt;\^\+*~\-=]+|\s!|/=\s" context="#stay"/>
<!-- regexp hack -->
<RegExpr attribute="Operator" String="\s!" context="#stay"/>
<RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
<Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/> <Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/>
<Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/> <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
<RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?" context="check_div_1"/> <RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?|:\[\]=?" context="check_div_1"/>
<RegExpr attribute="Symbol" String=":\[\]=?" context="check_div_1"/>
<!-- Do not send to "check_div_1" context!: <!-- Do not send to "check_div_1" context!:
after detecting these rules (": ") there can be a regular expression (see bug: #361875) --> after detecting these rules (": ") there can be a regular expression (see bug: #361875) -->
<RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: " context="#stay"/> <RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: |\[\]=?: " context="#stay"/>
<RegExpr attribute="Symbol" String="\[\]=?: " context="#stay"/>
<DetectChar attribute="String" char="&quot;" context="Quoted String"/> <DetectChar attribute="String" char="&quot;" context="Quoted String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/> <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
@@ -291,14 +283,12 @@
<Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/> <Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/>
<RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/> <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
<RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/> <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/> <DetectChar attribute="Comment" char="#" context="General Comment"/>
<DetectChar attribute="Delimiter" char="[" context="#stay"/> <DetectChar attribute="Delimiter" char="[" context="#stay"/>
<DetectChar attribute="Delimiter" char="]" context="check_div_1"/> <DetectChar attribute="Delimiter" char="]" context="check_div_1"/>
<DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
<DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="def block"/>
<RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="check_div_1"/> <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="check_div_1"/>
<RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="check_div_1"/> <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="check_div_1"/>
@@ -320,20 +310,20 @@
<!-- A slash is always a division operator, even if preceeded by whitespace --> <!-- A slash is always a division operator, even if preceeded by whitespace -->
<context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop"> <context name="check_div_1" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
<RegExpr attribute="Normal Text" String="\s*" context="#stay"/> <DetectSpaces attribute="Normal Text" context="#stay"/>
<AnyChar attribute="Operator" String="/%" context="#pop"/> <AnyChar attribute="Operator" String="/%" context="#pop"/>
</context> </context>
<!-- Same as check_div_1, but with double pop to exit the surrounding context --> <!-- Same as check_div_1, but with double pop to exit the surrounding context -->
<context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> <context name="check_div_1_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
<RegExpr attribute="Normal Text" String="\s*" context="#stay"/> <DetectSpaces attribute="Normal Text" context="#stay"/>
<AnyChar attribute="Operator" String="/%" context="#pop#pop"/> <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
</context> </context>
<!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace --> <!-- A slash is division operator if it's the first character, or if preceeded and followed by whitespace -->
<context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop"> <context name="check_div_2" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop">
<AnyChar attribute="Operator" String="/%" context="#pop"/> <AnyChar attribute="Operator" String="/%" context="#pop"/>
<RegExpr attribute="Normal Text" String="\s+" context="check_div_2_internal"/> <DetectSpaces attribute="Normal Text" context="check_div_2_internal"/>
</context> </context>
<!-- Internal context used by check_div_2 --> <!-- Internal context used by check_div_2 -->
@@ -345,7 +335,7 @@
<!-- Same as check_div_2, but with double pop to exit the surrounding context --> <!-- Same as check_div_2, but with double pop to exit the surrounding context -->
<context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop"> <context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#pop#pop">
<AnyChar attribute="Operator" String="/%" context="#pop#pop"/> <AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
<RegExpr attribute="Normal Text" String="\s+" context="check_div_2_pop_internal"/> <DetectSpaces attribute="Normal Text" context="check_div_2_pop_internal"/>
</context> </context>
<!-- Internal context used by check_div_2_pop --> <!-- Internal context used by check_div_2_pop -->
@@ -355,8 +345,7 @@
</context> </context>
<context name="Line Continue" attribute="Normal Text" lineEndContext="#pop"> <context name="Line Continue" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/> <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)|(if|unless)\b" context="#stay" firstNonSpace="true"/>
<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
<IncludeRules context="Normal"/> <IncludeRules context="Normal"/>
</context> </context>
@@ -390,7 +379,7 @@
<context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay"> <context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay">
<RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/> <RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/>
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
</context> </context>
<context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay"> <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
@@ -433,8 +422,7 @@
<context name="General Comment" attribute="Comment" lineEndContext="#pop"> <context name="General Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<!-- HEREDOC support <!-- HEREDOC support
@@ -443,15 +431,11 @@
<!-- here we markup the heredoc markers --> <!-- here we markup the heredoc markers -->
<context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="find_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" /> <RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="(\w+)" /> <RegExpr attribute="Keyword" context="normal_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;(\w+)&quot;" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="`(\w+)`" />
</context> </context>
<context name="find_indented_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> <context name="find_indented_heredoc" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" /> <RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="(\w+)" /> <RegExpr attribute="Keyword" context="indented_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;(\w+)&quot;" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="`(\w+)`" />
</context> </context>
<!-- these are the real heredoc contexts --> <!-- these are the real heredoc contexts -->
<context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
@@ -463,11 +447,11 @@
</context> </context>
<context name="normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <context name="normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/> <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
<IncludeRules context="heredoc_rules" /> <IncludeRules context="heredoc_rules" />
</context> </context>
<context name="apostrophed_normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true"> <context name="apostrophed_normal_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/> <RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument" column="0"/>
</context> </context>
<!-- rules for heredoc types --> <!-- rules for heredoc types -->
@@ -481,8 +465,8 @@
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Operator" char="&lt;" char1="&lt;" context="#pop"/> <Detect2Chars attribute="Operator" char="&lt;" char1="&lt;" context="#pop"/>
<!-- comments --> <!-- comments -->
<RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/> <RegExpr attribute="Comment" String="^#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
<RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/> <RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/> <DetectChar attribute="Comment" char="#" context="General Comment"/>
</context> </context>
@@ -602,7 +586,7 @@
--> -->
<context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true"> <context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="dq_string_rules" /> <IncludeRules context="dq_string_rules" />
<RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" /> <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context> </context>
<!-- rules to be included in all dq_string contexts --> <!-- rules to be included in all dq_string contexts -->
@@ -667,7 +651,7 @@
--> -->
<context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true"> <context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="token_array_rules" /> <IncludeRules context="token_array_rules" />
<RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/> <StringDetect attribute="String" String="\%1" context="#stay" dynamic="true"/>
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context> </context>
@@ -731,7 +715,7 @@
--> -->
<context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true"> <context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
<IncludeRules context="apostrophed_rules" /> <IncludeRules context="apostrophed_rules" />
<RegExpr attribute="Raw String" String="\\%1" context="#stay" dynamic="true"/> <StringDetect attribute="Raw String" String="\%1" context="#stay" dynamic="true"/>
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context> </context>
@@ -795,7 +779,7 @@
--> -->
<context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true"> <context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
<IncludeRules context="shell_command_rules" /> <IncludeRules context="shell_command_rules" />
<RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" /> <StringDetect attribute="Command" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" /> <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
</context> </context>
@@ -861,7 +845,7 @@
--> -->
<context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true"> <context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
<IncludeRules context="regexpr_rules" /> <IncludeRules context="regexpr_rules" />
<RegExpr attribute="Regular Expression" String="\\%1" context="#stay" dynamic="true" /> <StringDetect attribute="Regular Expression" String="\%1" context="#stay" dynamic="true" />
<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" /> <RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
</context> </context>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<language name="Valgrind Suppression" section="Other" extensions="*.supp;" mimetype="" version="3" kateversion="2.4" author="Milian Wolff (mail@milianw.de)" license="LGPL"> <language name="Valgrind Suppression" section="Other" extensions="*.supp;" mimetype="" version="4" kateversion="5.0" author="Milian Wolff (mail@milianw.de)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>
<context name="File" attribute="Normal Text" lineEndContext="#stay"> <context name="File" attribute="Normal Text" lineEndContext="#stay">
@@ -9,7 +9,7 @@
</context> </context>
<context name="Rule" attribute="Normal Text" lineEndContext="#stay" > <context name="Rule" attribute="Normal Text" lineEndContext="#stay" >
<RegExpr attribute="RuleName" String="^[^\}]+$" context="Rule2" /> <RegExpr attribute="RuleName" String="^[^\}]+$" context="Rule2" column="0" />
<DetectChar char="}" attribute="Normal Text" context="#pop" firstNonSpace="true" /> <DetectChar char="}" attribute="Normal Text" context="#pop" firstNonSpace="true" />
</context> </context>
@@ -25,8 +25,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop"> <context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
</contexts> </contexts>

View File

@@ -6,7 +6,7 @@
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*"> <!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> <!ENTITY entref "&amp;(?:#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]> ]>
<language name="XML" version="10" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL"> <language name="XML" version="12" kateversion="5.0" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae;*.sch;*.brd" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" indenter="xml" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -17,10 +17,10 @@
<context name="FindXML" attribute="Normal Text" lineEndContext="#stay"> <context name="FindXML" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" /> <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
<StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" /> <StringDetect attribute="CDATA" context="CDATAStart" String="&lt;![CDATA[" lookAhead="true" />
<RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" /> <RegExpr attribute="Doctype Symbols" context="DoctypeTagName" String="&lt;!(?=DOCTYPE\s+)" beginRegion="doctype" />
<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" /> <IncludeRules context="FindProcessingInstruction" />
<RegExpr attribute="Element" context="Element" String="&lt;&name;" beginRegion="element" /> <RegExpr attribute="Element Symbols" context="ElementTagName" String="&lt;(?=(&name;))" beginRegion="element" />
<IncludeRules context="FindEntityRefs" /> <IncludeRules context="FindEntityRefs" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
@@ -41,37 +41,67 @@
<DetectSpaces /> <DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" /> <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" /> <RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>
<context name="CDATAStart" attribute="Other Text" lineEndContext="#pop">
<StringDetect attribute="CDATA Symbols" context="#stay" String="&lt;![" beginRegion="cdata" />
<StringDetect attribute="CDATA" context="#stay" String="CDATA" />
<DetectChar attribute="CDATA Symbols" context="#pop!CDATA" char="[" />
</context>
<context name="CDATA" attribute="Other Text" lineEndContext="#stay"> <context name="CDATA" attribute="Other Text" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<DetectIdentifier /> <DetectIdentifier />
<StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" /> <StringDetect attribute="CDATA Symbols" context="#pop" String="]]&gt;" endRegion="cdata" />
<StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" /> <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
</context> </context>
<context name="FindProcessingInstruction" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="PI Symbols" context="PI TagName" String="&lt;\?(?=([\w:_-]*))" beginRegion="pi" />
</context>
<context name="PI TagName" attribute="Other Text" lineEndContext="#pop!PI" fallthrough="true" fallthroughContext="#pop!PI">
<RegExpr attribute="Processing Instruction" context="#pop!PI-XML" String="xml(?=\s|$)" insensitive="true" />
<StringDetect attribute="Processing Instruction" context="#pop!PI" String="%1" dynamic="true" />
</context>
<context name="PI" attribute="Other Text" lineEndContext="#stay"> <context name="PI" attribute="Other Text" lineEndContext="#stay">
<Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" /> <Detect2Chars attribute="PI Symbols" context="#pop" char="?" char1="&gt;" endRegion="pi" />
</context>
<context name="PI-XML" attribute="Other Text" lineEndContext="#stay">
<IncludeRules context="PI" />
<RegExpr attribute="Attribute" context="#stay" String="(?:^|\s+)&name;" />
<DetectChar attribute="Attribute" context="Value" char="=" />
</context> </context>
<context name="DoctypeTagName" attribute="Other Text" lineEndContext="#pop">
<StringDetect attribute="Doctype" context="#pop!DoctypeVariableName" String="DOCTYPE" />
</context>
<context name="DoctypeVariableName" attribute="Other Text" lineEndContext="#pop!Doctype" fallthrough="true" fallthroughContext="#pop!Doctype">
<DetectSpaces />
<RegExpr attribute="Doctype Name" context="#pop!Doctype" String="&name;" />
</context>
<context name="Doctype" attribute="Other Text" lineEndContext="#stay"> <context name="Doctype" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" /> <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" endRegion="doctype" />
<DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" /> <DetectChar attribute="Doctype Symbols" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
</context> </context>
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay"> <context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" /> <DetectChar attribute="Doctype Symbols" context="#pop" char="]" endRegion="int_subset" />
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" /> <RegExpr attribute="Doctype Symbols" context="Doctype Markupdecl TagName" String="&lt;!(?=(ELEMENT|ENTITY|ATTLIST|NOTATION)\b)" />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" /> <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" /> <IncludeRules context="FindProcessingInstruction" />
<IncludeRules context="FindPEntityRefs" /> <IncludeRules context="FindPEntityRefs" />
</context> </context>
<context name="Doctype Markupdecl TagName" attribute="Other Text" lineEndContext="#pop">
<StringDetect attribute="Doctype" context="#pop!Doctype Markupdecl VariableName" String="%1" dynamic="true" />
</context>
<context name="Doctype Markupdecl VariableName" attribute="Other Text" lineEndContext="#pop!Doctype Markupdecl" fallthrough="true" fallthroughContext="#pop!Doctype Markupdecl">
<DetectSpaces />
<RegExpr attribute="Doctype Name" context="#pop!Doctype Markupdecl" String="&name;" />
</context>
<context name="Doctype Markupdecl" attribute="Other Text" lineEndContext="#stay"> <context name="Doctype Markupdecl" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Doctype" context="#pop" char="&gt;" /> <DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" />
<DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" /> <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
<DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" /> <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
</context> </context>
@@ -86,25 +116,31 @@
<IncludeRules context="FindPEntityRefs" /> <IncludeRules context="FindPEntityRefs" />
</context> </context>
<context name="ElementTagName" attribute="Other Text" lineEndContext="#pop!Element" fallthrough="true" fallthroughContext="#pop!Element">
<StringDetect attribute="Element" context="#pop!Element" String="%1" dynamic="true" />
</context>
<context name="Element" attribute="Other Text" lineEndContext="#stay"> <context name="Element" attribute="Other Text" lineEndContext="#stay">
<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" /> <Detect2Chars attribute="Element Symbols" context="#pop" char="/" char1="&gt;" endRegion="element" />
<DetectChar attribute="Element" context="El Content" char="&gt;" /> <DetectChar attribute="Element Symbols" context="El Content" char="&gt;" />
<RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" /> <RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" />
<RegExpr attribute="Error" context="#stay" String="\S" /> <RegExpr attribute="Error" context="#stay" String="\S" />
</context> </context>
<context name="El Content" attribute="Other Text" lineEndContext="#stay"> <context name="El Content" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="Element" context="El End" String="&lt;/&name;" /> <RegExpr attribute="Element Symbols" context="El End TagName" String="&lt;/(?=(&name;))" />
<IncludeRules context="FindXML" /> <IncludeRules context="FindXML" />
</context> </context>
<context name="El End TagName" attribute="Other Text" lineEndContext="#pop!El End" fallthrough="true" fallthroughContext="#pop!El End">
<StringDetect attribute="Element" context="#pop!El End" String="%1" dynamic="true" />
</context>
<context name="El End" attribute="Other Text" lineEndContext="#stay"> <context name="El End" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" endRegion="element" /> <DetectChar attribute="Element Symbols" context="#pop#pop#pop" char="&gt;" endRegion="element" />
<RegExpr attribute="Error" context="#stay" String="\S" /> <RegExpr attribute="Error" context="#stay" String="\S" />
</context> </context>
<context name="Attribute" attribute="Other Text" lineEndContext="#stay"> <context name="Attribute" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Attribute" context="Value" char="=" /> <DetectChar attribute="Attribute" context="#pop!Value" char="=" />
<RegExpr attribute="Error" context="#stay" String="\S" /> <RegExpr attribute="Error" context="#stay" String="\S" />
</context> </context>
@@ -115,12 +151,12 @@
</context> </context>
<context name="Value DQ" attribute="Value" lineEndContext="#stay"> <context name="Value DQ" attribute="Value" lineEndContext="#stay">
<DetectChar attribute="Value" context="#pop#pop#pop" char="&quot;" /> <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
<IncludeRules context="FindEntityRefs" /> <IncludeRules context="FindEntityRefs" />
</context> </context>
<context name="Value SQ" attribute="Value" lineEndContext="#stay"> <context name="Value SQ" attribute="Value" lineEndContext="#stay">
<DetectChar attribute="Value" context="#pop#pop#pop" char="&apos;" /> <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
<IncludeRules context="FindEntityRefs" /> <IncludeRules context="FindEntityRefs" />
</context> </context>
@@ -129,10 +165,15 @@
<itemData name="Normal Text" defStyleNum="dsNormal" /> <itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Other Text" defStyleNum="dsNormal" /> <itemData name="Other Text" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="false" /> <itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" spellChecking="false" /> <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" italic="0" spellChecking="false" />
<itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false" /> <itemData name="CDATA Symbols" defStyleNum="dsBaseN" bold="0" italic="0" spellChecking="false" />
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false" /> <itemData name="Processing Instruction" defStyleNum="dsFunction" bold="1" italic="0" spellChecking="false" />
<itemData name="PI Symbols" defStyleNum="dsFunction" bold="0" italic="0" spellChecking="false" />
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" italic="0" spellChecking="false" />
<itemData name="Doctype Name" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
<itemData name="Doctype Symbols" defStyleNum="dsDataType" bold="0" italic="0" spellChecking="false" />
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" /> <itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" />
<itemData name="Element Symbols" defStyleNum="dsNormal" spellChecking="false" />
<itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" /> <itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="Value" defStyleNum="dsString" spellChecking="false" /> <itemData name="Value" defStyleNum="dsString" spellChecking="false" />
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" /> <itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />

View File

@@ -32,7 +32,7 @@ This code is released under the LGPL as part of kdelibs/kate.
======================================================================== ========================================================================
--> -->
<language name="Yacc/Bison" version="7" kateversion="5.0" section="Sources" extensions="*.y;*.yy;*.ypp;*.y++" mimetype="text/x-yacc;text/x-bison" priority="5" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL"> <language name="Yacc/Bison" version="9" kateversion="5.0" section="Sources" extensions="*.y;*.yy;*.ypp;*.y++" mimetype="text/x-yacc;text/x-bison" priority="5" author="Jan Villat (jan.villat@net2000.ch)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>
@@ -139,9 +139,9 @@ This code is released under the LGPL as part of kdelibs/kate.
<WordDetect attribute="Directive" context="#stay" String="%merge" /> <WordDetect attribute="Directive" context="#stay" String="%merge" />
<!-- Finish rule without the ';' character (see the 'rhses.1' rule in the 'src/parse-gram.y' file, from the Bison source) --> <!-- Finish rule without the ';' character (see the 'rhses.1' rule in the 'src/parse-gram.y' file, from the Bison source) -->
<RegExpr attribute="Open Rule" context="#pop" String="[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" /> <RegExpr attribute="Open Rule" context="#pop" String="^[\w\-\.](?=[\w\-\.]*:)" column="0" endRegion="rule" />
<Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="%" lookAhead="true" firstNonSpace="true" endRegion="rule" /> <Detect2Chars attribute="Content-Type Delimiter" context="#pop" char="%" char1="%" lookAhead="true" firstNonSpace="true" endRegion="rule" />
<RegExpr attribute="Directive" context="#pop" String="%(?:union|code|destructor|printer|start|(?:no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" /> <RegExpr attribute="Directive" context="#pop" String="^%(?:union|code|destructor|printer|start|(?:no\-)?default\-prec|nterm|token|type|left|right|nonassoc|precedence)\b" lookAhead="true" column="0" endRegion="rule" />
</context> </context>
<!-- The Bison parser allows to have ';' followed by '|', without the rule ending. <!-- The Bison parser allows to have ';' followed by '|', without the rule ending.
The problem here is that the ';' char has endRegion="rule" (although it is not very relevant). --> The problem here is that the ';' char has endRegion="rule" (although it is not very relevant). -->
@@ -201,13 +201,11 @@ This code is released under the LGPL as part of kdelibs/kate.
<context name="CommentStar" attribute="Comment" lineEndContext="#stay"> <context name="CommentStar" attribute="Comment" lineEndContext="#stay">
<DetectSpaces /> <DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" /> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<context name="CommentSlash" attribute="Comment" lineEndContext="#pop"> <context name="CommentSlash" attribute="Comment" lineEndContext="#pop">
<DetectSpaces /> <DetectSpaces />
<IncludeRules context="##Alerts" /> <IncludeRules context="##Comments" />
<IncludeRules context="##Modelines" />
</context> </context>
<context name="StringOrChar" attribute="Normal Text" lineEndContext="#stay"> <context name="StringOrChar" attribute="Normal Text" lineEndContext="#stay">

View File

@@ -0,0 +1,352 @@
{
"custom-styles": {
"Go": {
"Predeclared Identifier": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
}
},
"INI Files": {
"Assignment": {
"selected-text-color": "#abb2bf",
"text-color": "#abb2bf"
},
"Section": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
}
},
"JavaScript": {
"Built-in Objects": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Function Declaration": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Function Name": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Module": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Object Member": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Object Method (Built-in)": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
}
},
"Markdown": {
"Code": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Emphasis Text": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Fenced Code": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Header H1": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Header H2": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Header H3": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Header H4": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Header H5": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Header H6": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Link": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Reference-Link Name": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Reference-Link Target": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Reference-Link Target: Link": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Reference-Link: Email": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Reference-Link: Link": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Strong Text": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
}
},
"Python": {
"Builtin Function": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"String Substitution": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
}
},
"Rust": {
"Lifetime": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Macro": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Self": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Trait": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Type": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
}
},
"TypeScript": {
"Built-in Objects": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Module": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Object Member": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Object Method (Built-in)": {
"italic": false,
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"Reserved": {
"italic": false
},
"Types": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
}
},
"XML": {
"Attribute": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Element": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
}
}
},
"editor-colors": {
"BackgroundColor": "#282c34",
"BracketMatching": "#8e44ad",
"CodeFolding": "#363c4a",
"CurrentLine": "#0A99BBFF",
"CurrentLineNumber": "#abb2bf",
"IconBorder": "#282c34",
"IndentationLine": "#3a3f44",
"LineNumbers": "#636D83",
"MarkBookmark": "#0404bf",
"MarkBreakpointActive": "#8b0607",
"MarkBreakpointDisabled": "#820683",
"MarkBreakpointReached": "#6d6e07",
"MarkError": "#c24038",
"MarkExecution": "#4d4e50",
"MarkWarning": "#d19a66",
"ModifiedLines": "#e06c75",
"ReplaceHighlight": "#a34f56",
"SavedLines": "#98c379",
"SearchHighlight": "#3D528BFF",
"Separator": "#3f4347",
"SpellChecking": "#c24038",
"TabMarker": "#21252B",
"TemplateBackground": "#31363b",
"TemplateFocusedPlaceholder": "#123723",
"TemplatePlaceholder": "#123723",
"TemplateReadOnlyPlaceholder": "#4d1f24",
"TextSelection": "#363c4a",
"WordWrapMarker": "#3a3f44"
},
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2016 GitHub Inc.",
"SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
],
"license": "SPDX-License-Identifier: MIT",
"name": "Atom One Dark",
"revision": 2
},
"text-styles": {
"Alert": {
"background-color": "#4d1f24",
"bold": true,
"selected-text-color": "#95da4c",
"text-color": "#95da4c"
},
"Annotation": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Attribute": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"BaseN": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"BuiltIn": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Char": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Comment": {
"italic": true,
"selected-text-color": "#5c6370",
"text-color": "#5c6370"
},
"CommentVar": {
"italic": true,
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"Constant": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"ControlFlow": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"DataType": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"DecVal": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Documentation": {
"selected-text-color": "#da4453",
"text-color": "#a43340"
},
"Error": {
"selected-text-color": "#f44747",
"text-color": "#f44747",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#61afef",
"text-color": "#61afef"
},
"Float": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Function": {
"selected-text-color": "#61afef",
"text-color": "#61afef"
},
"Import": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Information": {
"selected-text-color": "#e46700",
"text-color": "#c45b00"
},
"Keyword": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Normal": {
"selected-text-color": "#abb2bf",
"text-color": "#abb2bf"
},
"Operator": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"Others": {
"selected-text-color": "#27ae60",
"text-color": "#27ae60"
},
"Preprocessor": {
"selected-text-color": "#c678dd",
"text-color": "#c678dd"
},
"RegionMarker": {
"background-color": "#153042",
"selected-text-color": "#3daee9",
"text-color": "#2980b9"
},
"SpecialChar": {
"selected-text-color": "#56b6c2",
"text-color": "#56b6c2"
},
"SpecialString": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
},
"String": {
"selected-text-color": "#98c379",
"text-color": "#98c379"
},
"Variable": {
"selected-text-color": "#e06c75",
"text-color": "#e06c75"
},
"VerbatimString": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
},
"Warning": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
}
}
}

View File

@@ -0,0 +1,359 @@
{
"custom-styles": {
"Go": {
"Predeclared Identifier": {
"selected-text-color": "#986801",
"text-color": "#986801"
}
},
"INI Files": {
"Assignment": {
"selected-text-color": "#383a42",
"text-color": "#383a42"
},
"Section": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
}
},
"JavaScript": {
"Built-in Objects": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Function Declaration": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
},
"Function Name": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
},
"Module": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Object Member": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Object Method (Built-in)": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
}
},
"Markdown": {
"Code": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Emphasis Text": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Fenced Code": {
"selected-text-color": "#d19a66",
"text-color": "#d19a66"
},
"Header H1": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Header H2": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Header H3": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Header H4": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Header H5": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Header H6": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Line Break": {
"text-color": "#383a42"
},
"Link": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Reference-Link Name": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
},
"Reference-Link Target": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
},
"Reference-Link Target: Link": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Reference-Link: Email": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Reference-Link: Link": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Strong Text": {
"selected-text-color": "#986801",
"text-color": "#986801"
}
},
"Python": {
"Builtin Function": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
},
"Import": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"String Substitution": {
"selected-text-color": "#986801",
"text-color": "#986801"
}
},
"Rust": {
"Lifetime": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Macro": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
},
"Self": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Trait": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Type": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
}
},
"TypeScript": {
"Built-in Objects": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Module": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Object Member": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Object Method (Built-in)": {
"italic": false,
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
},
"Reserved": {
"italic": false
},
"Types": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
}
},
"XML": {
"Attribute": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Element": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
}
}
},
"editor-colors": {
"BackgroundColor": "#fafafa",
"BracketMatching": "#ff6e6e",
"CodeFolding": "#e5e5e6",
"CurrentLine": "#0C383A42",
"CurrentLineNumber": "#383a42",
"IconBorder": "#fafafa",
"IndentationLine": "#626772",
"LineNumbers": "#9D9D9F",
"MarkBookmark": "#0404bf",
"MarkBreakpointActive": "#8b0607",
"MarkBreakpointDisabled": "#820683",
"MarkBreakpointReached": "#6d6e07",
"MarkError": "#c24038",
"MarkExecution": "#4d4e50",
"MarkWarning": "#ce7c2b",
"ModifiedLines": "#e06c75",
"ReplaceHighlight": "#ef747e",
"SavedLines": "#98c379",
"SearchHighlight": "#33526FFF",
"Separator": "#a6b0ba",
"SpellChecking": "#c24038",
"TabMarker": "#8894a6",
"TemplateBackground": "#31363b",
"TemplateFocusedPlaceholder": "#123723",
"TemplatePlaceholder": "#123723",
"TemplateReadOnlyPlaceholder": "#4d1f24",
"TextSelection": "#e5e5e6",
"WordWrapMarker": "#cddff1"
},
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2016 GitHub Inc.",
"SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
],
"license": "SPDX-License-Identifier: MIT",
"name": "Atom One Light",
"revision": 3
},
"text-styles": {
"Alert": {
"background-color": "#4d1f24",
"bold": true,
"selected-text-color": "#95da4c",
"text-color": "#95da4c"
},
"Annotation": {
"selected-text-color": "#50a14f",
"text-color": "#50a14f"
},
"Attribute": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"BaseN": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"BuiltIn": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Char": {
"selected-text-color": "#50a14f",
"text-color": "#50a14f"
},
"Comment": {
"italic": true,
"selected-text-color": "#a0a1a7",
"text-color": "#a0a1a7"
},
"CommentVar": {
"italic": true,
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"Constant": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"ControlFlow": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"DataType": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"DecVal": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Documentation": {
"selected-text-color": "#da4453",
"text-color": "#e45649"
},
"Error": {
"selected-text-color": "#f44747",
"text-color": "#f44747",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
},
"Float": {
"selected-text-color": "#986801",
"text-color": "#986801"
},
"Function": {
"selected-text-color": "#4078f2",
"text-color": "#4078f2"
},
"Import": {
"selected-text-color": "#50a14f",
"text-color": "#50a14f"
},
"Information": {
"selected-text-color": "#e46700",
"text-color": "#c45b00"
},
"Keyword": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Normal": {
"selected-text-color": "#383a42",
"text-color": "#383a42"
},
"Operator": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"Others": {
"selected-text-color": "#27ae60",
"text-color": "#27ae60"
},
"Preprocessor": {
"selected-text-color": "#a626a4",
"text-color": "#a626a4"
},
"RegionMarker": {
"background-color": "#153042",
"selected-text-color": "#3daee9",
"text-color": "#2980b9"
},
"SpecialChar": {
"selected-text-color": "#0184bc",
"text-color": "#0184bc"
},
"SpecialString": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
},
"String": {
"selected-text-color": "#50a14f",
"text-color": "#50a14f"
},
"Variable": {
"selected-text-color": "#e45649",
"text-color": "#e45649"
},
"VerbatimString": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
},
"Warning": {
"selected-text-color": "#da4453",
"text-color": "#da4453"
}
}
}

View File

@@ -1,6 +1,6 @@
{ {
"_comments": [ "_comments": [
"Last update: Sep 21, 2020 (revision 2)", "Last update: Feb 22, 2021 (revision 3)",
"This file has been converted from: https://github.com/dempfi/ayu", "This file has been converted from: https://github.com/dempfi/ayu",
"Also see: https://github.com/ayu-theme" "Also see: https://github.com/ayu-theme"
], ],
@@ -11,7 +11,7 @@
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"name": "ayu Dark", "name": "ayu Dark",
"revision": 2 "revision": 3
}, },
"editor-colors": { "editor-colors": {
"BackgroundColor": "#0a0e14", "BackgroundColor": "#0a0e14",
@@ -176,5 +176,30 @@
"selected-text-color": "#f07178", "selected-text-color": "#f07178",
"text-color": "#f07178" "text-color": "#f07178"
} }
},
"custom-styles": {
"XML": {
"Attribute": {
"selected-text-color": "#ffb454",
"text-color": "#ffb454"
},
"Element": {
"selected-text-color": "#39bae6",
"text-color": "#39bae6",
"bold": false
},
"Element Symbols": {
"selected-text-color": "#307896",
"text-color": "#22647d"
},
"EntityRef": {
"selected-text-color": "#95e6cb",
"text-color": "#95e6cb"
},
"PEntityRef": {
"selected-text-color": "#95e6cb",
"text-color": "#95e6cb"
}
}
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"_comments": [ "_comments": [
"Last update: Sep 21, 2020 (revision 2)", "Last update: Feb 22, 2021 (revision 3)",
"This file has been converted from: https://github.com/dempfi/ayu", "This file has been converted from: https://github.com/dempfi/ayu",
"Also see: https://github.com/ayu-theme" "Also see: https://github.com/ayu-theme"
], ],
@@ -11,7 +11,7 @@
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"name": "ayu Mirage", "name": "ayu Mirage",
"revision": 2 "revision": 3
}, },
"editor-colors": { "editor-colors": {
"BackgroundColor": "#1f2430", "BackgroundColor": "#1f2430",
@@ -176,5 +176,30 @@
"selected-text-color": "#f28779", "selected-text-color": "#f28779",
"text-color": "#f28779" "text-color": "#f28779"
} }
},
"custom-styles": {
"XML": {
"Attribute": {
"selected-text-color": "#ffd580",
"text-color": "#ffd580"
},
"Element": {
"selected-text-color": "#5ccfe6",
"text-color": "#5ccfe6",
"bold": false
},
"Element Symbols": {
"selected-text-color": "#4788a2",
"text-color": "#3d7a8b"
},
"EntityRef": {
"selected-text-color": "#95e6cb",
"text-color": "#95e6cb"
},
"PEntityRef": {
"selected-text-color": "#95e6cb",
"text-color": "#95e6cb"
}
}
} }
} }

View File

@@ -5,7 +5,7 @@
"SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>" "SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>"
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"revision" : 2, "revision" : 6,
"name" : "Breeze Dark" "name" : "Breeze Dark"
}, },
"text-styles": { "text-styles": {
@@ -36,8 +36,8 @@
"bold" : true "bold" : true
}, },
"Operator" : { "Operator" : {
"text-color" : "#cfcfc2", "text-color" : "#3f8058",
"selected-text-color" : "#cfcfc2" "selected-text-color" : "#54aa75"
}, },
"BuiltIn" : { "BuiltIn" : {
"text-color" : "#7f8c8d", "text-color" : "#7f8c8d",
@@ -149,7 +149,7 @@
"editor-colors": { "editor-colors": {
"BackgroundColor" : "#232629", "BackgroundColor" : "#232629",
"CodeFolding" : "#224e65", "CodeFolding" : "#224e65",
"BracketMatching" : "#8e44ad", "BracketMatching" : "#323030",
"CurrentLine" : "#2A2E32", "CurrentLine" : "#2A2E32",
"IconBorder" : "#31363b", "IconBorder" : "#31363b",
"IndentationLine" : "#3a3f44", "IndentationLine" : "#3a3f44",
@@ -167,7 +167,7 @@
"SavedLines" : "#1c8042", "SavedLines" : "#1c8042",
"SearchHighlight" : "#218058", "SearchHighlight" : "#218058",
"TextSelection" : "#2d5c76", "TextSelection" : "#2d5c76",
"Separator" : "#7a7c7d", "Separator" : "#3f4347",
"SpellChecking" : "#c0392b", "SpellChecking" : "#c0392b",
"TabMarker" : "#4d4d4d", "TabMarker" : "#4d4d4d",
"TemplateBackground" : "#31363b", "TemplateBackground" : "#31363b",

View File

@@ -5,7 +5,7 @@
"SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>" "SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>"
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"revision" : 4, "revision" : 8,
"name" : "Breeze Light" "name" : "Breeze Light"
}, },
"text-styles": { "text-styles": {
@@ -36,8 +36,8 @@
"bold" : true "bold" : true
}, },
"Operator" : { "Operator" : {
"text-color" : "#1f1c1b", "text-color" : "#ca60ca",
"selected-text-color" : "#ffffff" "selected-text-color" : "#a44ea4"
}, },
"BuiltIn" : { "BuiltIn" : {
"text-color" : "#644a9b", "text-color" : "#644a9b",
@@ -167,7 +167,7 @@
"SavedLines" : "#2ecc71", "SavedLines" : "#2ecc71",
"SearchHighlight" : "#ffff00", "SearchHighlight" : "#ffff00",
"TextSelection" : "#94caef", "TextSelection" : "#94caef",
"Separator" : "#a0a0a0", "Separator" : "#d5d5d5",
"SpellChecking" : "#bf0303", "SpellChecking" : "#bf0303",
"TabMarker" : "#d2d2d2", "TabMarker" : "#d2d2d2",
"TemplateBackground" : "#d6d2d0", "TemplateBackground" : "#d6d2d0",

View File

@@ -1,13 +1,547 @@
{ {
"custom-styles": {
"Alerts": {
"Region Marker": {
"selected-text-color": "#6db8c7",
"text-color": "#6db8c7"
}
},
"Apache Configuration": {
"Directives": {
"bold": false
}
},
"Bash": {
"Path": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Redirection": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Variable": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
}
},
"C": {
"Prep. Lib": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
}
},
"C++": {
"Qt Macros": {
"bold": false,
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
}
},
"CMake": {
"Builtin Variable": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
}
},
"CSS": {
"Color": {
"bold": false
},
"Property": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Selector Class": {
"italic": true
},
"Selector Id": {
"bold": false,
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Selector Pseudo": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Selector Tag": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Unit": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
}
},
"D": {
"Attribute": {
"bold": false
},
"Declarator": {
"bold": false
},
"Deprecated": {
"bold": false
},
"Expression": {
"bold": false
},
"Module": {
"bold": false
},
"Property": {
"bold": false
},
"Template": {
"bold": false
}
},
"Diff": {
"Added line": {
"selected-text-color": "#5fde38",
"text-color": "#50fa7b"
},
"Changed line (new)": {
"background-color": "#50fa7b",
"selected-text-color": "#5fde38",
"text-color": "#50fa7b"
},
"Changed line (old)": {
"selected-text-color": "#e66eb4",
"text-color": "#ff79c6"
},
"Removed line": {
"selected-text-color": "#e66eb4",
"text-color": "#ff79c6"
}
},
"Doxygen": {
"Custom Tags": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"Description": {
"selected-text-color": "#c58e53",
"text-color": "#c58e53"
},
"Entities": {
"bold": false
},
"HTML Tag": {
"bold": false,
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"Region": {
"selected-text-color": "#6db8c7",
"text-color": "#6db8c7"
},
"Tags": {
"bold": false,
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"Word": {
"bold": false,
"selected-text-color": "#c58e53",
"text-color": "#c58e53"
}
},
"GNU Assembler": {
"Label": {
"underline": true
}
},
"Go": {
"Builtin Function": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
}
},
"HTML": {
"Doctype": {
"bold": false,
"italic": false,
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
}
},
"ISO C++": {
"Prep. Lib": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Standard Suffix": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"UDL Numeric Suffix": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"UDL String Suffix": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
}
},
"Intel x86 (NASM)": {
"Label": {
"underline": true
},
"Registers": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
}
},
"JSON": {
"Style_Keyword": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Style_String_Key": {
"italic": false
}
},
"JavaScript": {
"Built-in Objects": {
"italic": true
},
"Function (Built-in)": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Object Member": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
}
},
"JavaScript React (JSX)": {
"Attribute": {
"italic": true
},
"Component Tag": {
"bold": false,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
}
},
"Makefile": {
"Operator": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Prereq": {
"italic": false,
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Target": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Variable": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
}
},
"Markdown": {
"Blockquote: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Email": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Emphasis Text": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Header H1": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Header H2": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Header H3": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Header H4": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Header H5": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Header H6": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Inline Image": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
},
"Inline Image: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"List: Emphasis Text": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"List: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"List: Strong Text": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
},
"Normal Text: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Reference Image": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
},
"Reference-Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Reference-Link Name": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6",
"underline": false
},
"Reference-Link Target": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Reference-Link Target: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Reference-Link: Link": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Strong Text": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
}
},
"Modelines": {
"Variable": {
"selected-text-color": "#c58e53",
"text-color": "#c58e53"
}
},
"PHP/PHP": {
"Backslash Code": {
"bold": false,
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Control Structures": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Library Constant": {
"bold": false,
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Special Variable": {
"bold": false,
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Variable": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
}
},
"Python": {
"Builtin Function": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Special Variable": {
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
}
},
"QMake": {
"Backslash Code": {
"bold": false
},
"Predefined Variable": {
"bold": false,
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
}
},
"Ruby": {
"Access Control": {
"bold": false,
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Default globals": {
"bold": false
},
"Definition": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Global Constant": {
"bold": false,
"italic": true,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Kernel methods": {
"bold": false,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Message": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Module mixin methods": {
"bold": false
},
"Pseudo variable": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
}
},
"Rust": {
"Attribute": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"CConstant": {
"bold": false
},
"CType": {
"italic": true,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Constant": {
"bold": false
},
"Definition": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Lifetime": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"Macro": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Scope": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Self": {
"italic": true,
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Trait": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
}
},
"SPDX-Comments": {
"SPDX Deprecated License": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"SPDX Deprecated License Exception": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"SPDX License": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"SPDX License Exception": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"SPDX Tag": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
},
"SPDX Value": {
"selected-text-color": "#d465a7",
"text-color": "#d465a7"
}
},
"TypeScript": {
"Built-in Objects": {
"italic": true
},
"Function (Built-in)": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
},
"Object Member": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
}
},
"TypeScript React (TSX)": {
"Attribute": {
"italic": true
},
"Component Tag": {
"bold": false,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
}
},
"YAML": {
"Attribute": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Key": {
"bold": false,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"List": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
}
}
},
"editor-colors": { "editor-colors": {
"BackgroundColor": "#282a36", "BackgroundColor": "#282a36",
"BracketMatching": "#55007f", "BracketMatching": "#7c62a5",
"CodeFolding": "#8be9fd", "CodeFolding": "#44475a",
"CurrentLine": "#282a36", "CurrentLine": "#44475a",
"CurrentLineNumber": "#f8f8f2", "CurrentLineNumber": "#f8f8f2",
"IconBorder": "#282a36", "IconBorder": "#282a36",
"IndentationLine": "#6272a4", "IndentationLine": "#6272a4",
"LineNumbers": "#909194", "LineNumbers": "#6272a4",
"MarkBookmark": "#8be9fd", "MarkBookmark": "#8be9fd",
"MarkBreakpointActive": "#ff5555", "MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9", "MarkBreakpointDisabled": "#bd93f9",
@@ -16,10 +550,10 @@
"MarkExecution": "#44475a", "MarkExecution": "#44475a",
"MarkWarning": "#ffb86c", "MarkWarning": "#ffb86c",
"ModifiedLines": "#ff79c6", "ModifiedLines": "#ff79c6",
"ReplaceHighlight": "#50fa7b", "ReplaceHighlight": "#2c8843",
"SavedLines": "#50fa7b", "SavedLines": "#50fa7b",
"SearchHighlight": "#b39800", "SearchHighlight": "#566591",
"Separator": "#909194", "Separator": "#45474e",
"SpellChecking": "#ff5555", "SpellChecking": "#ff5555",
"TabMarker": "#6272a4", "TabMarker": "#6272a4",
"TemplateBackground": "#282a36", "TemplateBackground": "#282a36",
@@ -36,7 +570,7 @@
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"name": "Dracula", "name": "Dracula",
"revision": 1 "revision": 7
}, },
"text-styles": { "text-styles": {
"Alert": { "Alert": {
@@ -49,20 +583,20 @@
"text-color": "#ff79c6" "text-color": "#ff79c6"
}, },
"Attribute": { "Attribute": {
"selected-text-color": "#8be9fd", "selected-text-color": "#ff79c6",
"text-color": "#8be9fd" "text-color": "#ff79c6"
}, },
"BaseN": { "BaseN": {
"selected-text-color": "#ffb86c", "selected-text-color": "#bd93f9",
"text-color": "#ffb86c" "text-color": "#bd93f9"
}, },
"BuiltIn": { "BuiltIn": {
"selected-text-color": "#8be9fd", "selected-text-color": "#8be9fd",
"text-color": "#8be9fd" "text-color": "#8be9fd"
}, },
"Char": { "Char": {
"selected-text-color": "#ff79c6", "selected-text-color": "#f1fa8c",
"text-color": "#ff79c6" "text-color": "#f1fa8c"
}, },
"Comment": { "Comment": {
"selected-text-color": "#6272a4", "selected-text-color": "#6272a4",
@@ -78,17 +612,17 @@
"text-color": "#bd93f9" "text-color": "#bd93f9"
}, },
"ControlFlow": { "ControlFlow": {
"bold": true, "selected-text-color": "#ff79c6",
"selected-text-color": "#ffb86c", "text-color": "#ff79c6"
"text-color": "#ffb86c"
}, },
"DataType": { "DataType": {
"italic": true,
"selected-text-color": "#8be9fd", "selected-text-color": "#8be9fd",
"text-color": "#8be9fd" "text-color": "#8be9fd"
}, },
"DecVal": { "DecVal": {
"selected-text-color": "#ffb86c", "selected-text-color": "#bd93f9",
"text-color": "#ffb86c" "text-color": "#bd93f9"
}, },
"Documentation": { "Documentation": {
"selected-text-color": "#ffb86c", "selected-text-color": "#ffb86c",
@@ -100,13 +634,12 @@
"underline": true "underline": true
}, },
"Extension": { "Extension": {
"bold": true, "selected-text-color": "#8be9fd",
"selected-text-color": "#0095ff", "text-color": "#8be9fd"
"text-color": "#0095ff"
}, },
"Float": { "Float": {
"selected-text-color": "#ffb86c", "selected-text-color": "#bd93f9",
"text-color": "#ffb86c" "text-color": "#bd93f9"
}, },
"Function": { "Function": {
"selected-text-color": "#50fa7b", "selected-text-color": "#50fa7b",
@@ -117,11 +650,10 @@
"text-color": "#ff79c6" "text-color": "#ff79c6"
}, },
"Information": { "Information": {
"selected-text-color": "#f67400", "selected-text-color": "#f1fa8c",
"text-color": "#f67400" "text-color": "#f1fa8c"
}, },
"Keyword": { "Keyword": {
"bold": true,
"selected-text-color": "#ff79c6", "selected-text-color": "#ff79c6",
"text-color": "#ff79c6" "text-color": "#ff79c6"
}, },
@@ -138,8 +670,8 @@
"text-color": "#50fa7b" "text-color": "#50fa7b"
}, },
"Preprocessor": { "Preprocessor": {
"selected-text-color": "#50fa7b", "selected-text-color": "#ff79c6",
"text-color": "#50fa7b" "text-color": "#ff79c6"
}, },
"RegionMarker": { "RegionMarker": {
"selected-text-color": "#8be9fd", "selected-text-color": "#8be9fd",

View File

@@ -0,0 +1,216 @@
{
"custom-styles": {
"INI Files": {
"Section": {
"selected-text-color": "#b392f0",
"text-color": "#b392f0"
}
},
"Python": {
"Builtin Function": {
"selected-text-color": "#b392f0",
"text-color": "#b392f0"
},
"Import": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"Special Variable": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
}
},
"Rust": {
"Attribute": {
"selected-text-color": "#e1e4e8",
"text-color": "#e1e4e8"
},
"Macro": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"Self": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"Trait": {
"selected-text-color": "#e1e4e8",
"text-color": "#e1e4e8"
}
},
"XML": {
"Element": {
"selected-text-color": "#85e89d",
"text-color": "#85e89d"
}
}
},
"editor-colors": {
"BackgroundColor": "#24292e",
"BracketMatching": "#65676a",
"CodeFolding": "#253749",
"CurrentLine": "#2b3036",
"CurrentLineNumber": "#e1e4e8",
"IconBorder": "#24292e",
"IndentationLine": "#d7dbe0",
"LineNumbers": "#444d56",
"MarkBookmark": "#8be9fd",
"MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9",
"MarkBreakpointReached": "#f1fa8c",
"MarkError": "#b31d28",
"MarkExecution": "#44475a",
"MarkWarning": "#ffab70",
"ModifiedLines": "#f97583",
"ReplaceHighlight": "#40c661",
"SavedLines": "#28a745",
"SearchHighlight": "#404030",
"Separator": "#1b1f23",
"SpellChecking": "#ff5555",
"TabMarker": "#444d56",
"TemplateBackground": "#23241e",
"TemplateFocusedPlaceholder": "#22231d",
"TemplatePlaceholder": "#22231d",
"TemplateReadOnlyPlaceholder": "#262721",
"TextSelection": "#253749",
"WordWrapMarker": "#2f3031"
},
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2020 GitHub Inc.",
"SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
],
"license": "SPDX-License-Identifier: MIT",
"name": "GitHub Dark",
"revision": 2
},
"text-styles": {
"Alert": {
"bold": true,
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
},
"Annotation": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Attribute": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"BaseN": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"BuiltIn": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"Char": {
"selected-text-color": "#9ecbff",
"text-color": "#9ecbff"
},
"Comment": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"CommentVar": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Constant": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"ControlFlow": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"DataType": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"DecVal": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"Documentation": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Error": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"Float": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"Function": {
"selected-text-color": "#b392f0",
"text-color": "#b392f0"
},
"Import": {
"selected-text-color": "#9ecbff",
"text-color": "#9ecbff"
},
"Information": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Keyword": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"Normal": {
"selected-text-color": "#e1e4e8",
"text-color": "#e1e4e8"
},
"Operator": {
"selected-text-color": "#e1e4e8",
"text-color": "#e1e4e8"
},
"Others": {
"selected-text-color": "#b392f0",
"text-color": "#b392f0"
},
"Preprocessor": {
"selected-text-color": "#f97583",
"text-color": "#f97583"
},
"RegionMarker": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"SpecialChar": {
"selected-text-color": "#79b8ff",
"text-color": "#79b8ff"
},
"SpecialString": {
"selected-text-color": "#9ecbff",
"text-color": "#9ecbff"
},
"String": {
"selected-text-color": "#9ecbff",
"text-color": "#9ecbff"
},
"Variable": {
"selected-text-color": "#ffab70",
"text-color": "#ffab70"
},
"VerbatimString": {
"selected-text-color": "#9ecbff",
"text-color": "#9ecbff"
},
"Warning": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
}
}
}

View File

@@ -0,0 +1,216 @@
{
"custom-styles": {
"INI Files": {
"Section": {
"selected-text-color": "#6f42c1",
"text-color": "#6f42c1"
}
},
"Python": {
"Builtin Function": {
"selected-text-color": "#6f42c1",
"text-color": "#6f42c1"
},
"Import": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"Special Variable": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
}
},
"Rust": {
"Attribute": {
"selected-text-color": "#24292e",
"text-color": "#24292e"
},
"Macro": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"Self": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"Trait": {
"selected-text-color": "#24292e",
"text-color": "#24292e"
}
},
"XML": {
"Element": {
"selected-text-color": "#22863a",
"text-color": "#22863a"
}
}
},
"editor-colors": {
"BackgroundColor": "#ffffff",
"BracketMatching": "#bef5cb",
"CodeFolding": "#f6f8fa",
"CurrentLine": "#f6f8fa",
"CurrentLineNumber": "#24292e",
"IconBorder": "#ffffff",
"IndentationLine": "#d7dbe0",
"LineNumbers": "#c7c2bc",
"MarkBookmark": "#8be9fd",
"MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9",
"MarkBreakpointReached": "#f1fa8c",
"MarkError": "#b31d28",
"MarkExecution": "#44475a",
"MarkWarning": "#e36209",
"ModifiedLines": "#d73a49",
"ReplaceHighlight": "#50fa7b",
"SavedLines": "#28a745",
"SearchHighlight": "#ffea7f",
"Separator": "#e1e4e8",
"SpellChecking": "#ff5555",
"TabMarker": "#d1d5da",
"TemplateBackground": "#23241e",
"TemplateFocusedPlaceholder": "#22231d",
"TemplatePlaceholder": "#22231d",
"TemplateReadOnlyPlaceholder": "#262721",
"TextSelection": "#dee6fc",
"WordWrapMarker": "#e1e4e8"
},
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2020 GitHub Inc.",
"SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
],
"license": "SPDX-License-Identifier: MIT",
"name": "GitHub Light",
"revision": 2
},
"text-styles": {
"Alert": {
"bold": true,
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
},
"Annotation": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Attribute": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"BaseN": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"BuiltIn": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"Char": {
"selected-text-color": "#032f62",
"text-color": "#032f62"
},
"Comment": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"CommentVar": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Constant": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"ControlFlow": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"DataType": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"DecVal": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"Documentation": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Error": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"Float": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"Function": {
"selected-text-color": "#6f42c1",
"text-color": "#6f42c1"
},
"Import": {
"selected-text-color": "#032f62",
"text-color": "#032f62"
},
"Information": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"Keyword": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"Normal": {
"selected-text-color": "#24292e",
"text-color": "#24292e"
},
"Operator": {
"selected-text-color": "#24292e",
"text-color": "#24292e"
},
"Others": {
"selected-text-color": "#6f42c1",
"text-color": "#6f42c1"
},
"Preprocessor": {
"selected-text-color": "#d73a49",
"text-color": "#d73a49"
},
"RegionMarker": {
"selected-text-color": "#6a737d",
"text-color": "#6a737d"
},
"SpecialChar": {
"selected-text-color": "#005cc5",
"text-color": "#005cc5"
},
"SpecialString": {
"selected-text-color": "#032f62",
"text-color": "#032f62"
},
"String": {
"selected-text-color": "#032f62",
"text-color": "#032f62"
},
"Variable": {
"selected-text-color": "#e36209",
"text-color": "#e36209"
},
"VerbatimString": {
"selected-text-color": "#032f62",
"text-color": "#032f62"
},
"Warning": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
}
}
}

View File

@@ -0,0 +1,394 @@
{
"custom-styles": {
"C": {
"Prep. Lib": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
}
},
"C++": {
"Qt Classes": {
"bold": false,
"selected-text-color": "#66d9ef",
"text-color": "#66d9ef"
},
"Qt Macros": {
"bold": false,
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Qt Types": {
"bold": false,
"selected-text-color": "#66D9EF",
"text-color": "#66D9EF"
}
},
"CMake": {
"Builtin Variable": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"False Special Arg": {
"selected-text-color": "#e03232",
"text-color": "#e03232"
},
"True Special Arg": {
"selected-text-color": "#38bd38",
"text-color": "#38bd38"
}
},
"Doxygen": {
"Tags": {
"bold": false,
"selected-text-color": "#52afbf",
"text-color": "#52afbf"
},
"Word": {
"bold": false,
"selected-text-color": "#7ba822",
"text-color": "#7ba822",
"underline": true
}
},
"Diff": {
"Added line": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Changed line (new)": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Changed line (old)": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Removed line": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"Go": {
"Builtin Function": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Predeclared Identifier": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
}
},
"ISO C++": {
"Attribute": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Boost Stuff": {
"bold": false
},
"Prep. Lib": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
},
"Standard Attribute": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Standard Macros": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Standard Suffix": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"UDL Numeric Suffix": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"UDL String Suffix": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"JSON": {
"Style_String_Key": {
"italic": false,
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"JavaScript": {
"Object Member": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Substitution": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"JavaScript React (JSX)": {
"Component Tag": {
"bold": false,
"selected-text-color": "#66d9ef",
"text-color": "#66d9ef"
}
},
"Makefile": {
"FuncParam": {
"selected-text-color": "#fd971f",
"text-color": "#fd971f"
},
"Target": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Variable": {
"italic": false,
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
}
},
"Markdown": {
"Emphasis Text": {
"selected-text-color": "#66D9EF",
"text-color": "#66D9EF"
},
"Reference-Link ID": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"Reference-Link Name": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"Reference-Link Target": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"Strong Text": {
"selected-text-color": "#66d9ef",
"text-color": "#66d9ef"
}
},
"Python": {
"Import": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"Rust": {
"Definition": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Lifetime": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Macro": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Self": {
"selected-text-color": "#fd971f",
"text-color": "#fd971f"
}
},
"TypeScript": {
"Function (Built-in)": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Object Member": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Substitution": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
},
"TypeScript React (TSX)": {
"Component Tag": {
"bold": false,
"selected-text-color": "#66d9ef",
"text-color": "#66d9ef"
},
"Substitution": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
}
}
},
"editor-colors": {
"BackgroundColor": "#272822",
"BracketMatching": "#5b5a4a",
"CodeFolding": "#3a3b32",
"CurrentLine": "#3e3d32",
"CurrentLineNumber": "#d1d931",
"IconBorder": "#272822",
"IndentationLine": "#6272a4",
"LineNumbers": "#909194",
"MarkBookmark": "#66D9EF",
"MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9",
"MarkBreakpointReached": "#f1fa8c",
"MarkError": "#ff5555",
"MarkExecution": "#44475a",
"MarkWarning": "#ffb86c",
"ModifiedLines": "#ff473d",
"ReplaceHighlight": "#735d16",
"SavedLines": "#20e852",
"SearchHighlight": "#245676",
"Separator": "#45474e",
"SpellChecking": "#ff5555",
"TabMarker": "#6272a4",
"TemplateBackground": "#23241e",
"TemplateFocusedPlaceholder": "#22231d",
"TemplatePlaceholder": "#22231d",
"TemplateReadOnlyPlaceholder": "#262721",
"TextSelection": "#3f413e",
"WordWrapMarker": "#282a36"
},
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2006 Wimer Hazenberg",
"SPDX-FileCopyrightText: 2020 Waqar Ahmed <waqar.17a@gmail.com>"
],
"license": "SPDX-License-Identifier: MIT",
"name": "Monokai",
"revision": 5
},
"text-styles": {
"Alert": {
"bold": true,
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
},
"Annotation": {
"selected-text-color": "#75715e",
"text-color": "#75715e"
},
"Attribute": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"BaseN": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"BuiltIn": {
"selected-text-color": "#66D9EF",
"text-color": "#66D9EF"
},
"Char": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
},
"Comment": {
"selected-text-color": "#75715e",
"text-color": "#75715e"
},
"CommentVar": {
"selected-text-color": "#75715e",
"text-color": "#75715e"
},
"Constant": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"ControlFlow": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"DataType": {
"italic": true,
"selected-text-color": "#66d9ef",
"text-color": "#66d9ef"
},
"DecVal": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"Documentation": {
"selected-text-color": "#75715e",
"text-color": "#75715e"
},
"Error": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Float": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"Function": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Import": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Information": {
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Keyword": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"Normal": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Operator": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"Others": {
"selected-text-color": "#a6e22e",
"text-color": "#a6e22e"
},
"Preprocessor": {
"selected-text-color": "#f92672",
"text-color": "#f92672"
},
"RegionMarker": {
"selected-text-color": "#75715e",
"text-color": "#75715e"
},
"SpecialChar": {
"selected-text-color": "#ae81ff",
"text-color": "#ae81ff"
},
"SpecialString": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
},
"String": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
},
"Variable": {
"selected-text-color": "#f8f8f2",
"text-color": "#f8f8f2"
},
"VerbatimString": {
"selected-text-color": "#e6db74",
"text-color": "#e6db74"
},
"Warning": {
"selected-text-color": "#ff5555",
"text-color": "#ff5555"
}
}
}

View File

@@ -0,0 +1,179 @@
{
"_comments": [
"This theme has been adapted from the GtkSourceView Oblivion theme"
],
"metadata": {
"copyright": [
"SPDX-FileCopyrightText: 2007 Paolo Borelli <pborelli@gnome.org>, GtkSourceView team",
"SPDX-FileCopyrightText: 2020 Alexander Schlarb <alexander@ninetailed.ninja>"
],
"name": "Oblivion",
"revision": 2,
"license": "SPDX-License-Identifier: MIT"
},
"text-styles": {
"Alert": {
"background-color": "#451e1a",
"bold": true,
"selected-text-color": "#e85848",
"text-color": "#e85848"
},
"Annotation": {
"selected-text-color": "#ad7fa8",
"text-color": "#ad7fa8"
},
"Attribute": {
"selected-text-color": "#ad7fa8",
"text-color": "#ad7fa8"
},
"BaseN": {
"selected-text-color": "#fce94f",
"text-color": "#edd400"
},
"BuiltIn": {
"selected-text-color": "#729fcf",
"text-color": "#729fcf"
},
"Char": {
"selected-text-color": "#fcaf3e",
"text-color": "#ce5c00"
},
"Comment": {
"selected-text-color": "#8ae234",
"text-color": "#30a100"
},
"CommentVar": {
"selected-text-color": "#ad7fa8",
"text-color": "#ad7fa8"
},
"Constant": {
"bold": true,
"selected-text-color": "#ffffff",
"text-color": "#edd400"
},
"ControlFlow": {
"bold": true,
"selected-text-color": "#ffffff",
"text-color": "#ffffff"
},
"DataType": {
"selected-text-color": "#508ed8",
"text-color": "#508ed8"
},
"DecVal": {
"selected-text-color": "#fce94f",
"text-color": "#edd400"
},
"Documentation": {
"selected-text-color": "#8ae234",
"text-color": "#4e9a06"
},
"Error": {
"selected-text-color": "#e85848",
"text-color": "#e85848",
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#508ed8",
"text-color": "#508ed8"
},
"Float": {
"selected-text-color": "#fcaf3e",
"text-color": "#ce5c00"
},
"Function": {
"bold": true,
"selected-text-color": "#729fcf",
"text-color": "#729fcf"
},
"Import": {
"selected-text-color": "#ad7fa8",
"text-color": "#ad7fa8"
},
"Information": {
"selected-text-color": "#c0a25f",
"text-color": "#c0a25f"
},
"Keyword": {
"bold": true,
"selected-text-color": "#ffffff",
"text-color": "#ffffff"
},
"Normal": {
"selected-text-color": "#eeeeec",
"text-color": "#d3d7c1"
},
"Operator": {
"selected-text-color": "#eeeeec",
"text-color": "#eeeeec"
},
"Others": {
"selected-text-color": "#fce94f",
"text-color": "#edd400"
},
"Preprocessor": {
"selected-text-color": "#ad7fa8",
"text-color": "#ad7fa8"
},
"RegionMarker": {
"background-color": "#1c2c3f",
"selected-text-color": "#508ed8",
"text-color": "#508ed8"
},
"SpecialChar": {
"selected-text-color": "#fcaf3e",
"text-color": "#ce5c00"
},
"SpecialString": {
"selected-text-color": "#fce94f",
"text-color": "#fce94f"
},
"String": {
"selected-text-color": "#fce94f",
"text-color": "#edd400"
},
"Variable": {
"selected-text-color": "#ce5c00",
"text-color": "#ce5c00"
},
"VerbatimString": {
"selected-text-color": "#fce94f",
"text-color": "#c4a000"
},
"Warning": {
"selected-text-color": "#e85848",
"text-color": "#e85848"
}
},
"editor-colors": {
"BackgroundColor": "#201f1f",
"BracketMatching": "#8f5902",
"CodeFolding": "#19395f",
"CurrentLine": "#2e3436",
"CurrentLineNumber": "#ffffff",
"IconBorder": "#302f2f",
"IndentationLine": "#989595",
"LineNumbers": "#e0dedb",
"MarkBookmark": "#0000cc",
"MarkBreakpointActive": "#cc0000",
"MarkBreakpointDisabled": "#cc00cc",
"MarkBreakpointReached": "#00cc00",
"MarkError": "#cc0000",
"MarkExecution": "#888a85",
"MarkWarning": "#ad7fa8",
"ModifiedLines": "#451e1a",
"ReplaceHighlight": "#356703",
"SavedLines": "#23321a",
"SearchHighlight": "#4e9a06",
"Separator": "#787775",
"SpellChecking": "#e85848",
"TabMarker": "#555753",
"TemplateBackground": "#302f2f",
"TemplateFocusedPlaceholder": "#23321a",
"TemplatePlaceholder": "#23321a",
"TemplateReadOnlyPlaceholder": "#451e1a",
"TextSelection": "#184880",
"WordWrapMarker": "#3c3a3a"
}
}

View File

@@ -9,7 +9,7 @@
"SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>" "SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>"
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"revision" : 2, "revision" : 5,
"name" : "Solarized Dark" "name" : "Solarized Dark"
}, },
"text-styles": { "text-styles": {
@@ -23,8 +23,7 @@
}, },
"Keyword" : { "Keyword" : {
"text-color" : "#859900", "text-color" : "#859900",
"selected-text-color" : "#859900", "selected-text-color" : "#859900"
"bold" : true
}, },
"Function" : { "Function" : {
"text-color" : "#268bd2", "text-color" : "#268bd2",
@@ -36,8 +35,7 @@
}, },
"ControlFlow" : { "ControlFlow" : {
"text-color" : "#859900", "text-color" : "#859900",
"selected-text-color" : "#859900", "selected-text-color" : "#859900"
"bold" : true
}, },
"Operator" : { "Operator" : {
"text-color" : "#859900", "text-color" : "#859900",
@@ -49,8 +47,7 @@
}, },
"Extension" : { "Extension" : {
"text-color" : "#268bd2", "text-color" : "#268bd2",
"selected-text-color" : "#268bd2", "selected-text-color" : "#268bd2"
"bold" : true
}, },
"Preprocessor" : { "Preprocessor" : {
"text-color" : "#cb4b16", "text-color" : "#cb4b16",
@@ -86,8 +83,7 @@
}, },
"DataType" : { "DataType" : {
"text-color" : "#b58900", "text-color" : "#b58900",
"selected-text-color" : "#b58900", "selected-text-color" : "#b58900"
"bold" : true
}, },
"DecVal" : { "DecVal" : {
"text-color" : "#2aa198", "text-color" : "#2aa198",
@@ -153,13 +149,13 @@
}, },
"editor-colors": { "editor-colors": {
"BackgroundColor" : "#002b36", "BackgroundColor" : "#002b36",
"CodeFolding" : "#6c71c4", "CodeFolding": "#083d4a",
"BracketMatching" : "#073642", "BracketMatching" : "#083d4a",
"CurrentLine" : "#073642", "CurrentLine" : "#073642",
"IconBorder" : "#073642", "IconBorder" : "#073642",
"IndentationLine" : "#073642", "IndentationLine" : "#083d4a",
"LineNumbers" : "#586e75", "LineNumbers" : "#586e75",
"CurrentLineNumber" : "#586e75", "CurrentLineNumber": "#93a1a1",
"MarkBookmark" : "#268bd2", "MarkBookmark" : "#268bd2",
"MarkBreakpointActive" : "#dc322f", "MarkBreakpointActive" : "#dc322f",
"MarkBreakpointReached" : "#b58900", "MarkBreakpointReached" : "#b58900",
@@ -168,11 +164,11 @@
"MarkWarning" : "#cb4b16", "MarkWarning" : "#cb4b16",
"MarkError" : "#dc322f", "MarkError" : "#dc322f",
"ModifiedLines" : "#cb4b16", "ModifiedLines" : "#cb4b16",
"ReplaceHighlight" : "#859900", "ReplaceHighlight": "#3c4300",
"SavedLines" : "#2aa198", "SavedLines" : "#2aa198",
"SearchHighlight" : "#b58900", "SearchHighlight": "#0a4d5e",
"TextSelection" : "#eee8d5", "TextSelection": "#083d4a",
"Separator" : "#002b36", "Separator" : "#1c3e49",
"SpellChecking" : "#dc322f", "SpellChecking" : "#dc322f",
"TabMarker" : "#586e75", "TabMarker" : "#586e75",
"TemplateBackground" : "#073642", "TemplateBackground" : "#073642",
@@ -180,5 +176,17 @@
"TemplateFocusedPlaceholder" : "#073642", "TemplateFocusedPlaceholder" : "#073642",
"TemplateReadOnlyPlaceholder" : "#073642", "TemplateReadOnlyPlaceholder" : "#073642",
"WordWrapMarker" : "#586e75" "WordWrapMarker" : "#586e75"
},
"custom-styles": {
"XML": {
"Element": {
"selected-text-color": "#839496",
"text-color": "#268bd2"
},
"Element Symbols": {
"selected-text-color": "#586e75",
"text-color": "#657b83"
}
}
} }
} }

View File

@@ -9,7 +9,7 @@
"SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>" "SPDX-FileCopyrightText: 2018 Andrew Crouthamel <andrew.crouthamel@kdemail.net>"
], ],
"license": "SPDX-License-Identifier: MIT", "license": "SPDX-License-Identifier: MIT",
"revision" : 2, "revision" : 4,
"name" : "Solarized Light" "name" : "Solarized Light"
}, },
"text-styles": { "text-styles": {
@@ -172,7 +172,7 @@
"SavedLines" : "#2aa198", "SavedLines" : "#2aa198",
"SearchHighlight" : "#b58900", "SearchHighlight" : "#b58900",
"TextSelection" : "#073642", "TextSelection" : "#073642",
"Separator" : "#fdf6e3", "Separator" : "#e0dccc",
"SpellChecking" : "#dc322f", "SpellChecking" : "#dc322f",
"TabMarker" : "#93a1a1", "TabMarker" : "#93a1a1",
"TemplateBackground" : "#eee8d5", "TemplateBackground" : "#eee8d5",
@@ -180,5 +180,17 @@
"TemplateFocusedPlaceholder" : "#eee8d5", "TemplateFocusedPlaceholder" : "#eee8d5",
"TemplateReadOnlyPlaceholder" : "#eee8d5", "TemplateReadOnlyPlaceholder" : "#eee8d5",
"WordWrapMarker" : "#93a1a1" "WordWrapMarker" : "#93a1a1"
},
"custom-styles": {
"XML": {
"Element": {
"selected-text-color": "#268bd2",
"text-color": "#268bd2"
},
"Element Symbols": {
"selected-text-color": "#93a1a1",
"text-color": "#839496"
}
}
} }
} }

View File

@@ -1,15 +1,21 @@
<!DOCTYPE RCC> <!DOCTYPE RCC>
<RCC version="1.0"> <RCC version="1.0">
<qresource prefix="/org.kde.syntax-highlighting/themes"> <qresource prefix="/org.kde.syntax-highlighting/themes">
<file>atom-one-dark.theme</file>
<file>atom-one-light.theme</file>
<file>breeze-dark.theme</file> <file>breeze-dark.theme</file>
<file>breeze-light.theme</file> <file>breeze-light.theme</file>
<file>ayu-dark.theme</file> <file>ayu-dark.theme</file>
<file>ayu-light.theme</file> <file>ayu-light.theme</file>
<file>ayu-mirage.theme</file> <file>ayu-mirage.theme</file>
<file>dracula.theme</file> <file>dracula.theme</file>
<file>github-dark.theme</file>
<file>github-light.theme</file>
<file>gruvbox-dark.theme</file> <file>gruvbox-dark.theme</file>
<file>gruvbox-light.theme</file> <file>gruvbox-light.theme</file>
<file>monokai.theme</file>
<file>nord.theme</file> <file>nord.theme</file>
<file>oblivion.theme</file>
<file>printing.theme</file> <file>printing.theme</file>
<file>radical.theme</file> <file>radical.theme</file>
<file>solarized-dark.theme</file> <file>solarized-dark.theme</file>

View File

@@ -2,4 +2,4 @@ add_executable(kate-syntax-highlighter kate-syntax-highlighter.cpp)
ecm_mark_nongui_executable(kate-syntax-highlighter) ecm_mark_nongui_executable(kate-syntax-highlighter)
target_link_libraries(kate-syntax-highlighter KF5SyntaxHighlighting) target_link_libraries(kate-syntax-highlighter KF5SyntaxHighlighting)
install(TARGETS kate-syntax-highlighter ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS kate-syntax-highlighter ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

View File

@@ -6,10 +6,10 @@
#include "ksyntaxhighlighting_version.h" #include "ksyntaxhighlighting_version.h"
#include <ansihighlighter.h>
#include <definition.h> #include <definition.h>
#include <definitiondownloader.h> #include <definitiondownloader.h>
#include <htmlhighlighter.h> #include <htmlhighlighter.h>
#include <ansihighlighter.h>
#include <repository.h> #include <repository.h>
#include <theme.h> #include <theme.h>
@@ -21,8 +21,14 @@
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
template<class Highlighter, class ...Ts> template<class Highlighter, class... Ts>
static void applyHighlighter(Highlighter &highlighter, QCommandLineParser &parser, bool fromFileName, const QString &inFileName, const QCommandLineOption &stdinOption, const QCommandLineOption &outputName, const Ts &...highlightParams) 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)) if (parser.isSet(outputName))
highlighter.setOutputFile(parser.value(outputName)); highlighter.setOutputFile(parser.value(outputName));
@@ -56,16 +62,19 @@ int main(int argc, char **argv)
parser.addVersionOption(); parser.addVersionOption();
parser.addPositionalArgument(app.translate("SyntaxHighlightingCLI", "source"), app.translate("SyntaxHighlightingCLI", "The source file to highlight.")); parser.addPositionalArgument(app.translate("SyntaxHighlightingCLI", "source"), app.translate("SyntaxHighlightingCLI", "The source file to highlight."));
QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"), app.translate("SyntaxHighlightingCLI", "List all available syntax definitions.")); QCommandLineOption listDefs(QStringList() << QStringLiteral("l") << QStringLiteral("list"),
app.translate("SyntaxHighlightingCLI", "List all available syntax definitions."));
parser.addOption(listDefs); parser.addOption(listDefs);
QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), app.translate("SyntaxHighlightingCLI", "List all available themes.")); QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), app.translate("SyntaxHighlightingCLI", "List all available themes."));
parser.addOption(listThemes); parser.addOption(listThemes);
QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"), app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions.")); QCommandLineOption updateDefs(QStringList() << QStringLiteral("u") << QStringLiteral("update"),
app.translate("SyntaxHighlightingCLI", "Download new/updated syntax definitions."));
parser.addOption(updateDefs); parser.addOption(updateDefs);
QCommandLineOption outputName( QCommandLineOption outputName(QStringList() << QStringLiteral("o") << QStringLiteral("output"),
QStringList() << QStringLiteral("o") << QStringLiteral("output"), app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."), app.translate("SyntaxHighlightingCLI", "output")); app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."),
app.translate("SyntaxHighlightingCLI", "output"));
parser.addOption(outputName); parser.addOption(outputName);
QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"), QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"),
@@ -73,18 +82,23 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "syntax")); app.translate("SyntaxHighlightingCLI", "syntax"));
parser.addOption(syntaxName); parser.addOption(syntaxName);
QCommandLineOption themeName( QCommandLineOption themeName(QStringList() << QStringLiteral("t") << QStringLiteral("theme"),
QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), repo.defaultTheme(Repository::LightTheme).name()); app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."),
app.translate("SyntaxHighlightingCLI", "theme"),
repo.defaultTheme(Repository::LightTheme).name());
parser.addOption(themeName); parser.addOption(themeName);
QCommandLineOption outputFormatOption(QStringList() << QStringLiteral("f") << QStringLiteral("output-format"), 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", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."),
app.translate("SyntaxHighlightingCLI", "format"), app.translate("SyntaxHighlightingCLI", "format"),
QStringLiteral("html")); QStringLiteral("html"));
parser.addOption(outputFormatOption); parser.addOption(outputFormatOption);
QCommandLineOption traceOption(QStringList() << QStringLiteral("syntax-trace"), 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",
"Add information to debug a syntax file. Only works with --output-format=ansi or ansi256Colors. Possible "
"values are format, region, context and stackSize."),
app.translate("SyntaxHighlightingCLI", "type")); app.translate("SyntaxHighlightingCLI", "type"));
parser.addOption(traceOption); parser.addOption(traceOption);
@@ -92,12 +106,14 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "Disable ANSI background for the default color.")); app.translate("SyntaxHighlightingCLI", "Disable ANSI background for the default color."));
parser.addOption(noAnsiEditorBg); parser.addOption(noAnsiEditorBg);
QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"), 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", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."),
app.translate("SyntaxHighlightingCLI", "title")); app.translate("SyntaxHighlightingCLI", "title"));
parser.addOption(titleOption); parser.addOption(titleOption);
QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"), app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used.")); QCommandLineOption stdinOption(QStringList() << QStringLiteral("stdin"),
app.translate("SyntaxHighlightingCLI", "Read file from stdin. The -s option must also be used."));
parser.addOption(stdinOption); parser.addOption(stdinOption);
parser.process(app); parser.process(app);
@@ -117,7 +133,9 @@ int main(int argc, char **argv)
if (parser.isSet(updateDefs)) { if (parser.isSet(updateDefs)) {
DefinitionDownloader downloader(&repo); DefinitionDownloader downloader(&repo);
QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) { std::cout << qPrintable(msg) << std::endl; }); QObject::connect(&downloader, &DefinitionDownloader::informationMessage, [](const QString &msg) {
std::cout << qPrintable(msg) << std::endl;
});
QObject::connect(&downloader, &DefinitionDownloader::done, &app, &QCoreApplication::quit); QObject::connect(&downloader, &DefinitionDownloader::done, &app, &QCoreApplication::quit);
downloader.start(); downloader.start();
return app.exec(); return app.exec();
@@ -139,7 +157,7 @@ int main(int argc, char **argv)
def = repo.definitionForMimeType(syntax); def = repo.definitionForMimeType(syntax);
if (!def.isValid()) { if (!def.isValid()) {
/* see if it's a extension instead */ /* see if it's a extension instead */
def = repo.definitionForFileName(QLatin1String("f.")+syntax); def = repo.definitionForFileName(QLatin1String("f.") + syntax);
if (!def.isValid()) if (!def.isValid())
/* see if it's a filename instead */ /* see if it's a filename instead */
def = repo.definitionForFileName(syntax); def = repo.definitionForFileName(syntax);
@@ -178,13 +196,15 @@ int main(int argc, char **argv)
auto debugOptions = AnsiHighlighter::TraceOptions(); auto debugOptions = AnsiHighlighter::TraceOptions();
if (parser.isSet(traceOption)) { if (parser.isSet(traceOption)) {
const auto options = parser.values(traceOption); const auto options = parser.values(traceOption);
for (auto const& option : options) { for (auto const &option : options) {
if (option == QStringLiteral("format")) { if (option == QStringLiteral("format")) {
debugOptions |= AnsiHighlighter::TraceOption::Format; debugOptions |= AnsiHighlighter::TraceOption::Format;
} else if (option == QStringLiteral("region")) { } else if (option == QStringLiteral("region")) {
debugOptions |= AnsiHighlighter::TraceOption::Region; debugOptions |= AnsiHighlighter::TraceOption::Region;
} else if (option == QStringLiteral("context")) { } else if (option == QStringLiteral("context")) {
debugOptions |= AnsiHighlighter::TraceOption::Context; debugOptions |= AnsiHighlighter::TraceOption::Context;
} else if (option == QStringLiteral("stackSize")) {
debugOptions |= AnsiHighlighter::TraceOption::StackSize;
} else { } else {
std::cerr << "Unknown trace name." << std::endl; std::cerr << "Unknown trace name." << std::endl;
return 2; return 2;

View File

@@ -27,7 +27,7 @@ elseif(CMAKE_CROSSCOMPILING)
${CMAKE_CURRENT_BINARY_DIR}/native_katehighlightingindexer-prefix/src/native_katehighlightingindexer-build/bin/katehighlightingindexer) ${CMAKE_CURRENT_BINARY_DIR}/native_katehighlightingindexer-prefix/src/native_katehighlightingindexer-build/bin/katehighlightingindexer)
else() else()
# host build # host build
add_executable(katehighlightingindexer katehighlightingindexer.cpp) add_executable(katehighlightingindexer katehighlightingindexer.cpp ../lib/worddelimiters.cpp)
if(Qt5XmlPatterns_FOUND) if(Qt5XmlPatterns_FOUND)
target_link_libraries(katehighlightingindexer Qt5::XmlPatterns) target_link_libraries(katehighlightingindexer Qt5::XmlPatterns)
else() else()

View File

@@ -55,7 +55,7 @@ ecm_generate_headers(SyntaxHighlighting_HEADERS
REQUIRED_HEADERS SyntaxHighlighting_HEADERS REQUIRED_HEADERS SyntaxHighlighting_HEADERS
) )
install(TARGETS KF5SyntaxHighlighting EXPORT KF5SyntaxHighlightingTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS KF5SyntaxHighlighting EXPORT KF5SyntaxHighlightingTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES install(FILES
${SyntaxHighlighting_HEADERS} ${SyntaxHighlighting_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_export.h ${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_export.h
@@ -66,7 +66,7 @@ if(BUILD_QCH)
KF5SyntaxHighlighting_QCH KF5SyntaxHighlighting_QCH
NAME KSyntaxHighlighting NAME KSyntaxHighlighting
BASE_NAME KF5SyntaxHighlighting BASE_NAME KF5SyntaxHighlighting
VERSION ${KF5_VERSION} VERSION ${KF_VERSION}
ORG_DOMAIN org.kde ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API SOURCES # using only public headers, to cover only public API
${SyntaxHighlighting_HEADERS} ${SyntaxHighlighting_HEADERS}

View File

@@ -128,7 +128,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* see https://phabricator.kde.org/D18509 * see https://phabricator.kde.org/D18509
*/ */
int endlessLoopingCounter = 0; int endlessLoopingCounter = 0;
while (!stateData->topContext()->lineEmptyContext().isStay() || (stateData->topContext()->lineEmptyContext().isStay() && !stateData->topContext()->lineEndContext().isStay())) { while (!stateData->topContext()->lineEmptyContext().isStay()
|| (stateData->topContext()->lineEmptyContext().isStay() && !stateData->topContext()->lineEndContext().isStay())) {
/** /**
* line empty context switches * line empty context switches
*/ */
@@ -143,7 +144,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* line end context switches only when lineEmptyContext is #stay. This avoids * line end context switches only when lineEmptyContext is #stay. This avoids
* skipping empty lines after a line continuation character (see bug 405903) * skipping empty lines after a line continuation character (see bug 405903)
*/ */
} else if (!stateData->topContext()->lineEndContext().isStay() && !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList())) } else if (!stateData->topContext()->lineEndContext().isStay()
&& !d->switchContext(stateData, stateData->topContext()->lineEndContext(), QStringList()))
break; break;
// guard against endless loops // guard against endless loops

View File

@@ -5,36 +5,39 @@
*/ */
#include "ansihighlighter.h" #include "ansihighlighter.h"
#include "context_p.h"
#include "definition.h" #include "definition.h"
#include "definition_p.h"
#include "format.h" #include "format.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "state.h" #include "state.h"
#include "theme.h"
#include "state_p.h" #include "state_p.h"
#include "context_p.h" #include "theme.h"
#include "definition_p.h"
#include <QColor>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QTextStream>
#include <QColor>
#include <QMap> #include <QMap>
#include <QtMath> #include <QTextStream>
#include <vector>
#include <cmath> #include <cmath>
#include <vector>
using namespace KSyntaxHighlighting; using namespace KSyntaxHighlighting;
namespace namespace
{ {
struct CieLab struct CieLab {
{
double l; double l;
double a; double a;
double b; double b;
}; };
#ifndef M_PI
constexpr double M_PI = 3.14159265358979323846;
#endif
// clang-format off
// xterm color reference // xterm color reference
// constexpr Rgb888 xterm256Colors[] { // constexpr Rgb888 xterm256Colors[] {
// {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x80, 0x00}, {0x80, 0x80, 0x00}, // {0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x80, 0x00}, {0x80, 0x80, 0x00},
@@ -377,13 +380,14 @@ namespace
constexpr double illuminant_D65[] { constexpr double illuminant_D65[] {
0.95047, 1.00000, 1.08883, 0.95047, 1.00000, 1.08883,
}; };
// clang-format on
// convert a sRGB (D65) color to CIELAB (D65) // convert a sRGB (D65) color to CIELAB (D65)
CieLab rgbToLab(QRgb rgb) CieLab rgbToLab(QRgb rgb)
{ {
// Perform the inverse gamma companding for a sRGB color // Perform the inverse gamma companding for a sRGB color
// http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html // http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
auto inverseGammaCompanding = [](int c){ auto inverseGammaCompanding = [](int c) {
if (c <= 10) if (c <= 10)
return c / (255.0 * 12.92); return c / (255.0 * 12.92);
else else
@@ -415,28 +419,36 @@ namespace
500.0 * (f_x - f_y), 500.0 * (f_x - f_y),
200.0 * (f_y - f_z), 200.0 * (f_y - f_z),
}; };
} }
constexpr double epsilon = 1e-15;
constexpr double epsilon = 1e-15; inline double sinDegree(double x)
{
return std::sin(x * M_PI / 180.0);
}
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 cosDegree(double x) { return std::cos(x * M_PI / 180.0); } inline double pow2(double x)
{
return x * x;
}
inline double pow2(double x) { return x * x; } inline double computeHPrime(double a_prime, double b)
{
inline double computeHPrime(double a_prime, double b)
{
if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon) if (std::abs(a_prime) < epsilon && std::abs(b) < epsilon)
return 0.0; return 0.0;
const double value = std::atan2(b, a_prime) * 180.0 / M_PI; const double value = std::atan2(b, a_prime) * 180.0 / M_PI;
return (value < 0.0) ? value + 360.0 : value; return (value < 0.0) ? value + 360.0 : value;
} }
inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime) inline double computeDeltaHPrime(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
{ {
if (C1_prime * C2_prime < epsilon) if (C1_prime * C2_prime < epsilon)
return 0.0; return 0.0;
@@ -448,10 +460,10 @@ namespace
return diff - 360.0; return diff - 360.0;
else else
return diff + 360.0; return diff + 360.0;
} }
inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime, double h2_prime) inline double computeHPrimeBar(double C1_prime, double C2_prime, double h1_prime, double h2_prime)
{ {
const double sum = h1_prime + h2_prime; const double sum = h1_prime + h2_prime;
if (C1_prime * C2_prime < epsilon) if (C1_prime * C2_prime < epsilon)
@@ -465,13 +477,13 @@ namespace
return 0.5 * (sum + 360.0); return 0.5 * (sum + 360.0);
else else
return 0.5 * (sum - 360.0); return 0.5 * (sum - 360.0);
} }
/// Calculate the perceptual color difference based on CIEDE2000. /// Calculate the perceptual color difference based on CIEDE2000.
/// https://en.wikipedia.org/wiki/Color_difference#CIEDE2000 /// https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
/// \return The color difference of the two colors. /// \return The color difference of the two colors.
double calculate_CIEDE2000(const CieLab& color1, const CieLab& color2) double calculate_CIEDE2000(const CieLab &color1, const CieLab &color2)
{ {
const double L1 = color1.l; const double L1 = color1.l;
const double a1 = color1.a; const double a1 = color1.a;
const double b1 = color1.b; const double b1 = color1.b;
@@ -479,7 +491,7 @@ namespace
const double a2 = color2.a; const double a2 = color2.a;
const double b2 = color2.b; const double b2 = color2.b;
const double _25_pow_7 = /*std::pow(25.0, 7.0) = */6103515625.0; 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 C1_ab = std::sqrt(a1 * a1 + b1 * b1);
const double C2_ab = std::sqrt(a2 * a2 + b2 * b2); const double C2_ab = std::sqrt(a2 * a2 + b2 * b2);
@@ -502,16 +514,12 @@ namespace
const double C_primeBar = 0.5 * (C1_prime + C2_prime); 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 h_primeBar = computeHPrimeBar(C1_prime, C2_prime, h1_prime, h2_prime);
const double T = 1.0 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.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); - 0.20 * cosDegree(4.0 * h_primeBar - 63.0);
const double C_primeBar_pow7 = std::pow(C_primeBar, 7.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 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)) const double S_L = 1.0 + (0.015 * pow2(L_primeBar - 50.0)) / std::sqrt(20.0 + 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_C = 1.0 + 0.045 * C_primeBar;
const double S_H = 1.0 + 0.015 * C_primeBar * T; 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))); const double R_T = -R_C * sinDegree(60.0 * std::exp(-pow2((h_primeBar - 275) / 25.0)));
@@ -524,14 +532,10 @@ namespace
const double deltaC = deltaC_prime / (kC * S_C); const double deltaC = deltaC_prime / (kC * S_C);
const double deltaH = deltaH_prime / (kH * S_H); const double deltaH = deltaH_prime / (kH * S_H);
return /*std::sqrt*/( deltaL * deltaL return /*std::sqrt*/ (deltaL * deltaL + deltaC * deltaC + deltaH * deltaH + R_T * deltaC * deltaH);
+ deltaC * deltaC }
+ deltaH * deltaH
+ R_T * deltaC * deltaH);
}
struct AnsiBuffer struct AnsiBuffer {
{
using ColorCache = QMap<QRgb, int>; using ColorCache = QMap<QRgb, int>;
void append(char c) void append(char c)
@@ -548,36 +552,36 @@ namespace
m_size += str.size(); m_size += str.size();
} }
void appendForeground(QRgb rgb, bool is256Colors, ColorCache& colorCache) void appendForeground(QRgb rgb, bool is256Colors, ColorCache &colorCache)
{ {
append(QLatin1String("38;")); append(QLatin1String("38;"));
append(rgb, is256Colors, colorCache); append(rgb, is256Colors, colorCache);
} }
void appendBackground(QRgb rgb, bool is256Colors, ColorCache& colorCache) void appendBackground(QRgb rgb, bool is256Colors, ColorCache &colorCache)
{ {
append(QLatin1String("48;")); append(QLatin1String("48;"));
append(rgb, is256Colors, colorCache); append(rgb, is256Colors, colorCache);
} }
void append(QRgb rgb, bool is256Colors, ColorCache& colorCache) void append(QRgb rgb, bool is256Colors, ColorCache &colorCache)
{ {
auto appendUInt8 = [&](int x){ auto appendUInt8 = [&](int x) {
Q_ASSERT(x <= 255 && x >= 0); Q_ASSERT(x <= 255 && x >= 0);
if (x > 99) { if (x > 99) {
if (x >= 200) { if (x >= 200) {
append('2'); append('2');
x -= 200; x -= 200;
} } else {
else {
append('1'); append('1');
x -= 100; x -= 100;
} }
} else if (x < 10) { } else if (x < 10) {
append(char('0' + x)); append(char('0' + x));
return ; return;
} }
// clang-format off
constexpr char const* tb2digits = constexpr char const* tb2digits =
"00" "01" "02" "03" "04" "05" "06" "07" "08" "09" "00" "01" "02" "03" "04" "05" "06" "07" "08" "09"
"10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "10" "11" "12" "13" "14" "15" "16" "17" "18" "19"
@@ -588,9 +592,10 @@ namespace
"60" "61" "62" "63" "64" "65" "66" "67" "68" "69" "60" "61" "62" "63" "64" "65" "66" "67" "68" "69"
"70" "71" "72" "73" "74" "75" "76" "77" "78" "79" "70" "71" "72" "73" "74" "75" "76" "77" "78" "79"
"80" "81" "82" "83" "84" "85" "86" "87" "88" "89" "80" "81" "82" "83" "84" "85" "86" "87" "88" "89"
"90" "91" "92" "93" "94" "95" "96" "97" "98" "99" "90" "91" "92" "93" "94" "95" "96" "97" "98" "99";
; // clang-format on
auto* p = tb2digits + x * 2;
auto *p = tb2digits + x * 2;
append(p[0]); append(p[0]);
append(p[1]); append(p[1]);
}; };
@@ -602,7 +607,7 @@ namespace
if (it == colorCache.end()) { if (it == colorCache.end()) {
const auto lab = rgbToLab(rgb); const auto lab = rgbToLab(rgb);
// find the nearest xterm color // find the nearest xterm color
for (CieLab const& xtermLab : xterm240Labs) { for (CieLab const &xtermLab : xterm240Labs) {
auto dist2 = calculate_CIEDE2000(lab, xtermLab); auto dist2 = calculate_CIEDE2000(lab, xtermLab);
if (dist2 < dist) { if (dist2 < dist) {
dist = dist2; dist = dist2;
@@ -612,8 +617,7 @@ namespace
// add 16 to convert 240 colors mode to 256 colors mode // add 16 to convert 240 colors mode to 256 colors mode
idx += 16; idx += 16;
colorCache.insert(rgb, idx); colorCache.insert(rgb, idx);
} } else {
else {
idx = it.value(); idx = it.value();
} }
@@ -635,8 +639,8 @@ namespace
// Replace last character with 'm'. Last character must be ';' // Replace last character with 'm'. Last character must be ';'
void setFinalStyle() void setFinalStyle()
{ {
Q_ASSERT(m_data[m_size-1] == ';'); Q_ASSERT(m_data[m_size - 1] == ';');
m_data[m_size-1] = 'm'; m_data[m_size - 1] = 'm';
} }
void clear() void clear()
@@ -649,7 +653,7 @@ namespace
return QLatin1String(m_data, m_size); return QLatin1String(m_data, m_size);
} }
private: private:
char m_data[128]; char m_data[128];
int m_size = 0; int m_size = 0;
@@ -657,28 +661,26 @@ namespace
{ {
return 128 - m_size; return 128 - m_size;
} }
}; };
void fillString(QString &s, int n, const QString &fill) void fillString(QString &s, int n, const QString &fill)
{ {
if (n > 0) { if (n > 0) {
for (; n > fill.size(); n -= fill.size()) { for (; n > fill.size(); n -= fill.size()) {
s += fill; s += fill;
} }
s += fill.left(n); s += fill.left(n);
} }
} }
struct GraphLine struct GraphLine {
{
QString graphLine; QString graphLine;
QString labelLine; QString labelLine;
int graphLineLength = 0; int graphLineLength = 0;
int labelLineLength = 0; int labelLineLength = 0;
int nextLabelOffset = 0; int nextLabelOffset = 0;
template<class String> template<class String> void pushLabel(int offset, String const &s, int charCounter)
void pushLabel(int offset, String const& s, int charCounter)
{ {
Q_ASSERT(offset >= labelLineLength); Q_ASSERT(offset >= labelLineLength);
const int n = offset - labelLineLength; const int n = offset - labelLineLength;
@@ -688,8 +690,7 @@ namespace
nextLabelOffset = labelLineLength; nextLabelOffset = labelLineLength;
} }
template<class String> template<class String> void pushGraph(int offset, String const &s, int charCounter)
void pushGraph(int offset, String const& s, int charCounter)
{ {
Q_ASSERT(offset >= graphLineLength); Q_ASSERT(offset >= graphLineLength);
const int n = offset - graphLineLength; const int n = offset - graphLineLength;
@@ -705,25 +706,25 @@ namespace
} }
} }
private: private:
static void fillLine(QString& s, int n) static void fillLine(QString &s, int n)
{ {
Q_ASSERT(n >= 0); Q_ASSERT(n >= 0);
fillString(s, n, QStringLiteral( fillString(s,
n,
QStringLiteral(" "
" " " "
" " " "));
" "
));
} }
}; };
/** /**
* Returns the first free line at a given position or create a new one * Returns the first free line at a given position or create a new one
*/ */
GraphLine& lineAtOffset(std::vector<GraphLine> &graphLines, int offset) GraphLine &lineAtOffset(std::vector<GraphLine> &graphLines, int offset)
{ {
const auto last = graphLines.end(); const auto last = graphLines.end();
auto p = std::find_if(graphLines.begin(), last, [=](GraphLine const& line) { auto p = std::find_if(graphLines.begin(), last, [=](GraphLine const &line) {
return line.nextLabelOffset < offset; return line.nextLabelOffset < offset;
}); });
if (p == last) { if (p == last) {
@@ -731,37 +732,43 @@ namespace
return graphLines.back(); return graphLines.back();
} }
return *p; return *p;
} }
// disable bold, italic and underline on | // disable bold, italic and underline on |
const QLatin1String graphSymbol("\x1b[21;23;24m|"); const QLatin1String graphSymbol("\x1b[21;23;24m|");
// reverse video // reverse video
const QLatin1String nameStyle("\x1b[7m"); const QLatin1String nameStyle("\x1b[7m");
/** /**
* ANSI Highlighter dedicated to traces * ANSI Highlighter dedicated to traces
*/ */
class DebugSyntaxHighlighter : public KSyntaxHighlighting::AbstractHighlighter class DebugSyntaxHighlighter : public KSyntaxHighlighting::AbstractHighlighter
{ {
public: public:
using TraceOption = KSyntaxHighlighting::AnsiHighlighter::TraceOption; using TraceOption = KSyntaxHighlighting::AnsiHighlighter::TraceOption;
using TraceOptions = KSyntaxHighlighting::AnsiHighlighter::TraceOptions; using TraceOptions = KSyntaxHighlighting::AnsiHighlighter::TraceOptions;
void setDefinition(const KSyntaxHighlighting::Definition & def) override void setDefinition(const KSyntaxHighlighting::Definition &def) override
{ {
AbstractHighlighter::setDefinition(def); AbstractHighlighter::setDefinition(def);
m_defData = DefinitionData::get(def); m_defData = DefinitionData::get(def);
m_contextCapture.setDefinition(def); m_contextCapture.setDefinition(def);
} }
void highlightData(QTextStream &in, QTextStream &out, QLatin1String infoStyle, QLatin1String editorBackground, const std::vector<QPair<QString, QString>> &ansiStyles, TraceOptions traceOptions) void highlightData(QTextStream &in,
QTextStream &out,
QLatin1String infoStyle,
QLatin1String editorBackground,
const std::vector<QPair<QString, QString>> &ansiStyles,
TraceOptions traceOptions)
{ {
initRegionStyles(ansiStyles); initRegionStyles(ansiStyles);
m_hasFormatTrace = traceOptions.testFlag(TraceOption::Format); m_hasFormatTrace = traceOptions.testFlag(TraceOption::Format);
m_hasRegionTrace = traceOptions.testFlag(TraceOption::Region); m_hasRegionTrace = traceOptions.testFlag(TraceOption::Region);
const bool hasContextTrace = traceOptions.testFlag(TraceOption::Context); m_hasStackSizeTrace = traceOptions.testFlag(TraceOption::StackSize);
const bool hasFormatOrContextTrace = m_hasFormatTrace || hasContextTrace; m_hasContextTrace = traceOptions.testFlag(TraceOption::Context);
const bool hasFormatOrContextTrace = m_hasFormatTrace || m_hasContextTrace || m_hasStackSizeTrace;
const bool hasSeparator = hasFormatOrContextTrace && m_hasRegionTrace; const bool hasSeparator = hasFormatOrContextTrace && m_hasRegionTrace;
const QString resetBgColor = (editorBackground.isEmpty() ? QStringLiteral("\x1b[0m") : editorBackground); const QString resetBgColor = (editorBackground.isEmpty() ? QStringLiteral("\x1b[0m") : editorBackground);
@@ -785,14 +792,14 @@ namespace
} }
for (const auto &fragment : m_highlightedFragments) { for (const auto &fragment : m_highlightedFragments) {
auto const& ansiStyle = ansiStyles[fragment.formatId]; auto const &ansiStyle = ansiStyles[fragment.formatId];
out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second; out << ansiStyle.first << currentLine.midRef(fragment.offset, fragment.length) << ansiStyle.second;
} }
out << QStringLiteral("\x1b[K\n"); out << QStringLiteral("\x1b[K\n");
if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) { if (hasFormatOrContextTrace && !m_highlightedFragments.empty()) {
if (hasContextTrace) if (m_hasContextTrace || m_hasStackSizeTrace)
appendContextNames(oldState, currentLine); appendContextNames(oldState, currentLine);
printFormats(out, infoStyle, ansiStyles); printFormats(out, infoStyle, ansiStyles);
@@ -810,12 +817,22 @@ namespace
void applyFolding(int offset, int /*length*/, FoldingRegion region) override void applyFolding(int offset, int /*length*/, FoldingRegion region) override
{ {
if (!m_hasRegionTrace) return; if (!m_hasRegionTrace)
return;
const auto id = region.id(); const auto id = region.id();
if (region.type() == FoldingRegion::Begin) { if (region.type() == FoldingRegion::Begin) {
m_regions.push_back(Region{m_regionDepth, offset, -1, id, Region::State::Open}); m_regions.push_back(Region{m_regionDepth, offset, -1, id, Region::State::Open});
// swap with previous region if this is a closing region with same offset in order to superimpose labels
if (m_regions.size() >= 2) {
auto &previousRegion = m_regions[m_regions.size() - 2];
if (previousRegion.state == Region::State::Close && previousRegion.offset == offset) {
std::swap(previousRegion, m_regions.back());
if (previousRegion.bindIndex != -1)
m_regions[previousRegion.bindIndex].bindIndex = m_regions.size() - 1;
}
}
++m_regionDepth; ++m_regionDepth;
} else { } else {
// find open region // find open region
@@ -838,13 +855,13 @@ namespace
m_regions.push_back(Region{-1, offset, -1, id, Region::State::Close}); m_regions.push_back(Region{-1, offset, -1, id, Region::State::Close});
} }
m_regionDepth = std::max(m_regionDepth-1, 0); m_regionDepth = std::max(m_regionDepth - 1, 0);
} }
} }
using KSyntaxHighlighting::AbstractHighlighter::highlightLine; using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
private: private:
/** /**
* Initializes with colors of \p ansiStyle without duplicate. * Initializes with colors of \p ansiStyle without duplicate.
*/ */
@@ -889,29 +906,37 @@ namespace
*/ */
QString extractContextName(StateData *stateData) const QString extractContextName(StateData *stateData) const
{ {
QString label;
if (m_hasStackSizeTrace) {
label += QLatin1Char('(') % QString::number(stateData->size()) % QLatin1Char(')');
}
if (m_hasContextTrace) {
// first state is empty // first state is empty
if (stateData->isEmpty()) { if (stateData->isEmpty()) {
return QStringLiteral("[???]"); return label + QStringLiteral("[???]");
} }
const auto context = stateData->topContext(); const auto context = stateData->topContext();
const auto defData = DefinitionData::get(context->definition()); const auto defData = DefinitionData::get(context->definition());
const auto contextName = (defData != m_defData) const auto contextName = (defData != m_defData) ? QString(QLatin1Char('<') % defData->name % QLatin1Char('>')) : QString();
? QString(QLatin1Char('<') % defData->name % QLatin1Char('>')) return QString(label % contextName % QLatin1Char('[') % context->name() % QLatin1Char(']'));
: QString(); }
return QString(contextName % QLatin1Char('[') % context->name() % QLatin1Char(']'));
return label;
} }
void printFormats(QTextStream &out, QLatin1String regionStyle, const std::vector<QPair<QString, QString>> &ansiStyles) void printFormats(QTextStream &out, QLatin1String regionStyle, const std::vector<QPair<QString, QString>> &ansiStyles)
{ {
// init graph // init graph
m_formatGraph.clear(); m_formatGraph.clear();
for (auto const& fragment : m_highlightedFragments) { for (auto const &fragment : m_highlightedFragments) {
GraphLine& line = lineAtOffset(m_formatGraph, fragment.offset); GraphLine &line = lineAtOffset(m_formatGraph, fragment.offset);
auto const& style = ansiStyles[fragment.formatId].first; auto const &style = ansiStyles[fragment.formatId].first;
line.pushLabel(fragment.offset, style % nameStyle % fragment.name % regionStyle, fragment.name.size()); line.pushLabel(fragment.offset, style % nameStyle % fragment.name % regionStyle, fragment.name.size());
for (GraphLine* pline = m_formatGraph.data(); pline <= &line; ++pline) { for (GraphLine *pline = m_formatGraph.data(); pline <= &line; ++pline) {
pline->pushGraph(fragment.offset, style % graphSymbol % regionStyle, 1); pline->pushGraph(fragment.offset, style % graphSymbol % regionStyle, 1);
} }
} }
@@ -941,14 +966,14 @@ namespace
QString numStr; QString numStr;
// init graph // init graph
for (Region& region : m_regions) { for (Region &region : m_regions) {
if (region.state == Region::State::Continuation) { if (region.state == Region::State::Continuation) {
hasContinuation = true; hasContinuation = true;
continue; continue;
} }
auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style){ auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style) {
for (GraphLine* pline = m_regionGraph.data(); pline <= endline; ++pline) { for (GraphLine *pline = m_regionGraph.data(); pline <= endline; ++pline) {
// a label can hide a graph // a label can hide a graph
if (pline->graphLineLength <= offset) { if (pline->graphLineLength <= offset) {
pline->pushGraph(offset, style % graphSymbol % regionStyle, 1); pline->pushGraph(offset, style % graphSymbol % regionStyle, 1);
@@ -1035,32 +1060,33 @@ namespace
} }
// keep regions that are not closed // keep regions that are not closed
m_regions.erase(std::remove_if(m_regions.begin(), m_regions.end(), [](Region const& region){ m_regions.erase(std::remove_if(m_regions.begin(),
m_regions.end(),
[](Region const &region) {
return region.bindIndex != -1 || region.state == Region::State::Close; return region.bindIndex != -1 || region.state == Region::State::Close;
}), m_regions.end()); }),
m_regions.end());
// all remaining regions become Continuation // all remaining regions become Continuation
for (auto& region : m_regions) { for (auto &region : m_regions) {
region.offset = 0; region.offset = 0;
region.state = Region::State::Continuation; region.state = Region::State::Continuation;
} }
} }
struct HighlightFragment struct HighlightFragment {
{
QString name; QString name;
int offset; int offset;
int length; int length;
quint16 formatId; quint16 formatId;
}; };
struct ContextCaptureHighlighter : KSyntaxHighlighting::AbstractHighlighter struct ContextCaptureHighlighter : KSyntaxHighlighting::AbstractHighlighter {
{
int offset; int offset;
int length; int length;
int offsetNext; int offsetNext;
int lengthNext; int lengthNext;
void applyFormat(int offset, int length, const KSyntaxHighlighting::Format &/*format*/) override void applyFormat(int offset, int length, const KSyntaxHighlighting::Format & /*format*/) override
{ {
offset = offsetNext; offset = offsetNext;
length = lengthNext; length = lengthNext;
@@ -1071,10 +1097,8 @@ namespace
using KSyntaxHighlighting::AbstractHighlighter::highlightLine; using KSyntaxHighlighting::AbstractHighlighter::highlightLine;
}; };
struct Region struct Region {
{ enum class State : int8_t {
enum class State : int8_t
{
Open, Open,
Close, Close,
Continuation, Continuation,
@@ -1089,17 +1113,19 @@ namespace
bool m_hasFormatTrace; bool m_hasFormatTrace;
bool m_hasRegionTrace; bool m_hasRegionTrace;
bool m_hasStackSizeTrace;
bool m_hasContextTrace;
std::vector<HighlightFragment> m_highlightedFragments; std::vector<HighlightFragment> m_highlightedFragments;
std::vector<GraphLine> m_formatGraph; std::vector<GraphLine> m_formatGraph;
ContextCaptureHighlighter m_contextCapture; ContextCaptureHighlighter m_contextCapture;
DefinitionData* m_defData; DefinitionData *m_defData;
int m_regionDepth = 0; int m_regionDepth = 0;
std::vector<Region> m_regions; std::vector<Region> m_regions;
std::vector<GraphLine> m_regionGraph; std::vector<GraphLine> m_regionGraph;
std::vector<QStringView> m_regionStyles; std::vector<QStringView> m_regionStyles;
}; };
} // anonymous namespace } // anonymous namespace
class KSyntaxHighlighting::AnsiHighlighterPrivate class KSyntaxHighlighting::AnsiHighlighterPrivate
@@ -1186,13 +1212,13 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
} }
// initialize ansiStyles // initialize ansiStyles
for (auto&& definition : qAsConst(definitions)) { for (auto &&definition : qAsConst(definitions)) {
const auto formats = definition.formats(); const auto formats = definition.formats();
for (auto&& format : formats) { for (auto &&format : formats) {
const auto id = format.id(); const auto id = format.id();
if (id >= d->ansiStyles.size()) { if (id >= d->ansiStyles.size()) {
// better than id + 1 to avoid successive allocations // better than id + 1 to avoid successive allocations
d->ansiStyles.resize(std::max(std::size_t(id*2), std::size_t(32))); d->ansiStyles.resize(std::max(std::size_t(id * 2), std::size_t(32)));
} }
AnsiBuffer buffer; AnsiBuffer buffer;
@@ -1210,11 +1236,16 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
buffer.appendForeground(format.textColor(theme).rgb(), is256Colors, colorCache); buffer.appendForeground(format.textColor(theme).rgb(), is256Colors, colorCache);
else else
buffer.append(foregroundDefaultColor); buffer.append(foregroundDefaultColor);
if (hasBg) buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache); if (hasBg)
if (hasBold) buffer.append(QLatin1String("1;")); buffer.appendBackground(format.backgroundColor(theme).rgb(), is256Colors, colorCache);
if (hasItalic) buffer.append(QLatin1String("3;")); if (hasBold)
if (hasUnderline) buffer.append(QLatin1String("4;")); buffer.append(QLatin1String("1;"));
if (hasStrikeThrough) buffer.append(QLatin1String("9;")); if (hasItalic)
buffer.append(QLatin1String("3;"));
if (hasUnderline)
buffer.append(QLatin1String("4;"));
if (hasStrikeThrough)
buffer.append(QLatin1String("9;"));
// if there is ANSI style // if there is ANSI style
if (buffer.latin1().size() > 2) { if (buffer.latin1().size() > 2) {
@@ -1231,10 +1262,14 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
d->ansiStyles[id].second = buffer.latin1(); d->ansiStyles[id].second = buffer.latin1();
} else if (hasEffect) { } else if (hasEffect) {
buffer.append(QLatin1String("\x1b[")); buffer.append(QLatin1String("\x1b["));
if (hasBold) buffer.append(QLatin1String("21;")); if (hasBold)
if (hasItalic) buffer.append(QLatin1String("23;")); buffer.append(QLatin1String("21;"));
if (hasUnderline) buffer.append(QLatin1String("24;")); if (hasItalic)
if (hasStrikeThrough) buffer.append(QLatin1String("29;")); buffer.append(QLatin1String("23;"));
if (hasUnderline)
buffer.append(QLatin1String("24;"));
if (hasStrikeThrough)
buffer.append(QLatin1String("29;"));
buffer.setFinalStyle(); buffer.setFinalStyle();
d->ansiStyles[id].second = buffer.latin1(); d->ansiStyles[id].second = buffer.latin1();
} }
@@ -1286,6 +1321,6 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
void AnsiHighlighter::applyFormat(int offset, int length, const Format &format) void AnsiHighlighter::applyFormat(int offset, int length, const Format &format)
{ {
auto const& ansiStyle = d->ansiStyles[format.id()]; auto const &ansiStyle = d->ansiStyles[format.id()];
d->out << ansiStyle.first << d->currentLine.midRef(offset, length) << ansiStyle.second; d->out << ansiStyle.first << d->currentLine.midRef(offset, length) << ansiStyle.second;
} }

View File

@@ -10,9 +10,9 @@
#include "abstracthighlighter.h" #include "abstracthighlighter.h"
#include "ksyntaxhighlighting_export.h" #include "ksyntaxhighlighting_export.h"
#include <QFlags>
#include <QIODevice> #include <QIODevice>
#include <QString> #include <QString>
#include <QFlags>
#include <memory> #include <memory>
@@ -23,26 +23,29 @@ class AnsiHighlighterPrivate;
class KSYNTAXHIGHLIGHTING_EXPORT AnsiHighlighter final : public AbstractHighlighter class KSYNTAXHIGHLIGHTING_EXPORT AnsiHighlighter final : public AbstractHighlighter
{ {
public: public:
enum class AnsiFormat enum class AnsiFormat {
{
TrueColor, TrueColor,
XTerm256Color, XTerm256Color,
}; };
enum class TraceOption enum class TraceOption {
{
NoOptions, NoOptions,
Format = 1 << 0, Format = 1 << 0,
Region = 1 << 1, Region = 1 << 1,
Context = 1 << 2, Context = 1 << 2,
StackSize = 1 << 3,
}; };
Q_DECLARE_FLAGS(TraceOptions, TraceOption) Q_DECLARE_FLAGS(TraceOptions, TraceOption)
AnsiHighlighter(); AnsiHighlighter();
~AnsiHighlighter() override; ~AnsiHighlighter() override;
void highlightFile(const QString &fileName, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions()); void highlightFile(const QString &fileName,
void highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions()); 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(const QString &fileName);
void setOutputFile(FILE *fileHandle); void setOutputFile(FILE *fileHandle);

View File

@@ -135,7 +135,8 @@ void Context::resolveIncludes()
context = defData->contextByName(inc->contextName()); context = defData->contextByName(inc->contextName());
} }
if (!context) { if (!context) {
qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in" << m_def.definition().name(); qCWarning(Log) << "Unable to resolve include rule for definition" << inc->contextName() << "##" << inc->definitionName() << "in"
<< m_def.definition().name();
++it; ++it;
continue; continue;
} }
@@ -171,7 +172,8 @@ void Context::resolveAttributeFormat()
m_attributeFormat = DefinitionData::get(def)->formatByName(m_attribute); m_attributeFormat = DefinitionData::get(def)->formatByName(m_attribute);
if (!m_attributeFormat.isValid()) { if (!m_attributeFormat.isValid()) {
if (m_attributeContext) { if (m_attributeContext) {
qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name() << "from included context" << m_attributeContext->m_name << "of definition" << def.name(); qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name()
<< "from included context" << m_attributeContext->m_name << "of definition" << def.name();
} else { } else {
qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name(); qCWarning(Log) << "Context: Unknown format" << m_attribute << "in context" << m_name << "of definition" << m_def.definition().name();
} }

View File

@@ -19,15 +19,14 @@
#include "repository.h" #include "repository.h"
#include "repository_p.h" #include "repository_p.h"
#include "rule_p.h" #include "rule_p.h"
#include "xml_p.h"
#include "worddelimiters_p.h" #include "worddelimiters_p.h"
#include "xml_p.h"
#include <QCborMap> #include <QCborMap>
#include <QCoreApplication> #include <QCoreApplication>
#include <QFile> #include <QFile>
#include <QHash> #include <QHash>
#include <QStringList> #include <QStringList>
#include <QVector>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <algorithm> #include <algorithm>
@@ -234,7 +233,9 @@ QVector<Format> Definition::formats() const
// sort formats so that the order matches the order of the itemDatas in the xml files. // sort formats so that the order matches the order of the itemDatas in the xml files.
auto formatList = QVector<Format>::fromList(d->formats.values()); auto formatList = QVector<Format>::fromList(d->formats.values());
std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format &lhs, const KSyntaxHighlighting::Format &rhs) { return lhs.id() < rhs.id(); }); std::sort(formatList.begin(), formatList.end(), [](const KSyntaxHighlighting::Format &lhs, const KSyntaxHighlighting::Format &rhs) {
return lhs.id() < rhs.id();
});
return formatList; return formatList;
} }
@@ -244,15 +245,16 @@ QVector<Definition> Definition::includedDefinitions() const
d->load(); d->load();
// init worklist and result used as guard with this definition // init worklist and result used as guard with this definition
QVector<Definition> queue {*this}; QVector<Definition> queue{*this};
QVector<Definition> definitions {*this}; QVector<Definition> definitions{*this};
while (!queue.isEmpty()) { while (!queue.isEmpty()) {
// Iterate all context rules to find associated Definitions. This will // Iterate all context rules to find associated Definitions. This will
// automatically catch other Definitions referenced with IncludeRuldes or ContextSwitch. // automatically catch other Definitions referenced with IncludeRuldes or ContextSwitch.
const auto definition = queue.takeLast(); const auto definition = queue.takeLast();
for (const auto &context : qAsConst(definition.d->contexts)) { for (const auto &context : qAsConst(definition.d->contexts)) {
// handle context switch attributes of this context itself // handle context switch attributes of this context itself
for (const auto switchContext : {context->lineEndContext().context(), context->lineEmptyContext().context(), context->fallthroughContext().context()}) { for (const auto switchContext :
{context->lineEndContext().context(), context->lineEmptyContext().context(), context->fallthroughContext().context()}) {
if (switchContext) { if (switchContext) {
if (!definitions.contains(switchContext->definition())) { if (!definitions.contains(switchContext->definition())) {
queue.push_back(switchContext->definition()); queue.push_back(switchContext->definition());
@@ -387,6 +389,12 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords)
context->resolveAttributeFormat(); context->resolveAttributeFormat();
} }
for (const auto context : qAsConst(contexts)) {
for (const auto &rule : context->rules()) {
rule->resolvePostProcessing();
}
}
return true; return true;
} }
@@ -449,18 +457,10 @@ bool DefinitionData::loadMetaData(const QString &file, const QCborMap &obj)
fileName = file; fileName = file;
const auto exts = obj.value(QLatin1String("extensions")).toString(); 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)) for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext); extensions.push_back(ext);
const auto mts = obj.value(QLatin1String("mimetype")).toString(); 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)) for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt); mimetypes.push_back(mt);
return true; return true;
@@ -485,18 +485,10 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader)
author = reader.attributes().value(QLatin1String("author")).toString(); author = reader.attributes().value(QLatin1String("author")).toString();
license = reader.attributes().value(QLatin1String("license")).toString(); license = reader.attributes().value(QLatin1String("license")).toString();
const auto exts = reader.attributes().value(QLatin1String("extensions")).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)) for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext); extensions.push_back(ext);
const auto mts = reader.attributes().value(QLatin1String("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)) for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt); mimetypes.push_back(mt);
if (reader.attributes().hasAttribute(QLatin1String("casesensitive"))) if (reader.attributes().hasAttribute(QLatin1String("casesensitive")))
caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
@@ -630,10 +622,8 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader)
caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive; caseSensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("casesensitive"))) ? Qt::CaseSensitive : Qt::CaseInsensitive;
// adapt wordDelimiters // adapt wordDelimiters
for (QChar c : reader.attributes().value(QLatin1String("additionalDeliminator"))) wordDelimiters.append(reader.attributes().value(QLatin1String("additionalDeliminator")));
wordDelimiters.append(c); wordDelimiters.remove(reader.attributes().value(QLatin1String("weakDeliminator")));
for (QChar c : reader.attributes().value(QLatin1String("weakDeliminator")))
wordDelimiters.remove(c);
// adapt WordWrapDelimiters // adapt WordWrapDelimiters
auto wordWrapDeliminatorAttr = reader.attributes().value( auto wordWrapDeliminatorAttr = reader.attributes().value(
@@ -641,8 +631,7 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader)
if (wordWrapDeliminatorAttr.isEmpty()) if (wordWrapDeliminatorAttr.isEmpty())
wordWrapDelimiters = wordDelimiters; wordWrapDelimiters = wordDelimiters;
else { else {
for (QChar c : wordWrapDeliminatorAttr) wordWrapDelimiters.append(wordWrapDeliminatorAttr);
wordWrapDelimiters.append(c);
} }
} else if (reader.name() == QLatin1String("folding")) { } else if (reader.name() == QLatin1String("folding")) {
if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive"))) if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive")))

View File

@@ -43,7 +43,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
const auto networkError = reply->error(); const auto networkError = reply->error();
if (networkError != QNetworkReply::NoError) { if (networkError != QNetworkReply::NoError) {
qCWarning(Log) << networkError; qCWarning(Log) << networkError;
emit q->done(); // TODO return error Q_EMIT q->done(); // TODO return error
return; return;
} }
@@ -60,7 +60,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
} }
if (pendingDownloads == 0) if (pendingDownloads == 0)
emit q->informationMessage(QObject::tr("All syntax definitions are up-to-date.")); Q_EMIT q->informationMessage(QObject::tr("All syntax definitions are up-to-date."));
checkDone(); checkDone();
} }
@@ -72,14 +72,14 @@ void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser)
auto localDef = repo->definitionForName(name.toString()); auto localDef = repo->definitionForName(name.toString());
if (!localDef.isValid()) { if (!localDef.isValid()) {
emit q->informationMessage(QObject::tr("Downloading new syntax definition for '%1'...").arg(name.toString())); Q_EMIT q->informationMessage(QObject::tr("Downloading new syntax definition for '%1'...").arg(name.toString()));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString())); downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
return; return;
} }
const auto version = parser.attributes().value(QLatin1String("version")); const auto version = parser.attributes().value(QLatin1String("version"));
if (localDef.version() < version.toFloat()) { if (localDef.version() < version.toFloat()) {
emit q->informationMessage(QObject::tr("Updating syntax definition for '%1' to version %2...").arg(name.toString(), version.toString())); Q_EMIT q->informationMessage(QObject::tr("Updating syntax definition for '%1' to version %2...").arg(name.toString(), version.toString()));
downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString())); downloadDefinition(QUrl(parser.attributes().value(QLatin1String("url")).toString()));
} }
} }
@@ -94,7 +94,9 @@ void DefinitionDownloaderPrivate::downloadDefinition(const QUrl &downloadUrl)
QNetworkRequest req(url); QNetworkRequest req(url);
auto reply = nam->get(req); auto reply = nam->get(req);
QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() { downloadDefinitionFinished(reply); }); QObject::connect(reply, &QNetworkReply::finished, q, [this, reply]() {
downloadDefinitionFinished(reply);
});
++pendingDownloads; ++pendingDownloads;
needsReload = true; needsReload = true;
} }
@@ -134,7 +136,7 @@ void DefinitionDownloaderPrivate::checkDone()
if (needsReload) if (needsReload)
repo->reload(); repo->reload();
emit QTimer::singleShot(0, q, &DefinitionDownloader::done); Q_EMIT QTimer::singleShot(0, q, &DefinitionDownloader::done);
} }
} }
@@ -161,10 +163,13 @@ DefinitionDownloader::~DefinitionDownloader()
void DefinitionDownloader::start() void DefinitionDownloader::start()
{ {
const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") + QString::number(SyntaxHighlighting_VERSION_MAJOR) + QLatin1Char('.') + QString::number(SyntaxHighlighting_VERSION_MINOR) + QLatin1String(".xml"); const QString url = QLatin1String("https://www.kate-editor.org/syntax/update-") + QString::number(SyntaxHighlighting_VERSION_MAJOR) + QLatin1Char('.')
+ QString::number(SyntaxHighlighting_VERSION_MINOR) + QLatin1String(".xml");
auto req = QNetworkRequest(QUrl(url)); auto req = QNetworkRequest(QUrl(url));
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, req.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
QNetworkRequest::NoLessSafeRedirectPolicy); QNetworkRequest::NoLessSafeRedirectPolicy);
auto reply = d->nam->get(req); auto reply = d->nam->get(req);
QObject::connect(reply, &QNetworkReply::finished, this, [=]() { d->definitionListDownloadFinished(reply); }); QObject::connect(reply, &QNetworkReply::finished, this, [=]() {
d->definitionListDownloadFinished(reply);
});
} }

View File

@@ -98,13 +98,16 @@ Theme::TextStyle Format::textStyle() const
bool Format::isDefaultTextStyle(const Theme &theme) const bool Format::isDefaultTextStyle(const Theme &theme) const
{ {
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! // 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))) && return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme).rgba() == theme.selectedTextColor(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)); && (selectedBackgroundColor(theme).rgba() == (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 bool Format::hasTextColor(const Theme &theme) const
{ {
return textColor(theme) != theme.textColor(Theme::Normal) && (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor); return textColor(theme) != QColor::fromRgba(theme.textColor(Theme::Normal))
&& (d->style.textColor || theme.textColor(d->defaultStyle) || d->styleOverride(theme).textColor);
} }
QColor Format::textColor(const Theme &theme) const QColor Format::textColor(const Theme &theme) const
@@ -112,7 +115,7 @@ QColor Format::textColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme); const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.textColor) if (overrideStyle.textColor)
return overrideStyle.textColor; return overrideStyle.textColor;
return d->style.textColor ? d->style.textColor : theme.textColor(d->defaultStyle); return d->style.textColor ? QColor::fromRgba(d->style.textColor) : QColor::fromRgba(theme.textColor(d->defaultStyle));
} }
QColor Format::selectedTextColor(const Theme &theme) const QColor Format::selectedTextColor(const Theme &theme) const
@@ -120,13 +123,14 @@ QColor Format::selectedTextColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme); const auto overrideStyle = d->styleOverride(theme);
if (overrideStyle.selectedTextColor) if (overrideStyle.selectedTextColor)
return overrideStyle.selectedTextColor; return overrideStyle.selectedTextColor;
return d->style.selectedTextColor ? d->style.selectedTextColor : theme.selectedTextColor(d->defaultStyle); return d->style.selectedTextColor ? QColor::fromRgba(d->style.selectedTextColor) : QColor::fromRgba(theme.selectedTextColor(d->defaultStyle));
} }
bool Format::hasBackgroundColor(const Theme &theme) const bool Format::hasBackgroundColor(const Theme &theme) const
{ {
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! // 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); 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 QColor Format::backgroundColor(const Theme &theme) const
@@ -136,7 +140,7 @@ QColor Format::backgroundColor(const Theme &theme) const
return overrideStyle.backgroundColor; return overrideStyle.backgroundColor;
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! // 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)); return d->style.backgroundColor ? QColor::fromRgba(d->style.backgroundColor) : QColor::fromRgba(theme.backgroundColor(d->defaultStyle));
} }
QColor Format::selectedBackgroundColor(const Theme &theme) const QColor Format::selectedBackgroundColor(const Theme &theme) const
@@ -146,7 +150,8 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const
return overrideStyle.selectedBackgroundColor; return overrideStyle.selectedBackgroundColor;
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black! // 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)); return d->style.selectedBackgroundColor ? QColor::fromRgba(d->style.selectedBackgroundColor)
: QColor::fromRgba(theme.selectedBackgroundColor(d->defaultStyle));
} }
bool Format::isBold(const Theme &theme) const bool Format::isBold(const Theme &theme) const

View File

@@ -76,6 +76,33 @@ void HtmlHighlighter::highlightFile(const QString &fileName, const QString &titl
highlightData(&f, title); highlightData(&f, title);
} }
/**
* @brief toHtmlRgba
* Converts QColor -> rgba(r, g, b, a) if there is an alpha channel
* otherwise it will just return the hexcode. This is because QColor
* outputs #AARRGGBB, whereas browser support #RRGGBBAA.
*
* @param color
* @return
*/
static QString toHtmlRgbaString(const QColor &color)
{
if (color.alpha() == 0xFF)
return color.name();
QString rgba = QStringLiteral("rgba(");
rgba.append(QString::number(color.red()));
rgba.append(QLatin1Char(','));
rgba.append(QString::number(color.green()));
rgba.append(QLatin1Char(','));
rgba.append(QString::number(color.blue()));
rgba.append(QLatin1Char(','));
// this must be alphaF
rgba.append(QString::number(color.alphaF()));
rgba.append(QLatin1Char(')'));
return rgba;
}
void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title) void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
{ {
if (!d->out) { if (!d->out) {
@@ -94,11 +121,12 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
*d->out << "<html><head>\n"; *d->out << "<html><head>\n";
*d->out << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n"; *d->out << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n";
*d->out << "<title>" << htmlTitle << "</title>\n"; *d->out << "<title>" << htmlTitle << "</title>\n";
*d->out << "<meta name=\"generator\" content=\"KF5::SyntaxHighlighting - Definition (" << definition().name() << ") - Theme (" << theme().name() << ")\"/>\n"; *d->out << "<meta name=\"generator\" content=\"KF5::SyntaxHighlighting - Definition (" << definition().name() << ") - Theme (" << theme().name()
<< ")\"/>\n";
*d->out << "</head><body"; *d->out << "</head><body";
*d->out << " style=\"background-color:" << QColor(theme().editorColor(Theme::BackgroundColor)).name(); *d->out << " style=\"background-color:" << toHtmlRgbaString(QColor::fromRgba(theme().editorColor(Theme::BackgroundColor)));
if (theme().textColor(Theme::Normal)) if (theme().textColor(Theme::Normal))
*d->out << ";color:" << QColor(theme().textColor(Theme::Normal)).name(); *d->out << ";color:" << toHtmlRgbaString(QColor::fromRgba(theme().textColor(Theme::Normal)));
*d->out << "\"><pre>\n"; *d->out << "\"><pre>\n";
QTextStream in(dev); QTextStream in(dev);
@@ -128,9 +156,9 @@ void HtmlHighlighter::applyFormat(int offset, int length, const Format &format)
// collect potential output, cheaper than thinking about "is there any?" // collect potential output, cheaper than thinking about "is there any?"
QVarLengthArray<QString, 16> formatOutput; QVarLengthArray<QString, 16> formatOutput;
if (format.hasTextColor(theme())) if (format.hasTextColor(theme()))
formatOutput << QStringLiteral("color:") << format.textColor(theme()).name() << QStringLiteral(";"); formatOutput << QStringLiteral("color:") << toHtmlRgbaString(format.textColor(theme())) << QStringLiteral(";");
if (format.hasBackgroundColor(theme())) if (format.hasBackgroundColor(theme()))
formatOutput << QStringLiteral("background-color:") << format.backgroundColor(theme()).name() << QStringLiteral(";"); formatOutput << QStringLiteral("background-color:") << toHtmlRgbaString(format.backgroundColor(theme())) << QStringLiteral(";");
if (format.isBold(theme())) if (format.isBold(theme()))
formatOutput << QStringLiteral("font-weight:bold;"); formatOutput << QStringLiteral("font-weight:bold;");
if (format.isItalic(theme())) if (format.isItalic(theme()))

View File

@@ -26,7 +26,9 @@ bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensi
/** /**
* search with right predicate * search with right predicate
*/ */
return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(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) void KeywordList::load(QXmlStreamReader &reader)
@@ -90,7 +92,9 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
/** /**
* sort with right predicate * 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) void KeywordList::resolveIncludeKeywords(DefinitionData &def)

View File

@@ -9,8 +9,8 @@
#define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H #define KSYNTAXHIGHLIGHTING_KEYWORDLIST_P_H
#include <QString> #include <QString>
#include <QStringView>
#include <QStringList> #include <QStringList>
#include <QStringView>
#include <vector> #include <vector>

View File

@@ -18,6 +18,7 @@
#include <QDirIterator> #include <QDirIterator>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
#include <QPalette>
#ifndef NO_STANDARD_PATHS #ifndef NO_STANDARD_PATHS
#include <QStandardPaths> #include <QStandardPaths>
@@ -62,7 +63,9 @@ Definition Repository::definitionForName(const QString &defName) const
static void sortDefinitions(QVector<Definition> &definitions) static void sortDefinitions(QVector<Definition> &definitions)
{ {
std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) { return lhs.priority() > rhs.priority(); }); std::stable_sort(definitions.begin(), definitions.end(), [](const Definition &lhs, const Definition &rhs) {
return lhs.priority() > rhs.priority();
});
} }
Definition Repository::definitionForFileName(const QString &fileName) const Definition Repository::definitionForFileName(const QString &fileName) const
@@ -133,13 +136,52 @@ Theme Repository::theme(const QString &themeName) const
return Theme(); return Theme();
} }
Theme Repository::defaultTheme(Repository::DefaultTheme t) Theme Repository::defaultTheme(Repository::DefaultTheme t) const
{ {
if (t == DarkTheme) if (t == DarkTheme)
return theme(QLatin1String("Breeze Dark")); return theme(QLatin1String("Breeze Dark"));
return theme(QLatin1String("Breeze Light")); return theme(QLatin1String("Breeze Light"));
} }
Theme Repository::defaultTheme(Repository::DefaultTheme t)
{
return qAsConst(*this).defaultTheme(t);
}
Theme Repository::themeForPalette(const QPalette &palette) const
{
const auto base = palette.color(QPalette::Base);
const auto themes = d->m_themes;
// find themes with matching background colors
QVector<KSyntaxHighlighting::Theme> matchingThemes;
for (const auto &theme : themes) {
const auto background = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::BackgroundColor);
if (background == base.rgb()) {
matchingThemes.append(theme);
}
}
if (!matchingThemes.empty()) {
// if there's multiple, search for one with a matching highlight color
const auto highlight = palette.color(QPalette::Highlight);
for (const auto &theme : qAsConst(matchingThemes)) {
auto selection = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
if (selection == highlight.rgb()) {
return theme;
}
}
return matchingThemes.first();
}
// fallback to just use the default light or dark theme
return defaultTheme((base.lightness() < 128) ? KSyntaxHighlighting::Repository::DarkTheme : KSyntaxHighlighting::Repository::LightTheme);
}
Theme Repository::themeForPalette(const QPalette &palette)
{
return qAsConst(*this).themeForPalette(palette);
}
void RepositoryPrivate::load(Repository *repo) void RepositoryPrivate::load(Repository *repo)
{ {
// always add invalid default "None" highlighting // always add invalid default "None" highlighting
@@ -147,7 +189,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled // do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS #ifndef NO_STANDARD_PATHS
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory)) for (const auto &dir :
QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
loadSyntaxFolder(repo, dir); loadSyntaxFolder(repo, dir);
// backward compatibility with Kate // backward compatibility with Kate
@@ -176,7 +219,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled // do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS #ifndef NO_STANDARD_PATHS
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory)) for (const auto &dir :
QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
loadThemeFolder(dir); loadThemeFolder(dir);
#endif #endif
@@ -256,7 +300,9 @@ static int themeRevision(const Theme &theme)
void RepositoryPrivate::addTheme(const Theme &theme) void RepositoryPrivate::addTheme(const Theme &theme)
{ {
const auto it = std::lower_bound(m_themes.begin(), m_themes.end(), theme, [](const Theme &lhs, const Theme &rhs) { return lhs.name() < rhs.name(); }); const auto it = std::lower_bound(m_themes.begin(), m_themes.end(), theme, [](const Theme &lhs, const Theme &rhs) {
return lhs.name() < rhs.name();
});
if (it == m_themes.end() || (*it).name() != theme.name()) { if (it == m_themes.end() || (*it).name() != theme.name()) {
m_themes.insert(it, theme); m_themes.insert(it, theme);
return; return;

View File

@@ -15,6 +15,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QString; class QString;
class QPalette;
QT_END_NAMESPACE QT_END_NAMESPACE
/** /**
@@ -209,9 +210,32 @@ public:
/** /**
* Returns a default theme instance of the given type. * Returns a default theme instance of the given type.
* The returned Theme is guaranteed to be a valid theme. * The returned Theme is guaranteed to be a valid theme.
* @since 5.79
*/
Theme defaultTheme(DefaultTheme t = LightTheme) const;
/**
* Returns a default theme instance of the given type.
* The returned Theme is guaranteed to be a valid theme.
*
* KF6: remove in favor of const variant
*/ */
Theme defaultTheme(DefaultTheme t = LightTheme); Theme defaultTheme(DefaultTheme t = LightTheme);
/**
* Returns the best matching theme for the given palette
* @since 5.79
**/
Theme themeForPalette(const QPalette &palette) const;
/**
* Returns the best matching theme for the given palette
* @since 5.77
*
* KF6: remove in favor of const variant
**/
Theme themeForPalette(const QPalette &palette);
/** /**
* Reloads the repository. * Reloads the repository.
* This is a moderately expensive operations and should thus only be * This is a moderately expensive operations and should thus only be

View File

@@ -10,8 +10,8 @@
#include "definition_p.h" #include "definition_p.h"
#include "ksyntaxhighlighting_logging.h" #include "ksyntaxhighlighting_logging.h"
#include "rule_p.h" #include "rule_p.h"
#include "xml_p.h"
#include "worddelimiters_p.h" #include "worddelimiters_p.h"
#include "xml_p.h"
#include <QString> #include <QString>
#include <QXmlStreamReader> #include <QXmlStreamReader>
@@ -31,9 +31,7 @@ static bool isOctalChar(QChar c)
static bool isHexChar(QChar c) static bool isHexChar(QChar c)
{ {
return isDigit(c) return isDigit(c) || (c <= QLatin1Char('f') && QLatin1Char('a') <= c) || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
|| (c <= QLatin1Char('f') && QLatin1Char('a') <= c)
|| (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
} }
static int matchEscapedChar(const QString &text, int offset) static int matchEscapedChar(const QString &text, int offset)
@@ -44,9 +42,18 @@ static int matchEscapedChar(const QString &text, int offset)
const auto c = text.at(offset + 1); const auto c = text.at(offset + 1);
switch (c.unicode()) { switch (c.unicode()) {
// control chars // control chars
case 'a': case 'b': case 'e': case 'f': case 'a':
case 'n': case 'r': case 't': case 'v': case 'b':
case '"': case '\'': case '?': case '\\': case 'e':
case 'f':
case 'n':
case 'r':
case 't':
case 'v':
case '"':
case '\'':
case '?':
case '\\':
return offset + 2; return offset + 2;
// hex encoded character // hex encoded character
@@ -59,8 +66,14 @@ static int matchEscapedChar(const QString &text, int offset)
return offset; return offset;
// octal encoding, simple \0 is OK, too, unlike simple \x above // octal encoding, simple \0 is OK, too, unlike simple \x above
case '0': case '1': case '2': case '3': case '0':
case '4': case '5': case '6': case '7': 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 + 2 < text.size() && isOctalChar(text.at(offset + 2))) {
if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3))) if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3)))
return offset + 4; return offset + 4;
@@ -81,6 +94,13 @@ static QString replaceCaptures(const QString &pattern, const QStringList &captur
return result; return result;
} }
Rule::~Rule()
{
if (!m_additionalDeliminator.isEmpty() || !m_weakDeliminator.isEmpty()) {
delete m_wordDelimiters;
}
}
Definition Rule::definition() const Definition Rule::definition() const
{ {
return m_def.definition(); return m_def.definition();
@@ -124,12 +144,17 @@ bool Rule::load(QXmlStreamReader &reader)
void Rule::resolveContext() void Rule::resolveContext()
{ {
auto const& def = m_def.definition(); auto const &def = m_def.definition();
m_context.resolve(def); m_context.resolve(def);
// cache for DefinitionData::wordDelimiters, is accessed VERY often // cache for DefinitionData::wordDelimiters, is accessed VERY often
m_wordDelimiters = &DefinitionData::get(def)->wordDelimiters; m_wordDelimiters = &DefinitionData::get(def)->wordDelimiters;
if (!m_additionalDeliminator.isEmpty() || !m_weakDeliminator.isEmpty()) {
m_wordDelimiters = new WordDelimiters(*m_wordDelimiters);
m_wordDelimiters->append(m_additionalDeliminator);
m_wordDelimiters->remove(m_weakDeliminator);
}
} }
void Rule::resolveAttributeFormat(Context *lookupContext) void Rule::resolveAttributeFormat(Context *lookupContext)
@@ -151,6 +176,12 @@ bool Rule::doLoad(QXmlStreamReader &reader)
return true; return true;
} }
void Rule::loadAdditionalWordDelimiters(QXmlStreamReader &reader)
{
m_additionalDeliminator = reader.attributes().value(QLatin1String("additionalDeliminator")).toString();
m_weakDeliminator = reader.attributes().value(QLatin1String("weakDeliminator")).toString();
}
Rule::Ptr Rule::create(const QStringView &name) Rule::Ptr Rule::create(const QStringView &name)
{ {
if (name == QLatin1String("AnyChar")) if (name == QLatin1String("AnyChar"))
@@ -283,6 +314,12 @@ MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QString
return offset; return offset;
} }
bool Float::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -344,6 +381,12 @@ MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList
return offset; return offset;
} }
bool HlCHex::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -367,6 +410,12 @@ MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &
return offset; return offset;
} }
bool HlCOct::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -411,11 +460,7 @@ bool IncludeRules::includeAttribute() const
bool IncludeRules::doLoad(QXmlStreamReader &reader) bool IncludeRules::doLoad(QXmlStreamReader &reader)
{ {
const auto s = reader.attributes().value(QLatin1String("context")); const auto s = reader.attributes().value(QLatin1String("context"));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const auto split = s.split(QLatin1String("##"), QString::KeepEmptyParts);
#else
const auto split = s.split(QString::fromLatin1("##"), Qt::KeepEmptyParts); const auto split = s.split(QString::fromLatin1("##"), Qt::KeepEmptyParts);
#endif
if (split.isEmpty()) if (split.isEmpty())
return false; return false;
m_contextName = split.at(0).toString(); m_contextName = split.at(0).toString();
@@ -433,6 +478,12 @@ MatchResult IncludeRules::doMatch(const QString &text, int offset, const QString
return offset; return offset;
} }
bool Int::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const
{ {
if (offset > 0 && !isWordDelimiter(text.at(offset - 1))) if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -466,6 +517,8 @@ bool KeywordListRule::doLoad(QXmlStreamReader &reader)
m_hasCaseSensitivityOverride = false; m_hasCaseSensitivityOverride = false;
} }
loadAdditionalWordDelimiters(reader);
return !m_keywordList->isEmpty(); return !m_keywordList->isEmpty();
} }
@@ -540,21 +593,52 @@ bool RegExpr::doLoad(QXmlStreamReader &reader)
const auto isMinimal = Xml::attrToBool(reader.attributes().value(QLatin1String("minimal"))); const auto isMinimal = Xml::attrToBool(reader.attributes().value(QLatin1String("minimal")));
const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))); const auto isCaseInsensitive = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive")));
m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption) | (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)); m_regexp.setPatternOptions((isMinimal ? QRegularExpression::InvertedGreedinessOption : QRegularExpression::NoPatternOption)
| (isCaseInsensitive ? QRegularExpression::CaseInsensitiveOption : QRegularExpression::NoPatternOption)
// DontCaptureOption is removed by resolvePostProcessing() when necessary
| QRegularExpression::DontCaptureOption);
m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
return !m_regexp.pattern().isEmpty();
}
void KSyntaxHighlighting::RegExpr::resolvePostProcessing()
{
if (m_isResolved)
return;
m_isResolved = true;
bool hasCapture = false;
// disable DontCaptureOption when reference a context with dynamic rule
if (auto *ctx = context().context()) {
for (const Rule::Ptr &rule : ctx->rules()) {
if (rule->isDynamic()) {
hasCapture = true;
m_regexp.setPatternOptions(m_regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
break;
}
}
}
// optimize the pattern for the non-dynamic case, we use them OFTEN // optimize the pattern for the non-dynamic case, we use them OFTEN
m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
if (!m_dynamic) { if (!m_dynamic) {
m_regexp.optimize(); m_regexp.optimize();
} }
// always using m_regexp.isValid() would be better, but parses the regexp and thus is way too expensive for release builds bool isValid = m_regexp.isValid();
if (!isValid) {
// DontCaptureOption with back reference capture is an error, remove this option then try again
if (!hasCapture) {
m_regexp.setPatternOptions(m_regexp.patternOptions() & ~QRegularExpression::DontCaptureOption);
isValid = m_regexp.isValid();
}
if (Log().isDebugEnabled()) { if (!isValid) {
if (!m_regexp.isValid())
qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern(); qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern();
} }
return !m_regexp.pattern().isEmpty(); }
} }
MatchResult RegExpr::doMatch(const QString &text, int offset, const QStringList &captures) const MatchResult RegExpr::doMatch(const QString &text, int offset, const QStringList &captures) const
@@ -616,6 +700,7 @@ bool WordDetect::doLoad(QXmlStreamReader &reader)
{ {
m_word = reader.attributes().value(QLatin1String("String")).toString(); m_word = reader.attributes().value(QLatin1String("String")).toString();
m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive; m_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
loadAdditionalWordDelimiters(reader);
return !m_word.isEmpty(); return !m_word.isEmpty();
} }

View File

@@ -33,7 +33,7 @@ class Rule
{ {
public: public:
Rule() = default; Rule() = default;
virtual ~Rule() = default; virtual ~Rule();
typedef std::shared_ptr<Rule> Ptr; typedef std::shared_ptr<Rule> Ptr;
@@ -83,6 +83,9 @@ public:
bool load(QXmlStreamReader &reader); bool load(QXmlStreamReader &reader);
void resolveContext(); void resolveContext();
void resolveAttributeFormat(Context *lookupContext); void resolveAttributeFormat(Context *lookupContext);
virtual void resolvePostProcessing()
{
}
virtual MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const = 0; virtual MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const = 0;
@@ -93,6 +96,8 @@ protected:
bool isWordDelimiter(QChar c) const; bool isWordDelimiter(QChar c) const;
void loadAdditionalWordDelimiters(QXmlStreamReader &reader);
private: private:
Q_DISABLE_COPY(Rule) Q_DISABLE_COPY(Rule)
@@ -107,7 +112,10 @@ private:
bool m_lookAhead = false; bool m_lookAhead = false;
// cache for DefinitionData::wordDelimiters, is accessed VERY often // cache for DefinitionData::wordDelimiters, is accessed VERY often
WordDelimiters* m_wordDelimiters = nullptr; WordDelimiters *m_wordDelimiters = nullptr;
QString m_additionalDeliminator;
QString m_weakDeliminator;
protected: protected:
bool m_dynamic = false; bool m_dynamic = false;
@@ -160,6 +168,7 @@ protected:
class Float : public Rule class Float : public Rule
{ {
protected: protected:
bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override; MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
}; };
@@ -183,6 +192,7 @@ private:
class Int : public Rule class Int : public Rule
{ {
protected: protected:
bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override; MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
}; };
@@ -195,12 +205,14 @@ protected:
class HlCHex : public Rule class HlCHex : public Rule
{ {
protected: protected:
bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override; MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
}; };
class HlCOct : public Rule class HlCOct : public Rule
{ {
protected: protected:
bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &) const override; MatchResult doMatch(const QString &text, int offset, const QStringList &) const override;
}; };
@@ -246,11 +258,13 @@ private:
class RegExpr : public Rule class RegExpr : public Rule
{ {
protected: protected:
void resolvePostProcessing() override;
bool doLoad(QXmlStreamReader &reader) override; bool doLoad(QXmlStreamReader &reader) override;
MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override; MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const override;
private: private:
QRegularExpression m_regexp; QRegularExpression m_regexp;
bool m_isResolved = false;
}; };
class StringDetect : public Rule class StringDetect : public Rule

View File

@@ -47,7 +47,7 @@ QString Theme::name() const
QString Theme::translatedName() const QString Theme::translatedName() const
{ {
return m_data ? QCoreApplication::translate("Theme", m_data->name().toUtf8().constData()) : QString(); return m_data ? QCoreApplication::instance()->translate("Theme", m_data->name().toUtf8().constData()) : QString();
} }
bool Theme::isReadOnly() const bool Theme::isReadOnly() const

View File

@@ -30,7 +30,7 @@ ThemeData::ThemeData()
/** /**
* Convert QJsonValue @p val into a color, if possible. Valid colors are only * Convert QJsonValue @p val into a color, if possible. Valid colors are only
* in hex format: #rrggbb. On error, returns 0x00000000. * in hex format: #aarrggbb. On error, returns 0x00000000.
*/ */
static inline QRgb readColor(const QJsonValue &val) static inline QRgb readColor(const QJsonValue &val)
{ {
@@ -43,7 +43,7 @@ static inline QRgb readColor(const QJsonValue &val)
return unsetColor; return unsetColor;
} }
const QColor color(str); const QColor color(str);
return color.isValid() ? color.rgb() : unsetColor; return color.isValid() ? color.rgba() : unsetColor;
} }
static inline TextStyleData readThemeData(const QJsonObject &obj) static inline TextStyleData readThemeData(const QJsonObject &obj)

View File

@@ -11,7 +11,7 @@ using namespace KSyntaxHighlighting;
WordDelimiters::WordDelimiters() WordDelimiters::WordDelimiters()
: asciiDelimiters{} : asciiDelimiters{}
{ {
for(const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p) for (const char *p = "\t !%&()*+,-./:;<=>?[\\]^{|}~"; *p; ++p)
// int(*p) fix -Wchar-subscripts // int(*p) fix -Wchar-subscripts
asciiDelimiters[int(*p)] = true; asciiDelimiters[int(*p)] = true;
} }
@@ -24,20 +24,24 @@ bool WordDelimiters::contains(QChar c) const
return notAsciiDelimiters.contains(c); return notAsciiDelimiters.contains(c);
} }
void WordDelimiters::append(QChar c) void WordDelimiters::append(QStringView s)
{ {
for (QChar c : s) {
if (c.unicode() < 128) { if (c.unicode() < 128) {
asciiDelimiters[c.unicode()] = true; asciiDelimiters[c.unicode()] = true;
} else { } else {
notAsciiDelimiters.append(c); notAsciiDelimiters.append(c);
} }
}
} }
void WordDelimiters::remove(QChar c) void WordDelimiters::remove(QStringView s)
{ {
for (QChar c : s) {
if (c.unicode() < 128) { if (c.unicode() < 128) {
asciiDelimiters[c.unicode()] = false; asciiDelimiters[c.unicode()] = false;
} else { } else {
notAsciiDelimiters.remove(c); notAsciiDelimiters.remove(c);
} }
}
} }

View File

@@ -30,14 +30,14 @@ public:
bool contains(QChar c) const; bool contains(QChar c) const;
/** /**
* Appends the character @p c to word delimiter. * Appends each character of @p s to word delimiters.
*/ */
void append(QChar c); void append(QStringView s);
/** /**
* Removes the character @p c from word delimiters. * Removes each character of @p s from word delimiters.
*/ */
void remove(QChar c); void remove(QStringView c);
private: private:
/** /**

View File

@@ -4,8 +4,7 @@ Minimum version is the same as the sqlite version in the source tree.
We compile SQLite with the flowing settings: We compile SQLite with the flowing settings:
* SQLITE_THREADSAFE=2 * SQLITE_THREADSAFE=2
* SQLITE_ENABLE_FTS4 * SQLITE_ENABLE_FTS5
* SQLITE_ENABLE_FTS3_PARENTHESIS
* SQLITE_ENABLE_UNLOCK_NOTIFY * SQLITE_ENABLE_UNLOCK_NOTIFY
* SQLITE_ENABLE_COLUMN_METADATA * SQLITE_ENABLE_COLUMN_METADATA
* SQLITE_ENABLE_JSON1 * SQLITE_ENABLE_JSON1

View File

@@ -44,6 +44,7 @@
#include <QTimer> #include <QTimer>
using namespace Core; using namespace Core;
using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace ClassView { namespace ClassView {
@@ -94,7 +95,7 @@ public:
ParserTreeItem::ConstPtr m_root; ParserTreeItem::ConstPtr m_root;
QTimer m_timer; QTimer m_timer;
QHash<QString, CPlusPlus::Document::Ptr> m_awaitingDocuments; QSet<FilePath> m_awaitingDocuments;
//! Internal manager state. \sa Manager::state //! Internal manager state. \sa Manager::state
bool state = false; bool state = false;
@@ -116,7 +117,15 @@ void ManagerPrivate::cancelScheduledUpdate()
void ManagerPrivate::resetParser() void ManagerPrivate::resetParser()
{ {
cancelScheduledUpdate(); cancelScheduledUpdate();
QMetaObject::invokeMethod(m_parser, &Parser::resetDataToCurrentState, Qt::QueuedConnection);
QHash<FilePath, QPair<QString, FilePaths>> projectData;
for (const Project *project : SessionManager::projects()) {
projectData.insert(project->projectFilePath(),
qMakePair(project->displayName(), project->files(Project::SourceFiles)));
}
QMetaObject::invokeMethod(m_parser, [this, projectData]() {
m_parser->resetData(projectData);
}, Qt::QueuedConnection);
} }
/*! /*!
@@ -218,15 +227,26 @@ bool Manager::hasChildren(QStandardItem *item) const
void Manager::initialize() void Manager::initialize()
{ {
using ProjectExplorer::SessionManager;
d->m_timer.setSingleShot(true); d->m_timer.setSingleShot(true);
// connections to enable/disable navi widget factory // connections to enable/disable navi widget factory
SessionManager *sessionManager = SessionManager::instance(); SessionManager *sessionManager = SessionManager::instance();
connect(sessionManager, &SessionManager::projectAdded, connect(sessionManager, &SessionManager::projectAdded,
this, &Manager::onProjectListChanged); this, [this](Project *project) {
const FilePath projectPath = project->projectFilePath();
const QString projectName = project->displayName();
const FilePaths projectFiles = project->files(Project::SourceFiles);
QMetaObject::invokeMethod(d->m_parser, [this, projectPath, projectName, projectFiles]() {
d->m_parser->addProject(projectPath, projectName, projectFiles);
}, Qt::QueuedConnection);
});
connect(sessionManager, &SessionManager::projectRemoved, connect(sessionManager, &SessionManager::projectRemoved,
this, &Manager::onProjectListChanged); this, [this](Project *project) {
const FilePath projectPath = project->projectFilePath();
QMetaObject::invokeMethod(d->m_parser, [this, projectPath]() {
d->m_parser->removeProject(projectPath);
}, Qt::QueuedConnection);
});
// connect to the progress manager for signals about Parsing tasks // connect to the progress manager for signals about Parsing tasks
connect(ProgressManager::instance(), &ProgressManager::taskStarted, connect(ProgressManager::instance(), &ProgressManager::taskStarted,
@@ -283,12 +303,12 @@ void Manager::initialize()
if (doc.data() == nullptr) if (doc.data() == nullptr)
return; return;
d->m_awaitingDocuments.insert(doc->fileName(), doc); d->m_awaitingDocuments.insert(FilePath::fromString(doc->fileName()));
d->m_timer.start(400); // Accumulate multiple requests into one, restarts the timer d->m_timer.start(400); // Accumulate multiple requests into one, restarts the timer
}); });
connect(&d->m_timer, &QTimer::timeout, this, [this]() { connect(&d->m_timer, &QTimer::timeout, this, [this]() {
const QList<CPlusPlus::Document::Ptr> docsToBeUpdated = d->m_awaitingDocuments.values(); const QSet<FilePath> docsToBeUpdated = d->m_awaitingDocuments;
d->cancelScheduledUpdate(); d->cancelScheduledUpdate();
if (!state() || d->disableCodeParser) // enabling any of them will trigger the total update if (!state() || d->disableCodeParser) // enabling any of them will trigger the total update
return; return;
@@ -346,20 +366,7 @@ void Manager::onWidgetVisibilityIsChanged(bool visibility)
if (!visibility) if (!visibility)
return; return;
setState(true); setState(true);
onProjectListChanged(); // TODO: this one may change into getter (when a new class view widget is being shown)
}
/*!
Reacts to the project list being changed by updating the navigation pane
visibility if necessary.
*/
void Manager::onProjectListChanged()
{
// do nothing if Manager is disabled
if (!state())
return;
QMetaObject::invokeMethod(d->m_parser, &Parser::requestCurrentState, Qt::QueuedConnection); QMetaObject::invokeMethod(d->m_parser, &Parser::requestCurrentState, Qt::QueuedConnection);
} }

View File

@@ -60,7 +60,6 @@ signals:
void treeDataUpdate(QSharedPointer<QStandardItem> result); void treeDataUpdate(QSharedPointer<QStandardItem> result);
private: private:
void onProjectListChanged();
void initialize(); void initialize();
inline bool state() const; inline bool state() const;

View File

@@ -32,18 +32,13 @@
// other // other
#include <cpptools/cppmodelmanager.h> #include <cpptools/cppmodelmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QStandardItem> #include <QElapsedTimer>
#include <QDebug> #include <QDebug>
#include <QHash> #include <QHash>
#include <QSet> #include <QSet>
#include <QElapsedTimer>
enum { debug = false }; enum { debug = false };
@@ -67,17 +62,11 @@ namespace Internal {
\brief The Parser class parses C++ information. Multithreading is supported. \brief The Parser class parses C++ information. Multithreading is supported.
*/ */
/*!
\fn void Parser::treeDataUpdate(QSharedPointer<QStandardItem> result)
Emits a signal about a tree data update.
*/
class ParserPrivate class ParserPrivate
{ {
public: public:
//! Get document from documentList //! Get document from documentList
CPlusPlus::Document::Ptr document(const QString &fileName) const; CPlusPlus::Document::Ptr document(const Utils::FilePath &fileName) const;
struct DocumentCache { struct DocumentCache {
unsigned treeRevision = 0; unsigned treeRevision = 0;
@@ -87,23 +76,20 @@ public:
struct ProjectCache { struct ProjectCache {
unsigned treeRevision = 0; unsigned treeRevision = 0;
ParserTreeItem::ConstPtr tree; ParserTreeItem::ConstPtr tree;
QStringList fileList; QString projectName;
QSet<FilePath> fileNames;
}; };
// Project file path to its cached data // Project file path to its cached data
QHash<QString, DocumentCache> m_documentCache; QHash<FilePath, DocumentCache> m_documentCache;
// Project file path to its cached data // Project file path to its cached data
QHash<QString, ProjectCache> m_projectCache; QHash<FilePath, ProjectCache> m_projectCache;
// other
//! List for files which has to be parsed
QSet<QString> fileList;
//! Flat mode //! Flat mode
bool flatMode = false; bool flatMode = false;
}; };
CPlusPlus::Document::Ptr ParserPrivate::document(const QString &fileName) const CPlusPlus::Document::Ptr ParserPrivate::document(const FilePath &fileName) const
{ {
return m_documentCache.value(fileName).document; return m_documentCache.value(fileName).document;
} }
@@ -161,16 +147,14 @@ ParserTreeItem::ConstPtr Parser::parse()
QHash<SymbolInformation, ParserTreeItem::ConstPtr> projectTrees; QHash<SymbolInformation, ParserTreeItem::ConstPtr> projectTrees;
// TODO: move a call to SessionManager::projects() out of this thread for (auto it = d->m_projectCache.cbegin(); it != d->m_projectCache.cend(); ++it) {
for (const Project *prj : SessionManager::projects()) { const ParserPrivate::ProjectCache &projectCache = it.value();
const QString prjName(prj->displayName()); const FilePath projectPath = it.key();
const QString prjType = prj->projectFilePath().toString(); const SymbolInformation projectInfo = { projectCache.projectName, projectPath.toString() };
const SymbolInformation inf(prjName, prjType); ParserTreeItem::ConstPtr item = getCachedOrParseProjectTree(projectPath, projectCache.fileNames);
ParserTreeItem::ConstPtr item = addFlatTree(prj);
if (item.isNull()) if (item.isNull())
continue; continue;
projectTrees.insert(inf, item); projectTrees.insert(projectInfo, item);
} }
ParserTreeItem::ConstPtr rootItem(new ParserTreeItem(projectTrees)); ParserTreeItem::ConstPtr rootItem(new ParserTreeItem(projectTrees));
@@ -189,16 +173,16 @@ ParserTreeItem::ConstPtr Parser::parse()
project. project.
*/ */
ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList, ParserTreeItem::ConstPtr Parser::getParseProjectTree(const FilePath &projectPath,
const QString &projectId) const QSet<FilePath> &filesInProject)
{ {
//! \todo Way to optimize - for documentUpdate - use old cached project and subtract //! \todo Way to optimize - for documentUpdate - use old cached project and subtract
//! changed files only (old edition), and add curent editions //! changed files only (old edition), and add curent editions
QList<ParserTreeItem::ConstPtr> docTrees; QList<ParserTreeItem::ConstPtr> docTrees;
unsigned revision = 0; unsigned revision = 0;
for (const QString &file : fileList) { for (const FilePath &fileInProject : filesInProject) {
const CPlusPlus::Document::Ptr &doc = d->document(file); const CPlusPlus::Document::Ptr &doc = d->document(fileInProject);
if (doc.isNull()) if (doc.isNull())
continue; continue;
@@ -210,11 +194,11 @@ ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList
docTrees.append(docTree); docTrees.append(docTree);
} }
ParserTreeItem::ConstPtr item = ParserTreeItem::mergeTrees(Utils::FilePath::fromString(projectId), docTrees); ParserTreeItem::ConstPtr item = ParserTreeItem::mergeTrees(projectPath, docTrees);
// update the cache // update the cache
if (!projectId.isEmpty()) { if (!projectPath.isEmpty()) {
ParserPrivate::ProjectCache &projectCache = d->m_projectCache[projectId]; ParserPrivate::ProjectCache &projectCache = d->m_projectCache[projectPath];
projectCache.tree = item; projectCache.tree = item;
projectCache.treeRevision = revision; projectCache.treeRevision = revision;
} }
@@ -227,15 +211,15 @@ ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList
Updates the internal cached tree for this project. Updates the internal cached tree for this project.
*/ */
ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const QStringList &fileList, ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const FilePath &projectPath,
const QString &projectId) const QSet<FilePath> &filesInProject)
{ {
const auto it = d->m_projectCache.constFind(projectId); const auto it = d->m_projectCache.constFind(projectPath);
if (it != d->m_projectCache.constEnd() && !it.value().tree.isNull()) { if (it != d->m_projectCache.constEnd() && !it.value().tree.isNull()) {
// calculate project's revision // calculate project's revision
unsigned revision = 0; unsigned revision = 0;
for (const QString &file : fileList) { for (const FilePath &fileInProject : filesInProject) {
const CPlusPlus::Document::Ptr &doc = d->document(file); const CPlusPlus::Document::Ptr &doc = d->document(fileInProject);
if (doc.isNull()) if (doc.isNull())
continue; continue;
revision += doc->revision(); revision += doc->revision();
@@ -246,7 +230,7 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const QStringList &
return it.value().tree; return it.value().tree;
} }
return getParseProjectTree(fileList, projectId); return getParseProjectTree(projectPath, filesInProject);
} }
/*! /*!
@@ -261,9 +245,7 @@ ParserTreeItem::ConstPtr Parser::getParseDocumentTree(const CPlusPlus::Document:
if (doc.isNull()) if (doc.isNull())
return ParserTreeItem::ConstPtr(); return ParserTreeItem::ConstPtr();
const QString &fileName = doc->fileName(); const FilePath fileName = FilePath::fromString(doc->fileName());
if (!d->fileList.contains(fileName))
return ParserTreeItem::ConstPtr();
ParserTreeItem::ConstPtr itemPtr = ParserTreeItem::parseDocument(doc); ParserTreeItem::ConstPtr itemPtr = ParserTreeItem::parseDocument(doc);
@@ -284,7 +266,7 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
return ParserTreeItem::ConstPtr(); return ParserTreeItem::ConstPtr();
const QString &fileName = doc->fileName(); const QString &fileName = doc->fileName();
const auto it = d->m_documentCache.constFind(fileName); const auto it = d->m_documentCache.constFind(FilePath::fromString(fileName));
if (it != d->m_documentCache.constEnd() && !it.value().tree.isNull() if (it != d->m_documentCache.constEnd() && !it.value().tree.isNull()
&& it.value().treeRevision == doc->revision()) { && it.value().treeRevision == doc->revision()) {
return it.value().tree; return it.value().tree;
@@ -297,13 +279,17 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
the internal storage. the internal storage.
*/ */
void Parser::updateDocuments(const QList<CPlusPlus::Document::Ptr> &docs) void Parser::updateDocuments(const QSet<FilePath> &documentPaths)
{ {
for (const CPlusPlus::Document::Ptr &doc: docs) { updateDocumentsFromSnapshot(documentPaths, CppTools::CppModelManager::instance()->snapshot());
const QString &name = doc->fileName(); }
// if it is external file (not in any of our projects) void Parser::updateDocumentsFromSnapshot(const QSet<Utils::FilePath> &documentPaths,
if (!d->fileList.contains(name)) const CPlusPlus::Snapshot &snapshot)
{
for (const FilePath &documentPath : documentPaths) {
CPlusPlus::Document::Ptr doc = snapshot.document(documentPath);
if (doc.isNull())
continue; continue;
getParseDocumentTree(doc); getParseDocumentTree(doc);
@@ -311,16 +297,6 @@ void Parser::updateDocuments(const QList<CPlusPlus::Document::Ptr> &docs)
requestCurrentState(); requestCurrentState();
} }
/*!
Specifies the files that must be allowed for the parsing as a \a fileList.
Files outside of this list will not be in any tree.
*/
void Parser::setFileList(const QStringList &fileList)
{
d->fileList = Utils::toSet(fileList);
}
/*! /*!
Removes the files defined in the \a fileList from the parsing. Removes the files defined in the \a fileList from the parsing.
*/ */
@@ -331,11 +307,11 @@ void Parser::removeFiles(const QStringList &fileList)
return; return;
for (const QString &name : fileList) { for (const QString &name : fileList) {
d->fileList.remove(name); const FilePath filePath = FilePath::fromString(name);
d->m_documentCache.remove(name); d->m_documentCache.remove(filePath);
d->m_projectCache.remove(name); d->m_projectCache.remove(filePath);
for (auto it = d->m_projectCache.begin(); it != d->m_projectCache.end(); ++it) for (auto it = d->m_projectCache.begin(); it != d->m_projectCache.end(); ++it)
it.value().fileList.removeOne(name); it.value().fileNames.remove(filePath);
} }
requestCurrentState(); requestCurrentState();
} }
@@ -343,75 +319,66 @@ void Parser::removeFiles(const QStringList &fileList)
/*! /*!
Fully resets the internal state of the code parser to \a snapshot. Fully resets the internal state of the code parser to \a snapshot.
*/ */
void Parser::resetData(const CPlusPlus::Snapshot &snapshot) void Parser::resetData(const QHash<FilePath, QPair<QString, FilePaths>> &projects)
{ {
d->m_projectCache.clear(); d->m_projectCache.clear();
d->m_documentCache.clear(); d->m_documentCache.clear();
for (auto it = snapshot.begin(); it != snapshot.end(); ++it)
d->m_documentCache[it.key().toString()].document = it.value();
// recalculate file list const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManager::instance()->snapshot();
FilePaths fileList; for (auto it = projects.cbegin(); it != projects.cend(); ++it) {
const auto projectData = it.value();
QSet<FilePath> commonFiles;
for (const auto &fileInProject : projectData.second) {
CPlusPlus::Document::Ptr doc = snapshot.document(fileInProject);
if (doc.isNull())
continue;
commonFiles.insert(fileInProject);
d->m_documentCache[fileInProject].document = doc;
}
d->m_projectCache.insert(it.key(), { 0, nullptr, projectData.first, commonFiles });
}
// TODO: move a call to SessionManager::projects() out of this thread requestCurrentState();
for (const Project *prj : SessionManager::projects()) }
fileList += prj->files(Project::SourceFiles);
setFileList(Utils::transform(fileList, &FilePath::toString)); void Parser::addProject(const FilePath &projectPath, const QString &projectName,
const FilePaths &filesInProject)
{
const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManager::instance()->snapshot();
QSet<FilePath> commonFiles;
for (const auto &fileInProject : filesInProject) {
CPlusPlus::Document::Ptr doc = snapshot.document(fileInProject);
if (doc.isNull())
continue;
commonFiles.insert(fileInProject);
d->m_documentCache[fileInProject].document = doc;
}
d->m_projectCache.insert(projectPath, { 0, nullptr, projectName, commonFiles });
updateDocumentsFromSnapshot(commonFiles, snapshot);
}
void Parser::removeProject(const FilePath &projectPath)
{
auto it = d->m_projectCache.find(projectPath);
if (it == d->m_projectCache.end())
return;
const QSet<FilePath> &filesInProject = it.value().fileNames;
for (const FilePath &fileInProject : filesInProject)
d->m_documentCache.remove(fileInProject);
d->m_projectCache.erase(it);
requestCurrentState(); requestCurrentState();
} }
/*!
Fully resets the internal state of the code parser to the current state.
\sa resetData
*/
void Parser::resetDataToCurrentState()
{
// get latest data
resetData(CppTools::CppModelManager::instance()->snapshot());
}
/*! /*!
Requests to emit a signal with the current tree state. Requests to emit a signal with the current tree state.
*/ */
void Parser::requestCurrentState() void Parser::requestCurrentState()
{ {
// TODO: we need to have a fresh SessionManager data here, which we could pass to parse()
emit treeRegenerated(parse()); emit treeRegenerated(parse());
} }
// TODO: don't use Project class in this thread
QStringList Parser::getAllFiles(const Project *project)
{
if (!project)
return {};
const QString projectPath = project->projectFilePath().toString();
const auto it = d->m_projectCache.constFind(projectPath);
if (it != d->m_projectCache.constEnd())
return it.value().fileList;
const QStringList fileList = Utils::transform(project->files(Project::SourceFiles),
&FilePath::toString);
d->m_projectCache[projectPath].fileList = fileList;
return fileList;
}
// TODO: don't use Project class in this thread
ParserTreeItem::ConstPtr Parser::addFlatTree(const Project *project)
{
if (!project)
return {};
const QStringList fileList = getAllFiles(project);
if (fileList.isEmpty())
return {};
return getCachedOrParseProjectTree(fileList, project->projectFilePath().toString());
}
} // namespace Internal } // namespace Internal
} // namespace ClassView } // namespace ClassView

View File

@@ -54,28 +54,29 @@ public:
void requestCurrentState(); void requestCurrentState();
void removeFiles(const QStringList &fileList); void removeFiles(const QStringList &fileList);
void resetDataToCurrentState(); void resetData(const QHash<Utils::FilePath, QPair<QString, Utils::FilePaths>> &projects);
void addProject(const Utils::FilePath &projectPath, const QString &projectName,
const Utils::FilePaths &filesInProject);
void removeProject(const Utils::FilePath &projectPath);
void setFlatMode(bool flat); void setFlatMode(bool flat);
void updateDocuments(const QList<CPlusPlus::Document::Ptr> &docs); void updateDocuments(const QSet<Utils::FilePath> &documentPaths);
signals: signals:
void treeRegenerated(const ParserTreeItem::ConstPtr &root); void treeRegenerated(const ParserTreeItem::ConstPtr &root);
private: private:
void setFileList(const QStringList &fileList); void updateDocumentsFromSnapshot(const QSet<Utils::FilePath> &documentPaths,
void resetData(const CPlusPlus::Snapshot &snapshot); const CPlusPlus::Snapshot &snapshot);
ParserTreeItem::ConstPtr getParseDocumentTree(const CPlusPlus::Document::Ptr &doc); ParserTreeItem::ConstPtr getParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
ParserTreeItem::ConstPtr getCachedOrParseDocumentTree(const CPlusPlus::Document::Ptr &doc); ParserTreeItem::ConstPtr getCachedOrParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
ParserTreeItem::ConstPtr getParseProjectTree(const QStringList &fileList, const QString &projectId); ParserTreeItem::ConstPtr getParseProjectTree(const Utils::FilePath &projectPath,
ParserTreeItem::ConstPtr getCachedOrParseProjectTree(const QStringList &fileList, const QSet<Utils::FilePath> &filesInProject);
const QString &projectId); ParserTreeItem::ConstPtr getCachedOrParseProjectTree(const Utils::FilePath &projectPath,
const QSet<Utils::FilePath> &filesInProject);
ParserTreeItem::ConstPtr parse(); ParserTreeItem::ConstPtr parse();
QStringList getAllFiles(const ProjectExplorer::Project *project);
ParserTreeItem::ConstPtr addFlatTree(const ProjectExplorer::Project *project);
//! Private class data pointer //! Private class data pointer
ParserPrivate *d; ParserPrivate *d;
}; };

View File

@@ -233,7 +233,8 @@ void addFileSystemNodes(ProjectNode *root, const QList<const FileNode *> &allFil
if (!fileSystemNode->isEmpty()) { if (!fileSystemNode->isEmpty()) {
// make file system nodes less probable to be selected when syncing with the current document // make file system nodes less probable to be selected when syncing with the current document
fileSystemNode->forEachGenericNode([](Node *n) { n->setPriority(n->priority() + 10); }); fileSystemNode->forEachGenericNode(
[](Node *n) { n->setPriority(n->priority() + Node::DefaultProjectFilePriority + 1); });
root->addNode(std::move(fileSystemNode)); root->addNode(std::move(fileSystemNode));
} }
} }

View File

@@ -1753,6 +1753,11 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
flags = EditorManager::DoNotSwitchToDesignMode; flags = EditorManager::DoNotSwitchToDesignMode;
activateEditorForDocument(view, document, flags); activateEditorForDocument(view, document, flags);
} }
} else {
// no documents left - set current view since view->removeEditor can
// trigger a focus change, context change, and updateActions, which
// requests the current EditorView
setCurrentView(currentView);
} }
} }
} }
@@ -1766,10 +1771,12 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
foreach (IEditor *editor, acceptedEditors) foreach (IEditor *editor, acceptedEditors)
delete editor; delete editor;
if (focusView) if (focusView) {
activateView(focusView); activateView(focusView);
else } else {
setCurrentView(currentView);
setCurrentEditor(currentView->currentEditor()); setCurrentEditor(currentView->currentEditor());
}
if (!EditorManager::currentEditor()) { if (!EditorManager::currentEditor()) {
emit m_instance->currentEditorChanged(nullptr); emit m_instance->currentEditorChanged(nullptr);

View File

@@ -142,6 +142,8 @@ Client::~Client()
} }
for (IAssistProcessor *processor : qAsConst(m_runningAssistProcessors)) for (IAssistProcessor *processor : qAsConst(m_runningAssistProcessors))
processor->setAsyncProposalAvailable(nullptr); processor->setAsyncProposalAvailable(nullptr);
qDeleteAll(m_documentHighlightsTimer);
m_documentHighlightsTimer.clear();
updateEditorToolBar(m_openedDocument.keys()); updateEditorToolBar(m_openedDocument.keys());
// do not handle messages while shutting down // do not handle messages while shutting down
disconnect(m_clientInterface.data(), &BaseClientInterface::messageReceived, disconnect(m_clientInterface.data(), &BaseClientInterface::messageReceived,
@@ -437,6 +439,64 @@ void Client::updateFunctionHintProvider(TextEditor::TextDocument *document)
} }
} }
void Client::requestDocumentHighlights(TextEditor::TextEditorWidget *widget)
{
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
if (m_dynamicCapabilities.isRegistered(DocumentHighlightsRequest::methodName).value_or(false)) {
TextDocumentRegistrationOptions option(
m_dynamicCapabilities.option(DocumentHighlightsRequest::methodName));
if (!option.filterApplies(widget->textDocument()->filePath()))
return;
} else {
Utils::optional<Utils::variant<bool, WorkDoneProgressOptions>> provider
= m_serverCapabilities.documentHighlightProvider();
if (!provider.has_value())
return;
if (Utils::holds_alternative<bool>(*provider) && !Utils::get<bool>(*provider))
return;
}
auto runningRequest = m_highlightRequests.find(uri);
if (runningRequest != m_highlightRequests.end())
cancelRequest(runningRequest.value());
DocumentHighlightsRequest request(
TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(widget->textCursor())));
request.setResponseCallback(
[widget = QPointer<TextEditor::TextEditorWidget>(widget), this, uri]
(const DocumentHighlightsRequest::Response &response)
{
m_highlightRequests.remove(uri);
if (!widget)
return;
const Id &id = TextEditor::TextEditorWidget::CodeSemanticsSelection;
QList<QTextEdit::ExtraSelection> selections;
const Utils::optional<DocumentHighlightsResult> &result = response.result();
if (!result.has_value() || holds_alternative<std::nullptr_t>(result.value())) {
widget->setExtraSelections(id, selections);
return;
}
const QTextCharFormat &format =
widget->textDocument()->fontSettings().toTextCharFormat(TextEditor::C_OCCURRENCES);
QTextDocument *document = widget->document();
for (const auto &highlight : get<QList<DocumentHighlight>>(result.value())) {
QTextEdit::ExtraSelection selection{widget->textCursor(), format};
const int &start = highlight.range().start().toPositionInDocument(document);
const int &end = highlight.range().end().toPositionInDocument(document);
if (start < 0 || end < 0)
continue;
selection.cursor.setPosition(start);
selection.cursor.setPosition(end, QTextCursor::KeepAnchor);
selections << selection;
}
widget->setExtraSelections(id, selections);
});
m_highlightRequests[uri] = request.id();
sendContent(request);
}
void Client::activateDocument(TextEditor::TextDocument *document) void Client::activateDocument(TextEditor::TextDocument *document)
{ {
auto uri = DocumentUri::fromFilePath(document->filePath()); auto uri = DocumentUri::fromFilePath(document->filePath());
@@ -453,11 +513,11 @@ void Client::activateDocument(TextEditor::TextDocument *document)
for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) { for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) {
updateEditorToolBar(editor); updateEditorToolBar(editor);
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) { if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) {
textEditor->editorWidget()->addHoverHandler(&m_hoverHandler); TextEditor::TextEditorWidget *widget = textEditor->editorWidget();
if (symbolSupport().supportsRename(document)) { widget->addHoverHandler(&m_hoverHandler);
textEditor->editorWidget()->addOptionalActions( requestDocumentHighlights(widget);
TextEditor::TextEditorActionHandler::RenameSymbol); if (symbolSupport().supportsRename(document))
} widget->addOptionalActions(TextEditor::TextEditorActionHandler::RenameSymbol);
} }
} }
} }
@@ -472,8 +532,11 @@ void Client::deactivateDocument(TextEditor::TextDocument *document)
highlighter->clearAllExtraFormats(); highlighter->clearAllExtraFormats();
} }
for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) { for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) {
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) {
textEditor->editorWidget()->removeHoverHandler(&m_hoverHandler); TextEditor::TextEditorWidget *widget = textEditor->editorWidget();
widget->removeHoverHandler(&m_hoverHandler);
widget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, {});
}
} }
} }
@@ -635,61 +698,38 @@ TextEditor::HighlightingResult createHighlightingResult(const SymbolInformation
void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget) void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget)
{ {
if (m_documentsToUpdate.contains(widget->textDocument())) TextEditor::TextDocument *document = widget->textDocument();
if (m_documentsToUpdate.contains(document))
return; // we are currently changing this document so postpone the DocumentHighlightsRequest return; // we are currently changing this document so postpone the DocumentHighlightsRequest
QTimer *timer = m_documentHighlightsTimer[widget];
if (!timer) {
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath()); const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
if (m_dynamicCapabilities.isRegistered(DocumentHighlightsRequest::methodName).value_or(false)) {
TextDocumentRegistrationOptions option(
m_dynamicCapabilities.option(DocumentHighlightsRequest::methodName));
if (!option.filterApplies(widget->textDocument()->filePath()))
return;
} else {
Utils::optional<Utils::variant<bool, WorkDoneProgressOptions>> provider
= m_serverCapabilities.documentHighlightProvider();
if (!provider.has_value())
return;
if (Utils::holds_alternative<bool>(*provider) && !Utils::get<bool>(*provider))
return;
}
auto runningRequest = m_highlightRequests.find(uri); auto runningRequest = m_highlightRequests.find(uri);
if (runningRequest != m_highlightRequests.end()) if (runningRequest != m_highlightRequests.end())
cancelRequest(runningRequest.value()); cancelRequest(runningRequest.value());
timer = new QTimer;
DocumentHighlightsRequest request( timer->setSingleShot(true);
TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(widget->textCursor()))); m_documentHighlightsTimer.insert(widget, timer);
request.setResponseCallback( connect(timer, &QTimer::timeout, this, [this, widget]() {
[widget = QPointer<TextEditor::TextEditorWidget>(widget), this, uri] requestDocumentHighlights(widget);
(DocumentHighlightsRequest::Response response) m_documentHighlightsTimer.take(widget)->deleteLater();
{
m_highlightRequests.remove(uri);
if (!widget)
return;
QList<QTextEdit::ExtraSelection> selections;
const DocumentHighlightsResult result = response.result().value_or(DocumentHighlightsResult());
if (!holds_alternative<QList<DocumentHighlight>>(result)) {
widget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, selections);
return;
}
const QTextCharFormat &format =
widget->textDocument()->fontSettings().toTextCharFormat(TextEditor::C_OCCURRENCES);
QTextDocument *document = widget->document();
for (const auto &highlight : get<QList<DocumentHighlight>>(result)) {
QTextEdit::ExtraSelection selection{widget->textCursor(), format};
const int &start = highlight.range().start().toPositionInDocument(document);
const int &end = highlight.range().end().toPositionInDocument(document);
if (start < 0 || end < 0)
continue;
selection.cursor.setPosition(start);
selection.cursor.setPosition(end, QTextCursor::KeepAnchor);
selections << selection;
}
widget->setExtraSelections(TextEditor::TextEditorWidget::CodeSemanticsSelection, selections);
}); });
m_highlightRequests[uri] = request.id(); connect(widget, &QWidget::destroyed, this, [widget, this]() {
sendContent(request); delete m_documentHighlightsTimer.take(widget);
});
}
const Id selectionsId(TextEditor::TextEditorWidget::CodeSemanticsSelection);
const QList semanticSelections = widget->extraSelections(selectionsId);
if (!semanticSelections.isEmpty()) {
auto selectionContainsPos =
[pos = widget->position()](const QTextEdit::ExtraSelection &selection) {
const QTextCursor cursor = selection.cursor;
return cursor.selectionStart() <= pos && cursor.selectionEnd() >= pos;
};
if (!Utils::anyOf(semanticSelections, selectionContainsPos))
widget->setExtraSelections(selectionsId, {});
}
timer->start(250);
} }
SymbolSupport &Client::symbolSupport() SymbolSupport &Client::symbolSupport()
@@ -893,6 +933,8 @@ bool Client::reset()
for (TextEditor::IAssistProcessor *processor : qAsConst(m_runningAssistProcessors)) for (TextEditor::IAssistProcessor *processor : qAsConst(m_runningAssistProcessors))
processor->setAsyncProposalAvailable(nullptr); processor->setAsyncProposalAvailable(nullptr);
m_runningAssistProcessors.clear(); m_runningAssistProcessors.clear();
qDeleteAll(m_documentHighlightsTimer);
m_documentHighlightsTimer.clear();
return true; return true;
} }

View File

@@ -199,6 +199,7 @@ private:
void updateCompletionProvider(TextEditor::TextDocument *document); void updateCompletionProvider(TextEditor::TextDocument *document);
void updateFunctionHintProvider(TextEditor::TextDocument *document); void updateFunctionHintProvider(TextEditor::TextDocument *document);
void requestDocumentHighlights(TextEditor::TextEditorWidget *widget);
void rehighlight(); void rehighlight();
using ContentHandler = std::function<void(const QByteArray &, QTextCodec *, QString &, using ContentHandler = std::function<void(const QByteArray &, QTextCodec *, QString &,
@@ -216,6 +217,7 @@ private:
QMap<TextEditor::TextDocument *, QMap<TextEditor::TextDocument *,
QList<LanguageServerProtocol::DidChangeTextDocumentParams::TextDocumentContentChangeEvent>> QList<LanguageServerProtocol::DidChangeTextDocumentParams::TextDocumentContentChangeEvent>>
m_documentsToUpdate; m_documentsToUpdate;
QMap<TextEditor::TextEditorWidget *, QTimer *> m_documentHighlightsTimer;
QTimer m_documentUpdateTimer; QTimer m_documentUpdateTimer;
Utils::Id m_id; Utils::Id m_id;
LanguageServerProtocol::ServerCapabilities m_serverCapabilities; LanguageServerProtocol::ServerCapabilities m_serverCapabilities;

View File

@@ -435,16 +435,11 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
if (auto client = clientForDocument(document)) if (auto client = clientForDocument(document))
client->symbolSupport().renameSymbol(document, cursor); client->symbolSupport().renameSymbol(document, cursor);
}); });
connect(widget, &TextEditorWidget::cursorPositionChanged, this, [this, widget]() { connect(widget, &TextEditorWidget::cursorPositionChanged, this, [widget]() {
// TODO This would better be a compressing timer
QTimer::singleShot(50, this, [widget = QPointer<TextEditorWidget>(widget)]() {
if (!widget)
return;
if (Client *client = clientForDocument(widget->textDocument())) if (Client *client = clientForDocument(widget->textDocument()))
if (client->reachable()) if (client->reachable())
client->cursorPositionChanged(widget); client->cursorPositionChanged(widget);
}); });
});
updateEditorToolBar(editor); updateEditorToolBar(editor);
if (TextEditor::TextDocument *document = textEditor->textDocument()) { if (TextEditor::TextDocument *document = textEditor->textDocument()) {
if (Client *client = m_clientForDocument[document]) if (Client *client = m_clientForDocument[document])

View File

@@ -29,7 +29,9 @@
#include "annotation.h" #include "annotation.h"
QT_BEGIN_NAMESPACE
class QDir; class QDir;
QT_END_NAMESPACE
namespace QmlDesigner { namespace QmlDesigner {

View File

@@ -63,9 +63,9 @@ CurveEditorStyle CurveEditorModel::style() const
{ {
// Pseudo auto generated. See: CurveEditorStyleDialog // Pseudo auto generated. See: CurveEditorStyleDialog
CurveEditorStyle out; CurveEditorStyle out;
out.backgroundBrush = QBrush(QColor(21, 21, 21)); out.backgroundBrush = QmlDesigner::Theme::getColor(QmlDesigner::Theme::DSsectionHeadBackground);
out.backgroundAlternateBrush = QBrush(QColor(32, 32, 32)); out.backgroundAlternateBrush = QmlDesigner::Theme::getColor(QmlDesigner::Theme::DSpanelBackground);
out.fontColor = QColor(255, 255, 255); out.fontColor = QmlDesigner::Theme::getColor(QmlDesigner::Theme::DStextColor);
out.gridColor = QColor(114, 116, 118); out.gridColor = QColor(114, 116, 118);
out.canvasMargin = 15; out.canvasMargin = 15;
out.zoomInWidth = 99; out.zoomInWidth = 99;

View File

@@ -363,6 +363,7 @@ void CurveEditorView::commitKeyframes(TreeItem *item)
void CurveEditorView::commitCurrentFrame(int frame) void CurveEditorView::commitCurrentFrame(int frame)
{ {
QmlTimeline timeline = activeTimeline(); QmlTimeline timeline = activeTimeline();
if (timeline.isValid())
timeline.modelNode().setAuxiliaryData("currentFrame@NodeInstance", frame); timeline.modelNode().setAuxiliaryData("currentFrame@NodeInstance", frame);
} }

View File

@@ -31,6 +31,9 @@
#include "treeitem.h" #include "treeitem.h"
#include "utils.h" #include "utils.h"
#include <theme.h>
#include <utils/fileutils.h>
#include <QAction> #include <QAction>
#include <QMenu> #include <QMenu>
#include <QResizeEvent> #include <QResizeEvent>
@@ -84,6 +87,11 @@ GraphicsView::GraphicsView(CurveEditorModel *model, QWidget *parent)
applyZoom(m_zoomX, m_zoomY); applyZoom(m_zoomX, m_zoomY);
update(); update();
const QString css = Theme::replaceCssColors(QString::fromUtf8(
Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css"))));
horizontalScrollBar()->setStyleSheet(css);
verticalScrollBar()->setStyleSheet(css);
} }
GraphicsView::~GraphicsView() GraphicsView::~GraphicsView()

View File

@@ -81,7 +81,17 @@ QTabBar::tab:selected {
QLineEdit { QLineEdit {
color: creatorTheme.DStextColor; color: creatorTheme.DStextColor;
background-color: creatorTheme.DSdockAreaBackground; background-color: creatorTheme.DScontrolBackground;
border: 1px solid creatorTheme.DScontrolOutline;
selection-color: creatorTheme.DStextSelectedTextColor; selection-color: creatorTheme.DStextSelectedTextColor;
selection-background-color: creatorTheme.DStextSelectionColor; selection-background-color: creatorTheme.DStextSelectionColor;
} }
QLineEdit:hover {
background-color: creatorTheme.DScontrolBackgroundHover;
}
QLineEdit:focus {
background-color: creatorTheme.DScontrolBackgroundInteraction;
border-color: creatorTheme.DScontrolOutlineInteraction;
}

View File

@@ -70,15 +70,17 @@ void TextEditItem::setFormEditorItem(FormEditorItem *formEditorItem)
setGeometry(rect); setGeometry(rect);
NodeMetaInfo metaInfo = m_formEditorItem->qmlItemNode().modelNode().metaInfo(); NodeMetaInfo metaInfo = m_formEditorItem->qmlItemNode().modelNode().metaInfo();
auto node = m_formEditorItem->qmlItemNode();
auto font = node.instanceValue("font").value<QFont>();
if (metaInfo.isValid() && if (metaInfo.isValid() &&
(metaInfo.isSubclassOf("QtQuick.TextEdit") (metaInfo.isSubclassOf("QtQuick.TextEdit")
|| metaInfo.isSubclassOf("QtQuick.Controls.TextArea"))) { || metaInfo.isSubclassOf("QtQuick.Controls.TextArea"))) {
QSize maximumSize = rect.size().toSize(); QSize maximumSize = rect.size().toSize();
textEdit()->setFont(font);
activateTextEdit(maximumSize); activateTextEdit(maximumSize);
} else { } else {
auto lineEdit = TextEditItemWidget::lineEdit(); auto lineEdit = TextEditItemWidget::lineEdit();
auto node = m_formEditorItem->qmlItemNode(); lineEdit->setFont(font);
lineEdit->setFont(node.instanceValue("font").value<QFont>());
activateLineEdit(); activateLineEdit();
} }

View File

@@ -55,11 +55,10 @@ constexpr int spacingg = 5;
const QColor background = Qt::white; const QColor background = Qt::white;
const QColor labelBackground = qRgb(0x70, 0x70, 0x70); PresetItemDelegate::PresetItemDelegate(const QColor& background)
const QColor canvasBackground = qRgb(0x46, 0x46, 0x46); : QStyledItemDelegate()
const QColor curveLine = qRgb(0xe6, 0xe7, 0xe8); , m_background(background)
{}
PresetItemDelegate::PresetItemDelegate() = default;
void PresetItemDelegate::paint(QPainter *painter, void PresetItemDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &opt, const QStyleOptionViewItem &opt,
@@ -80,10 +79,10 @@ void PresetItemDelegate::paint(QPainter *painter,
option.font.setPixelSize(Theme::instance()->smallFontPixelSize()); option.font.setPixelSize(Theme::instance()->smallFontPixelSize());
painter->save(); painter->save();
painter->fillRect(option.rect, canvasBackground); painter->fillRect(option.rect, m_background);
if (option.text.isEmpty()) if (option.text.isEmpty())
painter->fillRect(textRect, canvasBackground); painter->fillRect(textRect, m_background);
else else
painter->fillRect(textRect, Theme::instance()->qmlDesignerButtonColor()); painter->fillRect(textRect, Theme::instance()->qmlDesignerButtonColor());
@@ -118,23 +117,25 @@ QSize PresetItemDelegate::sizeHint(const QStyleOptionViewItem &opt, const QModel
return size; return size;
} }
QIcon paintPreview() QIcon paintPreview(const QColor& background)
{ {
QPixmap pm(iconWidth, iconHeight); QPixmap pm(iconWidth, iconHeight);
pm.fill(canvasBackground); pm.fill(background);
return QIcon(pm); return QIcon(pm);
} }
QIcon paintPreview(const EasingCurve &curve) QIcon paintPreview(const EasingCurve &curve, const QColor& background, const QColor& curveColor)
{ {
const QColor curveLine = Theme::getColor(Theme::DStextColor);
QPixmap pm(iconWidth, iconHeight); QPixmap pm(iconWidth, iconHeight);
pm.fill(canvasBackground); pm.fill(background);
QPainter painter(&pm); QPainter painter(&pm);
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
Canvas canvas(iconWidth, iconHeight, 2, 2, 9, 6, 0, 1); Canvas canvas(iconWidth, iconHeight, 2, 2, 9, 6, 0, 1);
canvas.paintCurve(&painter, curve, curveLine); canvas.paintCurve(&painter, curve, curveColor);
return QIcon(pm); return QIcon(pm);
} }
@@ -159,6 +160,8 @@ PresetList::PresetList(QSettings::Scope scope, QWidget *parent)
, m_scope(scope) , m_scope(scope)
, m_index(-1) , m_index(-1)
, m_filename(Internal::settingsFullFilePath(scope)) , m_filename(Internal::settingsFullFilePath(scope))
, m_background(Theme::getColor(Theme::DSsectionHeadBackground ))
, m_curveColor(Theme::getColor(Theme::DStextColor))
{ {
int magic = 4; int magic = 4;
int scrollBarWidth = this->style()->pixelMetric(QStyle::PM_ScrollBarExtent); int scrollBarWidth = this->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
@@ -168,7 +171,7 @@ PresetList::PresetList(QSettings::Scope scope, QWidget *parent)
setModel(new QStandardItemModel); setModel(new QStandardItemModel);
setItemDelegate(new PresetItemDelegate); setItemDelegate(new PresetItemDelegate(m_background));
setSpacing(spacingg); setSpacing(spacingg);
@@ -260,6 +263,16 @@ bool PresetList::isEditable(const QModelIndex &index) const
return flags.testFlag(Qt::ItemIsEditable); return flags.testFlag(Qt::ItemIsEditable);
} }
QColor PresetList::backgroundColor() const
{
return m_background;
}
QColor PresetList::curveColor() const
{
return m_curveColor;
}
void PresetList::initialize(int index) void PresetList::initialize(int index)
{ {
m_index = index; m_index = index;
@@ -278,7 +291,7 @@ void PresetList::readPresets()
for (int i = 0; i < curves.size(); ++i) { for (int i = 0; i < curves.size(); ++i) {
QVariant curveData = QVariant::fromValue(curves[i].curve()); QVariant curveData = QVariant::fromValue(curves[i].curve());
auto *item = new QStandardItem(paintPreview(curves[i].curve()), curves[i].name()); auto *item = new QStandardItem(paintPreview(curves[i].curve(), m_background, m_curveColor), curves[i].name());
item->setData(curveData, ItemRole_Data); item->setData(curveData, ItemRole_Data);
item->setEditable(m_scope == QSettings::UserScope); item->setEditable(m_scope == QSettings::UserScope);
item->setToolTip(curves[i].name()); item->setToolTip(curves[i].name());
@@ -320,7 +333,7 @@ void PresetList::revert(const QModelIndex &index)
for (const auto &curve : curves) { for (const auto &curve : curves) {
if (curve.name() == name) { if (curve.name() == name) {
item->setData(false, ItemRole_Dirty); item->setData(false, ItemRole_Dirty);
item->setData(paintPreview(curve.curve()), Qt::DecorationRole); item->setData(paintPreview(curve.curve(), m_background, m_curveColor), Qt::DecorationRole);
item->setData(QVariant::fromValue(curve.curve()), ItemRole_Data); item->setData(QVariant::fromValue(curve.curve()), ItemRole_Data);
item->setToolTip(name); item->setToolTip(name);
return; return;
@@ -334,7 +347,7 @@ void PresetList::updateCurve(const EasingCurve &curve)
if (!selectionModel()->hasSelection()) if (!selectionModel()->hasSelection())
return; return;
QVariant icon = QVariant::fromValue(paintPreview(curve)); QVariant icon = QVariant::fromValue(paintPreview(curve, m_background, m_curveColor));
QVariant curveData = QVariant::fromValue(curve); QVariant curveData = QVariant::fromValue(curve);
for (const auto &index : selectionModel()->selectedIndexes()) for (const auto &index : selectionModel()->selectedIndexes())
@@ -382,7 +395,7 @@ void PresetList::createItem()
void PresetList::createItem(const QString &name, const EasingCurve &curve) void PresetList::createItem(const QString &name, const EasingCurve &curve)
{ {
auto *item = new QStandardItem(paintPreview(curve), name); auto *item = new QStandardItem(paintPreview(curve, m_background, m_curveColor), name);
item->setData(QVariant::fromValue(curve), ItemRole_Data); item->setData(QVariant::fromValue(curve), ItemRole_Data);
item->setToolTip(name); item->setToolTip(name);
@@ -507,7 +520,8 @@ void PresetEditor::update(const EasingCurve &curve)
m_presets->selectionModel()->clear(); m_presets->selectionModel()->clear();
else { else {
if (m_customs->selectionModel()->hasSelection()) { if (m_customs->selectionModel()->hasSelection()) {
QVariant icon = QVariant::fromValue(paintPreview(curve)); QVariant icon = QVariant::fromValue(
paintPreview(curve, m_presets->backgroundColor(), m_presets->curveColor()));
QVariant curveData = QVariant::fromValue(curve); QVariant curveData = QVariant::fromValue(curve);
for (const QModelIndex &index : m_customs->selectionModel()->selectedIndexes()) for (const QModelIndex &index : m_customs->selectionModel()->selectedIndexes())
m_customs->setItemData(index, curveData, icon); m_customs->setItemData(index, curveData, icon);

View File

@@ -43,13 +43,16 @@ class PresetItemDelegate : public QStyledItemDelegate
Q_OBJECT Q_OBJECT
public: public:
PresetItemDelegate(); PresetItemDelegate(const QColor& background);
void paint(QPainter *painter, void paint(QPainter *painter,
const QStyleOptionViewItem &opt, const QStyleOptionViewItem &opt,
const QModelIndex &index) const override; const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
private:
QColor m_background;
}; };
class PresetList : public QListView class PresetList : public QListView
@@ -80,6 +83,10 @@ public:
bool isEditable(const QModelIndex &index) const; bool isEditable(const QModelIndex &index) const;
QColor backgroundColor() const;
QColor curveColor() const;
void initialize(int index); void initialize(int index);
void readPresets(); void readPresets();
@@ -118,6 +125,10 @@ private:
int m_index; int m_index;
QString m_filename; QString m_filename;
QColor m_background;
QColor m_curveColor;
}; };
class PresetEditor : public QStackedWidget class PresetEditor : public QStackedWidget

View File

@@ -6010,6 +6010,7 @@ void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block)
void TextEditorWidget::setLanguageSettingsId(Id settingsId) void TextEditorWidget::setLanguageSettingsId(Id settingsId)
{ {
d->m_tabSettingsId = settingsId; d->m_tabSettingsId = settingsId;
setCodeStyle(TextEditorSettings::codeStyle(settingsId));
} }
Id TextEditorWidget::languageSettingsId() const Id TextEditorWidget::languageSettingsId() const
@@ -6019,20 +6020,24 @@ Id TextEditorWidget::languageSettingsId() const
void TextEditorWidget::setCodeStyle(ICodeStylePreferences *preferences) void TextEditorWidget::setCodeStyle(ICodeStylePreferences *preferences)
{ {
textDocument()->indenter()->setCodeStylePreferences(preferences); TextDocument *document = d->m_document.data();
// Not fully initialized yet... wait for TextEditorWidgetPrivate::setupDocumentSignals
if (!document)
return;
document->indenter()->setCodeStylePreferences(preferences);
if (d->m_codeStylePreferences) { if (d->m_codeStylePreferences) {
disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged, disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged,
d->m_document.data(), &TextDocument::setTabSettings); document, &TextDocument::setTabSettings);
disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged, disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged,
this, &TextEditorWidget::slotCodeStyleSettingsChanged); this, &TextEditorWidget::slotCodeStyleSettingsChanged);
} }
d->m_codeStylePreferences = preferences; d->m_codeStylePreferences = preferences;
if (d->m_codeStylePreferences) { if (d->m_codeStylePreferences) {
connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged, connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged,
d->m_document.data(), &TextDocument::setTabSettings); document, &TextDocument::setTabSettings);
connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged, connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged,
this, &TextEditorWidget::slotCodeStyleSettingsChanged); this, &TextEditorWidget::slotCodeStyleSettingsChanged);
d->m_document->setTabSettings(d->m_codeStylePreferences->currentTabSettings()); document->setTabSettings(d->m_codeStylePreferences->currentTabSettings());
slotCodeStyleSettingsChanged(d->m_codeStylePreferences->currentValue()); slotCodeStyleSettingsChanged(d->m_codeStylePreferences->currentValue());
} }
} }

View File

@@ -5,6 +5,10 @@ add_subdirectory(qtlockedfile)
add_subdirectory(help) add_subdirectory(help)
add_subdirectory(registryaccess) add_subdirectory(registryaccess)
# PCHs used by qmake based plugin builds
qtc_add_public_header(qtcreator_pch.h)
qtc_add_public_header(qtcreator_gui_pch.h)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qbs/CMakeLists.txt) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/qbs/CMakeLists.txt)
set(BUILD_QBS_DEFAULT YES) set(BUILD_QBS_DEFAULT YES)
else() else()

View File

@@ -209,7 +209,8 @@ def __getExpectedCompilers__():
expected.extend(__getWinCompilers__()) expected.extend(__getWinCompilers__())
compilers = ["g++", "gcc"] compilers = ["g++", "gcc"]
if platform.system() in ('Linux', 'Darwin'): if platform.system() in ('Linux', 'Darwin'):
for c in ('clang++', 'clang', 'afl-clang', 'clang-[0-9]', 'clang-[0-9].[0-9]', for c in ('clang++', 'clang', 'afl-clang',
'clang-[0-9]', 'clang-[0-9].[0-9]', 'clang-1[0-9]', 'clang-1[0-9].[0-9]',
'*g++*', '*gcc*'): '*g++*', '*gcc*'):
compilers.extend(findAllFilesInPATH(c)) compilers.extend(findAllFilesInPATH(c))
if platform.system() == 'Darwin': if platform.system() == 'Darwin':