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
SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}"
PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
)
endif()
@@ -500,6 +502,8 @@ function(add_qtc_plugin target_name)
set_target_properties(${target_name} PROPERTIES
SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}"
PREFIX ""
IMPORT_SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORT_PREFIX ""
)
endif()
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/
**
** This file is part of the Qt Creator documentation.
@@ -28,22 +28,22 @@
\section1 Creating UIs for MCUs
\l{Qt for MCUs} enables you to use subsets of QML and Qt Quick Controls
types to create UIs for devices that are powered by microcontroller units
(MCU). The subset of supported types depends on the Qt for MCUs version
that you use for development. In this manual, we indicate which components
are supported at the time of writing.
\l{Qt for MCUs} enables you to use subsets of components to create UIs for
devices that are powered by microcontroller units (MCU). The subset of
supported components depends on the Qt for MCUs version that you use for
development. In this manual, we indicate which components are supported at
the time of writing.
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
in \uicontrol Library. Only a subset of properties is supported for the
supported types. The properties that are not available on MCUs are marked
in the \uicontrol Properties view by enclosing them in square brackets.
the components available on MCUs are displayed in the \uicontrol Components
tab in \l Library. Only a subset of properties is supported for the
supported components. The properties that are not available on MCUs are
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
\l{Qt for MCUs - All QML Types}.
For more information about the supported components and their properties,
see \l{Qt for MCUs - All QML Types}.
//! [mcu qtquick components]
*/

View File

@@ -58,6 +58,8 @@ bool isPropertyBlackListed(const QmlDesigner::PropertyName &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(
PropertyNameList *propertyNameList, const QQuickDesignerSupport::PropertyName &propertyName)
{
@@ -132,12 +134,19 @@ PropertyNameList allPropertyNamesInline(QObject *object,
return propertyNameList;
}
#endif
PropertyNameList allPropertyNames(QObject *object,
const PropertyName &baseName,
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);
#else
return QQuickDesignerSupportProperties::allPropertyNames(object, baseName, inspectedObjects);
#endif
}
PropertyNameList propertyNameListForWritableProperties(QObject *object,

View File

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

View File

@@ -48,6 +48,7 @@ set(PROJECT_SOURCES
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(%{ProjectName}
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
@if %{HasTranslation}
@@ -77,3 +78,7 @@ set_target_properties(%{ProjectName} PROPERTIES
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
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
DStitleBarText=ffdadada
DStitleBarIcon=f4f5052
DStitleBarIcon=ff4f5052
DStitleBarButtonHover=40ffffff
DStitleBarButtonPress=60ffffff

View File

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

View File

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

View File

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

View File

@@ -6,12 +6,15 @@ Syntax highlighting engine for Kate syntax definitions
1. [Introduction](#introduction)
2. [Out of scope](#out-of-scope)
3. [Syntax Definition Files](#syntax-definition-files)
4. [Build it](#build-it)
5. [How to contribute](#how-to-contribute)
6. [Adding unit tests for a syntax definition](#adding-unit-tests-for-a-syntax-definition)
3. [Syntax definition files](#syntax-definition-files)
4. [Color theme files](#color-theme-files)
5. [Build it](#build-it)
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)
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
@@ -33,7 +36,7 @@ out of scope:
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,
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>
<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>
</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
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
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
```
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/).
**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
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)
* [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
are going to modify a XML file, adds examples to existing test files.
Then, it is necessary to generate and update the files in **autotests/folding/**,
**autotests/html/** and **autotests/reference/**, which must be included in the
patches. The instructions are in the [next section](#adding-unit-tests-for-a-syntax-definition).
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
**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=---)
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,
please run after successful **build** & **test** the following make target:

View File

@@ -3,10 +3,10 @@
#ifndef 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_MINOR 75
#define SyntaxHighlighting_VERSION_MINOR 80
#define SyntaxHighlighting_VERSION_PATCH 0
#define SyntaxHighlighting_VERSION ((5<<16)|(75<<8)|(0))
#define SyntaxHighlighting_VERSION ((5<<16)|(80<<8)|(0))
#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
macro(generate_php_syntax_definition targetFile srcFile)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax)
execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generators/generate-php.pl
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/syntax/${srcFile}
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/generated/syntax/${targetFile})
generate_syntax_definition(generate-php.pl ${targetFile} ${srcFile} ${CMAKE_CURRENT_SOURCE_DIR}/syntax/php.xml)
endmacro()
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(mustache-php.xml mustache.xml)
# generate DoxygenLua definition
generate_syntax_definition(generate-doxygenlua.pl doxygenlua.xml doxygen.xml)
# find all definitions
file(GLOB src_defs "${CMAKE_CURRENT_SOURCE_DIR}/syntax/*.xml")
set(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
)
set(defs ${src_defs} ${gen_defs})
# theme data resource
qt5_add_resources(themes_QRC ${CMAKE_CURRENT_SOURCE_DIR}/themes/theme-data.qrc)
@@ -43,7 +56,7 @@ if (QRC_SYNTAX)
# generate the index file
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax"
COMMAND katehighlightingindexer "${CMAKE_CURRENT_BINARY_DIR}/index.katesyntax" "${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd" "${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc"
DEPENDS ${defs} ${CMAKE_CURRENT_SOURCE_DIR}/schema/language.xsd ${CMAKE_CURRENT_BINARY_DIR}/syntax-data.qrc
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...
@@ -57,7 +70,7 @@ if (QRC_SYNTAX)
add_library(SyntaxHighlightingData OBJECT ${themes_QRC} ${CMAKE_CURRENT_BINARY_DIR}/qrc_syntax-data.cpp)
else()
# install the syntax files as normal files into the prefix
install (FILES ${defs} DESTINATION share/org.kde.syntax-highlighting/syntax)
install (FILES ${defs} DESTINATION ${KDE_INSTALL_DATADIR}/org.kde.syntax-highlighting/syntax)
# object library to make cross-folder dependencies work, only themes
add_library(SyntaxHighlightingData OBJECT ${themes_QRC})

View File

@@ -14,9 +14,15 @@
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
name="CMake"
version="25"
version="31"
kateversion="5.0"
section="Other"
extensions="CMakeLists.txt;*.cmake;*.cmake.in"
@@ -28,66 +34,66 @@
<highlighting>
<list name="commands">
{%- for command in commands %}
<item>{{command.name}}</item>
{%- endfor %}
<!--[- for command in commands ]-->
<item><!--{command.name}--></item>
<!--[- endfor ]-->
</list>
{% for command in commands -%}
{%- if command.named_args and command.named_args.kw %}
<list name="{{command.name}}_nargs">
{%- for arg in command.named_args.kw %}
<item>{{arg}}</item>
{%- endfor %}
<!--[ for command in commands -]-->
<!--[- if command.named_args and command.named_args.kw ]-->
<list name="<!--{command.name}-->_nargs">
<!--[- for arg in command.named_args.kw ]-->
<item><!--{arg}--></item>
<!--[- endfor ]-->
</list>
{%- endif %}
{%- if command.special_args and command.special_args.kw %}
<list name="{{command.name}}_sargs">
{%- for arg in command.special_args.kw %}
<item>{{arg}}</item>
{%- endfor %}
<!--[- endif ]-->
<!--[- if command.special_args and command.special_args.kw ]-->
<list name="<!--{command.name}-->_sargs">
<!--[- for arg in command.special_args.kw ]-->
<item><!--{arg}--></item>
<!--[- endfor ]-->
</list>
{%- endif %}
{%- endfor %}
<!--[- endif ]-->
<!--[- endfor ]-->
<list name="variables">
{%- for var in variables.kw %}
<item>{{var}}</item>
{%- endfor %}
<!--[- for var in variables.kw ]-->
<item><!--{var}--></item>
<!--[- endfor ]-->
</list>
<list name="deprecated-or-internal-variables">
{%- for var in deprecated_or_internal_variables.kw %}
<item>{{var}}</item>
{%- endfor %}
<!--[- for var in deprecated_or_internal_variables.kw ]-->
<item><!--{var}--></item>
<!--[- endfor ]-->
</list>
<list name="environment-variables">
{%- for var in environment_variables.kw %}
<item>{{var}}</item>
{%- endfor %}
<!--[- for var in environment_variables.kw ]-->
<item><!--{var}--></item>
<!--[- endfor ]-->
</list>
{%- for kind in properties.kinds %}
<list name="{{ kind|replace('_', '-') }}">
{%- for prop in properties[kind].kw %}
<item>{{prop}}</item>
{%- endfor %}
<!--[- for kind in properties.kinds ]-->
<list name="<!--{ kind|replace('_', '-') }-->">
<!--[- for prop in properties[kind].kw ]-->
<item><!--{prop}--></item>
<!--[- endfor ]-->
</list>
{%- endfor %}
<!--[- endfor ]-->
<list name="generator-expressions">
{%- for expr in generator_expressions %}
<item>{{ expr }}</item>
{%- endfor %}
<!--[- for expr in generator_expressions ]-->
<item><!--{ expr }--></item>
<!--[- endfor ]-->
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text">
<DetectSpaces/>
{% 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 %} />
{% endfor -%}
<!--[ 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 ]--> />
<!--[ endfor -]-->
<DetectChar attribute="Comment" context="Match Comments and Docs" char="#" lookAhead="true" />
<DetectIdentifier attribute="User Function/Macro" context="User Function" />
<RegExpr attribute="@Variable Substitution" context="@VarSubst" String="@&id_re;@" lookAhead="true" />
@@ -95,71 +101,64 @@
<keyword attribute="Command" context="#stay" String="commands" />
</context>
{% for command in commands -%}
{#
<!--
{{ command|pprint }}
-->
-#}
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx">
<DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op" char="(" />
<!--[ for command in commands -]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx">
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op" char="(" />
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op">
{%- if command.nested_parentheses %}
<DetectChar attribute="Normal Text" context="{{command.name}}_ctx_op_nested" char="(" />
{%- endif %}
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op">
<!--[- if command.nested_parentheses ]-->
<DetectChar attribute="Normal Text" context="<!--{command.name}-->_ctx_op_nested" char="(" />
<!--[- endif ]-->
<IncludeRules context="EndCmdPop2" />
{%- if command.named_args and command.named_args.kw %}
<keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" />
{%- endif %}
{%- if command.special_args and command.special_args.kw %}
<keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" />
{%- endif %}
{%- if command.property_args and command.property_args.kw %}
{%- for kind in command.property_args.kw %}
<keyword attribute="Property" context="#stay" String="{{kind}}" />
{%- if properties[kind|replace('-', '_')].re %}
<IncludeRules context="Detect More {{kind}}" />
{%- endif %}
{%- endfor %}
{%- endif %}
{%- if command is not nulary %}
<!--[- if command.named_args and command.named_args.kw ]-->
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
<!--[- endif ]-->
<!--[- if command.special_args and command.special_args.kw ]-->
<keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
<!--[- endif ]-->
<!--[- if command.property_args and command.property_args.kw ]-->
<!--[- for kind in command.property_args.kw ]-->
<keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
<!--[- if properties[kind|replace('-', '_')].re ]-->
<IncludeRules context="Detect More <!--{kind}-->" />
<!--[- endif ]-->
<!--[- endfor ]-->
<!--[- endif ]-->
<!--[- if command is not nulary ]-->
<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 -->
<RegExpr attribute="Special Args" context="#stay" String="\bCMP[0-9]+\b" />
{%- endif %}
{%- endif %}
<!--[- endif ]-->
<!--[- endif ]-->
</context>
{%- if command.nested_parentheses %}
<context attribute="Normal Text" lineEndContext="#stay" name="{{command.name}}_ctx_op_nested">
<!--[- if command.nested_parentheses ]-->
<context attribute="Normal Text" lineEndContext="#stay" name="<!--{command.name}-->_ctx_op_nested">
<IncludeRules context="EndCmdPop" />
{%- if command.named_args and command.named_args.kw %}
<keyword attribute="Named Args" context="#stay" String="{{command.name}}_nargs" />
{%- endif %}
{%- if command.special_args and command.special_args.kw %}
<keyword attribute="Special Args" context="#stay" String="{{command.name}}_sargs" />
{%- endif %}
{%- if command.property_args and command.property_args.kw %}
{%- for kind in command.property_args.kw %}
<keyword attribute="Property" context="#stay" String="{{kind}}" />
{%- if properties[kind|replace('-', '_')].re %}
<IncludeRules context="Detect More {{kind}}" />
{%- endif %}
{%- endfor %}
{%- endif %}
<!--[- if command.named_args and command.named_args.kw ]-->
<keyword attribute="Named Args" context="#stay" String="<!--{command.name}-->_nargs" />
<!--[- endif ]-->
<!--[- if command.special_args and command.special_args.kw ]-->
<keyword attribute="Special Args" context="#stay" String="<!--{command.name}-->_sargs" />
<!--[- endif ]-->
<!--[- if command.property_args and command.property_args.kw ]-->
<!--[- for kind in command.property_args.kw ]-->
<keyword attribute="Property" context="#stay" String="<!--{kind}-->" />
<!--[- if properties[kind|replace('-', '_')].re ]-->
<IncludeRules context="Detect More <!--{kind}-->" />
<!--[- endif ]-->
<!--[- endfor ]-->
<!--[- endif ]-->
<IncludeRules context="User Function Args" />
</context>
{%- endif %}
{% endfor -%}
<!--[- endif ]-->
<!--[ endfor -]-->
{% for kind in properties.kinds if properties[kind].re -%}
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More {{ kind|replace('_', '-') }}">
{%- for prop in properties[kind].re %}
<RegExpr attribute="Property" context="#stay" String="{{prop}}" />
{%- endfor %}
</context>{{ '\n' }}
{% endfor -%}
<!--[ for kind in properties.kinds if properties[kind].re -]-->
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More <!--{ kind|replace('_', '-') }-->">
<RegExpr attribute="Property" context="#stay" String="<!--{properties[kind].re}-->" />
</context><!--{ '\n' }-->
<!--[ endfor -]-->
<context attribute="Normal Text" lineEndContext="#stay" name="EndCmdPop">
<DetectChar attribute="Normal Text" context="#pop" char=")" />
@@ -187,12 +186,12 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect More Builtin Variables">
{%- for var in deprecated_or_internal_variables.re %}
<RegExpr attribute="CMake Internal Variable" context="#stay" String="{{var}}" />
{%- endfor %}
{%- for var in variables.re %}
<RegExpr attribute="Builtin Variable" context="#stay" String="{{var}}" />
{%- endfor %}
<!--[- if deprecated_or_internal_variables.re ]-->
<RegExpr attribute="CMake Internal Variable" context="#stay" String="<!--{deprecated_or_internal_variables.re}-->" />
<!--[- endif ]-->
<!--[- if variables.re ]-->
<RegExpr attribute="Builtin Variable" context="#stay" String="<!--{variables.re}-->" />
<!--[- endif ]-->
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Variable Substitutions">
@@ -204,9 +203,9 @@
<context attribute="Environment Variable Substitution" lineEndContext="#pop" name="EnvVarSubst">
<keyword attribute="Standard Environment Variable" context="#stay" String="environment-variables" insensitive="false" />
{%- for var in environment_variables.re %}
<RegExpr attribute="Standard Environment Variable" context="#stay" String="{{var}}" />
{%- endfor %}
<!--[- if environment_variables.re ]-->
<RegExpr attribute="Standard Environment Variable" context="#stay" String="<!--{environment_variables.re}-->" />
<!--[- endif ]-->
<DetectIdentifier />
<IncludeRules context="Detect Variable Substitutions" />
<DetectChar attribute="Environment Variable Substitution" context="#pop" char="}" />
@@ -248,10 +247,20 @@
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Detect Special Values">
<WordDetect attribute="True Special Arg" context="#stay" String="TRUE" />
<WordDetect attribute="True Special Arg" context="#stay" String="ON" />
<WordDetect attribute="False Special Arg" context="#stay" String="FALSE" />
<WordDetect attribute="False Special Arg" context="#stay" String="OFF" />
<RegExpr attribute="Version Arg" context="#stay" String="\b[0-9]+(.[0-9]+)+\b" />
<!-- Source/cmStringAlgorithms.cxx: bool cmIsOff(cm::string_view val) -->
<WordDetect attribute="True Special Arg" context="#stay" String="TRUE" insensitive="true" />
<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="Special Args" context="#stay" String="\bCMP[0-9][0-9][0-9]\b" />
</context>
@@ -273,8 +282,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#pop" />
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<context attribute="Comment" lineEndContext="#stay" name="RST Documentation" dynamic="true">
@@ -286,8 +294,7 @@
<LineContinue attribute="Comment" context="#stay" />
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="]%1]" dynamic="true" endRegion="BracketedComment" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<context attribute="Strings" lineEndContext="#stay" name="String">
@@ -331,6 +338,7 @@
<itemData name="Special Args" defStyleNum="dsOthers" 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="Version Arg" defStyleNum="dsDataType" spellChecking="false" />
<itemData name="Strings" defStyleNum="dsString" spellChecking="true" />
<itemData name="Escapes" defStyleNum="dsSpecialChar" 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="multiLine" start="#[[" end="]]" region="BracketedComment"/>
</comments>
<keywords casesensitive="1" />
<keywords casesensitive="1" weakDeliminator="." />
</general>
</language>

View File

@@ -232,6 +232,9 @@ target-properties:
- INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
- INTERPROCEDURAL_OPTIMIZATION
- 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_LINK
- LABELS
@@ -274,6 +277,14 @@ target-properties:
- NAME
- NO_SONAME
- 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
- OSX_CURRENT_VERSION # Since 3.17
@@ -281,6 +292,7 @@ target-properties:
- OUTPUT_NAME_<CONFIG>
- OUTPUT_NAME
- PCH_WARN_INVALID # Since 3.18
- PCH_INSTANTIATE_TEMPLATES # Since 3.19
- PDB_NAME_<CONFIG>
- PDB_NAME
- PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -362,6 +374,7 @@ target-properties:
- XCODE_ATTRIBUTE_<an-attribute>
- XCODE_EXPLICIT_FILE_TYPE
- XCODE_GENERATE_SCHEME # Since 3.15
- XCODE_LINK_BUILD_PHASE_MODE # Since 3.19
- XCODE_PRODUCT_TYPE
- XCODE_SCHEME_ADDRESS_SANITIZER # 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_HOST_ARCHITECTURE
- 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
- <PROJECT-NAME>_BINARY_DIR
- <PROJECT-NAME>_DESCRIPTION # Since 3.12
- <PROJECT-NAME>_HOMEPAGE_URL # Since 3.12
- <PROJECT-NAME>_SOURCE_DIR
- <PROJECT-NAME>_VERSION
- <PROJECT-NAME>_VERSION_MAJOR
@@ -679,7 +695,7 @@ variables:
- <PROJECT-NAME>_VERSION_PATCH
- <PROJECT-NAME>_VERSION_TWEAK
- PROJECT_BINARY_DIR
- PROJECT_DESCRIPTION
- PROJECT_DESCRIPTION # Since 3.9
- PROJECT_HOMEPAGE_URL # Since 3.12
- PROJECT_NAME
- PROJECT_SOURCE_DIR
@@ -695,6 +711,7 @@ variables:
- CMAKE_AUTOMOC_RELAXED_MODE
- CMAKE_BACKWARDS_COMPATIBILITY
- CMAKE_BUILD_TYPE
- CMAKE_CLANG_VFS_OVERLAY # Since 3.19
- CMAKE_CODEBLOCKS_COMPILER_ID # Since 3.11
- CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES # Since 3.10
- CMAKE_CODELITE_USE_TARGETS
@@ -777,7 +794,9 @@ variables:
- CMAKE_USER_MAKE_RULES_OVERRIDE
- CMAKE_WARN_DEPRECATED
- CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
- CMAKE_XCODE_GENERATE_SCHEME
- 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_USE_AFTER_RETURN # Since 3.13
- CMAKE_XCODE_SCHEME_WORKING_DIRECTORY # Since 3.17
@@ -869,6 +888,7 @@ variables:
- CMAKE_ANDROID_SKIP_ANT_STEP
- CMAKE_ANDROID_STANDALONE_TOOLCHAIN
- CMAKE_ANDROID_STL_TYPE
- CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY
- CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_AUTOGEN_ORIGIN_DEPENDS # Since 3.14
@@ -951,10 +971,12 @@ variables:
- CMAKE_NINJA_OUTPUT_PATH_PREFIX
- CMAKE_NO_BUILTIN_CHRPATH
- CMAKE_NO_SYSTEM_FROM_IMPORTED
- CMAKE_OPTIMIZE_DEPENDENCIES # Since 3.19
- CMAKE_OSX_ARCHITECTURES
- CMAKE_OSX_DEPLOYMENT_TARGET
- CMAKE_OSX_SYSROOT
- CMAKE_PCH_WARN_INVALID # Since 3.18
- CMAKE_PCH_INSTANTIATE_TEMPLATES # Since 3.19
- CMAKE_PDB_OUTPUT_DIRECTORY
- CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>
- CMAKE_POSITION_INDEPENDENT_CODE
@@ -1015,6 +1037,9 @@ variables:
- CMAKE_Fortran_MODDIR_DEFAULT
- CMAKE_Fortran_MODDIR_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_PREFIX
- CMAKE_<LANG>_ANDROID_TOOLCHAIN_SUFFIX
@@ -1063,6 +1088,12 @@ variables:
- CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS
- CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES
- 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_USER_MAKE_RULES_OVERRIDE_<LANG>
# Variables for CTest
@@ -1190,8 +1221,11 @@ variables:
- <pfx>_UNPARSED_ARGUMENTS
- <pfx>_KEYWORDS_MISSING_VALUES
# Well known CMake's official module's variables
# - CheckCompilerFlag
# - CheckCCompilerFlag
# - CheckSourceCompiles
# - CheckCSourceCompiles
# - CheckSourceRuns
# - CheckCSourceRuns
# - CheckCxxCompilerFlag
# - CheckCxxSourceCompiles
@@ -1337,6 +1371,7 @@ variables:
- CPACK_EXTERNAL_REQUESTED_VERSIONS
- CPACK_EXTERNAL_ENABLE_STAGING
- CPACK_EXTERNAL_PACKAGE_SCRIPT
- CPACK_EXTERNAL_BUILT_PACKAGES # Since 3.19
# - CPackIFW
- CPACK_IFW_ROOT
- QTIFWDIR
@@ -1597,6 +1632,9 @@ variables:
- CPACK_PACKAGE_INSTALL_REGISTRY_KEY
- CPACK_CREATE_DESKTOP_LINKS
- CPACK_BINARY_<GENNAME>
- CPACK_PRE_BUILD_SCRIPTS # Since 3.19
- CPACK_POST_BUILD_SCRIPTS # Since 3.19
- CPACK_PACKAGE_FILES # Since 3.19
# - CPackWIX
- CPACK_WIX_UPGRADE_GUID
- CPACK_WIX_PRODUCT_GUID
@@ -1621,6 +1659,7 @@ variables:
- CPACK_WIX_SKIP_PROGRAM_FOLDER
- CPACK_WIX_ROOT_FOLDER_ID
- CPACK_WIX_ROOT
- CPACK_WIX_CUSTOM_XMLNS # Since 3.19
# - CTest
# - Dart
- BUILD_TESTING
@@ -1750,6 +1789,7 @@ deprecated-or-internal-variables:
# NOTE Added to syntax file version 14 at 3.15.0 version of CMake
environment-variables:
# Environment Variables that Control the Build
- CMAKE_APPLE_SILICON_PROCESSOR # Since 3.19.2
- CMAKE_BUILD_PARALLEL_LEVEL
- CMAKE_CONFIG_TYPE
- CMAKE_EXPORT_COMPILE_COMMANDS # Since 3.17
@@ -1837,7 +1877,19 @@ scripting-commands:
]
-
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
named-args: [VERSION, FATAL_ERROR]
@@ -1850,7 +1902,13 @@ scripting-commands:
special-args: [OLD, NEW]
-
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]
-
name: continue
@@ -1934,6 +1992,7 @@ scripting-commands:
, ENCODING
, ECHO_OUTPUT_VARIABLE # Since 3.18
, ECHO_ERROR_VARIABLE # Since 3.18
, COMMAND_ERROR_IS_FATAL # Since 3.19
]
special-args: [
NONE
@@ -1943,6 +2002,8 @@ scripting-commands:
, UTF8
, STDERR # 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
-
@@ -2009,6 +2070,7 @@ scripting-commands:
, INPUT
, CONTENT
, CONDITION
, TARGET # Since 3.19
, COPY
, INSTALL
, DESTINATION
@@ -2040,7 +2102,8 @@ scripting-commands:
, ARCHIVE_CREATE
, FILES
, FORMAT
, TYPE
, COMPRESSION
, COMPRESSION_LEVEL # Since 3.19
, MTIME
, VERBOSE
, ARCHIVE_EXTRACT
@@ -2049,6 +2112,10 @@ scripting-commands:
, ESCAPE_QUOTES
, "@ONLY"
, NEWLINE_STYLE
, CHMOD # Since 3.19
, CHMOD_RECURSE # Since 3.19
, REAL_PATH # Since 3.19
, BASE_DIRECTORY # Since 3.19
]
special-args: [
UTF-8
@@ -2345,7 +2412,13 @@ scripting-commands:
nulary?: true
-
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
named-args: [PROPERTIES]
@@ -2429,6 +2502,16 @@ scripting-commands:
, NAME
, TYPE
, UPPER
# Since 3.19
, JSON
, ERROR_VARIABLE
, GET
, TYPE
, MEMBER
, LENGTH
, REMOVE
, SET
, EQUAL
]
-
name: unset
@@ -2532,6 +2615,7 @@ project-commands:
, CSharp
, CXX
, CUDA
, ISPC # Since 3.19
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16
@@ -2656,6 +2740,7 @@ project-commands:
, CSharp
, CXX
, CUDA
, ISPC # Since 3.19
, Java
, OBJC # Since 3.16
, OBJCXX # Since 3.16

View File

@@ -3,7 +3,7 @@
#
# 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:
#
@@ -43,21 +43,29 @@ def try_transform_placeholder_string_to_regex(name):
'''
m = _TEMPLATED_NAME.split(name)
if 'CMAKE_MATCH_' in m:
return '\\bCMAKE_MATCH_[0-9]+\\b'
return 'CMAKE_MATCH_[0-9]+'
if 'CMAKE_ARGV' in m:
return '\\bCMAKE_ARGV[0-9]+\\b'
return 'CMAKE_ARGV[0-9]+'
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:
return '\\bCMAKE_POLICY_WARNING_CMP[0-9]{4}\\b'
return 'CMAKE_POLICY_WARNING_CMP[0-9]{4}'
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):
@@ -73,7 +81,7 @@ def _transform_command_set(cmd, list_name):
list_name = list_name.replace('-', '_')
cmd[list_name] = {k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [args, args_re])}
cmd[list_name]['re'] = [*map(lambda x: try_transform_placeholder_string_to_regex(x), args_re)]
cmd[list_name]['re'] = try_placeholders_to_regex(args_re)
return cmd
@@ -136,12 +144,7 @@ def cli(input_yaml, template):
, [*partition_iterable(lambda x: _TEMPLATED_NAME.search(x) is None, data[var_key])]
)
}
data[var_key]['re'] = [
*map(
lambda x: try_transform_placeholder_string_to_regex(x)
, data[var_key]['re']
)
]
data[var_key]['re'] = try_placeholders_to_regex(data[var_key]['re'])
# Transform properties and make all-properties list
data['properties'] = {}
@@ -153,18 +156,16 @@ def cli(input_yaml, template):
data['properties'][python_prop_list_name] = {
k: sorted(set(v)) for k, v in zip(_KW_RE_LIST, [props, props_re])
}
data['properties'][python_prop_list_name]['re'] = [
*map(lambda x: try_transform_placeholder_string_to_regex(x), props_re)
]
data['properties'][python_prop_list_name]['re'] = try_placeholders_to_regex(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
data['commands'] = [
*map(
lambda cmd: transform_command(cmd)
data['commands'] = list(
map(
transform_command
, data['scripting-commands'] + data['project-commands'] + data['ctest-commands'])
]
)
# Fix node names to be accessible from Jinja template
data['generator_expressions'] = data['generator-expressions']
@@ -177,6 +178,12 @@ def cli(input_yaml, template):
env = jinja2.Environment(
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
env.tests['nulary'] = cmd_is_nulary

View File

@@ -19,7 +19,13 @@
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 .= $_;
}
@@ -55,12 +61,17 @@ else
$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[^>]*[^>\/])\s*\/>/$1>\n<IncludeRules context="FindPHP" \/>\n<\/context>/g;
$file =~ s/(?=<\/contexts\s*>)/$findphp/;
print $file;
print $warning;
print $output $file;
print $output $warning;

View File

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

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<list name="alerts_hi">
<item>ALERT</item>
@@ -19,6 +19,7 @@
<item>WARNING</item>
<item>CAUTION</item>
<item>NOLINT</item>
<item>NOQA</item>
</list>
<list name="alerts_lo">
<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 -->
<highlighting>
@@ -822,6 +822,7 @@ Changelog:
<item>static</item>
<item>static-position</item>
<item>status-bar</item>
<item>sticky</item>
<item>thick</item>
<item>thin</item>
<item>ultra-condensed</item>
@@ -1584,8 +1585,7 @@ Changelog:
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="comment" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>

View File

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

View File

@@ -3,7 +3,7 @@
<!ENTITY nmtoken "[\-\w\d\.:_]+">
<!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>
<list name="Category">
@@ -45,8 +45,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
@@ -78,7 +77,7 @@
<context name="InlineComment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="-" char1="-" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>

View File

@@ -5,7 +5,7 @@
<!ENTITY attributeName "[A-Za-z_:*#\(\[][\)\]\w.:_-]*">
<!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>
<contexts>
@@ -79,8 +79,7 @@
</context>
<context name="FindAttributes" attribute="Other Text" lineEndContext="#stay">
<RegExpr attribute="Attribute" context="#stay" String="&attributeName;" column="0"/>
<RegExpr attribute="Attribute" context="#stay" String="\s+&attributeName;" />
<RegExpr attribute="Attribute" context="#stay" String="^&attributeName;|\s+&attributeName;" />
<DetectChar attribute="Attribute" context="Value" char="=" />
</context>
@@ -92,8 +91,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#stay">
<DetectSpaces/>
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier/>
<RegExpr attribute="Error" context="#stay" String="-(?:-(?!-&gt;))+" />
</context>
@@ -195,7 +193,7 @@
<context name="JS comment close" attribute="Comment" lineEndContext="#pop">
<RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" />
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<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">
<IncludeRules context="FindEntityRefs" />
<RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" />
<RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
<RegExpr attribute="Value" context="#stay" String="/(?!&gt;)|[^/&gt;&lt;&quot;&apos;\s]" />
</context>
<context name="Value DQ" attribute="Value" lineEndContext="#stay">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<list name="keywords">
@@ -36,8 +36,7 @@
<context name="ini" attribute="Normal Text" lineEndContext="#stay">
<RangeDetect attribute="Section" context="#stay" char="[" char1="]" beginRegion="Section" endRegion="Section" />
<DetectChar attribute="Assignment" context="Value" char="=" />
<DetectChar char=";" attribute="Comment" context="Comment" firstNonSpace="true" />
<DetectChar char="#" attribute="Comment" context="Comment" firstNonSpace="true" />
<AnyChar String=";#" attribute="Comment" context="Comment" firstNonSpace="true" />
</context>
<context name="Value" attribute="Value" lineEndContext="#pop" >
@@ -48,8 +47,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
</contexts>

View File

@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY int "[0-9]([0-9_]*[0-9])?">
<!ENTITY hex "[0-9a-fA-F]([0-9a-fA-F_]*[0-9a-fA-F])?">
<!ENTITY int "(?:[0-9]++(_++[0-9]++)*+)">
<!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>
<list name="java15">
<item>ACTIVE</item>
@@ -3704,21 +3707,11 @@
</list>
<list name="keywords">
<item>abstract</item>
<item>break</item>
<item>case</item>
<item>catch</item>
<item>class</item>
<item>continue</item>
<item>default</item>
<item>do</item>
<item>else</item>
<item>enum</item>
<item>extends</item>
<item>false</item>
<item>finally</item>
<item>for</item>
<item>goto</item>
<item>if</item>
<item>implements</item>
<item>instanceof</item>
<item>@interface</item>
@@ -3729,18 +3722,30 @@
<item>private</item>
<item>protected</item>
<item>public</item>
<item>return</item>
<item>super</item>
<item>strictfp</item>
<item>switch</item>
<item>synchronized</item>
<item>this</item>
<item>throws</item>
<item>throw</item>
<item>transient</item>
<item>true</item>
<item>try</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>
</list>
<list name="types">
@@ -3759,87 +3764,127 @@
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<!-- Comment next line if you don't use Javadoc tool -->
<IncludeRules context="##Javadoc"/>
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<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"/>
<DetectSpaces context="#stay"/>
<DetectChar attribute="Symbol" context="Dot" char="." lookAhead="1"/>
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1"/>
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1"/>
<RegExpr attribute="Keyword" context="#stay" String="\.{3,3}\s+" />
<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="Annotation" context="Annotation" 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 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">
<IncludeRules context="Normal"/>
<DetectChar attribute="Symbol" context="#pop" char=")"/>
</context>
<context attribute="String" lineEndContext="#pop" name="String">
<LineContinue attribute="String" context="#stay"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<RegExpr attribute="String Char" context="#stay" String="\\u[0-9a-fA-F]{4}"/>
<DetectChar context="StringEscapedChar" char="\" lookAhead="1"/>
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="EnterPrintf" fallthrough="true" fallthroughContext="#pop">
<DetectChar attribute="Symbol" context="Printf" char="("/>
<context attribute="String" lineEndContext="#pop" name="StringEscapedChar">
<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"/>
</context>
<context attribute="Normal Text" lineEndContext="#stay" name="Printf">
<context attribute="Normal Text" lineEndContext="#stay" name="InPrintf">
<DetectChar attribute="String" context="PrintfString" char="&quot;"/>
<IncludeRules context="InFunctionCall"/>
</context>
<context attribute="PrintfString" lineEndContext="#pop" name="PrintfString">
<LineContinue attribute="String" context="#stay"/>
<HlCStringChar attribute="String Char" context="#stay"/>
<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)" />
<IncludeRules context="String"/>
<RegExpr attribute="String Char" context="#stay" String="%((\d+\$)?[-#+ 0,(]*\d*((\.\d+)?[a-hosxA-CEGHSX]|[tT][aAbBcCdDeFhHIjklLmMNpPQrRsSTyYzZ])|[%n])" />
</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 attribute="Normal Text" lineEndContext="#pop" name="StaticImports">
<RegExpr attribute="StaticImports" context="#pop" String="\s*.*;" />
<context attribute="Normal Text" lineEndContext="#stay" name="Member" fallthroughContext="#pop">
<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 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 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">
<DetectSpaces />
<IncludeRules context="##Alerts"/>
<IncludeRules context="##Modelines"/>
<IncludeRules context="##Comments"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
<DetectSpaces />
<IncludeRules context="##Alerts"/>
<IncludeRules context="##Modelines"/>
<IncludeRules context="##Comments"/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" 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="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="StaticImports" defStyleNum="dsImport" spellChecking="false"/>
@@ -3855,8 +3900,9 @@
<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="PrintfString" defStyleNum="dsString"/>
<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="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<contexts>
<context name="Start" attribute="Normal Text" lineEndContext="#stay">
@@ -12,74 +12,52 @@
</context>
<context attribute="JavadocFS" lineEndContext="#stay" name="JavadocFSar">
<Detect2Chars attribute="JavadocFS" context="#pop" char="*" char1="/" endRegion="Javadoc"/>
<RegExpr attribute="JavadocFS" context="Javadocar" String="(!|\?)" />
<RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s*$)" />
<RegExpr attribute="JavadocFS" context="Javadocar" String="(\.\s)(?![\da-z])" />
<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"/>
<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|$))"/>
<IncludeRules context="FindInlineTag"/>
<IncludeRules context="##Comments"/>
<IncludeRules context="##HTML"/>
</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">
<Detect2Chars attribute="JavadocFS" context="#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
<RegExpr attribute="JavadocFS" context="#stay" String="\*+(?!/)" firstNonSpace="true"/>
<StringDetect attribute="BlockTag" context="#stay" String="@author " />
<StringDetect attribute="BlockTag" context="#stay" String="@deprecated " />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@exception " />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@param " />
<StringDetect attribute="BlockTag" context="#stay" String="@return " />
<StringDetect attribute="BlockTag" context="SeeTag" String="@see "/>
<StringDetect attribute="BlockTag" context="#stay" String="@serial " />
<StringDetect attribute="BlockTag" context="#stay" String="@serialData " />
<StringDetect attribute="BlockTag" context="#stay" String="@serialField " />
<StringDetect attribute="BlockTag" context="#stay" String="@since " />
<StringDetect attribute="BlockTag" context="JavadocParam" String="@throws " />
<StringDetect attribute="BlockTag" context="#stay" String="@version " />
<StringDetect attribute="BlockTag" context="#stay" String="@author&#009;" />
<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;" />
<DetectChar attribute="JavadocFS" context="JavadocFSStarPrefix" char="*" firstNonSpace="true"/>
<WordDetect attribute="BlockTag" context="#stay" String="@author"/>
<WordDetect attribute="BlockTag" context="#stay" String="@deprecated"/>
<WordDetect attribute="BlockTag" context="JavadocParam" String="@exception"/>
<WordDetect attribute="BlockTag" context="JavadocParam" String="@param"/>
<WordDetect attribute="BlockTag" context="#stay" String="@return"/>
<WordDetect attribute="BlockTag" context="SeeTag" String="@see"/>
<WordDetect attribute="BlockTag" context="#stay" String="@serial"/>
<WordDetect attribute="BlockTag" context="#stay" String="@serialData"/>
<WordDetect attribute="BlockTag" context="#stay" String="@serialField"/>
<WordDetect attribute="BlockTag" context="#stay" String="@since"/>
<WordDetect attribute="BlockTag" context="JavadocParam" String="@throws"/>
<WordDetect attribute="BlockTag" context="#stay" String="@version"/>
<IncludeRules context="FindInlineTag"/>
<IncludeRules context="##Alerts"/>
<IncludeRules context="##HTML"/>
</context>
<context attribute="Javadoc" lineEndContext="#pop" name="JavadocParam">
<DetectSpaces />
<RegExpr attribute="JavadocParam" context="#pop#pop" String="\S*(?=\*/)" />
<RegExpr attribute="JavadocParam" context="#pop" String="\S*(\s|$)" />
<IncludeRules context="##Alerts"/>
<context attribute="Javadoc" lineEndContext="#pop" name="JavadocFSStarPrefix" fallthroughContext="#pop">
<Detect2Chars attribute="JavadocFS" context="#pop#pop#pop" char="*" char1="/" endRegion="Javadoc"/>
<DetectChar attribute="JavadocFS" context="#stay" char="*"/>
</context>
<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 attribute="InlineTag" name="InlineTagar" lineEndContext="#stay">
<DetectChar attribute="InlineTag" context="#pop" char="}" />

View File

@@ -12,7 +12,7 @@
** 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>
<list name="Constants">
<item>null</item>
@@ -46,8 +46,7 @@
<DetectChar char="&quot;" context="String_Value" attribute="Style_String_Value" />
<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="#pop" lookAhead="true" />
<DetectChar char="," context="#pop" lookAhead="true" />
<AnyChar String="}," context="#pop" lookAhead="true" />
<DetectSpaces context="#stay" attribute="Style_Normal" />

View File

@@ -12,7 +12,7 @@
<!-- v10 by Peter J. Mello <admin@petermello.net>
Add recognition of POSIX 2013 '::=' operator for variable assignment -->
<language name="Makefile" section="Other"
version="10" kateversion="3.4"
version="13" kateversion="5.0"
extensions="GNUmakefile;Makefile;makefile;GNUmakefile.*;Makefile.*;makefile.*;*.mk"
mimetype="text/x-makefile" priority="11"
author="Per Wigren (wigren@home.se)" license="">
@@ -384,6 +384,8 @@
TODO :[range]
-->
<!-- 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.
: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"/>
<!-- :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"/>
<!-- :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),-->
<Detect2Chars attribute="Builtin" context="#pop!expect}" char="t" char1="A"/>
<!-- :tl Converts variable to lower-case letters.-->
@@ -417,12 +417,11 @@
:Dnewval If the variable is defined 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
:S/old_string/new_string/[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. -->
<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. -->
@@ -477,8 +476,7 @@
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<LineContinue attribute="Comment" context="#stay" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
</contexts>

View File

@@ -90,14 +90,14 @@
<!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>
<contexts>
<!-- 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) -->
<!-- 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 -->
<RegExpr attribute="Metadata Title" context="metadata-mm-value" String="^&metadatakey;(?=\s|$)" column="0"/>
<!-- Code Block -->
@@ -109,12 +109,12 @@
<RegExpr attribute="Metadata Title" String="^&metadatakey;(?=\s|$)" column="0"/>
</context>
<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 -->
<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"/>
</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"/>
</context>
@@ -130,9 +130,9 @@
NOTE: The indentation of the lists is captured. -->
<RegExpr attribute="Horizontal Rule" context="find-code-block" String="^&rulerregex;" column="0"/>
<DetectChar attribute="Blockquote" context="blockquote" char="&gt;" firstNonSpace="true"/>
<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="numlist2" String="(\s*)\d\d+\.(\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="numlist2" String="^(\s*)\d\d+\.(\s+)" column="0"/>
<!-- Find Strong, Emphasis and Strikethrough Text -->
<DetectChar context="find-strong-normal" char="*" lookAhead="true"/>
<DetectChar context="find-emphasis-normal" char="_" lookAhead="true"/>
@@ -142,33 +142,30 @@
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/>
</context>
<!-- 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="Normal Text" String="&end;" />
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;" column="0" beginRegion="comment"/>
<RegExpr attribute="Comment" context="comment" String="\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
<RegExpr attribute="Comment" context="comment" String="^\s*&startcomment;|\s*&startcomment;(?=.*&endcomment;)" beginRegion="comment"/>
</context>
<context name="find-header" attribute="Normal Text" lineEndContext="#pop">
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$"/>
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$"/>
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$"/>
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$"/>
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$"/>
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$"/>
<RegExpr attribute="Header H1" context="#pop" String="^#\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H2" context="#pop" String="^##\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H3" context="#pop" String="^###\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H4" context="#pop" String="^####\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H5" context="#pop" String="^#####\s.*[#]?$" column="0"/>
<RegExpr attribute="Header H6" context="#pop" String="^######\s.*[#]?$" column="0"/>
<DetectChar attribute="Normal Text" context="#pop" char="#"/>
</context>
<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_und2;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast_und;|&strongemphasisregex_ast_und2;"/>
<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="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;"/>
<DetectChar attribute="Normal Text" context="#pop" char="*"/>
</context>
<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_ast2;"/>
<RegExpr attribute="Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_und_ast;|&strongemphasisregex_und_ast2;"/>
<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="Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_und;"/>
@@ -195,7 +192,7 @@
<context name="default-blockquote-1" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<DetectChar attribute="Blockquote" char="&gt;" firstNonSpace="true"/>
<!-- 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 name="default-blockquote-2" attribute="Blockquote: Normal Text" lineEndContext="#stay">
<!-- Strong, emphasis, strong-emphasis and strikethrough text -->
@@ -206,16 +203,10 @@
<RegExpr attribute="Blockquote: Link" String="&implicitlink;"/>
</context>
<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_und_ast;"/>
<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_und_ast2;"/>
<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;"/>
<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 Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
<RegExpr attribute="Blockquote: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
<RegExpr attribute="Blockquote: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<AnyChar attribute="Blockquote: Normal Text" context="#pop" String="*_"/>
</context>
@@ -223,40 +214,40 @@
<!-- 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. -->
<!-- * 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 -->
<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="Horizontal Rule" String="%1%2\s+&rulerregex;" 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="Horizontal Rule" String="^%1%2\s+&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- 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 -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
<!-- Highlight checkbox at the start of the item (task list) -->
<RegExpr attribute="List: Checkbox" context="content-list" String="\s*&checkbox;"/>
</context>
<!-- 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 -->
<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="Horizontal Rule" String="%1%2\s{2,}&rulerregex;" 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="Horizontal Rule" String="^%1%2\s{2,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- 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 -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
<!-- 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 -->
<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="Horizontal Rule" String="%1%2\s{3,}&rulerregex;" 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="Horizontal Rule" String="^%1%2\s{3,}&rulerregex;" column="0" dynamic="true"/>
<RegExpr String="&emptyline;" column="0"/>
<!-- 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 -->
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/>
</context>
@@ -268,7 +259,7 @@
<!-- Blockquote and horzontal rule (check indentation) -->
<RegExpr context="#pop" String="^\s*(?:&gt;|&rulerregex;)" column="0" lookAhead="true"/>
<!-- 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 -->
<AnyChar context="find-strong-emphasis-list" String="*_" lookAhead="true"/>
<RegExpr attribute="List: Strikethrough Text" minimal="true" String="&strikeoutregex;"/>
@@ -277,24 +268,17 @@
<RegExpr attribute="List: Link" String="&implicitlink;"/>
</context>
<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_und_ast;"/>
<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_und_ast2;"/>
<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;"/>
<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 Text" context="#pop" minimal="true" String="&strongregex_ast;|&strongregex_und;"/>
<RegExpr attribute="List: Strong-Emphasis Text" context="#pop" minimal="true" String="&strongemphasisregex_ast;|&strongemphasisregex_und;"/>
<RegExpr attribute="List: Emphasis Text" context="#pop" minimal="true" String="&emphasisregex_ast;|&emphasisregex_und;"/>
<AnyChar attribute="List: Normal Text" context="#pop" String="*_"/>
</context>
<!-- Comments -->
<context name="comment" attribute="Comment" lineEndContext="#stay">
<StringDetect attribute="Comment" context="#pop" String="&endcomment;" endRegion="comment"/>
<IncludeRules context="##Alerts"/>
<IncludeRules context="##Modelines"/>
<IncludeRules context="##Comments"/>
</context>
<!-- Fenced Code Blocks -->
@@ -337,7 +321,7 @@
<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"/>
</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="##Bash" includeAttrib="true"/>
</context>
@@ -465,14 +449,9 @@
<!-- Common -->
<context name="inc" attribute="Normal Text" lineEndContext="#stay">
<!-- Code -->
<RegExpr attribute="Code" String="`[^`]+`(?!`)"/>
<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,}"/>
<RegExpr attribute="Code" String="`[^`]+`(?!`)|`{2}[^`](?:.*?[^`])?`{2}(?!`)|`{3}[^`](?:.*?[^`])?`{3}(?!`)|`{4}[^`](?:.*?[^`])?`{4}(?!`)|`{5,}[^`](?:.*?[^`])?`{5,}"/>
<!-- 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,}(?=[^~]*$)" 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"/>
<!-- Comment -->
<StringDetect attribute="Comment" context="comment" String="&startcomment;" beginRegion="comment"/>
<!-- Links and References -->
@@ -508,13 +487,13 @@
<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"/>
</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="FindHTMLTags##HTML"/>
</context>
<!-- 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" context="#pop" char="&gt;"/>
<RegExpr attribute="Link" String="&startlink;[^&quot;&gt;\s]+"/>
@@ -552,25 +531,23 @@
<RegExpr attribute="Reference-Link: Link" String="\b&startlink;(?:\\.|[^&quot;&gt;\s\]\\])+"/>
</context>
<!-- [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;"/>
</context>
<!-- 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" context="#pop!reflinktarget-link" String="\s*&lt;(?=&link;&gt;(?:\s|$))"/>
<RegExpr attribute="Reference-Link Target" context="#pop!reflinktarget-title" String="\s*#[\w\.\:\-]+\b"/>
</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;"/>
<RegExpr attribute="Reference-Link Target: Link" String="&link;"/>
</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"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&apos;(?:\\.|[^&apos;\\])*&apos;"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="\((?:\\.|[^\)\\])*\)"/>
<RegExpr attribute="Reference-Link Target" context="#pop" String="&quot;(?:\\.|[^&quot;\\])*&quot;|&apos;(?:\\.|[^&apos;\\])*&apos;|\((?:\\.|[^\)\\])*\)"/>
</context>
<!-- Image -->

View File

@@ -39,7 +39,7 @@
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>
<list name="keywords">
<item>if</item>
@@ -339,7 +339,7 @@
</list>
<contexts>
<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="#stay" String="__END__" firstNonSpace="true"/>
<RegExpr attribute="Keyword" context="sub_name_def" String="\bsub\s+" />
@@ -347,7 +347,7 @@
<keyword attribute="Operator" context="#stay" String="operators" />
<keyword attribute="Function" context="#stay" String="functions" />
<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 />
<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="Normal Text" context="#stay" String="[\w_]+\s*//?\=?" />
<RegExpr attribute="Normal Text" context="#stay" String="[&lt;&gt;&quot;':]//?\=?" />
<RegExpr attribute="Normal Text" context="#stay" String="[\w_]+\s*//?\=?|[&lt;&gt;&quot;':]//?\=?" />
<!-- Avoid conflicts between operators / and // -->
<StringDetect attribute="Normal Text" context="#stay" String="//=" />
<Detect2Chars attribute="Normal Text" context="#stay" char="/" char1="/" />
@@ -428,15 +427,7 @@
<!-- ====== Contexts for strings ===== -->
<context name="ipstring_internal" attribute="String (interpolated)" lineEndContext="#stay">
<DetectIdentifier />
<RegExpr attribute="String Special Character" context="#stay" String="\\c[^\s\\]" />
<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 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 (interpolated)" context="#stay" String="\\." />
<RegExpr attribute="Normal Text" context="find_variable_unsafe" String="(?:[\$@]\S|%([\w\{\-\+!]|\^H))" lookAhead="true" />
</context>
@@ -465,7 +456,7 @@
<IncludeRules context="ipstring_internal" />
</context>
<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"/>
<IncludeRules context="ipstring_internal" />
</context>
@@ -508,7 +499,7 @@
<context name="string_6" attribute="String" lineEndContext="#stay" dynamic="true">
<DetectIdentifier />
<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" />
</context>
@@ -605,10 +596,7 @@
</context>
<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*\{[^}]*\}" />
<RegExpr attribute="Pattern" context="#pop" String="\[[^]]*\]\s*\[[^\]]*\]" />
<RegExpr attribute="Pattern" context="#pop" String="([^a-zA-Z0-9_\s[\]{}()]).*\1.*\1" minimal="true"/>
<RegExpr attribute="Pattern" context="#pop" String="\([^)]*\)\s*\(?:[^)]*\)|\{[^}]*\}\s*\{[^}]*\}|\[[^]]*\]\s*\[[^\]]*\]|([^a-zA-Z0-9_\s[\]{}()]).*?\1.*?\1"/>
</context>
<!-- ====== PATTERNs ====== -->
@@ -629,7 +617,6 @@
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=%1)" dynamic="true" />
<RegExpr attribute="Operator" context="#pop#pop" String="%1[cgimosx]*" dynamic="true" endRegion="Pattern" />
<IncludeRules context="regex_pattern_internal_ip" />
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\$(?=\%1)" dynamic="true" />
</context>
<context name="pattern_brace" attribute="Pattern" lineEndContext="#stay">
<RegExpr attribute="Operator" context="#pop#pop" String="\}[cgimosx]*" endRegion="Pattern" />
@@ -663,13 +650,7 @@
<!-- rules internal stuff wrt regex patterns -->
<context name="regex_pattern_internal_rules_1" attribute="Pattern" lineEndContext="#stay">
<DetectChar attribute="Comment" context="comment" char="#" firstNonSpace="true" />
<RegExpr attribute="Special Variable" context="#stay" String="\\c[^\s\\]" />
<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="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="Pattern Character Class" context="#stay" String="\\[anDdSsWw]" />
<RegExpr attribute="Pattern Internal Operator" context="#stay" String="\\[ABbEGLlNUuQdQZz]" /> <!-- Also?: efFhHKrRtvVX -->
<RegExpr attribute="Special Variable" context="#stay" String="\\[\d]+" />
@@ -713,17 +694,10 @@
<!-- ====== Variables ====== -->
<context name="find_variable" attribute="Data Type" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" >
<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="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
<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="\$[0-9]+|[@\$](?:[\+\-_]\B|ARGV\b|INC\b)|[%\$](?:INC\b|ENV\b|SIG\b)|\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
<RegExpr attribute="Data Type" context="var_detect" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="var_detect" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
<RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}" />
<AnyChar attribute="Data Type" context="var_detect" String="$@%" />
<RegExpr attribute="Data Type" context="var_detect" String="\*[a-zA-Z_]+" />
<RegExpr attribute="Data Type" context="var_detect" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*[a-zA-Z_]+" />
<!-- Do not highlight brackets after *, Ex: (... @*) (see bug #391577) -->
<RegExpr attribute="Special Variable" context="#stay" String="\*[^a-zA-Z0-9\s\{\(\)\[\]\}][A-Z]?" />
<!-- this should be a rare case! -->
@@ -732,17 +706,11 @@
<!-- 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" >
<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="[@\$](?:[\+\-_]\B|ARGV\b|INC\b)" />
<RegExpr attribute="Special Variable" context="var_detect_unsafe" 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_unsafe" String="\$\$[\$\w_]" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$+::" />
<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" String="\$\^[A-Z_\]\[\^\?\\]|%([\-\+!]|\^H)" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\$\$[\$\w_]|\$+::" />
<RegExpr attribute="Special Variable" context="#stay" String="\$[^a-zA-Z0-9\s{][A-Z]?" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}" />
<AnyChar attribute="Data Type" context="var_detect_unsafe" String="$@%" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="\*\w+" />
<RegExpr attribute="Data Type" context="var_detect_unsafe" String="[\$@%]\{\^?[\w_]+\}|[$@%]|\*\w+" />
<AnyChar attribute="Operator" context="#pop" String="$@%*" />
</context>
<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">
<DetectSpaces />
<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" />
</context>
<context name="quote_word_paren" attribute="Normal Text" lineEndContext="#stay">
@@ -791,26 +759,24 @@
<!-- ====== Here Documents ====== -->
<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="\s*&quot;([^&quot;]+)&quot;\s*;?" />
<RegExpr attribute="Keyword" context="here_document" String="\s*`([^`]+)`\s*;?" />
<RegExpr attribute="Keyword" context="here_document" String="(?|(\w+)\s*;?|\s*&quot;([^&quot;]+)&quot;\s*;?|\s*`([^`]+)`\s*;?)" />
<RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" />
</context>
<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" />
<IncludeRules context="ipstring_internal" />
<DetectSpaces />
</context>
<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 />
<DetectIdentifier />
</context>
<!-- ====== Misc ====== -->
<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" />
</context>
@@ -841,14 +807,13 @@
<context name="pod" attribute="Pod" lineEndContext="#stay">
<DetectSpaces />
<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"/>
</context>
<context name="comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>

View File

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

View File

@@ -4,6 +4,35 @@
<!ENTITY digitPart "[0-9](?:_?[0-9])*">
<!ENTITY beforeDigit "(?&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 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.08 add missing overloaders, new Python 3 statements, builtins, and keywords -->
<!-- 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>
<list name="import">
<item>import</item>
@@ -355,8 +384,7 @@
<RegExpr attribute="Binary" String="&beforeDigit;0[bB](?:_?[01])+\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 -->
<RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;(?:\.(?:&digitPart;)?)?|&beforePointFloat;\.&digitPart;)[eE][\+\-]?&digitPart;\b" context="#stay"/>
<RegExpr attribute="Float" String="(?:&beforeDigit;&digitPart;\.(?:&digitPart;\b)?|&beforePointFloat;\.&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"/>
<!-- Decimal: 123 ; 000 -->
<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?&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)&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)&quot;" insensitive="true" context="Raw 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)&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)&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&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&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)&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)&quot;" insensitive="true" context="Raw 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)&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)&quot;" insensitive="true" context="Raw Q-F-String"/>
</context>
<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?&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)&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)&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)&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)&quot;" insensitive="true" firstNonSpace="true" context="Single Q-comment"/>
</context>
<context name="Dictionary" attribute="Normal Text" lineEndContext="#stay" noIndentationBasedFolding="true">
@@ -448,66 +476,38 @@
<context name="Hash comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<context name="Triple A-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="'''" context="#pop" endRegion="Triple A-region"/>
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<context name="Triple Q-comment" attribute="Comment" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<StringDetect attribute="Comment" String="&quot;&quot;&quot;" context="#pop" endRegion="Triple Q-region"/>
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<context name="Single A-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="'" context="#pop"/>
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<context name="Single Q-comment" attribute="Comment" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<DetectChar attribute="Comment" char="&quot;" context="#pop"/>
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<!-- Strings -->
<!-- format characters -->
<context name="stringformat" attribute="String Substitution" lineEndContext="#stay">
<!-- 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]
-->
<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"/>
<RegExpr attribute="String Substitution" String="&strsubstitution_py2;|&strsubstitution_py3;" context="#stay"/>
<Detect2Chars attribute="String Substitution" char="{" char1="{" context="#stay" />
<Detect2Chars attribute="String Substitution" char="}" char1="}" context="#stay" />
</context>
@@ -517,12 +517,7 @@
<!-- 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
-->
<RegExpr attribute="String Char" String="\\[\\'&quot;abfnrtv]" 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"/>
<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"/>
</context>
<!-- f-literals -->
@@ -532,7 +527,7 @@
</context>
<context name="String Interpolation" attribute="String Substitution" lineEndContext="#stay">
<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 -->
</context>
@@ -552,50 +547,50 @@
<context name="Triple A-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<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 name="Raw Triple A-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<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 name="Triple A-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<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 name="Raw Triple A-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<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>
<!-- Triple-quoted Q-strings -->
<context name="Triple Q-string" attribute="String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<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 name="Raw Triple Q-string" attribute="Raw String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw String" context="#stay"/>
<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 name="Triple Q-F-String" attribute="F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<IncludeRules context="stringescape"/>
<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 name="Raw Triple Q-F-String" attribute="Raw F-String" lineEndContext="#stay" noIndentationBasedFolding="true">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<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>
@@ -603,50 +598,50 @@
<context name="Single A-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="String" char="'" context="#pop#CheckForString"/>
<DetectChar attribute="String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Raw A-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char="'" context="#pop#CheckForString"/>
<DetectChar attribute="Raw String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Single A-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char="'" context="#pop#CheckForString"/>
<DetectChar attribute="F-String" char="'" context="#pop!#CheckForString"/>
</context>
<context name="Raw A-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char="'" context="#pop#CheckForString"/>
<DetectChar attribute="Raw F-String" char="'" context="#pop!#CheckForString"/>
</context>
<!-- Single-quoted Q-strings -->
<context name="Single Q-string" attribute="String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="String" char="&quot;" context="#pop#CheckForString"/>
<DetectChar attribute="String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Raw Q-string" attribute="Raw String" lineEndContext="#stay">
<HlCStringChar attribute="Raw String" context="#stay"/>
<IncludeRules context="stringformat"/>
<DetectChar attribute="Raw String" char="&quot;" context="#pop#CheckForString"/>
<DetectChar attribute="Raw String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Single Q-F-String" attribute="F-String" lineEndContext="#stay">
<IncludeRules context="stringescape"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="F-String" char="&quot;" context="#pop#CheckForString"/>
<DetectChar attribute="F-String" char="&quot;" context="#pop!#CheckForString"/>
</context>
<context name="Raw Q-F-String" attribute="Raw F-String" lineEndContext="#stay">
<HlCStringChar attribute="Raw F-String" context="#stay"/>
<IncludeRules context="stringinterpolation"/>
<DetectChar attribute="Raw F-String" char="&quot;" context="#pop#CheckForString"/>
<DetectChar attribute="Raw F-String" char="&quot;" context="#pop!#CheckForString"/>
</context>
</contexts>

View File

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

View File

@@ -31,7 +31,7 @@
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
<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"
mimetype="application/x-ruby"
style="ruby" indenter="ruby"
@@ -191,19 +191,17 @@
<LineContinue attribute="Normal Text" context="Line Continue"/>
<!-- __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 -->
<RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
<RegExpr attribute="Keyword" String="^#!\/.*" context="#stay" column="0"/>
<!-- "def" - "end" blocks -->
<!-- check for statement modifiers with regexes -->
<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"/>
<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" />
<RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
<DetectChar attribute="Delimiter" char="}" context="check_div_1" endRegion="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="(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="module" context="#stay" beginRegion="def block"/>
<WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/>
@@ -236,8 +234,7 @@
<!-- (global) vars starting with $
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_]\b" context="check_div_1"/>
<RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+|\$\-[a-zA-Z_]\b" context="check_div_1"/>
<!-- special-character globals -->
<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"/>
@@ -269,21 +266,16 @@
<DetectChar attribute="Operator" char="." context="#stay"/>
<Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
<Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
<RegExpr attribute="Operator" String="\s[\?\:\%]\s" context="#stay"/>
<RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/>
<!-- regexp hack -->
<RegExpr attribute="Operator" String="\s!" context="#stay"/>
<RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
<!-- \s! is regexp hack -->
<RegExpr attribute="Operator" String="\s[\?\:\%]\s|[|&amp;&lt;&gt;\^\+*~\-=]+|\s!|/=\s" context="#stay"/>
<Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/>
<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=":\[\]=?" context="check_div_1"/>
<RegExpr attribute="Symbol" String=":(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?|:\[\]=?" context="check_div_1"/>
<!-- Do not send to "check_div_1" context!:
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="\[\]=?: " context="#stay"/>
<RegExpr attribute="Symbol" String="(@{1,2}|\$)?[a-zA-Z_][a-zA-Z0-9_]*[=?!]?: |\[\]=?: " context="#stay"/>
<DetectChar attribute="String" char="&quot;" context="Quoted String"/>
<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
@@ -291,14 +283,12 @@
<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*END.*$" context="#stay" endRegion="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"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/>
<DetectChar attribute="Delimiter" char="[" context="#stay"/>
<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="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 -->
<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"/>
</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">
<RegExpr attribute="Normal Text" String="\s*" context="#stay"/>
<DetectSpaces attribute="Normal Text" context="#stay"/>
<AnyChar attribute="Operator" String="/%" context="#pop#pop"/>
</context>
<!-- 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">
<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>
<!-- 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 -->
<context name="check_div_2_pop" attribute="Normal Text" fallthrough="true" fallthroughContext="#pop#pop" lineEndContext="#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>
<!-- Internal context used by check_div_2_pop -->
@@ -355,8 +345,7 @@
</context>
<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="(if|unless)\b" context="#stay" firstNonSpace="true"/>
<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)|(if|unless)\b" context="#stay" firstNonSpace="true"/>
<IncludeRules context="Normal"/>
</context>
@@ -390,7 +379,7 @@
<context name="Embedded documentation" attribute="Blockcomment" lineEndContext="#stay">
<RegExpr attribute="Comment" String="^=end(?:\s.*|$)" context="#pop" endRegion="comment block" column="0"/>
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Comments" />
</context>
<context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
@@ -433,8 +422,7 @@
<context name="General Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<!-- HEREDOC support
@@ -443,15 +431,11 @@
<!-- here we markup the heredoc markers -->
<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="normal_heredoc" String="(\w+)" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;(\w+)&quot;" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="`(\w+)`" />
<RegExpr attribute="Keyword" context="normal_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
</context>
<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="indented_heredoc" String="(\w+)" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;(\w+)&quot;" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="`(\w+)`" />
<RegExpr attribute="Keyword" context="indented_heredoc" String="(?|(\w+)|&quot;(\w+)&quot;|`(\w+)`)" />
</context>
<!-- these are the real heredoc contexts -->
<context name="indented_heredoc" attribute="Here Document" lineEndContext="#stay" dynamic="true">
@@ -463,11 +447,11 @@
</context>
<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" />
</context>
<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>
<!-- rules for heredoc types -->
@@ -481,8 +465,8 @@
<DetectSpaces />
<Detect2Chars attribute="Operator" char="&lt;" char1="&lt;" context="#pop"/>
<!-- comments -->
<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*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/>
<RegExpr attribute="Comment" String="^#\s*END.*$" context="#stay" endRegion="marker" column="0"/>
<DetectChar attribute="Comment" char="#" context="General Comment"/>
</context>
@@ -602,7 +586,7 @@
-->
<context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
<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" />
</context>
<!-- 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">
<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" />
</context>
@@ -731,7 +715,7 @@
-->
<context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
<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" />
</context>
@@ -795,7 +779,7 @@
-->
<context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
<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" />
</context>
@@ -861,7 +845,7 @@
-->
<context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
<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" />
</context>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<contexts>
<context name="File" attribute="Normal Text" lineEndContext="#stay">
@@ -9,7 +9,7 @@
</context>
<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" />
</context>
@@ -25,8 +25,7 @@
<context name="Comment" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</context>
</contexts>

View File

@@ -6,7 +6,7 @@
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!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>
<contexts>
@@ -17,10 +17,10 @@
<context name="FindXML" attribute="Normal Text" lineEndContext="#stay">
<DetectSpaces />
<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
<StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
<RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:_-]*" beginRegion="pi" />
<RegExpr attribute="Element" context="Element" String="&lt;&name;" beginRegion="element" />
<StringDetect attribute="CDATA" context="CDATAStart" String="&lt;![CDATA[" lookAhead="true" />
<RegExpr attribute="Doctype Symbols" context="DoctypeTagName" String="&lt;!(?=DOCTYPE\s+)" beginRegion="doctype" />
<IncludeRules context="FindProcessingInstruction" />
<RegExpr attribute="Element Symbols" context="ElementTagName" String="&lt;(?=(&name;))" beginRegion="element" />
<IncludeRules context="FindEntityRefs" />
<DetectIdentifier />
</context>
@@ -41,37 +41,67 @@
<DetectSpaces />
<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
<RegExpr attribute="Error" context="#stay" String="-(?:\-(?!-&gt;))+" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
<DetectIdentifier />
</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">
<DetectSpaces />
<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;" />
</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">
<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 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">
<DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
<DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
<DetectChar attribute="Doctype Symbols" context="#pop" char="&gt;" endRegion="doctype" />
<DetectChar attribute="Doctype Symbols" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
</context>
<context name="Doctype Internal Subset" attribute="Other Text" lineEndContext="#stay">
<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(?:ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
<DetectChar attribute="Doctype Symbols" context="#pop" char="]" endRegion="int_subset" />
<RegExpr attribute="Doctype Symbols" context="Doctype Markupdecl TagName" String="&lt;!(?=(ELEMENT|ENTITY|ATTLIST|NOTATION)\b)" />
<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" />
</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">
<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 SQ" char="&apos;" />
</context>
@@ -86,25 +116,31 @@
<IncludeRules context="FindPEntityRefs" />
</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">
<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="element" />
<DetectChar attribute="Element" context="El Content" char="&gt;" />
<Detect2Chars attribute="Element Symbols" context="#pop" char="/" char1="&gt;" endRegion="element" />
<DetectChar attribute="Element Symbols" context="El Content" char="&gt;" />
<RegExpr attribute="Attribute" context="Attribute" String="(?:^|\s+)&name;" />
<RegExpr attribute="Error" context="#stay" String="\S" />
</context>
<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" />
</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">
<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" />
</context>
<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" />
</context>
@@ -115,29 +151,34 @@
</context>
<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" />
</context>
<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" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Other Text" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" spellChecking="false" />
<itemData name="Processing Instruction" defStyleNum="dsKeyword" spellChecking="false" />
<itemData name="Doctype" defStyleNum="dsDataType" bold="1" spellChecking="false" />
<itemData name="Element" defStyleNum="dsKeyword" spellChecking="false" />
<itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="Value" defStyleNum="dsString" spellChecking="false" />
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="Error" defStyleNum="dsError" spellChecking="false" />
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Other Text" defStyleNum="dsNormal" />
<itemData name="Comment" defStyleNum="dsComment" spellChecking="false" />
<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" italic="0" spellChecking="false" />
<itemData name="CDATA Symbols" defStyleNum="dsBaseN" bold="0" italic="0" 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 Symbols" defStyleNum="dsNormal" spellChecking="false" />
<itemData name="Attribute" defStyleNum="dsOthers" spellChecking="false" />
<itemData name="Value" defStyleNum="dsString" spellChecking="false" />
<itemData name="EntityRef" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="PEntityRef" defStyleNum="dsDecVal" spellChecking="false" />
<itemData name="Error" defStyleNum="dsError" spellChecking="false" />
</itemDatas>
</highlighting>

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>
<contexts>
@@ -139,9 +139,9 @@ This code is released under the LGPL as part of kdelibs/kate.
<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) -->
<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" />
<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>
<!-- 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). -->
@@ -201,13 +201,11 @@ This code is released under the LGPL as part of kdelibs/kate.
<context name="CommentStar" attribute="Comment" lineEndContext="#stay">
<DetectSpaces />
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="comment" />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<context name="CommentSlash" attribute="Comment" lineEndContext="#pop">
<DetectSpaces />
<IncludeRules context="##Alerts" />
<IncludeRules context="##Modelines" />
<IncludeRules context="##Comments" />
</context>
<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": [
"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",
"Also see: https://github.com/ayu-theme"
],
@@ -11,7 +11,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "ayu Dark",
"revision": 2
"revision": 3
},
"editor-colors": {
"BackgroundColor": "#0a0e14",
@@ -176,5 +176,30 @@
"selected-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": [
"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",
"Also see: https://github.com/ayu-theme"
],
@@ -11,7 +11,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "ayu Mirage",
"revision": 2
"revision": 3
},
"editor-colors": {
"BackgroundColor": "#1f2430",
@@ -176,5 +176,30 @@
"selected-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>"
],
"license": "SPDX-License-Identifier: MIT",
"revision" : 2,
"revision" : 6,
"name" : "Breeze Dark"
},
"text-styles": {
@@ -36,8 +36,8 @@
"bold" : true
},
"Operator" : {
"text-color" : "#cfcfc2",
"selected-text-color" : "#cfcfc2"
"text-color" : "#3f8058",
"selected-text-color" : "#54aa75"
},
"BuiltIn" : {
"text-color" : "#7f8c8d",
@@ -149,7 +149,7 @@
"editor-colors": {
"BackgroundColor" : "#232629",
"CodeFolding" : "#224e65",
"BracketMatching" : "#8e44ad",
"BracketMatching" : "#323030",
"CurrentLine" : "#2A2E32",
"IconBorder" : "#31363b",
"IndentationLine" : "#3a3f44",
@@ -167,7 +167,7 @@
"SavedLines" : "#1c8042",
"SearchHighlight" : "#218058",
"TextSelection" : "#2d5c76",
"Separator" : "#7a7c7d",
"Separator" : "#3f4347",
"SpellChecking" : "#c0392b",
"TabMarker" : "#4d4d4d",
"TemplateBackground" : "#31363b",

View File

@@ -5,7 +5,7 @@
"SPDX-FileCopyrightText: 2016 Dominik Haumann <dhaumann@kde.org>"
],
"license": "SPDX-License-Identifier: MIT",
"revision" : 4,
"revision" : 8,
"name" : "Breeze Light"
},
"text-styles": {
@@ -36,8 +36,8 @@
"bold" : true
},
"Operator" : {
"text-color" : "#1f1c1b",
"selected-text-color" : "#ffffff"
"text-color" : "#ca60ca",
"selected-text-color" : "#a44ea4"
},
"BuiltIn" : {
"text-color" : "#644a9b",
@@ -167,7 +167,7 @@
"SavedLines" : "#2ecc71",
"SearchHighlight" : "#ffff00",
"TextSelection" : "#94caef",
"Separator" : "#a0a0a0",
"Separator" : "#d5d5d5",
"SpellChecking" : "#bf0303",
"TabMarker" : "#d2d2d2",
"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": {
"BackgroundColor": "#282a36",
"BracketMatching": "#55007f",
"CodeFolding": "#8be9fd",
"CurrentLine": "#282a36",
"BracketMatching": "#7c62a5",
"CodeFolding": "#44475a",
"CurrentLine": "#44475a",
"CurrentLineNumber": "#f8f8f2",
"IconBorder": "#282a36",
"IndentationLine": "#6272a4",
"LineNumbers": "#909194",
"LineNumbers": "#6272a4",
"MarkBookmark": "#8be9fd",
"MarkBreakpointActive": "#ff5555",
"MarkBreakpointDisabled": "#bd93f9",
@@ -16,10 +550,10 @@
"MarkExecution": "#44475a",
"MarkWarning": "#ffb86c",
"ModifiedLines": "#ff79c6",
"ReplaceHighlight": "#50fa7b",
"ReplaceHighlight": "#2c8843",
"SavedLines": "#50fa7b",
"SearchHighlight": "#b39800",
"Separator": "#909194",
"SearchHighlight": "#566591",
"Separator": "#45474e",
"SpellChecking": "#ff5555",
"TabMarker": "#6272a4",
"TemplateBackground": "#282a36",
@@ -36,7 +570,7 @@
],
"license": "SPDX-License-Identifier: MIT",
"name": "Dracula",
"revision": 1
"revision": 7
},
"text-styles": {
"Alert": {
@@ -49,20 +583,20 @@
"text-color": "#ff79c6"
},
"Attribute": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"BaseN": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"BuiltIn": {
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Char": {
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Comment": {
"selected-text-color": "#6272a4",
@@ -78,17 +612,17 @@
"text-color": "#bd93f9"
},
"ControlFlow": {
"bold": true,
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"DataType": {
"italic": true,
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"DecVal": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Documentation": {
"selected-text-color": "#ffb86c",
@@ -100,13 +634,12 @@
"underline": true
},
"Extension": {
"bold": true,
"selected-text-color": "#0095ff",
"text-color": "#0095ff"
"selected-text-color": "#8be9fd",
"text-color": "#8be9fd"
},
"Float": {
"selected-text-color": "#ffb86c",
"text-color": "#ffb86c"
"selected-text-color": "#bd93f9",
"text-color": "#bd93f9"
},
"Function": {
"selected-text-color": "#50fa7b",
@@ -117,11 +650,10 @@
"text-color": "#ff79c6"
},
"Information": {
"selected-text-color": "#f67400",
"text-color": "#f67400"
"selected-text-color": "#f1fa8c",
"text-color": "#f1fa8c"
},
"Keyword": {
"bold": true,
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
@@ -138,8 +670,8 @@
"text-color": "#50fa7b"
},
"Preprocessor": {
"selected-text-color": "#50fa7b",
"text-color": "#50fa7b"
"selected-text-color": "#ff79c6",
"text-color": "#ff79c6"
},
"RegionMarker": {
"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>"
],
"license": "SPDX-License-Identifier: MIT",
"revision" : 2,
"revision" : 5,
"name" : "Solarized Dark"
},
"text-styles": {
@@ -23,8 +23,7 @@
},
"Keyword" : {
"text-color" : "#859900",
"selected-text-color" : "#859900",
"bold" : true
"selected-text-color" : "#859900"
},
"Function" : {
"text-color" : "#268bd2",
@@ -36,8 +35,7 @@
},
"ControlFlow" : {
"text-color" : "#859900",
"selected-text-color" : "#859900",
"bold" : true
"selected-text-color" : "#859900"
},
"Operator" : {
"text-color" : "#859900",
@@ -49,8 +47,7 @@
},
"Extension" : {
"text-color" : "#268bd2",
"selected-text-color" : "#268bd2",
"bold" : true
"selected-text-color" : "#268bd2"
},
"Preprocessor" : {
"text-color" : "#cb4b16",
@@ -86,8 +83,7 @@
},
"DataType" : {
"text-color" : "#b58900",
"selected-text-color" : "#b58900",
"bold" : true
"selected-text-color" : "#b58900"
},
"DecVal" : {
"text-color" : "#2aa198",
@@ -153,13 +149,13 @@
},
"editor-colors": {
"BackgroundColor" : "#002b36",
"CodeFolding" : "#6c71c4",
"BracketMatching" : "#073642",
"CodeFolding": "#083d4a",
"BracketMatching" : "#083d4a",
"CurrentLine" : "#073642",
"IconBorder" : "#073642",
"IndentationLine" : "#073642",
"IndentationLine" : "#083d4a",
"LineNumbers" : "#586e75",
"CurrentLineNumber" : "#586e75",
"CurrentLineNumber": "#93a1a1",
"MarkBookmark" : "#268bd2",
"MarkBreakpointActive" : "#dc322f",
"MarkBreakpointReached" : "#b58900",
@@ -168,11 +164,11 @@
"MarkWarning" : "#cb4b16",
"MarkError" : "#dc322f",
"ModifiedLines" : "#cb4b16",
"ReplaceHighlight" : "#859900",
"ReplaceHighlight": "#3c4300",
"SavedLines" : "#2aa198",
"SearchHighlight" : "#b58900",
"TextSelection" : "#eee8d5",
"Separator" : "#002b36",
"SearchHighlight": "#0a4d5e",
"TextSelection": "#083d4a",
"Separator" : "#1c3e49",
"SpellChecking" : "#dc322f",
"TabMarker" : "#586e75",
"TemplateBackground" : "#073642",
@@ -180,5 +176,17 @@
"TemplateFocusedPlaceholder" : "#073642",
"TemplateReadOnlyPlaceholder" : "#073642",
"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>"
],
"license": "SPDX-License-Identifier: MIT",
"revision" : 2,
"revision" : 4,
"name" : "Solarized Light"
},
"text-styles": {
@@ -172,7 +172,7 @@
"SavedLines" : "#2aa198",
"SearchHighlight" : "#b58900",
"TextSelection" : "#073642",
"Separator" : "#fdf6e3",
"Separator" : "#e0dccc",
"SpellChecking" : "#dc322f",
"TabMarker" : "#93a1a1",
"TemplateBackground" : "#eee8d5",
@@ -180,5 +180,17 @@
"TemplateFocusedPlaceholder" : "#eee8d5",
"TemplateReadOnlyPlaceholder" : "#eee8d5",
"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>
<RCC version="1.0">
<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-light.theme</file>
<file>ayu-dark.theme</file>
<file>ayu-light.theme</file>
<file>ayu-mirage.theme</file>
<file>dracula.theme</file>
<file>github-dark.theme</file>
<file>github-light.theme</file>
<file>gruvbox-dark.theme</file>
<file>gruvbox-light.theme</file>
<file>monokai.theme</file>
<file>nord.theme</file>
<file>oblivion.theme</file>
<file>printing.theme</file>
<file>radical.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)
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 <ansihighlighter.h>
#include <definition.h>
#include <definitiondownloader.h>
#include <htmlhighlighter.h>
#include <ansihighlighter.h>
#include <repository.h>
#include <theme.h>
@@ -21,8 +21,14 @@
using namespace KSyntaxHighlighting;
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)
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)
{
if (parser.isSet(outputName))
highlighter.setOutputFile(parser.value(outputName));
@@ -56,16 +62,19 @@ int main(int argc, char **argv)
parser.addVersionOption();
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);
QCommandLineOption listThemes(QStringList() << QStringLiteral("list-themes"), app.translate("SyntaxHighlightingCLI", "List all available themes."));
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);
QCommandLineOption outputName(
QStringList() << QStringLiteral("o") << QStringLiteral("output"), app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."), app.translate("SyntaxHighlightingCLI", "output"));
QCommandLineOption outputName(QStringList() << QStringLiteral("o") << QStringLiteral("output"),
app.translate("SyntaxHighlightingCLI", "File to write HTML output to (default: stdout)."),
app.translate("SyntaxHighlightingCLI", "output"));
parser.addOption(outputName);
QCommandLineOption syntaxName(QStringList() << QStringLiteral("s") << QStringLiteral("syntax"),
@@ -73,18 +82,23 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "syntax"));
parser.addOption(syntaxName);
QCommandLineOption themeName(
QStringList() << QStringLiteral("t") << QStringLiteral("theme"), app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."), app.translate("SyntaxHighlightingCLI", "theme"), repo.defaultTheme(Repository::LightTheme).name());
QCommandLineOption themeName(QStringList() << QStringLiteral("t") << QStringLiteral("theme"),
app.translate("SyntaxHighlightingCLI", "Color theme to use for highlighting."),
app.translate("SyntaxHighlightingCLI", "theme"),
repo.defaultTheme(Repository::LightTheme).name());
parser.addOption(themeName);
QCommandLineOption outputFormatOption(QStringList() << QStringLiteral("f") << QStringLiteral("output-format"),
app.translate("SyntaxHighlightingCLI", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."),
app.translate("SyntaxHighlightingCLI", "format"),
QStringLiteral("html"));
QCommandLineOption outputFormatOption(
QStringList() << QStringLiteral("f") << QStringLiteral("output-format"),
app.translate("SyntaxHighlightingCLI", "Use the specified format instead of html. Must be html, ansi or ansi256Colors."),
app.translate("SyntaxHighlightingCLI", "format"),
QStringLiteral("html"));
parser.addOption(outputFormatOption);
QCommandLineOption traceOption(QStringList() << QStringLiteral("syntax-trace"),
app.translate("SyntaxHighlightingCLI", "Add information to debug a syntax file. Only works with --output-format=ansi or ansi256Colors. Possible values are format, region and context."),
app.translate("SyntaxHighlightingCLI",
"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"));
parser.addOption(traceOption);
@@ -92,12 +106,14 @@ int main(int argc, char **argv)
app.translate("SyntaxHighlightingCLI", "Disable ANSI background for the default color."));
parser.addOption(noAnsiEditorBg);
QCommandLineOption titleOption(QStringList() << QStringLiteral("T") << QStringLiteral("title"),
app.translate("SyntaxHighlightingCLI", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."),
app.translate("SyntaxHighlightingCLI", "title"));
QCommandLineOption titleOption(
QStringList() << QStringLiteral("T") << QStringLiteral("title"),
app.translate("SyntaxHighlightingCLI", "Set HTML page's title\n(default: the filename or \"Kate Syntax Highlighter\" if reading from stdin)."),
app.translate("SyntaxHighlightingCLI", "title"));
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.process(app);
@@ -117,7 +133,9 @@ int main(int argc, char **argv)
if (parser.isSet(updateDefs)) {
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);
downloader.start();
return app.exec();
@@ -139,7 +157,7 @@ int main(int argc, char **argv)
def = repo.definitionForMimeType(syntax);
if (!def.isValid()) {
/* see if it's a extension instead */
def = repo.definitionForFileName(QLatin1String("f.")+syntax);
def = repo.definitionForFileName(QLatin1String("f.") + syntax);
if (!def.isValid())
/* see if it's a filename instead */
def = repo.definitionForFileName(syntax);
@@ -178,13 +196,15 @@ int main(int argc, char **argv)
auto debugOptions = AnsiHighlighter::TraceOptions();
if (parser.isSet(traceOption)) {
const auto options = parser.values(traceOption);
for (auto const& option : options) {
for (auto const &option : options) {
if (option == QStringLiteral("format")) {
debugOptions |= AnsiHighlighter::TraceOption::Format;
} else if (option == QStringLiteral("region")) {
debugOptions |= AnsiHighlighter::TraceOption::Region;
} else if (option == QStringLiteral("context")) {
debugOptions |= AnsiHighlighter::TraceOption::Context;
} else if (option == QStringLiteral("stackSize")) {
debugOptions |= AnsiHighlighter::TraceOption::StackSize;
} else {
std::cerr << "Unknown trace name." << std::endl;
return 2;

View File

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

View File

@@ -55,7 +55,7 @@ ecm_generate_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
${SyntaxHighlighting_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/ksyntaxhighlighting_export.h
@@ -66,7 +66,7 @@ if(BUILD_QCH)
KF5SyntaxHighlighting_QCH
NAME KSyntaxHighlighting
BASE_NAME KF5SyntaxHighlighting
VERSION ${KF5_VERSION}
VERSION ${KF_VERSION}
ORG_DOMAIN org.kde
SOURCES # using only public headers, to cover only public API
${SyntaxHighlighting_HEADERS}

View File

@@ -128,7 +128,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* see https://phabricator.kde.org/D18509
*/
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
*/
@@ -143,7 +144,8 @@ State AbstractHighlighter::highlightLine(const QString &text, const State &state
* line end context switches only when lineEmptyContext is #stay. This avoids
* 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;
// guard against endless loops

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -135,7 +135,8 @@ void Context::resolveIncludes()
context = defData->contextByName(inc->contextName());
}
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;
continue;
}
@@ -171,7 +172,8 @@ void Context::resolveAttributeFormat()
m_attributeFormat = DefinitionData::get(def)->formatByName(m_attribute);
if (!m_attributeFormat.isValid()) {
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 {
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_p.h"
#include "rule_p.h"
#include "xml_p.h"
#include "worddelimiters_p.h"
#include "xml_p.h"
#include <QCborMap>
#include <QCoreApplication>
#include <QFile>
#include <QHash>
#include <QStringList>
#include <QVector>
#include <QXmlStreamReader>
#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.
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;
}
@@ -244,15 +245,16 @@ QVector<Definition> Definition::includedDefinitions() const
d->load();
// init worklist and result used as guard with this definition
QVector<Definition> queue {*this};
QVector<Definition> definitions {*this};
QVector<Definition> queue{*this};
QVector<Definition> definitions{*this};
while (!queue.isEmpty()) {
// Iterate all context rules to find associated Definitions. This will
// automatically catch other Definitions referenced with IncludeRuldes or ContextSwitch.
const auto definition = queue.takeLast();
for (const auto &context : qAsConst(definition.d->contexts)) {
// 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 (!definitions.contains(switchContext->definition())) {
queue.push_back(switchContext->definition());
@@ -387,6 +389,12 @@ bool DefinitionData::load(OnlyKeywords onlyKeywords)
context->resolveAttributeFormat();
}
for (const auto context : qAsConst(contexts)) {
for (const auto &rule : context->rules()) {
rule->resolvePostProcessing();
}
}
return true;
}
@@ -449,18 +457,10 @@ bool DefinitionData::loadMetaData(const QString &file, const QCborMap &obj)
fileName = file;
const auto exts = obj.value(QLatin1String("extensions")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext);
const auto mts = obj.value(QLatin1String("mimetype")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt);
return true;
@@ -485,18 +485,10 @@ bool DefinitionData::loadLanguage(QXmlStreamReader &reader)
author = reader.attributes().value(QLatin1String("author")).toString();
license = reader.attributes().value(QLatin1String("license")).toString();
const auto exts = reader.attributes().value(QLatin1String("extensions")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &ext : exts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &ext : exts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
extensions.push_back(ext);
const auto mts = reader.attributes().value(QLatin1String("mimetype")).toString();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
for (const auto &mt : mts.split(QLatin1Char(';'), QString::SkipEmptyParts))
#else
for (const auto &mt : mts.split(QLatin1Char(';'), Qt::SkipEmptyParts))
#endif
mimetypes.push_back(mt);
if (reader.attributes().hasAttribute(QLatin1String("casesensitive")))
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;
// adapt wordDelimiters
for (QChar c : reader.attributes().value(QLatin1String("additionalDeliminator")))
wordDelimiters.append(c);
for (QChar c : reader.attributes().value(QLatin1String("weakDeliminator")))
wordDelimiters.remove(c);
wordDelimiters.append(reader.attributes().value(QLatin1String("additionalDeliminator")));
wordDelimiters.remove(reader.attributes().value(QLatin1String("weakDeliminator")));
// adapt WordWrapDelimiters
auto wordWrapDeliminatorAttr = reader.attributes().value(
@@ -641,8 +631,7 @@ void DefinitionData::loadGeneral(QXmlStreamReader &reader)
if (wordWrapDeliminatorAttr.isEmpty())
wordWrapDelimiters = wordDelimiters;
else {
for (QChar c : wordWrapDeliminatorAttr)
wordWrapDelimiters.append(c);
wordWrapDelimiters.append(wordWrapDeliminatorAttr);
}
} else if (reader.name() == QLatin1String("folding")) {
if (reader.attributes().hasAttribute(QLatin1String("indentationsensitive")))

View File

@@ -43,7 +43,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
const auto networkError = reply->error();
if (networkError != QNetworkReply::NoError) {
qCWarning(Log) << networkError;
emit q->done(); // TODO return error
Q_EMIT q->done(); // TODO return error
return;
}
@@ -60,7 +60,7 @@ void DefinitionDownloaderPrivate::definitionListDownloadFinished(QNetworkReply *
}
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();
}
@@ -72,14 +72,14 @@ void DefinitionDownloaderPrivate::updateDefinition(QXmlStreamReader &parser)
auto localDef = repo->definitionForName(name.toString());
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()));
return;
}
const auto version = parser.attributes().value(QLatin1String("version"));
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()));
}
}
@@ -94,7 +94,9 @@ void DefinitionDownloaderPrivate::downloadDefinition(const QUrl &downloadUrl)
QNetworkRequest req(url);
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;
needsReload = true;
}
@@ -134,7 +136,7 @@ void DefinitionDownloaderPrivate::checkDone()
if (needsReload)
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()
{
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));
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute,
QNetworkRequest::NoLessSafeRedirectPolicy);
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
{
// use QColor::fromRgba for background QRgb => QColor conversion to avoid unset colors == black!
return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme) == theme.selectedTextColor(Theme::Normal)) && (selectedBackgroundColor(theme) == QColor::fromRgba(theme.selectedBackgroundColor(Theme::Normal))) &&
(isBold(theme) == theme.isBold(Theme::Normal)) && (isItalic(theme) == theme.isItalic(Theme::Normal)) && (isUnderline(theme) == theme.isUnderline(Theme::Normal)) && (isStrikeThrough(theme) == theme.isStrikeThrough(Theme::Normal));
return (!hasTextColor(theme)) && (!hasBackgroundColor(theme)) && (selectedTextColor(theme).rgba() == theme.selectedTextColor(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
{
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
@@ -112,7 +115,7 @@ QColor Format::textColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme);
if (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
@@ -120,13 +123,14 @@ QColor Format::selectedTextColor(const Theme &theme) const
const auto overrideStyle = d->styleOverride(theme);
if (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
{
// 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
@@ -136,7 +140,7 @@ QColor Format::backgroundColor(const Theme &theme) const
return overrideStyle.backgroundColor;
// 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
@@ -146,7 +150,8 @@ QColor Format::selectedBackgroundColor(const Theme &theme) const
return overrideStyle.selectedBackgroundColor;
// 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

View File

@@ -76,6 +76,33 @@ void HtmlHighlighter::highlightFile(const QString &fileName, const QString &titl
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)
{
if (!d->out) {
@@ -94,11 +121,12 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
*d->out << "<html><head>\n";
*d->out << "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\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 << " 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))
*d->out << ";color:" << QColor(theme().textColor(Theme::Normal)).name();
*d->out << ";color:" << toHtmlRgbaString(QColor::fromRgba(theme().textColor(Theme::Normal)));
*d->out << "\"><pre>\n";
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?"
QVarLengthArray<QString, 16> formatOutput;
if (format.hasTextColor(theme()))
formatOutput << QStringLiteral("color:") << format.textColor(theme()).name() << QStringLiteral(";");
formatOutput << QStringLiteral("color:") << toHtmlRgbaString(format.textColor(theme())) << QStringLiteral(";");
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()))
formatOutput << QStringLiteral("font-weight:bold;");
if (format.isItalic(theme()))

View File

@@ -26,7 +26,9 @@ bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensi
/**
* 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)
@@ -90,7 +92,9 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
/**
* 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)

View File

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

View File

@@ -18,6 +18,7 @@
#include <QDirIterator>
#include <QFile>
#include <QFileInfo>
#include <QPalette>
#ifndef NO_STANDARD_PATHS
#include <QStandardPaths>
@@ -62,7 +63,9 @@ Definition Repository::definitionForName(const QString &defName) const
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
@@ -133,13 +136,52 @@ Theme Repository::theme(const QString &themeName) const
return Theme();
}
Theme Repository::defaultTheme(Repository::DefaultTheme t)
Theme Repository::defaultTheme(Repository::DefaultTheme t) const
{
if (t == DarkTheme)
return theme(QLatin1String("Breeze Dark"));
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)
{
// always add invalid default "None" highlighting
@@ -147,7 +189,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
for (const auto &dir :
QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/syntax"), QStandardPaths::LocateDirectory))
loadSyntaxFolder(repo, dir);
// backward compatibility with Kate
@@ -176,7 +219,8 @@ void RepositoryPrivate::load(Repository *repo)
// do lookup in standard paths, if not disabled
#ifndef NO_STANDARD_PATHS
for (const auto &dir : QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
for (const auto &dir :
QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("org.kde.syntax-highlighting/themes"), QStandardPaths::LocateDirectory))
loadThemeFolder(dir);
#endif
@@ -256,7 +300,9 @@ static int themeRevision(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()) {
m_themes.insert(it, theme);
return;

View File

@@ -15,6 +15,7 @@
QT_BEGIN_NAMESPACE
class QString;
class QPalette;
QT_END_NAMESPACE
/**
@@ -209,9 +210,32 @@ public:
/**
* Returns a default theme instance of the given type.
* 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);
/**
* 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.
* This is a moderately expensive operations and should thus only be

View File

@@ -10,8 +10,8 @@
#include "definition_p.h"
#include "ksyntaxhighlighting_logging.h"
#include "rule_p.h"
#include "xml_p.h"
#include "worddelimiters_p.h"
#include "xml_p.h"
#include <QString>
#include <QXmlStreamReader>
@@ -31,9 +31,7 @@ static bool isOctalChar(QChar c)
static bool isHexChar(QChar c)
{
return isDigit(c)
|| (c <= QLatin1Char('f') && QLatin1Char('a') <= c)
|| (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
return isDigit(c) || (c <= QLatin1Char('f') && QLatin1Char('a') <= c) || (c <= QLatin1Char('F') && QLatin1Char('A') <= c);
}
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);
switch (c.unicode()) {
// control chars
case 'a': case 'b': case 'e': case 'f':
case 'n': case 'r': case 't': case 'v':
case '"': case '\'': case '?': case '\\':
case 'a':
case 'b':
case 'e':
case 'f':
case 'n':
case 'r':
case 't':
case 'v':
case '"':
case '\'':
case '?':
case '\\':
return offset + 2;
// hex encoded character
@@ -59,8 +66,14 @@ static int matchEscapedChar(const QString &text, int offset)
return offset;
// octal encoding, simple \0 is OK, too, unlike simple \x above
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
if (offset + 2 < text.size() && isOctalChar(text.at(offset + 2))) {
if (offset + 3 < text.size() && isOctalChar(text.at(offset + 3)))
return offset + 4;
@@ -81,6 +94,13 @@ static QString replaceCaptures(const QString &pattern, const QStringList &captur
return result;
}
Rule::~Rule()
{
if (!m_additionalDeliminator.isEmpty() || !m_weakDeliminator.isEmpty()) {
delete m_wordDelimiters;
}
}
Definition Rule::definition() const
{
return m_def.definition();
@@ -124,12 +144,17 @@ bool Rule::load(QXmlStreamReader &reader)
void Rule::resolveContext()
{
auto const& def = m_def.definition();
auto const &def = m_def.definition();
m_context.resolve(def);
// cache for DefinitionData::wordDelimiters, is accessed VERY often
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)
@@ -151,6 +176,12 @@ bool Rule::doLoad(QXmlStreamReader &reader)
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)
{
if (name == QLatin1String("AnyChar"))
@@ -283,6 +314,12 @@ MatchResult DetectSpaces::doMatch(const QString &text, int offset, const QString
return offset;
}
bool Float::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult Float::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -344,6 +381,12 @@ MatchResult HlCChar::doMatch(const QString &text, int offset, const QStringList
return offset;
}
bool HlCHex::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -367,6 +410,12 @@ MatchResult HlCHex::doMatch(const QString &text, int offset, const QStringList &
return offset;
}
bool HlCOct::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult HlCOct::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -411,11 +460,7 @@ bool IncludeRules::includeAttribute() const
bool IncludeRules::doLoad(QXmlStreamReader &reader)
{
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);
#endif
if (split.isEmpty())
return false;
m_contextName = split.at(0).toString();
@@ -433,6 +478,12 @@ MatchResult IncludeRules::doMatch(const QString &text, int offset, const QString
return offset;
}
bool Int::doLoad(QXmlStreamReader &reader)
{
loadAdditionalWordDelimiters(reader);
return true;
}
MatchResult Int::doMatch(const QString &text, int offset, const QStringList &) const
{
if (offset > 0 && !isWordDelimiter(text.at(offset - 1)))
@@ -466,6 +517,8 @@ bool KeywordListRule::doLoad(QXmlStreamReader &reader)
m_hasCaseSensitivityOverride = false;
}
loadAdditionalWordDelimiters(reader);
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 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
m_dynamic = Xml::attrToBool(reader.attributes().value(QLatin1String("dynamic")));
if (!m_dynamic) {
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 (!m_regexp.isValid())
if (!isValid) {
qCDebug(Log) << "Invalid regexp:" << m_regexp.pattern();
}
}
return !m_regexp.pattern().isEmpty();
}
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_caseSensitivity = Xml::attrToBool(reader.attributes().value(QLatin1String("insensitive"))) ? Qt::CaseInsensitive : Qt::CaseSensitive;
loadAdditionalWordDelimiters(reader);
return !m_word.isEmpty();
}

View File

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

View File

@@ -47,7 +47,7 @@ QString Theme::name() 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

View File

@@ -30,7 +30,7 @@ ThemeData::ThemeData()
/**
* 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)
{
@@ -43,7 +43,7 @@ static inline QRgb readColor(const QJsonValue &val)
return unsetColor;
}
const QColor color(str);
return color.isValid() ? color.rgb() : unsetColor;
return color.isValid() ? color.rgba() : unsetColor;
}
static inline TextStyleData readThemeData(const QJsonObject &obj)

View File

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

View File

@@ -30,14 +30,14 @@ public:
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:
/**

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:
* SQLITE_THREADSAFE=2
* SQLITE_ENABLE_FTS4
* SQLITE_ENABLE_FTS3_PARENTHESIS
* SQLITE_ENABLE_FTS5
* SQLITE_ENABLE_UNLOCK_NOTIFY
* SQLITE_ENABLE_COLUMN_METADATA
* SQLITE_ENABLE_JSON1

View File

@@ -44,6 +44,7 @@
#include <QTimer>
using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
namespace ClassView {
@@ -94,7 +95,7 @@ public:
ParserTreeItem::ConstPtr m_root;
QTimer m_timer;
QHash<QString, CPlusPlus::Document::Ptr> m_awaitingDocuments;
QSet<FilePath> m_awaitingDocuments;
//! Internal manager state. \sa Manager::state
bool state = false;
@@ -116,7 +117,15 @@ void ManagerPrivate::cancelScheduledUpdate()
void ManagerPrivate::resetParser()
{
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()
{
using ProjectExplorer::SessionManager;
d->m_timer.setSingleShot(true);
// connections to enable/disable navi widget factory
SessionManager *sessionManager = SessionManager::instance();
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,
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(ProgressManager::instance(), &ProgressManager::taskStarted,
@@ -283,12 +303,12 @@ void Manager::initialize()
if (doc.data() == nullptr)
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
});
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();
if (!state() || d->disableCodeParser) // enabling any of them will trigger the total update
return;
@@ -346,20 +366,7 @@ void Manager::onWidgetVisibilityIsChanged(bool visibility)
if (!visibility)
return;
setState(true);
onProjectListChanged();
}
/*!
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;
// TODO: this one may change into getter (when a new class view widget is being shown)
QMetaObject::invokeMethod(d->m_parser, &Parser::requestCurrentState, Qt::QueuedConnection);
}

View File

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

View File

@@ -32,18 +32,13 @@
// other
#include <cpptools/cppmodelmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/project.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QStandardItem>
#include <QElapsedTimer>
#include <QDebug>
#include <QHash>
#include <QSet>
#include <QElapsedTimer>
enum { debug = false };
@@ -67,17 +62,11 @@ namespace Internal {
\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
{
public:
//! Get document from documentList
CPlusPlus::Document::Ptr document(const QString &fileName) const;
CPlusPlus::Document::Ptr document(const Utils::FilePath &fileName) const;
struct DocumentCache {
unsigned treeRevision = 0;
@@ -87,23 +76,20 @@ public:
struct ProjectCache {
unsigned treeRevision = 0;
ParserTreeItem::ConstPtr tree;
QStringList fileList;
QString projectName;
QSet<FilePath> fileNames;
};
// Project file path to its cached data
QHash<QString, DocumentCache> m_documentCache;
QHash<FilePath, DocumentCache> m_documentCache;
// Project file path to its cached data
QHash<QString, ProjectCache> m_projectCache;
// other
//! List for files which has to be parsed
QSet<QString> fileList;
QHash<FilePath, ProjectCache> m_projectCache;
//! Flat mode
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;
}
@@ -161,16 +147,14 @@ ParserTreeItem::ConstPtr Parser::parse()
QHash<SymbolInformation, ParserTreeItem::ConstPtr> projectTrees;
// TODO: move a call to SessionManager::projects() out of this thread
for (const Project *prj : SessionManager::projects()) {
const QString prjName(prj->displayName());
const QString prjType = prj->projectFilePath().toString();
const SymbolInformation inf(prjName, prjType);
ParserTreeItem::ConstPtr item = addFlatTree(prj);
for (auto it = d->m_projectCache.cbegin(); it != d->m_projectCache.cend(); ++it) {
const ParserPrivate::ProjectCache &projectCache = it.value();
const FilePath projectPath = it.key();
const SymbolInformation projectInfo = { projectCache.projectName, projectPath.toString() };
ParserTreeItem::ConstPtr item = getCachedOrParseProjectTree(projectPath, projectCache.fileNames);
if (item.isNull())
continue;
projectTrees.insert(inf, item);
projectTrees.insert(projectInfo, item);
}
ParserTreeItem::ConstPtr rootItem(new ParserTreeItem(projectTrees));
@@ -189,16 +173,16 @@ ParserTreeItem::ConstPtr Parser::parse()
project.
*/
ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList,
const QString &projectId)
ParserTreeItem::ConstPtr Parser::getParseProjectTree(const FilePath &projectPath,
const QSet<FilePath> &filesInProject)
{
//! \todo Way to optimize - for documentUpdate - use old cached project and subtract
//! changed files only (old edition), and add curent editions
QList<ParserTreeItem::ConstPtr> docTrees;
unsigned revision = 0;
for (const QString &file : fileList) {
const CPlusPlus::Document::Ptr &doc = d->document(file);
for (const FilePath &fileInProject : filesInProject) {
const CPlusPlus::Document::Ptr &doc = d->document(fileInProject);
if (doc.isNull())
continue;
@@ -210,11 +194,11 @@ ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList
docTrees.append(docTree);
}
ParserTreeItem::ConstPtr item = ParserTreeItem::mergeTrees(Utils::FilePath::fromString(projectId), docTrees);
ParserTreeItem::ConstPtr item = ParserTreeItem::mergeTrees(projectPath, docTrees);
// update the cache
if (!projectId.isEmpty()) {
ParserPrivate::ProjectCache &projectCache = d->m_projectCache[projectId];
if (!projectPath.isEmpty()) {
ParserPrivate::ProjectCache &projectCache = d->m_projectCache[projectPath];
projectCache.tree = item;
projectCache.treeRevision = revision;
}
@@ -227,15 +211,15 @@ ParserTreeItem::ConstPtr Parser::getParseProjectTree(const QStringList &fileList
Updates the internal cached tree for this project.
*/
ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const QStringList &fileList,
const QString &projectId)
ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const FilePath &projectPath,
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()) {
// calculate project's revision
unsigned revision = 0;
for (const QString &file : fileList) {
const CPlusPlus::Document::Ptr &doc = d->document(file);
for (const FilePath &fileInProject : filesInProject) {
const CPlusPlus::Document::Ptr &doc = d->document(fileInProject);
if (doc.isNull())
continue;
revision += doc->revision();
@@ -246,7 +230,7 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseProjectTree(const QStringList &
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())
return ParserTreeItem::ConstPtr();
const QString &fileName = doc->fileName();
if (!d->fileList.contains(fileName))
return ParserTreeItem::ConstPtr();
const FilePath fileName = FilePath::fromString(doc->fileName());
ParserTreeItem::ConstPtr itemPtr = ParserTreeItem::parseDocument(doc);
@@ -284,7 +266,7 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
return ParserTreeItem::ConstPtr();
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()
&& it.value().treeRevision == doc->revision()) {
return it.value().tree;
@@ -297,13 +279,17 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
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) {
const QString &name = doc->fileName();
updateDocumentsFromSnapshot(documentPaths, CppTools::CppModelManager::instance()->snapshot());
}
// if it is external file (not in any of our projects)
if (!d->fileList.contains(name))
void Parser::updateDocumentsFromSnapshot(const QSet<Utils::FilePath> &documentPaths,
const CPlusPlus::Snapshot &snapshot)
{
for (const FilePath &documentPath : documentPaths) {
CPlusPlus::Document::Ptr doc = snapshot.document(documentPath);
if (doc.isNull())
continue;
getParseDocumentTree(doc);
@@ -311,16 +297,6 @@ void Parser::updateDocuments(const QList<CPlusPlus::Document::Ptr> &docs)
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.
*/
@@ -331,11 +307,11 @@ void Parser::removeFiles(const QStringList &fileList)
return;
for (const QString &name : fileList) {
d->fileList.remove(name);
d->m_documentCache.remove(name);
d->m_projectCache.remove(name);
const FilePath filePath = FilePath::fromString(name);
d->m_documentCache.remove(filePath);
d->m_projectCache.remove(filePath);
for (auto it = d->m_projectCache.begin(); it != d->m_projectCache.end(); ++it)
it.value().fileList.removeOne(name);
it.value().fileNames.remove(filePath);
}
requestCurrentState();
}
@@ -343,75 +319,66 @@ void Parser::removeFiles(const QStringList &fileList)
/*!
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_documentCache.clear();
for (auto it = snapshot.begin(); it != snapshot.end(); ++it)
d->m_documentCache[it.key().toString()].document = it.value();
// recalculate file list
FilePaths fileList;
const CPlusPlus::Snapshot &snapshot = CppTools::CppModelManager::instance()->snapshot();
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
for (const Project *prj : SessionManager::projects())
fileList += prj->files(Project::SourceFiles);
setFileList(Utils::transform(fileList, &FilePath::toString));
requestCurrentState();
}
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();
}
/*!
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.
*/
void Parser::requestCurrentState()
{
// TODO: we need to have a fresh SessionManager data here, which we could pass to 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 ClassView

View File

@@ -54,28 +54,29 @@ public:
void requestCurrentState();
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 updateDocuments(const QList<CPlusPlus::Document::Ptr> &docs);
void updateDocuments(const QSet<Utils::FilePath> &documentPaths);
signals:
void treeRegenerated(const ParserTreeItem::ConstPtr &root);
private:
void setFileList(const QStringList &fileList);
void resetData(const CPlusPlus::Snapshot &snapshot);
void updateDocumentsFromSnapshot(const QSet<Utils::FilePath> &documentPaths,
const CPlusPlus::Snapshot &snapshot);
ParserTreeItem::ConstPtr getParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
ParserTreeItem::ConstPtr getCachedOrParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
ParserTreeItem::ConstPtr getParseProjectTree(const QStringList &fileList, const QString &projectId);
ParserTreeItem::ConstPtr getCachedOrParseProjectTree(const QStringList &fileList,
const QString &projectId);
ParserTreeItem::ConstPtr getParseProjectTree(const Utils::FilePath &projectPath,
const QSet<Utils::FilePath> &filesInProject);
ParserTreeItem::ConstPtr getCachedOrParseProjectTree(const Utils::FilePath &projectPath,
const QSet<Utils::FilePath> &filesInProject);
ParserTreeItem::ConstPtr parse();
QStringList getAllFiles(const ProjectExplorer::Project *project);
ParserTreeItem::ConstPtr addFlatTree(const ProjectExplorer::Project *project);
//! Private class data pointer
ParserPrivate *d;
};

View File

@@ -233,7 +233,8 @@ void addFileSystemNodes(ProjectNode *root, const QList<const FileNode *> &allFil
if (!fileSystemNode->isEmpty()) {
// 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));
}
}

View File

@@ -1753,6 +1753,11 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
flags = EditorManager::DoNotSwitchToDesignMode;
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)
delete editor;
if (focusView)
if (focusView) {
activateView(focusView);
else
} else {
setCurrentView(currentView);
setCurrentEditor(currentView->currentEditor());
}
if (!EditorManager::currentEditor()) {
emit m_instance->currentEditorChanged(nullptr);

View File

@@ -142,6 +142,8 @@ Client::~Client()
}
for (IAssistProcessor *processor : qAsConst(m_runningAssistProcessors))
processor->setAsyncProposalAvailable(nullptr);
qDeleteAll(m_documentHighlightsTimer);
m_documentHighlightsTimer.clear();
updateEditorToolBar(m_openedDocument.keys());
// do not handle messages while shutting down
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)
{
auto uri = DocumentUri::fromFilePath(document->filePath());
@@ -453,11 +513,11 @@ void Client::activateDocument(TextEditor::TextDocument *document)
for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) {
updateEditorToolBar(editor);
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) {
textEditor->editorWidget()->addHoverHandler(&m_hoverHandler);
if (symbolSupport().supportsRename(document)) {
textEditor->editorWidget()->addOptionalActions(
TextEditor::TextEditorActionHandler::RenameSymbol);
}
TextEditor::TextEditorWidget *widget = textEditor->editorWidget();
widget->addHoverHandler(&m_hoverHandler);
requestDocumentHighlights(widget);
if (symbolSupport().supportsRename(document))
widget->addOptionalActions(TextEditor::TextEditorActionHandler::RenameSymbol);
}
}
}
@@ -472,8 +532,11 @@ void Client::deactivateDocument(TextEditor::TextDocument *document)
highlighter->clearAllExtraFormats();
}
for (Core::IEditor *editor : Core::DocumentModel::editorsForDocument(document)) {
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor))
textEditor->editorWidget()->removeHoverHandler(&m_hoverHandler);
if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor)) {
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)
{
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
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;
QTimer *timer = m_documentHighlightsTimer[widget];
if (!timer) {
const auto uri = DocumentUri::fromFilePath(widget->textDocument()->filePath());
auto runningRequest = m_highlightRequests.find(uri);
if (runningRequest != m_highlightRequests.end())
cancelRequest(runningRequest.value());
timer = new QTimer;
timer->setSingleShot(true);
m_documentHighlightsTimer.insert(widget, timer);
connect(timer, &QTimer::timeout, this, [this, widget]() {
requestDocumentHighlights(widget);
m_documentHighlightsTimer.take(widget)->deleteLater();
});
connect(widget, &QWidget::destroyed, this, [widget, this]() {
delete m_documentHighlightsTimer.take(widget);
});
}
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]
(DocumentHighlightsRequest::Response response)
{
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();
sendContent(request);
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()
@@ -893,6 +933,8 @@ bool Client::reset()
for (TextEditor::IAssistProcessor *processor : qAsConst(m_runningAssistProcessors))
processor->setAsyncProposalAvailable(nullptr);
m_runningAssistProcessors.clear();
qDeleteAll(m_documentHighlightsTimer);
m_documentHighlightsTimer.clear();
return true;
}

View File

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

View File

@@ -435,15 +435,10 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
if (auto client = clientForDocument(document))
client->symbolSupport().renameSymbol(document, cursor);
});
connect(widget, &TextEditorWidget::cursorPositionChanged, this, [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->reachable())
client->cursorPositionChanged(widget);
});
connect(widget, &TextEditorWidget::cursorPositionChanged, this, [widget]() {
if (Client *client = clientForDocument(widget->textDocument()))
if (client->reachable())
client->cursorPositionChanged(widget);
});
updateEditorToolBar(editor);
if (TextEditor::TextDocument *document = textEditor->textDocument()) {

View File

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

View File

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

View File

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

View File

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

View File

@@ -81,7 +81,17 @@ QTabBar::tab:selected {
QLineEdit {
color: creatorTheme.DStextColor;
background-color: creatorTheme.DSdockAreaBackground;
background-color: creatorTheme.DScontrolBackground;
border: 1px solid creatorTheme.DScontrolOutline;
selection-color: creatorTheme.DStextSelectedTextColor;
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);
NodeMetaInfo metaInfo = m_formEditorItem->qmlItemNode().modelNode().metaInfo();
auto node = m_formEditorItem->qmlItemNode();
auto font = node.instanceValue("font").value<QFont>();
if (metaInfo.isValid() &&
(metaInfo.isSubclassOf("QtQuick.TextEdit")
|| metaInfo.isSubclassOf("QtQuick.Controls.TextArea"))) {
QSize maximumSize = rect.size().toSize();
textEdit()->setFont(font);
activateTextEdit(maximumSize);
} else {
auto lineEdit = TextEditItemWidget::lineEdit();
auto node = m_formEditorItem->qmlItemNode();
lineEdit->setFont(node.instanceValue("font").value<QFont>());
lineEdit->setFont(font);
activateLineEdit();
}

View File

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

View File

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

View File

@@ -6010,6 +6010,7 @@ void TextEditorWidgetPrivate::toggleBlockVisible(const QTextBlock &block)
void TextEditorWidget::setLanguageSettingsId(Id settingsId)
{
d->m_tabSettingsId = settingsId;
setCodeStyle(TextEditorSettings::codeStyle(settingsId));
}
Id TextEditorWidget::languageSettingsId() const
@@ -6019,20 +6020,24 @@ Id TextEditorWidget::languageSettingsId() const
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) {
disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged,
d->m_document.data(), &TextDocument::setTabSettings);
document, &TextDocument::setTabSettings);
disconnect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged,
this, &TextEditorWidget::slotCodeStyleSettingsChanged);
}
d->m_codeStylePreferences = preferences;
if (d->m_codeStylePreferences) {
connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentTabSettingsChanged,
d->m_document.data(), &TextDocument::setTabSettings);
document, &TextDocument::setTabSettings);
connect(d->m_codeStylePreferences, &ICodeStylePreferences::currentValueChanged,
this, &TextEditorWidget::slotCodeStyleSettingsChanged);
d->m_document->setTabSettings(d->m_codeStylePreferences->currentTabSettings());
document->setTabSettings(d->m_codeStylePreferences->currentTabSettings());
slotCodeStyleSettingsChanged(d->m_codeStylePreferences->currentValue());
}
}

View File

@@ -5,6 +5,10 @@ add_subdirectory(qtlockedfile)
add_subdirectory(help)
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)
set(BUILD_QBS_DEFAULT YES)
else()

View File

@@ -209,7 +209,8 @@ def __getExpectedCompilers__():
expected.extend(__getWinCompilers__())
compilers = ["g++", "gcc"]
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*'):
compilers.extend(findAllFilesInPATH(c))
if platform.system() == 'Darwin':