Merge remote-tracking branch 'origin/4.4'

Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsproject.h

Change-Id: I6b9cdf704be95ade02488c8b19582b6621282fb8
This commit is contained in:
Eike Ziller
2017-07-28 15:24:14 +02:00
106 changed files with 7908 additions and 7461 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -131,6 +131,9 @@
\endlist \endlist
\QC creates the test in the specified project directory. \QC creates the test in the specified project directory.
For more information about creating Google tests, see the
\l{https://github.com/google/googletest/blob/master/googletest/docs/Primer.md}
{Google Test Primer}.
\section1 Setting Up the Google C++ Testing Framework \section1 Setting Up the Google C++ Testing Framework
@@ -175,6 +178,87 @@
\li \c {LIBS += -lgmock -L<path_to_gmock_lib>} \li \c {LIBS += -lgmock -L<path_to_gmock_lib>}
\endlist \endlist
\section1 Building and Running Tests
To build and run tests:
\list 1
\li Open a project that contains tests.
\li In the \uicontrol Tests view, select the tests to run.
\li In the \uicontrol {Test Results} output pane, select
\inlineimage run_small.png
(\uicontrol {Run All Tests}) to run all test or
\inlineimage qtcreator-run-selected-tests.png
(\uicontrol {Run Selected Tests}) to run the selected tests.
\note By default, \QC builds a project before deploying and running
it.
\endlist
If a test takes more than a minute to execute, the default timeout might
stop the test execution. To increase the timeout, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol General.
\section2 Selecting Tests to Run
The \uicontrol Tests view shows all the tests found for the currently active
test frameworks in the current project. Select the test cases to run.
\image qtcreator-tests-view.png
If a Qt Quick test case does not have a name, it is marked
\uicontrol Unnamed in the list. Unnamed test cases are executed when you
select \uicontrol {Run All Tests}. You cannot select or deselect them.
\QC scans the project for tests when you open the project and updates the
test list for the currently active test frameworks when you edit tests.
To refresh the view, select \uicontrol {Rescan Tests} in the context menu.
You can add filters to specify the directories within the current project
to scan for tests. Select \uicontrol Tools > \uicontrol Options >
\uicontrol {Test Settings} > \uicontrol General > \uicontrol Add, and
specify paths to the directories to scan for tests. Wildcards are not
supported in the filter expressions.
\image qtcreator-autotests-options.png
To show or hide init and cleanup or data functions in the \uicontrol Tests
view, select \inlineimage filtericon.png
(\uicontrol {Filter Test Tree}), and then select \uicontrol {Show Init and
Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a
function in the list to open its source code in the code editor.
The test cases are listed in alphabetic order. To list them in the order in
which they are defined in the source code, select \inlineimage leafsort.png
(\uicontrol {Sort Naturally}).
\section2 Specifying Settings for Running Qt Tests
The code inside a benchmark test is measured, and possibly also repeated
several times in order to get an accurate measurement. This depends on the
measurement back-end that you can select in the
\uicontrol {Benchmark Metrics} group in \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Qt Test}:
walltime, CPU tick counter, event counter, Valgrind Callgrind, and Linux
Perf. For more information, see \l{Creating a Benchmark}.
\image qtcreator-autotests-options-qt.png
To receive verbose output when running benchmarks, select the
\uicontrol {Verbose benchmarks} check box.
To allow the debugger to interrupt Qt tests on assertions, select the
\uicontrol {Disable crash handler while debugging} check box.
To record information about signals and slots in the test log, select the
\uicontrol {Log signals and slots} check box.
\section2 Specifying Settings for Running Google Tests
To specify settings for running Google tests, select \uicontrol Tools > To specify settings for running Google tests, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Google Test}. \uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Google Test}.
@@ -193,58 +277,23 @@
failures into C++ exceptions, select the \uicontrol {Throw on failure} check failures into C++ exceptions, select the \uicontrol {Throw on failure} check
box. box.
For more information about creating Google tests, see the
\l{https://github.com/google/googletest/blob/master/googletest/docs/Primer.md}
{Google Test Primer}.
\section1 Building and Running Tests
To build and run tests:
\list 1
\li Open a project that contains tests.
\li In the \uicontrol {Test Results} output pane, select
\inlineimage run_small.png
(\uicontrol {Run All Tests}) to run all test or
\inlineimage qtcreator-run-selected-tests.png
(\uicontrol {Run Selected Tests}) to run the selected tests.
You can select the tests to run in the \uicontrol Tests view in the
\uicontrol Projects pane. For more information, see
\l{Viewing Tests}.
\note By default, \QC builds a project before deploying and running
it.
\endlist
If a test takes more than a minute to execute, the default timeout might
stop the test execution. To increase the timeout, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol General.
\image qtcreator-autotests-options.png
\QC scans the project for tests when you open the project and updates the
test list for the currently active test frameworks when you edit tests.
The code inside a benchmark test is measured, and possibly also repeated
several times in order to get an accurate measurement. This depends on the
measurement back-end that you can select in the
\uicontrol {Benchmark Metrics} group in \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Qt Test}:
walltime, CPU tick counter, event counter, Valgrind Callgrind, and Linux
Perf. For more information, see \l{Creating a Benchmark}.
\image qtcreator-autotests-options-qt.png
To allow the debugger to interrupt Qt tests on assertions, select the
\uicontrol {Disable crash handler while debugging} check box.
\section1 Viewing Test Output \section1 Viewing Test Output
The test results are displayed in the \uicontrol {Test Results} output pane. The test results are displayed in the \uicontrol {Test Results} output pane
in XML format. XML can be parsed more easily and reliably than plain text.
However, if a Qt test crashes, it might not produce complete XML code that
can be parsed, which might lead to information loss. The lost information
might be retrievable when viewing the results as plain text.
To view the results of Qt tests as plain text, select \uicontrol Tools >
\uicontrol Options > \uicontrol {Test Settings} > \uicontrol {Qt Test}, and
then deselect the \uicontrol {Use XML output} check box. Then select the
\inlineimage text.png
(\uicontrol {Switch Between Visual and Text Display}) button in the
\uicontrol {Test Results} output pane to switch to the text display.
The following table lists the messages that the \uicontrol {Test Results}
output pane displays:
\table \table
\header \header
@@ -272,6 +321,13 @@
\row \row
\li FAIL \li FAIL
\li Test case failed. Double-click the line for more information. \li Test case failed. Double-click the line for more information.
\row
\li FATAL
\li A fatal error occurred that stops the test case from being run,
for example.
\row
\li INFO
\li Informative message.
\row \row
\li INTERNAL \li INTERNAL
\li Internal message. \li Internal message.
@@ -281,6 +337,9 @@
\row \row
\li SKIP \li SKIP
\li Test case was skipped. \li Test case was skipped.
\row
\li SYSTEM
\li An error message received from or influenced by the OS.
\row \row
\li XPASS \li XPASS
\li Test case passed even though it was expected to fail. \li Test case passed even though it was expected to fail.
@@ -294,7 +353,14 @@
(\uicontrol {Filter Test Results}), and then select the types of messages to (\uicontrol {Filter Test Results}), and then select the types of messages to
show. show.
To hide internal messages and run configuration warnings, select By default, test result output is limited to 100,000 characters. The output
\uicontrol Tools > \uicontrol Options > \uicontrol {Test Settings} > pane is automatically scrolled down when new results are added. To display
\uicontrol General. full results, select \uicontrol Tools > \uicontrol Options >
\uicontrol {Test Settings} > \uicontrol General, and then deselect the
\uicontrol {Limit result output} check box. To disable automatic scrolling,
deselect the \uicontrol {Automatically scroll results} check box.
Internal messages and run configuration warnings for guessed configurations
are omitted by default. To view them, deselect the \uicontrol {Omit internal
messages} and \uicontrol {Omit run configuration warnings} check boxes.
*/ */

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the Qt Creator documentation. ** This file is part of the Qt Creator documentation.
@@ -141,6 +141,7 @@
hierarchy of a QML file. hierarchy of a QML file.
\li \uicontrol Tests lists autotests and Qt Quick tests in the project. \li \uicontrol Tests lists autotests and Qt Quick tests in the project.
For more information, see \l {Running Autotests}.
\li \uicontrol {Type Hierarchy} shows the base classes of a class. \li \uicontrol {Type Hierarchy} shows the base classes of a class.
@@ -303,28 +304,6 @@
\endlist \endlist
\section2 Viewing Tests
The \uicontrol Tests view shows the autotests and Qt Quick tests in the
current project. Select the test cases to run. If a Qt
Quick test case does not have a name, it is marked \uicontrol Unnamed in the
list. Unnamed test cases are always executed when the application that
contains them is run, and therefore you cannot select or deselect them.
To show or hide init and cleanup or data functions, select
\uicontrol {Filter Test Tree} > \uicontrol {Show Init and Cleanup Functions}
or \uicontrol {Show Data Functions}. Double-click a function in the list
to open its source code in the code editor.
The test cases are listed in alphabetic order. To list them in the order in
which they are defined in the source code, select \inlineimage leafsort.png
(\uicontrol {Sort Naturally}).
To run tests, select \uicontrol {Run All Tests} or
\uicontrol {Run Selected Tests} in the context menu.
To refresh the view, select \uicontrol {Rescan Tests} in the context menu.
\section2 Viewing Type Hierarchy \section2 Viewing Type Hierarchy
To view the base classes of a class, right-click the class and select To view the base classes of a class, right-click the class and select
@@ -375,8 +354,7 @@
To open the \uicontrol{General Messages} and \l{Using Version Control Systems} To open the \uicontrol{General Messages} and \l{Using Version Control Systems}
{Version Control} panes, select {Version Control} panes, select
\uicontrol {Window > Output Panes}. To display the \uicontrol {To-Do Entries} pane, \uicontrol {Window > Output Panes}. To display the \uicontrol {To-Do Entries} pane,
enable the Todo plugin and to display the \l{Running Autotests} enable the Todo plugin.
{Test Results} pane, enable the Auto Tests plugin.
\section2 Issues \section2 Issues

View File

@@ -57,17 +57,16 @@ def parse_arguments():
source_include_patterns = [ source_include_patterns = [
# directories # directories
r"^scripts/.*$", # everything under scripts/ r"^(?!(share|tests)/.*$)(.*/)?$", # look into all directories except under share/ and tests/
r"^doc/.*$", # everything under doc/
r"^share/(qtcreator/(qml/(qmlpuppet/(.*/)?)?)?)?$", # for shared headers for qt quick designer plugins r"^share/(qtcreator/(qml/(qmlpuppet/(.*/)?)?)?)?$", # for shared headers for qt quick designer plugins
r"^src/(.*/)?$", # all directories under src/
r"^plugins/(.*/)?$", # all directories under plugins/ (if this is run on extra plugin repositories)
# files # files
r"^HACKING$", r"^HACKING$",
r"^LICENSE.*$", r"^LICENSE.*$",
r"^README.md$", r"^README.md$",
r"^.*\.pri$", r"^scripts/.*$", # include everything under scripts/
r"^.*\.h$", r"^doc/.*$", # include everything under doc/
r"^.*\.pri$", # .pri files in all directories that are looked into
r"^.*\.h$", # .h files in all directories that are looked into
] ]
build_include_patterns = [ build_include_patterns = [

View File

@@ -20,9 +20,11 @@ win32 {
# We need the version in two separate formats for the .rc file # We need the version in two separate formats for the .rc file
# RC_VERSION=4,3,82,0 (quadruple) # RC_VERSION=4,3,82,0 (quadruple)
# RC_VERSION_STRING="4.4.0-beta1" (free text) # RC_VERSION_STRING="4.4.0-beta1" (free text)
# Also, we need to replace space with \x20 to be able to work with both rc and windres
COPYRIGHT = "2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd"
DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \ DEFINES += RC_VERSION=$$replace(QTCREATOR_VERSION, "\\.", ","),0 \
RC_VERSION_STRING=\\\"$${QTCREATOR_DISPLAY_VERSION}\\\" \ RC_VERSION_STRING=\"$${QTCREATOR_DISPLAY_VERSION}\" \
RC_COPYRIGHT='"\\\"2008-$${QTCREATOR_COPYRIGHT_YEAR} The Qt Company Ltd\\\""' RC_COPYRIGHT=\"$$replace(COPYRIGHT, " ", "\\x20")\"
RC_FILE = qtcreator.rc RC_FILE = qtcreator.rc
} else:macx { } else:macx {
LIBS += -framework CoreFoundation LIBS += -framework CoreFoundation

View File

@@ -54,9 +54,11 @@ QtcProduct {
// We need the version in two separate formats for the .rc file // We need the version in two separate formats for the .rc file
// RC_VERSION=4,3,82,0 (quadruple) // RC_VERSION=4,3,82,0 (quadruple)
// RC_VERSION_STRING="4.4.0-beta1" (free text) // RC_VERSION_STRING="4.4.0-beta1" (free text)
// Also, we need to replace space with \x20 to be able to work with both rc and windres
cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0", cpp.defines: outer.concat(["RC_VERSION=" + qtc.qtcreator_version.replace(/\./g, ",") + ",0",
"RC_VERSION_STRING=\"" + qtc.qtcreator_display_version + "\"", "RC_VERSION_STRING=" + qtc.qtcreator_display_version,
"RC_COPYRIGHT=\"2008-" + qtc.qtcreator_copyright_year + " The Qt Company Ltd\""]) "RC_COPYRIGHT=2008-" + qtc.qtcreator_copyright_year
+ " The Qt Company Ltd".replace(/ /g, "\\x20")])
files: "qtcreator.rc" files: "qtcreator.rc"
} }

View File

@@ -1,5 +1,8 @@
#include <windows.h> #include <windows.h>
#define STRINGIFY1(x) #x
#define STRINGIFY(x) STRINGIFY1(x)
IDI_ICON1 ICON DISCARDABLE "qtcreator.ico" IDI_ICON1 ICON DISCARDABLE "qtcreator.ico"
IDI_ICON2 ICON DISCARDABLE "winicons/c.ico" IDI_ICON2 ICON DISCARDABLE "winicons/c.ico"
IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico" IDI_ICON3 ICON DISCARDABLE "winicons/cpp.ico"
@@ -19,10 +22,10 @@ VS_VERSION_INFO VERSIONINFO
BLOCK "040904E4" BLOCK "040904E4"
{ {
VALUE "FileDescription", "Qt Creator" VALUE "FileDescription", "Qt Creator"
VALUE "FileVersion", RC_VERSION_STRING VALUE "FileVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "ProductName", "Qt Creator" VALUE "ProductName", "Qt Creator"
VALUE "ProductVersion", RC_VERSION_STRING VALUE "ProductVersion", STRINGIFY(RC_VERSION_STRING)
VALUE "LegalCopyright", RC_COPYRIGHT VALUE "LegalCopyright", STRINGIFY(RC_COPYRIGHT)
} }
} }
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@@ -1,2 +0,0 @@
#include "ASTPatternBuilder.h"

View File

@@ -1,3 +1,22 @@
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "Lexer.h" #include "Lexer.h"
#include "Token.h" #include "Token.h"

View File

@@ -1,3 +1,22 @@
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "ObjectiveCTypeQualifiers.h" #include "ObjectiveCTypeQualifiers.h"

View File

@@ -1,9 +1,27 @@
#ifndef CPLUSPLUS_OBJC_TYPEQUALIFIERS_H // Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
#define CPLUSPLUS_OBJC_TYPEQUALIFIERS_H //
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#pragma once
#include "CPlusPlusForwardDeclarations.h" #include "CPlusPlusForwardDeclarations.h"
namespace CPlusPlus { namespace CPlusPlus {
enum { enum {
@@ -27,6 +45,3 @@ enum {
CPLUSPLUS_EXPORT int classifyObjectiveCContextKeyword(const char *s, int n); CPLUSPLUS_EXPORT int classifyObjectiveCContextKeyword(const char *s, int n);
} // namespace CPlusPlus } // namespace CPlusPlus
#endif // CPLUSPLUS_OBJC_TYPEQUALIFIERS_H

View File

@@ -1,3 +1,22 @@
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "QtContextKeywords.h" #include "QtContextKeywords.h"

View File

@@ -1,3 +1,22 @@
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#pragma once #pragma once

View File

@@ -23,8 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef CPLUSPLUS_SAFETYPEMATCHER_H #pragma once
#define CPLUSPLUS_SAFETYPEMATCHER_H
#include "Matcher.h" #include "Matcher.h"
@@ -56,5 +55,3 @@ private:
}; };
} // CPlusPlus namespace } // CPlusPlus namespace
#endif // CPLUSPLUS_SAFETYPEMATCHER_H

View File

@@ -40,7 +40,6 @@ SOURCES += \
$$PWD/ASTMatch0.cpp \ $$PWD/ASTMatch0.cpp \
$$PWD/ASTVisitor.cpp \ $$PWD/ASTVisitor.cpp \
$$PWD/ASTClone.cpp \ $$PWD/ASTClone.cpp \
$$PWD/ASTPatternBuilder.cpp \
$$PWD/ASTMatcher.cpp \ $$PWD/ASTMatcher.cpp \
$$PWD/Matcher.cpp \ $$PWD/Matcher.cpp \
$$PWD/Control.cpp \ $$PWD/Control.cpp \

View File

@@ -30,7 +30,6 @@ Project {
"ASTMatch0.cpp", "ASTMatch0.cpp",
"ASTMatcher.cpp", "ASTMatcher.cpp",
"ASTMatcher.h", "ASTMatcher.h",
"ASTPatternBuilder.cpp",
"ASTPatternBuilder.h", "ASTPatternBuilder.h",
"ASTVisit.cpp", "ASTVisit.cpp",
"ASTVisitor.cpp", "ASTVisitor.cpp",

View File

@@ -32,6 +32,7 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <utils/stringutils.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
@@ -631,26 +632,6 @@ static inline QString msgInvalidFormat(const char *key, const QString &content)
.arg(QLatin1String(key), content); .arg(QLatin1String(key), content);
} }
bool PluginSpec::readMultiLineString(const QJsonValue &value, QString *out)
{
QTC_ASSERT(out, return false);
if (value.isString()) {
*out = value.toString();
} else if (value.isArray()) {
QJsonArray array = value.toArray();
QStringList lines;
foreach (const QJsonValue &v, array) {
if (!v.isString())
return false;
lines.append(v.toString());
}
*out = lines.join(QLatin1Char('\n'));
} else {
return false;
}
return true;
}
/*! /*!
\internal \internal
*/ */
@@ -735,7 +716,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
copyright = value.toString(); copyright = value.toString();
value = metaData.value(QLatin1String(DESCRIPTION)); value = metaData.value(QLatin1String(DESCRIPTION));
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &description)) if (!value.isUndefined() && !Utils::readMultiLineString(value, &description))
return reportError(msgValueIsNotAString(DESCRIPTION)); return reportError(msgValueIsNotAString(DESCRIPTION));
value = metaData.value(QLatin1String(URL)); value = metaData.value(QLatin1String(URL));
@@ -749,7 +730,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
category = value.toString(); category = value.toString();
value = metaData.value(QLatin1String(LICENSE)); value = metaData.value(QLatin1String(LICENSE));
if (!value.isUndefined() && !PluginSpec::readMultiLineString(value, &license)) if (!value.isUndefined() && !Utils::readMultiLineString(value, &license))
return reportError(msgValueIsNotAMultilineString(LICENSE)); return reportError(msgValueIsNotAMultilineString(LICENSE));
value = metaData.value(QLatin1String(PLATFORM)); value = metaData.value(QLatin1String(PLATFORM));
@@ -799,7 +780,7 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
} else if (typeValue.toLower() == QLatin1String(DEPENDENCY_TYPE_TEST)) { } else if (typeValue.toLower() == QLatin1String(DEPENDENCY_TYPE_TEST)) {
dep.type = PluginDependency::Test; dep.type = PluginDependency::Test;
} else { } else {
return reportError(tr("Dependency: \"%1\" must be \"%2\" or \"%3\" (is \"%4\")") return reportError(tr("Dependency: \"%1\" must be \"%2\" or \"%3\" (is \"%4\").")
.arg(QLatin1String(DEPENDENCY_TYPE), .arg(QLatin1String(DEPENDENCY_TYPE),
QLatin1String(DEPENDENCY_TYPE_HARD), QLatin1String(DEPENDENCY_TYPE_HARD),
QLatin1String(DEPENDENCY_TYPE_SOFT), QLatin1String(DEPENDENCY_TYPE_SOFT),

View File

@@ -131,8 +131,6 @@ public:
bool hasError() const; bool hasError() const;
QString errorString() const; QString errorString() const;
static bool readMultiLineString(const QJsonValue &value, QString *out);
private: private:
PluginSpec(); PluginSpec();

View File

@@ -758,6 +758,13 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
QMT_ASSERT(object, return); QMT_ASSERT(object, return);
QMT_ASSERT(object != m_rootPackage, return); QMT_ASSERT(object != m_rootPackage, return);
// verify that newOwner is not a child of object
MObject *newOwnerObject = newOwner;
while (newOwnerObject && newOwnerObject != object)
newOwnerObject = newOwnerObject->owner();
if (newOwnerObject == object)
return;
if (newOwner != object->owner()) { if (newOwner != object->owner()) {
int formerRow = 0; int formerRow = 0;
MObject *formerOwner = object->owner(); MObject *formerOwner = object->owner();

View File

@@ -2,6 +2,8 @@ import qbs
import qbs.Environment import qbs.Environment
import qbs.File import qbs.File
import qbs.FileInfo import qbs.FileInfo
import qbs.Process
import qbs.Utilities
QtcLibrary { QtcLibrary {
condition: qbs.toolchain.contains("msvc") && cdbPath condition: qbs.toolchain.contains("msvc") && cdbPath
@@ -45,11 +47,98 @@ QtcLibrary {
} }
return undefined; return undefined;
} }
cpp.includePaths: [FileInfo.joinPaths(cdbPath, "inc")]
cpp.dynamicLibraries: [ property string pythonInstallDir: Environment.getEnv("PYTHON_INSTALL_DIR")
"user32.lib",
FileInfo.joinPaths(cdbLibPath, "dbgeng.lib") Probe {
] id: pythonDllProbe
condition: product.condition
property string pythonDir: pythonInstallDir // Input
property string buildVariant: qbs.buildVariant // Input
property string fileNamePrefix // Output
configure: {
function printWarning(msg) {
console.warn(msg + " The python dumpers for cdb will not be available.");
}
if (!pythonDir) {
printWarning("PYTHON_INSTALL_DIR not set.");
return;
}
if (!File.exists(pythonDir)) {
printWarning("The provided python installation directory '" + pythonDir
+ "' does not exist.");
return;
}
var p = new Process();
try {
var pythonFilePath = FileInfo.joinPaths(pythonDir, "python.exe");
p.exec(pythonFilePath, ["--version"], true);
var output = p.readStdOut().trim();
var magicPrefix = "Python ";
if (!output.startsWith(magicPrefix)) {
printWarning("Unexpected python output when checking for version: '"
+ output + "'");
return;
}
var versionNumberString = output.slice(magicPrefix.length);
var versionNumbers = versionNumberString.split('.');
if (versionNumbers.length < 2) {
printWarning("Unexpected python output when checking for version: '"
+ output + "'");
return;
}
if (Utilities.versionCompare(versionNumberString, "3.5") < 0) {
printWarning("The python installation at '" + pythonDir
+ "' has version " + versionNumberString + ", but 3.5 or higher "
+ "is required.");
return;
}
found = true;
fileNamePrefix = "python" + versionNumbers[0] + versionNumbers[1];
if (buildVariant === "debug")
fileNamePrefix += "_d"
} finally {
p.close();
}
}
}
Group {
name: "pythonDumper"
condition: pythonDllProbe.found
files: [
"pycdbextmodule.cpp",
"pycdbextmodule.h",
"pyfield.cpp",
"pyfield.h",
"pystdoutredirect.cpp",
"pystdoutredirect.h",
"pytype.cpp",
"pytype.h",
"pyvalue.cpp",
"pyvalue.h",
]
}
Properties {
condition: pythonDllProbe.found
cpp.defines: ["WITH_PYTHON=1"]
}
cpp.includePaths: {
var paths = [FileInfo.joinPaths(cdbPath, "inc")];
if (pythonDllProbe.found)
paths.push(FileInfo.joinPaths(pythonInstallDir, "include"));
return paths;
}
cpp.dynamicLibraries: {
var libs = [ "user32.lib", FileInfo.joinPaths(cdbLibPath, "dbgeng.lib") ];
if (pythonDllProbe.found)
libs.push(FileInfo.joinPaths(pythonInstallDir, "libs",
pythonDllProbe.fileNamePrefix + ".lib"));
return libs;
}
cpp.linkerFlags: ["/DEF:" + FileInfo.toWindowsSeparators( cpp.linkerFlags: ["/DEF:" + FileInfo.toWindowsSeparators(
FileInfo.joinPaths(product.sourceDirectory, FileInfo.joinPaths(product.sourceDirectory,
"qtcreatorcdbext.def"))] "qtcreatorcdbext.def"))]
@@ -61,6 +150,16 @@ QtcLibrary {
dirName += "32"; dirName += "32";
return FileInfo.joinPaths(qtc.libDirName, dirName); return FileInfo.joinPaths(qtc.libDirName, dirName);
} }
Group {
condition: pythonDllProbe.found
files: [FileInfo.joinPaths(pythonInstallDir, pythonDllProbe.fileNamePrefix + ".dll")]
qbs.install: true
qbs.installDir: installDir
}
useNonGuiPchFile: false
files: [ files: [
"common.cpp", "common.cpp",
"common.h", "common.h",

View File

@@ -0,0 +1,305 @@
/****************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "highlightingitemdelegate.h"
#include <QApplication>
#include <QModelIndex>
#include <QPainter>
const int kMinimumLineNumberDigits = 6;
namespace Utils {
HighlightingItemDelegate::HighlightingItemDelegate(int tabWidth, QObject *parent)
: QItemDelegate(parent)
{
setTabWidth(tabWidth);
}
void HighlightingItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
static const int iconSize = 16;
painter->save();
const QStyleOptionViewItem opt = setOptions(index, option);
painter->setFont(opt.font);
QItemDelegate::drawBackground(painter, opt, index);
// ---- do the layout
QRect checkRect;
QRect pixmapRect;
QRect textRect;
// check mark
const bool checkable = (index.model()->flags(index) & Qt::ItemIsUserCheckable);
Qt::CheckState checkState = Qt::Unchecked;
if (checkable) {
QVariant checkStateData = index.data(Qt::CheckStateRole);
checkState = static_cast<Qt::CheckState>(checkStateData.toInt());
checkRect = doCheck(opt, opt.rect, checkStateData);
}
// icon
const QIcon icon = index.model()->data(index, Qt::DecorationRole).value<QIcon>();
if (!icon.isNull()) {
const QSize size = icon.actualSize(QSize(iconSize, iconSize));
pixmapRect = QRect(0, 0, size.width(), size.height());
}
// text
textRect = opt.rect.adjusted(0, 0, checkRect.width() + pixmapRect.width(), 0);
// do layout
doLayout(opt, &checkRect, &pixmapRect, &textRect, false);
// ---- draw the items
// icon
if (!icon.isNull())
icon.paint(painter, pixmapRect, option.decorationAlignment);
// line numbers
const int lineNumberAreaWidth = drawLineNumber(painter, opt, textRect, index);
textRect.adjust(lineNumberAreaWidth, 0, 0, 0);
// text and focus/selection
drawText(painter, opt, textRect, index);
QItemDelegate::drawFocus(painter, opt, opt.rect);
// check mark
if (checkable)
QItemDelegate::drawCheck(painter, opt, checkRect, checkState);
painter->restore();
}
void HighlightingItemDelegate::setTabWidth(int width)
{
m_tabString = QString(width, ' ');
}
// returns the width of the line number area
int HighlightingItemDelegate::drawLineNumber(QPainter *painter, const QStyleOptionViewItem &option,
const QRect &rect,
const QModelIndex &index) const
{
static const int lineNumberAreaHorizontalPadding = 4;
const int lineNumber = index.model()->data(index, int(HighlightingItemRole::LineNumber)).toInt();
if (lineNumber < 1)
return 0;
const bool isSelected = option.state & QStyle::State_Selected;
const QString lineText = QString::number(lineNumber);
const int minimumLineNumberDigits = qMax(kMinimumLineNumberDigits, lineText.count());
const int fontWidth = painter->fontMetrics().width(QString(minimumLineNumberDigits, '0'));
const int lineNumberAreaWidth = lineNumberAreaHorizontalPadding + fontWidth
+ lineNumberAreaHorizontalPadding;
QRect lineNumberAreaRect(rect);
lineNumberAreaRect.setWidth(lineNumberAreaWidth);
QPalette::ColorGroup cg = QPalette::Normal;
if (!(option.state & QStyle::State_Active))
cg = QPalette::Inactive;
else if (!(option.state & QStyle::State_Enabled))
cg = QPalette::Disabled;
painter->fillRect(lineNumberAreaRect, QBrush(isSelected ?
option.palette.brush(cg, QPalette::Highlight) :
option.palette.color(cg, QPalette::Base).darker(111)));
QStyleOptionViewItem opt = option;
opt.displayAlignment = Qt::AlignRight | Qt::AlignVCenter;
opt.palette.setColor(cg, QPalette::Text, Qt::darkGray);
const QStyle *style = QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1;
const QRect rowRect
= lineNumberAreaRect.adjusted(-textMargin, 0,
textMargin - lineNumberAreaHorizontalPadding, 0);
QItemDelegate::drawDisplay(painter, opt, rowRect, lineText);
return lineNumberAreaWidth;
}
void HighlightingItemDelegate::drawText(QPainter *painter,
const QStyleOptionViewItem &option,
const QRect &rect,
const QModelIndex &index) const
{
QString text = index.model()->data(index, Qt::DisplayRole).toString();
// show number of subresults in displayString
if (index.model()->hasChildren(index))
text += " (" + QString::number(index.model()->rowCount(index)) + ')';
int searchTermStart = index.model()->data(index, int(HighlightingItemRole::StartColumn)).toInt();
int searchTermLength = index.model()->data(index, int(HighlightingItemRole::Length)).toInt();
if (searchTermStart < 0 || searchTermStart >= text.length() || searchTermLength < 1) {
drawDisplay(painter, option, rect, text.replace('\t', m_tabString), {});
return;
}
// replace tabs with searchTerm bookkeeping
int searchTermEnd = searchTermStart + searchTermLength;
const int tabDiff = m_tabString.size() - 1;
for (int i = 0; i < text.length(); i++) {
if (text.at(i) == '\t') {
text.replace(i, 1, m_tabString);
if (i < searchTermStart) {
searchTermStart += tabDiff;
searchTermEnd += tabDiff;
} else if (i < searchTermEnd) {
searchTermEnd += tabDiff;
searchTermLength += tabDiff;
}
i += tabDiff;
}
}
const QColor highlightForeground =
index.model()->data(index, int(HighlightingItemRole::Foreground)).value<QColor>();
const QColor highlightBackground =
index.model()->data(index, int(HighlightingItemRole::Background)).value<QColor>();
QTextCharFormat highlightFormat;
highlightFormat.setForeground(highlightForeground);
highlightFormat.setBackground(highlightBackground);
drawDisplay(painter, option, rect, text, {{searchTermStart, searchTermLength, highlightFormat}});
}
// copied from QItemDelegate for drawDisplay
static QString replaceNewLine(QString text)
{
static const QChar nl = '\n';
for (int i = 0; i < text.count(); ++i)
if (text.at(i) == nl)
text[i] = QChar::LineSeparator;
return text;
}
// copied from QItemDelegate for drawDisplay
QSizeF doTextLayout(QTextLayout *textLayout, int lineWidth)
{
qreal height = 0;
qreal widthUsed = 0;
textLayout->beginLayout();
while (true) {
QTextLine line = textLayout->createLine();
if (!line.isValid())
break;
line.setLineWidth(lineWidth);
line.setPosition(QPointF(0, height));
height += line.height();
widthUsed = qMax(widthUsed, line.naturalTextWidth());
}
textLayout->endLayout();
return QSizeF(widthUsed, height);
}
// copied from QItemDelegate to be able to add the 'format' parameter
void HighlightingItemDelegate::drawDisplay(QPainter *painter,
const QStyleOptionViewItem &option,
const QRect &rect, const QString &text,
const QVector<QTextLayout::FormatRange> &format) const
{
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(option.state & QStyle::State_Active))
cg = QPalette::Inactive;
if (option.state & QStyle::State_Selected) {
painter->fillRect(rect, option.palette.brush(cg, QPalette::Highlight));
painter->setPen(option.palette.color(cg, QPalette::HighlightedText));
} else {
painter->setPen(option.palette.color(cg, QPalette::Text));
}
if (text.isEmpty())
return;
if (option.state & QStyle::State_Editing) {
painter->save();
painter->setPen(option.palette.color(cg, QPalette::Text));
painter->drawRect(rect.adjusted(0, 0, -1, -1));
painter->restore();
}
const QStyleOptionViewItem opt = option;
const QWidget *widget = option.widget;
QStyle *style = widget ? widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, widget) + 1;
QRect textRect = rect.adjusted(textMargin, 0, -textMargin, 0); // remove width padding
const bool wrapText = opt.features & QStyleOptionViewItem::WrapText;
QTextOption textOption;
textOption.setWrapMode(wrapText ? QTextOption::WordWrap : QTextOption::ManualWrap);
textOption.setTextDirection(option.direction);
textOption.setAlignment(QStyle::visualAlignment(option.direction, option.displayAlignment));
QTextLayout textLayout;
textLayout.setTextOption(textOption);
textLayout.setFont(option.font);
textLayout.setText(replaceNewLine(text));
QSizeF textLayoutSize = doTextLayout(&textLayout, textRect.width());
if (textRect.width() < textLayoutSize.width()
|| textRect.height() < textLayoutSize.height()) {
QString elided;
int start = 0;
int end = text.indexOf(QChar::LineSeparator, start);
if (end == -1) {
elided += option.fontMetrics.elidedText(text, option.textElideMode, textRect.width());
} else {
while (end != -1) {
elided += option.fontMetrics.elidedText(text.mid(start, end - start),
option.textElideMode, textRect.width());
elided += QChar::LineSeparator;
start = end + 1;
end = text.indexOf(QChar::LineSeparator, start);
}
// let's add the last line (after the last QChar::LineSeparator)
elided += option.fontMetrics.elidedText(text.mid(start),
option.textElideMode, textRect.width());
}
textLayout.setText(elided);
textLayoutSize = doTextLayout(&textLayout, textRect.width());
}
const QSize layoutSize(textRect.width(), int(textLayoutSize.height()));
const QRect layoutRect = QStyle::alignedRect(option.direction, option.displayAlignment,
layoutSize, textRect);
// if we still overflow even after eliding the text, enable clipping
if (!hasClipping() && (textRect.width() < textLayoutSize.width()
|| textRect.height() < textLayoutSize.height())) {
painter->save();
painter->setClipRect(layoutRect);
textLayout.draw(painter, layoutRect.topLeft(), format, layoutRect);
painter->restore();
} else {
textLayout.draw(painter, layoutRect.topLeft(), format, layoutRect);
}
}
} // namespace Utils

View File

@@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of Qt Creator. ** This file is part of Qt Creator.
@@ -25,28 +25,37 @@
#pragma once #pragma once
#include <texteditor/codeassist/completionassistprovider.h> #include "utils_global.h"
#include <QStringList> #include <QItemDelegate>
#include <QTextLayout>
namespace Android { namespace Utils {
namespace Internal {
class JavaCompletionAssistProvider : public TextEditor::CompletionAssistProvider enum class HighlightingItemRole {
{ LineNumber = Qt::UserRole,
Q_OBJECT StartColumn,
Length,
public: Foreground,
JavaCompletionAssistProvider(); Background,
~JavaCompletionAssistProvider(); User
void init() const;
TextEditor::IAssistProcessor *createProcessor() const;
private:
mutable QStringList m_keywords;
}; };
} // namespace Internal class QTCREATOR_UTILS_EXPORT HighlightingItemDelegate : public QItemDelegate
} // namespace Android {
public:
HighlightingItemDelegate(int tabWidth, QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
void setTabWidth(int width);
private:
int drawLineNumber(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QModelIndex &index) const;
void drawText(QPainter *painter, const QStyleOptionViewItem &option,
const QRect &rect, const QModelIndex &index) const;
using QItemDelegate::drawDisplay;
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect,
const QString &text, const QVector<QTextLayout::FormatRange> &format) const;
QString m_tabString;
};
} // namespace Utils

View File

@@ -36,6 +36,7 @@
#include <QPainter> #include <QPainter>
#include <QPaintEngine> #include <QPaintEngine>
#include <QWidget> #include <QWidget>
#include <QDebug>
namespace Utils { namespace Utils {
@@ -67,7 +68,12 @@ static MasksAndColors masksAndColors(const Icon &icon, int dpr)
const QColor color = creatorTheme()->color(i.second); const QColor color = creatorTheme()->color(i.second);
const QString dprFileName = StyleHelper::availableImageResolutions(i.first).contains(dpr) ? const QString dprFileName = StyleHelper::availableImageResolutions(i.first).contains(dpr) ?
StyleHelper::imageFileWithResolution(fileName, dpr) : fileName; StyleHelper::imageFileWithResolution(fileName, dpr) : fileName;
result.append(qMakePair(QPixmap(dprFileName), color)); QPixmap pixmap;
if (!pixmap.load(dprFileName)) {
pixmap = QPixmap(1, 1);
qWarning() << "Could not load image: " << dprFileName;
}
result.append({pixmap, color});
} }
return result; return result;
} }

View File

@@ -28,8 +28,11 @@
#include "hostosinfo.h" #include "hostosinfo.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QDir> #include <QDir>
#include <QJsonArray>
#include <QJsonValue>
#include <QRegularExpression> #include <QRegularExpression>
#include <QSet> #include <QSet>
@@ -246,4 +249,24 @@ QTCREATOR_UTILS_EXPORT QString stripAccelerator(const QString &text)
return res; return res;
} }
QTCREATOR_UTILS_EXPORT bool readMultiLineString(const QJsonValue &value, QString *out)
{
QTC_ASSERT(out, return false);
if (value.isString()) {
*out = value.toString();
} else if (value.isArray()) {
QJsonArray array = value.toArray();
QStringList lines;
foreach (const QJsonValue &v, array) {
if (!v.isString())
return false;
lines.append(v.toString());
}
*out = lines.join(QLatin1Char('\n'));
} else {
return false;
}
return true;
}
} // namespace Utils } // namespace Utils

View File

@@ -28,6 +28,7 @@
#include "utils_global.h" #include "utils_global.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QJsonValue;
class QStringList; class QStringList;
QT_END_NAMESPACE QT_END_NAMESPACE
@@ -53,6 +54,8 @@ QTCREATOR_UTILS_EXPORT QString withTildeHomePath(const QString &path);
// Removes first unescaped ampersand in text // Removes first unescaped ampersand in text
QTCREATOR_UTILS_EXPORT QString stripAccelerator(const QString &text); QTCREATOR_UTILS_EXPORT QString stripAccelerator(const QString &text);
QTCREATOR_UTILS_EXPORT bool readMultiLineString(const QJsonValue &value, QString *out);
class QTCREATOR_UTILS_EXPORT AbstractMacroExpander class QTCREATOR_UTILS_EXPORT AbstractMacroExpander
{ {
public: public:

View File

@@ -113,7 +113,8 @@ SOURCES += $$PWD/environment.cpp \
$$PWD/port.cpp \ $$PWD/port.cpp \
$$PWD/runextensions.cpp \ $$PWD/runextensions.cpp \
$$PWD/utilsicons.cpp \ $$PWD/utilsicons.cpp \
$$PWD/guard.cpp $$PWD/guard.cpp \
$$PWD/highlightingitemdelegate.cpp
win32:SOURCES += $$PWD/consoleprocess_win.cpp win32:SOURCES += $$PWD/consoleprocess_win.cpp
else:SOURCES += $$PWD/consoleprocess_unix.cpp else:SOURCES += $$PWD/consoleprocess_unix.cpp
@@ -239,8 +240,9 @@ HEADERS += \
$$PWD/asconst.h \ $$PWD/asconst.h \
$$PWD/smallstringfwd.h \ $$PWD/smallstringfwd.h \
$$PWD/optional.h \ $$PWD/optional.h \
$$PWD/../3rdparty/optional/optional.hpp \
$$PWD/qtcfallthrough.h \ $$PWD/qtcfallthrough.h \
$$PWD/../3rdparty/optional/optional.hpp $$PWD/highlightingitemdelegate.cpp
FORMS += $$PWD/filewizardpage.ui \ FORMS += $$PWD/filewizardpage.ui \
$$PWD/projectintropage.ui \ $$PWD/projectintropage.ui \

View File

@@ -117,6 +117,8 @@ Project {
"functiontraits.h", "functiontraits.h",
"guard.cpp", "guard.cpp",
"guard.h", "guard.h",
"highlightingitemdelegate.cpp",
"highlightingitemdelegate.h",
"historycompleter.cpp", "historycompleter.cpp",
"historycompleter.h", "historycompleter.h",
"hostosinfo.h", "hostosinfo.h",

View File

@@ -41,7 +41,6 @@ HEADERS += \
androidsignaloperation.h \ androidsignaloperation.h \
javaeditor.h \ javaeditor.h \
javaindenter.h \ javaindenter.h \
javacompletionassistprovider.h \
avddialog.h \ avddialog.h \
android_global.h \ android_global.h \
androidbuildapkstep.h \ androidbuildapkstep.h \
@@ -86,7 +85,6 @@ SOURCES += \
androidsignaloperation.cpp \ androidsignaloperation.cpp \
javaeditor.cpp \ javaeditor.cpp \
javaindenter.cpp \ javaindenter.cpp \
javacompletionassistprovider.cpp \
avddialog.cpp \ avddialog.cpp \
androidbuildapkstep.cpp \ androidbuildapkstep.cpp \
androidbuildapkwidget.cpp \ androidbuildapkwidget.cpp \

View File

@@ -107,8 +107,6 @@ Project {
"avddialog.h", "avddialog.h",
"certificatesmodel.cpp", "certificatesmodel.cpp",
"certificatesmodel.h", "certificatesmodel.h",
"javacompletionassistprovider.cpp",
"javacompletionassistprovider.h",
"javaeditor.cpp", "javaeditor.cpp",
"javaeditor.h", "javaeditor.h",
"javaindenter.cpp", "javaindenter.cpp",

View File

@@ -42,7 +42,6 @@
#include "androidruncontrol.h" #include "androidruncontrol.h"
#include "androidsettingspage.h" #include "androidsettingspage.h"
#include "androidtoolchain.h" #include "androidtoolchain.h"
#include "javacompletionassistprovider.h"
#include "javaeditor.h" #include "javaeditor.h"
#ifdef HAVE_QBS #ifdef HAVE_QBS

View File

@@ -78,7 +78,7 @@
<item row="2" column="2"> <item row="2" column="2">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Conflicting "am start" options might result in the app startup failure.</string> <string>If the "am start" options conflict, the application might not start.</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -1,113 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "javacompletionassistprovider.h"
#include "androidconstants.h"
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/keywordscompletionassist.h>
#include <coreplugin/id.h>
using namespace Android;
using namespace Android::Internal;
static const char *const keywords[] = {
"abstract",
"continue",
"for",
"new",
"switch",
"assert",
"default",
"goto",
"package",
"synchronized",
"boolean",
"do",
"if",
"private",
"this",
"break",
"double",
"implements",
"protected",
"throw",
"byte",
"else",
"import",
"public",
"throws",
"case",
"enum",
"instanceof",
"return",
"transient",
"catch",
"extends",
"int",
"short",
"try",
"char",
"final",
"interface",
"static",
"void",
"class",
"finally",
"long",
"strictfp",
"volatile",
"const",
"float",
"native",
"super",
"while",
0
};
JavaCompletionAssistProvider::JavaCompletionAssistProvider()
{
}
JavaCompletionAssistProvider::~JavaCompletionAssistProvider()
{
}
void JavaCompletionAssistProvider::init() const
{
for (uint i = 0; i < sizeof keywords / sizeof keywords[0] - 1; i++)
m_keywords.append(QLatin1String(keywords[i]));
}
TextEditor::IAssistProcessor *JavaCompletionAssistProvider::createProcessor() const
{
if (m_keywords.isEmpty())
init();
TextEditor::Keywords keywords = TextEditor::Keywords(m_keywords,
QStringList(),
QMap<QString, QStringList>());
return new TextEditor::KeywordsCompletionAssistProcessor(keywords);
}

View File

@@ -26,8 +26,8 @@
#include "javaeditor.h" #include "javaeditor.h"
#include "javaindenter.h" #include "javaindenter.h"
#include "androidconstants.h" #include "androidconstants.h"
#include "javacompletionassistprovider.h"
#include <texteditor/codeassist/keywordscompletionassist.h>
#include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditorfactory.h>
#include <texteditor/normalindenter.h> #include <texteditor/normalindenter.h>
#include <texteditor/textdocument.h> #include <texteditor/textdocument.h>
@@ -59,6 +59,14 @@ static TextEditor::TextDocument *createJavaDocument()
JavaEditorFactory::JavaEditorFactory() JavaEditorFactory::JavaEditorFactory()
{ {
static QStringList keywords = {
"abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const",
"continue", "default", "do", "double", "else", "enum", "extends", "final", "finally",
"float", "for", "goto", "if", "implements", "import", "instanceof", "int", "interface",
"long", "native", "new", "package", "private", "protected", "public", "return", "short",
"static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws",
"transient", "try", "void", "volatile", "while"
};
setId(Constants::JAVA_EDITOR_ID); setId(Constants::JAVA_EDITOR_ID);
setDisplayName(tr("Java Editor")); setDisplayName(tr("Java Editor"));
addMimeType(Constants::JAVA_MIMETYPE); addMimeType(Constants::JAVA_MIMETYPE);
@@ -67,8 +75,8 @@ JavaEditorFactory::JavaEditorFactory()
setUseGenericHighlighter(true); setUseGenericHighlighter(true);
setCommentDefinition(Utils::CommentDefinition::CppStyle); setCommentDefinition(Utils::CommentDefinition::CppStyle);
setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection); setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection);
setCompletionAssistProvider(new JavaCompletionAssistProvider);
setMarksVisible(true); setMarksVisible(true);
setCompletionAssistProvider(new TextEditor::KeywordsCompletionAssistProvider(keywords));
} }
} // namespace Internal } // namespace Internal

View File

@@ -47,6 +47,7 @@
#include <cpptools/editordocumenthandle.h> #include <cpptools/editordocumenthandle.h>
#include <texteditor/convenience.h> #include <texteditor/convenience.h>
#include <texteditor/displaysettings.h>
#include <texteditor/fontsettings.h> #include <texteditor/fontsettings.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
#include <texteditor/texteditorconstants.h> #include <texteditor/texteditorconstants.h>
@@ -274,6 +275,9 @@ void ClangEditorDocumentProcessor::addDiagnosticToolTipToLayout(uint line,
= m_diagnosticManager.diagnosticsAt(line, column); = m_diagnosticManager.diagnosticsAt(line, column);
target->addWidget(ClangDiagnosticWidget::create(diagnostics, ClangDiagnosticWidget::ToolTip)); target->addWidget(ClangDiagnosticWidget::create(diagnostics, ClangDiagnosticWidget::ToolTip));
auto link = TextEditor::DisplaySettings::createAnnotationSettingsLink();
target->addWidget(link);
target->setAlignment(link, Qt::AlignRight);
} }
void ClangEditorDocumentProcessor::editorDocumentTimerRestarted() void ClangEditorDocumentProcessor::editorDocumentTimerRestarted()

View File

@@ -39,7 +39,7 @@ VersionSelector::VersionSelector(const QString &fileName, const QString &message
{ {
ui->setupUi(this); ui->setupUi(this);
ui->headerLabel->setText(ui->headerLabel->text().arg(fileName)); ui->headerLabel->setText(ui->headerLabel->text().arg(fileName));
ui->loadedText->setHtml(tr("<html><head/><body><p><b>NOTE: You will not be able to check in " ui->loadedText->setHtml(tr("<html><head/><body><p><b>Note: You will not be able to check in "
"this file without merging the changes (not supported by the " "this file without merging the changes (not supported by the "
"plugin)</b></p></body></html>")); "plugin)</b></p></body></html>"));
m_stream = new QTextStream(message.toLocal8Bit(), QIODevice::ReadOnly | QIODevice::Text); m_stream = new QTextStream(message.toLocal8Bit(), QIODevice::ReadOnly | QIODevice::Text);

View File

@@ -17,7 +17,7 @@
<item> <item>
<widget class="QLabel" name="headerLabel"> <widget class="QLabel" name="headerLabel">
<property name="text"> <property name="text">
<string>There are multiple versions of '%1' which can be considered for checkout. Please select version to checkout:</string> <string>Multiple versions of "%1" can be checked out. Select the version to check out:</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@@ -32,7 +32,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QRadioButton" name="loadedRadioButton"> <widget class="QRadioButton" name="loadedRadioButton">
<property name="text"> <property name="text">
<string>&amp;Loaded Version</string> <string>&amp;Loaded version</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>

View File

@@ -132,7 +132,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
const QJsonObject metaData = plugin->metaData(); const QJsonObject metaData = plugin->metaData();
const QJsonValue mimetypes = metaData.value("Mimetypes"); const QJsonValue mimetypes = metaData.value("Mimetypes");
QString mimetypeString; QString mimetypeString;
if (ExtensionSystem::PluginSpec::readMultiLineString(mimetypes, &mimetypeString)) if (Utils::readMultiLineString(mimetypes, &mimetypeString))
Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypeString.trimmed().toUtf8()); Utils::addMimeTypes(plugin->name() + ".mimetypes", mimetypeString.trimmed().toUtf8());
} }

View File

@@ -79,12 +79,7 @@ public:
}; };
SearchResultWidget::SearchResultWidget(QWidget *parent) : SearchResultWidget::SearchResultWidget(QWidget *parent) :
QWidget(parent), QWidget(parent)
m_count(0),
m_preserveCaseSupported(true),
m_isShowingReplaceUI(false),
m_searchAgainSupported(false),
m_replaceSupported(false)
{ {
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0); layout->setMargin(0);
@@ -295,8 +290,6 @@ void SearchResultWidget::addResults(const QList<SearchResultItem> &items, Search
} }
} }
int SearchResultWidget::count() const int SearchResultWidget::count() const
{ {
return m_count; return m_count;
@@ -309,7 +302,6 @@ void SearchResultWidget::setSupportsReplace(bool replaceSupported, const QString
m_dontAskAgainGroup = group; m_dontAskAgainGroup = group;
} }
void SearchResultWidget::setTextToReplace(const QString &textToReplace) void SearchResultWidget::setTextToReplace(const QString &textToReplace)
{ {
m_replaceTextEdit->setText(textToReplace); m_replaceTextEdit->setText(textToReplace);

View File

@@ -119,28 +119,28 @@ private:
QList<SearchResultItem> checkedItems() const; QList<SearchResultItem> checkedItems() const;
void updateMatchesFoundLabel(); void updateMatchesFoundLabel();
SearchResultTreeView *m_searchResultTreeView; SearchResultTreeView *m_searchResultTreeView = nullptr;
int m_count; int m_count = 0;
QString m_dontAskAgainGroup; QString m_dontAskAgainGroup;
QFrame *m_messageWidget; QFrame *m_messageWidget = nullptr;
InfoBar m_infoBar; InfoBar m_infoBar;
InfoBarDisplay m_infoBarDisplay; InfoBarDisplay m_infoBarDisplay;
QWidget *m_topReplaceWidget; QWidget *m_topReplaceWidget = nullptr;
QLabel *m_replaceLabel; QLabel *m_replaceLabel = nullptr;
QLineEdit *m_replaceTextEdit; QLineEdit *m_replaceTextEdit = nullptr;
QToolButton *m_replaceButton; QToolButton *m_replaceButton = nullptr;
QToolButton *m_searchAgainButton; QToolButton *m_searchAgainButton = nullptr;
QCheckBox *m_preserveCaseCheck; QCheckBox *m_preserveCaseCheck = nullptr;
QCheckBox *m_renameFilesCheckBox = nullptr; QCheckBox *m_renameFilesCheckBox = nullptr;
QWidget *m_descriptionContainer; QWidget *m_descriptionContainer = nullptr;
QLabel *m_label; QLabel *m_label = nullptr;
QLabel *m_searchTerm; QLabel *m_searchTerm = nullptr;
QToolButton *m_cancelButton; QToolButton *m_cancelButton = nullptr;
QLabel *m_matchesFoundLabel; QLabel *m_matchesFoundLabel = nullptr;
bool m_preserveCaseSupported; bool m_preserveCaseSupported = true;
bool m_isShowingReplaceUI; bool m_isShowingReplaceUI = false;
bool m_searchAgainSupported; bool m_searchAgainSupported = false;
bool m_replaceSupported; bool m_replaceSupported = false;
}; };
} // Internal } // Internal

View File

@@ -33,14 +33,13 @@
#include <coreplugin/modemanager.h> #include <coreplugin/modemanager.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/find/searchresulttreeitemdelegate.h>
#include <coreplugin/find/searchresulttreeitemroles.h>
#include <coreplugin/icontext.h> #include <coreplugin/icontext.h>
#include <coreplugin/mainwindow.h> #include <coreplugin/mainwindow.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/appmainwindow.h> #include <utils/appmainwindow.h>
#include <utils/asconst.h> #include <utils/asconst.h>
#include <utils/fancylineedit.h> #include <utils/fancylineedit.h>
#include <utils/highlightingitemdelegate.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/itemviews.h> #include <utils/itemviews.h>
#include <utils/progressindicator.h> #include <utils/progressindicator.h>
@@ -67,6 +66,10 @@
Q_DECLARE_METATYPE(Core::LocatorFilterEntry) Q_DECLARE_METATYPE(Core::LocatorFilterEntry)
using namespace Utils;
const int LocatorEntryRole = int(HighlightingItemRole::User);
namespace Core { namespace Core {
namespace Internal { namespace Internal {
@@ -99,7 +102,7 @@ private:
QColor mBackgroundColor; QColor mBackgroundColor;
}; };
class CompletionDelegate : public SearchResultTreeItemDelegate class CompletionDelegate : public HighlightingItemDelegate
{ {
public: public:
CompletionDelegate(QObject *parent); CompletionDelegate(QObject *parent);
@@ -193,7 +196,6 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const
+ QLatin1String("\n\n") + mEntries.at(index.row()).extraInfo); + QLatin1String("\n\n") + mEntries.at(index.row()).extraInfo);
break; break;
case Qt::DecorationRole: case Qt::DecorationRole:
case ItemDataRoles::ResultIconRole:
if (index.column() == DisplayNameColumn) { if (index.column() == DisplayNameColumn) {
LocatorFilterEntry &entry = mEntries[index.row()]; LocatorFilterEntry &entry = mEntries[index.row()];
if (!entry.displayIcon && !entry.fileName.isEmpty()) if (!entry.displayIcon && !entry.fileName.isEmpty())
@@ -205,21 +207,21 @@ QVariant LocatorModel::data(const QModelIndex &index, int role) const
if (index.column() == ExtraInfoColumn) if (index.column() == ExtraInfoColumn)
return QColor(Qt::darkGray); return QColor(Qt::darkGray);
break; break;
case ItemDataRoles::ResultItemRole: case LocatorEntryRole:
return qVariantFromValue(mEntries.at(index.row())); return qVariantFromValue(mEntries.at(index.row()));
case ItemDataRoles::ResultBeginColumnNumberRole: case int(HighlightingItemRole::StartColumn):
case ItemDataRoles::SearchTermLengthRole: { case int(HighlightingItemRole::Length): {
LocatorFilterEntry &entry = mEntries[index.row()]; LocatorFilterEntry &entry = mEntries[index.row()];
const int highlightColumn = entry.highlightInfo.dataType == LocatorFilterEntry::HighlightInfo::DisplayName const int highlightColumn = entry.highlightInfo.dataType == LocatorFilterEntry::HighlightInfo::DisplayName
? DisplayNameColumn ? DisplayNameColumn
: ExtraInfoColumn; : ExtraInfoColumn;
if (highlightColumn == index.column()) { if (highlightColumn == index.column()) {
const bool startIndexRole = role == ItemDataRoles::ResultBeginColumnNumberRole; const bool startIndexRole = role == int(HighlightingItemRole::StartColumn);
return startIndexRole ? entry.highlightInfo.startIndex : entry.highlightInfo.length; return startIndexRole ? entry.highlightInfo.startIndex : entry.highlightInfo.length;
} }
break; break;
} }
case ItemDataRoles::ResultHighlightBackgroundColor: case int(HighlightingItemRole::Background):
return mBackgroundColor; return mBackgroundColor;
} }
@@ -843,7 +845,7 @@ void LocatorWidget::acceptEntry(int row)
const QModelIndex index = m_locatorModel->index(row, 0); const QModelIndex index = m_locatorModel->index(row, 0);
if (!index.isValid()) if (!index.isValid())
return; return;
const LocatorFilterEntry entry = m_locatorModel->data(index, ItemDataRoles::ResultItemRole).value<LocatorFilterEntry>(); const LocatorFilterEntry entry = m_locatorModel->data(index, LocatorEntryRole).value<LocatorFilterEntry>();
Q_ASSERT(entry.filter != nullptr); Q_ASSERT(entry.filter != nullptr);
QString newText; QString newText;
int selectionStart = -1; int selectionStart = -1;
@@ -926,13 +928,13 @@ LocatorPopup *createLocatorPopup(Locator *locator, QWidget *parent)
} }
CompletionDelegate::CompletionDelegate(QObject *parent) CompletionDelegate::CompletionDelegate(QObject *parent)
: SearchResultTreeItemDelegate(0, parent) : HighlightingItemDelegate(0, parent)
{ {
} }
QSize CompletionDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const QSize CompletionDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{ {
return SearchResultTreeItemDelegate::sizeHint(option, index) + QSize(0, 2); return HighlightingItemDelegate::sizeHint(option, index) + QSize(0, 2);
} }
} // namespace Internal } // namespace Internal

View File

@@ -312,6 +312,15 @@ void NavigationWidget::resizeEvent(QResizeEvent *re)
MiniSplitter::resizeEvent(re); MiniSplitter::resizeEvent(re);
} }
static QIcon closeIconForSide(Side side, int itemCount)
{
if (itemCount > 1)
return Utils::Icons::CLOSE_SPLIT_TOP.icon();
return side == Side::Left
? Utils::Icons::CLOSE_SPLIT_LEFT.icon()
: Utils::Icons::CLOSE_SPLIT_RIGHT.icon();
}
Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int factoryIndex) Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int factoryIndex)
{ {
for (int pos = position + 1; pos < d->m_subWidgets.size(); ++pos) { for (int pos = position + 1; pos < d->m_subWidgets.size(); ++pos) {
@@ -331,9 +340,7 @@ Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int
insertWidget(position, nsw); insertWidget(position, nsw);
d->m_subWidgets.insert(position, nsw); d->m_subWidgets.insert(position, nsw);
d->m_subWidgets.at(0)->setCloseIcon(d->m_subWidgets.size() == 1 d->m_subWidgets.at(0)->setCloseIcon(closeIconForSide(d->m_side, d->m_subWidgets.size()));
? Utils::Icons::CLOSE_SPLIT_LEFT.icon()
: Utils::Icons::CLOSE_SPLIT_TOP.icon());
NavigationWidgetPrivate::updateActivationsMap(nsw->factory()->id(), {d->m_side, position}); NavigationWidgetPrivate::updateActivationsMap(nsw->factory()->id(), {d->m_side, position});
return nsw; return nsw;
} }
@@ -386,10 +393,8 @@ void NavigationWidget::closeSubWidget()
subWidget->hide(); subWidget->hide();
subWidget->deleteLater(); subWidget->deleteLater();
// update close button of top item // update close button of top item
if (d->m_subWidgets.size() == 1) if (!d->m_subWidgets.isEmpty())
d->m_subWidgets.at(0)->setCloseIcon(d->m_subWidgets.size() == 1 d->m_subWidgets.at(0)->setCloseIcon(closeIconForSide(d->m_side, d->m_subWidgets.size()));
? Utils::Icons::CLOSE_SPLIT_LEFT.icon()
: Utils::Icons::CLOSE_SPLIT_TOP.icon());
} else { } else {
setShown(false); setShown(false);
} }

View File

@@ -25,6 +25,7 @@
#include "cppfindreferences.h" #include "cppfindreferences.h"
#include "cppfilesettingspage.h"
#include "cpptoolsconstants.h" #include "cpptoolsconstants.h"
#include "cppmodelmanager.h" #include "cppmodelmanager.h"
#include "cppworkingcopy.h" #include "cppworkingcopy.h"
@@ -384,6 +385,11 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
connect(progress, &FutureProgress::clicked, search, &SearchResult::popup); connect(progress, &FutureProgress::clicked, search, &SearchResult::popup);
} }
static bool isAllLowerCase(const QString &text)
{
return text.toLower() == text;
}
void CppFindReferences::onReplaceButtonClicked(const QString &text, void CppFindReferences::onReplaceButtonClicked(const QString &text,
const QList<SearchResultItem> &items, const QList<SearchResultItem> &items,
bool preserveCase) bool preserveCase)
@@ -405,21 +411,40 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text,
if (!renameFilesCheckBox || !renameFilesCheckBox->isChecked()) if (!renameFilesCheckBox || !renameFilesCheckBox->isChecked())
return; return;
CppFileSettings settings;
settings.fromSettings(Core::ICore::settings());
const QStringList newPaths = const QStringList newPaths =
Utils::transform<QList>(parameters.filesToRename, Utils::transform<QList>(parameters.filesToRename,
[&parameters, text](const Node *node) -> QString { [&parameters, text, &settings](const Node *node) -> QString {
const QFileInfo fi = node->filePath().toFileInfo(); const QFileInfo fi = node->filePath().toFileInfo();
const QString fileName = fi.fileName(); const QString oldSymbolName = parameters.prettySymbolName;
QString newName = fileName; const QString oldBaseName = fi.baseName();
newName.replace(parameters.prettySymbolName, text, Qt::CaseInsensitive); const QString newSymbolName = text;
QString newBaseName = newSymbolName;
if (newName != fileName) { // 1) new symbol lowercase: new base name lowercase
newName = Utils::matchCaseReplacement(fileName, newName); if (isAllLowerCase(newSymbolName)) {
newBaseName = newSymbolName;
return fi.absolutePath() + "/" + newName; // 2) old base name mixed case: new base name is verbatim symbol name
} else if (!isAllLowerCase(oldBaseName)) {
newBaseName = newSymbolName;
// 3) old base name lowercase, old symbol mixed case: new base name lowercase
} else if (!isAllLowerCase(oldSymbolName)) {
newBaseName = newSymbolName.toLower();
// 4) old base name lowercase, old symbol lowercase, new symbol mixed case:
// use the preferences setting for new base name case
} else if (settings.lowerCaseFiles) {
newBaseName = newSymbolName.toLower();
} }
return QString(); if (newBaseName == oldBaseName)
return QString();
return fi.absolutePath() + "/" + newBaseName + '.' + fi.completeSuffix();
}); });
for (int i = 0; i < parameters.filesToRename.size(); ++i) { for (int i = 0; i < parameters.filesToRename.size(); ++i) {

View File

@@ -2030,7 +2030,11 @@ void DebuggerEngine::checkState(DebuggerState state, const char *file, int line)
bool DebuggerEngine::isNativeMixedEnabled() const bool DebuggerEngine::isNativeMixedEnabled() const
{ {
return runParameters().nativeMixedEnabled && (runParameters().languages & QmlLanguage); if (DebuggerRunTool *rt = runTool()) {
const DebuggerRunParameters &runParams = rt->runParameters();
return runParams.nativeMixedEnabled && (runParams.languages & QmlLanguage);
}
return false;
} }
bool DebuggerEngine::isNativeMixedActive() const bool DebuggerEngine::isNativeMixedActive() const

View File

@@ -4034,7 +4034,10 @@ void GdbEngine::reloadDebuggingHelpers()
void GdbEngine::handleGdbError(QProcess::ProcessError error) void GdbEngine::handleGdbError(QProcess::ProcessError error)
{ {
QString program = runParameters().debugger.executable; QString program;
// avoid accessing invalid memory if the process crashed
if (runTool())
program = runParameters().debugger.executable;
QString msg = RunWorker::userMessageForProcessError(error, program); QString msg = RunWorker::userMessageForProcessError(error, program);
QString errorString = m_gdbProc.errorString(); QString errorString = m_gdbProc.errorString();
if (!errorString.isEmpty()) if (!errorString.isEmpty())

View File

@@ -1065,7 +1065,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
if (files.isEmpty()) { if (files.isEmpty()) {
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage); msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
} else { } else {
msgCannotRun(tr("Cannot reset %n file(s) in \"%1\": %2", 0, files.size()) msgCannotRun(tr("Cannot reset %n files in \"%1\": %2", 0, files.size())
.arg(QDir::toNativeSeparators(workingDirectory), resp.stdErr()), .arg(QDir::toNativeSeparators(workingDirectory), resp.stdErr()),
errorMessage); errorMessage);
} }
@@ -2468,9 +2468,9 @@ bool GitClient::getCommitData(const QString &workingDirectory,
static inline QString msgCommitted(const QString &amendSHA1, int fileCount) static inline QString msgCommitted(const QString &amendSHA1, int fileCount)
{ {
if (amendSHA1.isEmpty()) if (amendSHA1.isEmpty())
return GitClient::tr("Committed %n file(s).", 0, fileCount) + '\n'; return GitClient::tr("Committed %n files.", 0, fileCount) + '\n';
if (fileCount) if (fileCount)
return GitClient::tr("Amended \"%1\" (%n file(s)).", 0, fileCount).arg(amendSHA1) + '\n'; return GitClient::tr("Amended \"%1\" (%n files).", 0, fileCount).arg(amendSHA1) + '\n';
return GitClient::tr("Amended \"%1\".").arg(amendSHA1); return GitClient::tr("Amended \"%1\".").arg(amendSHA1);
} }
@@ -2561,7 +2561,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
VcsOutputWindow::appendError(stdErr); VcsOutputWindow::appendError(stdErr);
return true; return true;
} else { } else {
VcsOutputWindow::appendError(tr("Cannot commit %n file(s): %1\n", 0, commitCount).arg(stdErr)); VcsOutputWindow::appendError(tr("Cannot commit %n files: %1\n", 0, commitCount).arg(stdErr));
return false; return false;
} }
} }

View File

@@ -716,9 +716,11 @@ void GitPlugin::blameFile()
cursor.setPosition(selectionStart); cursor.setPosition(selectionStart);
const int startBlock = cursor.blockNumber(); const int startBlock = cursor.blockNumber();
cursor.setPosition(selectionEnd); cursor.setPosition(selectionEnd);
const int endBlock = cursor.blockNumber(); int endBlock = cursor.blockNumber();
if (startBlock != endBlock) { if (startBlock != endBlock) {
firstLine = startBlock + 1; firstLine = startBlock + 1;
if (cursor.atBlockStart())
--endBlock;
if (auto widget = qobject_cast<VcsBaseEditorWidget *>(textEditor->widget())) { if (auto widget = qobject_cast<VcsBaseEditorWidget *>(textEditor->widget())) {
const int previousFirstLine = widget->firstLineNumber(); const int previousFirstLine = widget->firstLineNumber();
if (previousFirstLine > 0) if (previousFirstLine > 0)

View File

@@ -145,11 +145,7 @@ void HelpIndexFilter::accept(LocatorFilterEntry selection,
Q_UNUSED(selectionLength) Q_UNUSED(selectionLength)
const QString &key = selection.displayName; const QString &key = selection.displayName;
const QMap<QString, QUrl> &links = HelpManager::linksForKeyword(key); const QMap<QString, QUrl> &links = HelpManager::linksForKeyword(key);
emit linksActivated(links, key);
if (links.size() == 1)
emit linkActivated(links.begin().value());
else
emit linksActivated(links, key);
} }
void HelpIndexFilter::refresh(QFutureInterface<void> &future) void HelpIndexFilter::refresh(QFutureInterface<void> &future)

View File

@@ -52,7 +52,6 @@ public:
Q_INVOKABLE QSet<QString> searchMatches(const QString &databaseFilePath, Q_INVOKABLE QSet<QString> searchMatches(const QString &databaseFilePath,
const QString &term, int limit); const QString &term, int limit);
signals: signals:
void linkActivated(const QUrl &link) const;
void linksActivated(const QMap<QString, QUrl> &links, const QString &key) const; void linksActivated(const QMap<QString, QUrl> &links, const QString &key) const;
private: private:

View File

@@ -236,10 +236,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
auto helpIndexFilter = new HelpIndexFilter(); auto helpIndexFilter = new HelpIndexFilter();
addAutoReleasedObject(helpIndexFilter); addAutoReleasedObject(helpIndexFilter);
connect(helpIndexFilter, &HelpIndexFilter::linkActivated,
this, &HelpPlugin::showLinkInHelpMode);
connect(helpIndexFilter, &HelpIndexFilter::linksActivated, connect(helpIndexFilter, &HelpIndexFilter::linksActivated,
this, &HelpPlugin::showLinksInHelpMode); this, &HelpPlugin::showLinksInCurrentViewer);
RemoteHelpFilter *remoteHelpFilter = new RemoteHelpFilter(); RemoteHelpFilter *remoteHelpFilter = new RemoteHelpFilter();
addAutoReleasedObject(remoteHelpFilter); addAutoReleasedObject(remoteHelpFilter);
@@ -430,11 +428,12 @@ void HelpPlugin::showLinkInHelpMode(const QUrl &source)
showInHelpViewer(source, helpModeHelpViewer()); showInHelpViewer(source, helpModeHelpViewer());
} }
void HelpPlugin::showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key) void HelpPlugin::showLinksInCurrentViewer(const QMap<QString, QUrl> &links, const QString &key)
{ {
activateHelpMode(); if (links.size() < 1)
ICore::raiseWindow(m_mode->widget()); return;
m_centralWidget->showTopicChooser(links, key); HelpWidget *widget = helpWidgetForWindow(QApplication::activeWindow());
widget->showLinks(links, key);
} }
void HelpPlugin::slotHideRightPane() void HelpPlugin::slotHideRightPane()
@@ -499,6 +498,14 @@ HelpViewer *HelpPlugin::helpModeHelpViewer()
return viewer; return viewer;
} }
HelpWidget *HelpPlugin::helpWidgetForWindow(QWidget *window)
{
if (m_externalWindow && m_externalWindow->window() == window->window())
return m_externalWindow;
activateHelpMode();
return m_centralWidget;
}
HelpViewer *HelpPlugin::viewerForHelpViewerLocation(HelpManager::HelpViewerLocation location) HelpViewer *HelpPlugin::viewerForHelpViewerLocation(HelpManager::HelpViewerLocation location)
{ {
HelpManager::HelpViewerLocation actualLocation = location; HelpManager::HelpViewerLocation actualLocation = location;

View File

@@ -89,7 +89,7 @@ private:
void saveExternalWindowSettings(); void saveExternalWindowSettings();
void showLinkInHelpMode(const QUrl &source); void showLinkInHelpMode(const QUrl &source);
void showLinksInHelpMode(const QMap<QString, QUrl> &links, const QString &key); void showLinksInCurrentViewer(const QMap<QString, QUrl> &links, const QString &key);
void slotHideRightPane(); void slotHideRightPane();
void updateSideBarSource(const QUrl &newUrl); void updateSideBarSource(const QUrl &newUrl);
@@ -109,6 +109,7 @@ private:
void createRightPaneContextViewer(); void createRightPaneContextViewer();
HelpViewer *externalHelpViewer(); HelpViewer *externalHelpViewer();
HelpViewer *helpModeHelpViewer(); HelpViewer *helpModeHelpViewer();
HelpWidget *helpWidgetForWindow(QWidget *window);
void doSetupIfNeeded(); void doSetupIfNeeded();

View File

@@ -354,10 +354,8 @@ void HelpWidget::addSideBar()
auto indexItem = new Core::SideBarItem(indexWindow, Constants::HELP_INDEX); auto indexItem = new Core::SideBarItem(indexWindow, Constants::HELP_INDEX);
indexWindow->setOpenInNewPageActionVisible(supportsNewPages); indexWindow->setOpenInNewPageActionVisible(supportsNewPages);
indexWindow->setWindowTitle(HelpPlugin::tr(Constants::SB_INDEX)); indexWindow->setWindowTitle(HelpPlugin::tr(Constants::SB_INDEX));
connect(indexWindow, &IndexWindow::linkActivated,
this, &HelpWidget::open);
connect(indexWindow, &IndexWindow::linksActivated, connect(indexWindow, &IndexWindow::linksActivated,
this, &HelpWidget::showTopicChooser); this, &HelpWidget::showLinks);
m_indexAction = new QAction(HelpPlugin::tr(Constants::SB_INDEX), this); m_indexAction = new QAction(HelpPlugin::tr(Constants::SB_INDEX), this);
cmd = Core::ActionManager::registerAction(m_indexAction, Constants::HELP_INDEX, m_context->context()); cmd = Core::ActionManager::registerAction(m_indexAction, Constants::HELP_INDEX, m_context->context());
cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+I") cmd->setDefaultKeySequence(QKeySequence(Core::UseMacShortcuts ? tr("Meta+I")
@@ -535,12 +533,18 @@ void HelpWidget::open(const QUrl &url, bool newPage)
setSource(url); setSource(url);
} }
void HelpWidget::showTopicChooser(const QMap<QString, QUrl> &links, void HelpWidget::showLinks(const QMap<QString, QUrl> &links,
const QString &keyword, bool newPage) const QString &keyword, bool newPage)
{ {
TopicChooser tc(this, keyword, links); if (links.size() < 1)
if (tc.exec() == QDialog::Accepted) return;
open(tc.link(), newPage); if (links.size() == 1) {
open(links.first(), newPage);
} else {
TopicChooser tc(this, keyword, links);
if (tc.exec() == QDialog::Accepted)
open(tc.link(), newPage);
}
} }
void HelpWidget::activateSideBarItem(const QString &id) void HelpWidget::activateSideBarItem(const QString &id)

View File

@@ -74,7 +74,7 @@ public:
void open(const QUrl &url, bool newPage = false); void open(const QUrl &url, bool newPage = false);
void openFromSearch(const QUrl &url, const QStringList &searchTerms, bool newPage = false); void openFromSearch(const QUrl &url, const QStringList &searchTerms, bool newPage = false);
void showTopicChooser(const QMap<QString, QUrl> &links, const QString &key, void showLinks(const QMap<QString, QUrl> &links, const QString &key,
bool newPage = false); bool newPage = false);
void activateSideBarItem(const QString &id); void activateSideBarItem(const QString &id);

View File

@@ -289,7 +289,10 @@ void IosConfigurations::updateAutomaticKitList()
continue; continue;
} }
Core::Id pDeviceType = deviceId(sdk.directoryName); Core::Id pDeviceType = deviceId(sdk.directoryName);
QTC_ASSERT(pDeviceType.isValid(), continue); if (!pDeviceType.isValid()) {
qCDebug(kitSetupLog) << "Unsupported/Invalid device type" << sdk.directoryName;
continue;
}
for (BaseQtVersion *qtVersion : qtVersions) { for (BaseQtVersion *qtVersion : qtVersions) {
qCDebug(kitSetupLog) << " - Qt version:" << qtVersion->displayName(); qCDebug(kitSetupLog) << " - Qt version:" << qtVersion->displayName();

View File

@@ -125,7 +125,7 @@ void IosSettingsWidget::onStart()
QList<QFuture<void>> futureList; QList<QFuture<void>> futureList;
foreach (const SimulatorInfo &info, simulatorInfoList) { foreach (const SimulatorInfo &info, simulatorInfoList) {
if (!info.isShutdown()) { if (!info.isShutdown()) {
statusDialog->addMessage(tr("Cannot start simulator(%1, %2) in current state: %3") statusDialog->addMessage(tr("Cannot start simulator (%1, %2) in current state: %3")
.arg(info.name).arg(info.runtimeName).arg(info.state), .arg(info.name).arg(info.runtimeName).arg(info.state),
Utils::StdErrFormat); Utils::StdErrFormat);
} else { } else {
@@ -151,10 +151,10 @@ void IosSettingsWidget::onCreate()
const auto onSimulatorCreate = [this, statusDialog](const QString &name, const auto onSimulatorCreate = [this, statusDialog](const QString &name,
const SimulatorControl::ResponseData &response) { const SimulatorControl::ResponseData &response) {
if (response.success) { if (response.success) {
statusDialog->addMessage(tr("Simulator device(%1) created.\nUDID: %2") statusDialog->addMessage(tr("Simulator device (%1) created.\nUDID: %2")
.arg(name).arg(response.simUdid), Utils::StdOutFormat); .arg(name).arg(response.simUdid), Utils::StdOutFormat);
} else { } else {
statusDialog->addMessage(tr("Simulator device(%1) creation failed.\nError: %2"). statusDialog->addMessage(tr("Simulator device (%1) creation failed.\nError: %2").
arg(name).arg(QString::fromUtf8(response.commandOutput)), arg(name).arg(QString::fromUtf8(response.commandOutput)),
Utils::StdErrFormat); Utils::StdErrFormat);
} }
@@ -218,6 +218,8 @@ void IosSettingsWidget::onRename()
const SimulatorInfo &simInfo = simulatorInfoList.at(0); const SimulatorInfo &simInfo = simulatorInfoList.at(0);
const QString newName = QInputDialog::getText(this, tr("Rename %1").arg(simInfo.name), const QString newName = QInputDialog::getText(this, tr("Rename %1").arg(simInfo.name),
tr("Enter new name:")); tr("Enter new name:"));
if (newName.isEmpty())
return;
QPointer<SimulatorOperationDialog> statusDialog = new SimulatorOperationDialog(this); QPointer<SimulatorOperationDialog> statusDialog = new SimulatorOperationDialog(this);
statusDialog->setAttribute(Qt::WA_DeleteOnClose); statusDialog->setAttribute(Qt::WA_DeleteOnClose);

View File

@@ -396,7 +396,7 @@ void IosToolHandlerPrivate::toolExited(int code)
void IosDeviceToolHandlerPrivate::subprocessError(QProcess::ProcessError error) void IosDeviceToolHandlerPrivate::subprocessError(QProcess::ProcessError error)
{ {
if (state != Stopped) if (state != Stopped)
errorMsg(IosToolHandler::tr("iOS tool Error %1").arg(error)); errorMsg(IosToolHandler::tr("iOS tool error %1").arg(error));
stop(-1); stop(-1);
if (error == QProcess::FailedToStart) { if (error == QProcess::FailedToStart) {
qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")"; qCDebug(toolHandlerLog) << "IosToolHandler::finished(" << this << ")";
@@ -837,7 +837,7 @@ void IosSimulatorToolHandlerPrivate::requestTransferApp(const QString &appBundle
if (response.success) { if (response.success) {
installAppOnSimulator(); installAppOnSimulator();
} else { } else {
errorMsg(IosToolHandler::tr("Application install on Simulator failed. Simulator not running.")); errorMsg(IosToolHandler::tr("Application install on simulator failed. Simulator not running."));
didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure); didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure);
emit q->finished(q); emit q->finished(q);
} }
@@ -862,7 +862,7 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath,
Utils::FileName appBundle = Utils::FileName::fromString(m_bundlePath); Utils::FileName appBundle = Utils::FileName::fromString(m_bundlePath);
if (!appBundle.exists()) { if (!appBundle.exists()) {
errorMsg(IosToolHandler::tr("Application launch on Simulator failed. Invalid Bundle path %1") errorMsg(IosToolHandler::tr("Application launch on simulator failed. Invalid bundle path %1")
.arg(m_bundlePath)); .arg(m_bundlePath));
didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure); didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure);
return; return;
@@ -874,7 +874,7 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath,
if (response.success) { if (response.success) {
launchAppOnSimulator(extraArgs); launchAppOnSimulator(extraArgs);
} else { } else {
errorMsg(IosToolHandler::tr("Application launch on Simulator failed. Simulator not running.")); errorMsg(IosToolHandler::tr("Application launch on simulator failed. Simulator not running."));
didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure); didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure);
} }
}; };
@@ -926,7 +926,7 @@ void IosSimulatorToolHandlerPrivate::installAppOnSimulator()
isTransferringApp(m_bundlePath, m_deviceId, 100, 100, ""); isTransferringApp(m_bundlePath, m_deviceId, 100, 100, "");
didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Success); didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Success);
} else { } else {
errorMsg(IosToolHandler::tr("Application install on Simulator failed. %1") errorMsg(IosToolHandler::tr("Application install on simulator failed. %1")
.arg(QString::fromLocal8Bit(response.commandOutput))); .arg(QString::fromLocal8Bit(response.commandOutput)));
didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure); didTransferApp(m_bundlePath, m_deviceId, IosToolHandler::Failure);
} }
@@ -990,7 +990,7 @@ void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &ext
stderrFile); stderrFile);
} else { } else {
m_pid = -1; m_pid = -1;
errorMsg(IosToolHandler::tr("Application launch on Simulator failed. %1") errorMsg(IosToolHandler::tr("Application launch on simulator failed. %1")
.arg(QString::fromLocal8Bit(response.commandOutput))); .arg(QString::fromLocal8Bit(response.commandOutput)));
didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure); didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure);
stop(-1); stop(-1);

View File

@@ -82,7 +82,7 @@ bool FieldPageFactory::validateData(Core::Id typeId, const QVariant &data, QStri
QList<QVariant> list = JsonWizardFactory::objectOrList(data, errorMessage); QList<QVariant> list = JsonWizardFactory::objectOrList(data, errorMessage);
if (list.isEmpty()) { if (list.isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard", *errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard",
"When parsing fields of page '%1': %2") "When parsing fields of page \"%1\": %2")
.arg(typeId.toString()).arg(*errorMessage); .arg(typeId.toString()).arg(*errorMessage);
return false; return false;
} }

View File

@@ -29,6 +29,7 @@
#include "projectexplorerconstants.h" #include "projectexplorerconstants.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcfallthrough.h>
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <utils/winutils.h> #include <utils/winutils.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -102,7 +103,7 @@ static bool hostSupportsPlatform(MsvcToolChain::Platform platform)
if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm
|| platform == MsvcToolChain::amd64_x86) || platform == MsvcToolChain::amd64_x86)
return true; return true;
// fall through (all x86 toolchains are also working on an amd64 host) Q_FALLTHROUGH(); // all x86 toolchains are also working on an amd64 host
case Utils::HostOsInfo::HostArchitectureX86: case Utils::HostOsInfo::HostArchitectureX86:
return platform == MsvcToolChain::x86 || platform == MsvcToolChain::x86_amd64 return platform == MsvcToolChain::x86 || platform == MsvcToolChain::x86_amd64
|| platform == MsvcToolChain::x86_ia64 || platform == MsvcToolChain::x86_arm; || platform == MsvcToolChain::x86_ia64 || platform == MsvcToolChain::x86_arm;

View File

@@ -1488,7 +1488,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
}); });
expander->registerFileVariables("CurrentRun:Executable", expander->registerFileVariables("CurrentRun:Executable",
tr("The currently active run configuration's executable (if applicable)"), tr("The currently active run configuration's executable (if applicable)."),
[this]() -> QString { [this]() -> QString {
if (Target *target = activeTarget()) { if (Target *target = activeTarget()) {
if (RunConfiguration *rc = target->activeRunConfiguration()) { if (RunConfiguration *rc = target->activeRunConfiguration()) {
@@ -1847,7 +1847,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProjects(con
if (ProjectManager::canOpenProjectForMimeType(mt)) { if (ProjectManager::canOpenProjectForMimeType(mt)) {
if (!QFileInfo(filePath).isFile()) { if (!QFileInfo(filePath).isFile()) {
appendError(errorString, appendError(errorString,
tr("Failed opening project \"%1\": Project is not a file").arg(fileName)); tr("Failed opening project \"%1\": Project is not a file.").arg(fileName));
} else if (Project *pro = ProjectManager::openProject(mt, Utils::FileName::fromString(filePath))) { } else if (Project *pro = ProjectManager::openProject(mt, Utils::FileName::fromString(filePath))) {
QObject::connect(pro, &Project::parsingFinished, [pro]() { QObject::connect(pro, &Project::parsingFinished, [pro]() {
emit SessionManager::instance()->projectFinishedParsing(pro); emit SessionManager::instance()->projectFinishedParsing(pro);

View File

@@ -936,7 +936,7 @@ void RunControlPrivate::onWorkerStarted(RunWorker *worker)
continueStart(); continueStart();
return; return;
} }
showError(tr("Unexpected run control state %1 when worker %2 started") showError(tr("Unexpected run control state %1 when worker %2 started.")
.arg(stateName(state)) .arg(stateName(state))
.arg(worker->d->id)); .arg(worker->d->id));
} }
@@ -1467,11 +1467,11 @@ bool RunWorkerPrivate::canStart() const
void RunWorkerPrivate::timerEvent(QTimerEvent *ev) void RunWorkerPrivate::timerEvent(QTimerEvent *ev)
{ {
if (ev->timerId() == startWatchdogTimerId) { if (ev->timerId() == startWatchdogTimerId) {
q->reportFailure(tr("Worker start timed out")); q->reportFailure(tr("Worker start timed out."));
return; return;
} }
if (ev->timerId() == stopWatchdogTimerId) { if (ev->timerId() == stopWatchdogTimerId) {
q->reportFailure(tr("Worker stop timed out")); q->reportFailure(tr("Worker stop timed out."));
return; return;
} }
} }
@@ -1610,7 +1610,7 @@ QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, cons
"permissions to invoke the program.").arg(program); "permissions to invoke the program.").arg(program);
break; break;
case QProcess::Crashed: case QProcess::Crashed:
msg = tr("The process was ended forcefully"); msg = tr("The process was ended forcefully.");
break; break;
case QProcess::Timedout: case QProcess::Timedout:
// "The last waitFor...() function timed out. " // "The last waitFor...() function timed out. "

View File

@@ -59,18 +59,19 @@ static Core::Id categoryForType(Task::TaskType type)
class TaskMark : public TextEditor::TextMark class TaskMark : public TextEditor::TextMark
{ {
public: public:
TaskMark(unsigned int id, const QString &fileName, int lineNumber, TaskMark(const Task &task) :
Task::TaskType type, bool visible) : TextMark(task.file.toString(), task.line, categoryForType(task.type)),
TextMark(fileName, lineNumber, categoryForType(type)), m_id(task.taskId)
m_id(id)
{ {
setColor(type == Task::Error ? Utils::Theme::ProjectExplorer_TaskError_TextMarkColor setColor(task.type == Task::Error ? Utils::Theme::ProjectExplorer_TaskError_TextMarkColor
: Utils::Theme::ProjectExplorer_TaskWarn_TextMarkColor); : Utils::Theme::ProjectExplorer_TaskWarn_TextMarkColor);
setDefaultToolTip(type == Task::Error ? QApplication::translate("TaskHub", "Error") setDefaultToolTip(task.type == Task::Error ? QApplication::translate("TaskHub", "Error")
: QApplication::translate("TaskHub", "Warning")); : QApplication::translate("TaskHub", "Warning"));
setPriority(type == Task::Error ? TextEditor::TextMark::NormalPriority setPriority(task.type == Task::Error ? TextEditor::TextMark::NormalPriority
: TextEditor::TextMark::LowPriority); : TextEditor::TextMark::LowPriority);
setVisible(visible); setToolTip(task.description);
setIcon(task.icon);
setVisible(!task.icon.isNull());
} }
bool isClickable() const; bool isClickable() const;
@@ -151,12 +152,8 @@ void TaskHub::addTask(Task task)
task.line = -1; task.line = -1;
task.movedLine = task.line; task.movedLine = task.line;
if (task.line != -1) { if (task.line != -1)
auto mark = new TaskMark(task.taskId, task.file.toString(), task.line, task.type, !task.icon.isNull()); task.setMark(new TaskMark(task));
mark->setToolTip(task.description);
mark->setIcon(task.icon);
task.setMark(mark);
}
emit m_instance->taskAdded(task); emit m_instance->taskAdded(task);
} }

View File

@@ -210,7 +210,7 @@ void QbsBuildStep::cancel()
QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) const QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) const
{ {
QVariantMap config = m_qbsConfiguration; QVariantMap config = m_qbsConfiguration;
config.insert(QLatin1String(Constants::QBS_FORCE_PROBES_KEY), m_forceProbes); config.insert(Constants::QBS_FORCE_PROBES_KEY, m_forceProbes);
if (variableHandling == ExpandVariables) { if (variableHandling == ExpandVariables) {
const Utils::MacroExpander *expander = Utils::globalMacroExpander(); const Utils::MacroExpander *expander = Utils::globalMacroExpander();
for (auto it = config.begin(), end = config.end(); it != end; ++it) { for (auto it = config.begin(), end = config.end(); it != end; ++it) {
@@ -227,9 +227,9 @@ void QbsBuildStep::setQbsConfiguration(const QVariantMap &config)
QbsProject *pro = static_cast<QbsProject *>(project()); QbsProject *pro = static_cast<QbsProject *>(project());
QVariantMap tmp = config; QVariantMap tmp = config;
tmp.insert(QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY), pro->profileForTarget(target())); tmp.insert(Constants::QBS_CONFIG_PROFILE_KEY, pro->profileForTarget(target()));
if (!tmp.contains(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY))) if (!tmp.contains(Constants::QBS_CONFIG_VARIANT_KEY))
tmp.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY), tmp.insert(Constants::QBS_CONFIG_VARIANT_KEY,
QString::fromLatin1(Constants::QBS_VARIANT_DEBUG)); QString::fromLatin1(Constants::QBS_VARIANT_DEBUG));
if (tmp == m_qbsConfiguration) if (tmp == m_qbsConfiguration)
@@ -263,13 +263,13 @@ bool QbsBuildStep::cleanInstallRoot() const
bool QbsBuildStep::hasCustomInstallRoot() const bool QbsBuildStep::hasCustomInstallRoot() const
{ {
return m_qbsConfiguration.contains(QLatin1String(Constants::QBS_INSTALL_ROOT_KEY)); return m_qbsConfiguration.contains(Constants::QBS_INSTALL_ROOT_KEY);
} }
Utils::FileName QbsBuildStep::installRoot() const Utils::FileName QbsBuildStep::installRoot() const
{ {
Utils::FileName root = Utils::FileName::fromString(m_qbsConfiguration Utils::FileName root = Utils::FileName::fromString(m_qbsConfiguration
.value(QLatin1String(Constants::QBS_INSTALL_ROOT_KEY)).toString()); .value(Constants::QBS_INSTALL_ROOT_KEY).toString());
if (root.isNull()) { if (root.isNull()) {
const QbsBuildConfiguration * const bc const QbsBuildConfiguration * const bc
= static_cast<QbsBuildConfiguration *>(buildConfiguration()); = static_cast<QbsBuildConfiguration *>(buildConfiguration());
@@ -293,15 +293,15 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
if (!ProjectExplorer::BuildStep::fromMap(map)) if (!ProjectExplorer::BuildStep::fromMap(map))
return false; return false;
setQbsConfiguration(map.value(QLatin1String(QBS_CONFIG)).toMap()); setQbsConfiguration(map.value(QBS_CONFIG).toMap());
m_qbsBuildOptions.setDryRun(map.value(QLatin1String(QBS_DRY_RUN)).toBool()); m_qbsBuildOptions.setDryRun(map.value(QBS_DRY_RUN).toBool());
m_qbsBuildOptions.setKeepGoing(map.value(QLatin1String(QBS_KEEP_GOING)).toBool()); m_qbsBuildOptions.setKeepGoing(map.value(QBS_KEEP_GOING).toBool());
m_qbsBuildOptions.setMaxJobCount(map.value(QLatin1String(QBS_MAXJOBCOUNT)).toInt()); m_qbsBuildOptions.setMaxJobCount(map.value(QBS_MAXJOBCOUNT).toInt());
const bool showCommandLines = map.value(QLatin1String(QBS_SHOWCOMMANDLINES)).toBool(); const bool showCommandLines = map.value(QBS_SHOWCOMMANDLINES).toBool();
m_qbsBuildOptions.setEchoMode(showCommandLines ? qbs::CommandEchoModeCommandLine m_qbsBuildOptions.setEchoMode(showCommandLines ? qbs::CommandEchoModeCommandLine
: qbs::CommandEchoModeSummary); : qbs::CommandEchoModeSummary);
m_qbsBuildOptions.setInstall(map.value(QLatin1String(QBS_INSTALL), true).toBool()); m_qbsBuildOptions.setInstall(map.value(QBS_INSTALL, true).toBool());
m_qbsBuildOptions.setRemoveExistingInstallation(map.value(QLatin1String(QBS_CLEAN_INSTALL_ROOT)) m_qbsBuildOptions.setRemoveExistingInstallation(map.value(QBS_CLEAN_INSTALL_ROOT)
.toBool()); .toBool());
m_forceProbes = map.value(forceProbesKey()).toBool(); m_forceProbes = map.value(forceProbesKey()).toBool();
return true; return true;
@@ -310,14 +310,14 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
QVariantMap QbsBuildStep::toMap() const QVariantMap QbsBuildStep::toMap() const
{ {
QVariantMap map = ProjectExplorer::BuildStep::toMap(); QVariantMap map = ProjectExplorer::BuildStep::toMap();
map.insert(QLatin1String(QBS_CONFIG), m_qbsConfiguration); map.insert(QBS_CONFIG, m_qbsConfiguration);
map.insert(QLatin1String(QBS_DRY_RUN), m_qbsBuildOptions.dryRun()); map.insert(QBS_DRY_RUN, m_qbsBuildOptions.dryRun());
map.insert(QLatin1String(QBS_KEEP_GOING), m_qbsBuildOptions.keepGoing()); map.insert(QBS_KEEP_GOING, m_qbsBuildOptions.keepGoing());
map.insert(QLatin1String(QBS_MAXJOBCOUNT), m_qbsBuildOptions.maxJobCount()); map.insert(QBS_MAXJOBCOUNT, m_qbsBuildOptions.maxJobCount());
map.insert(QLatin1String(QBS_SHOWCOMMANDLINES), map.insert(QBS_SHOWCOMMANDLINES,
m_qbsBuildOptions.echoMode() == qbs::CommandEchoModeCommandLine); m_qbsBuildOptions.echoMode() == qbs::CommandEchoModeCommandLine);
map.insert(QLatin1String(QBS_INSTALL), m_qbsBuildOptions.install()); map.insert(QBS_INSTALL, m_qbsBuildOptions.install());
map.insert(QLatin1String(QBS_CLEAN_INSTALL_ROOT), map.insert(QBS_CLEAN_INSTALL_ROOT,
m_qbsBuildOptions.removeExistingInstallation()); m_qbsBuildOptions.removeExistingInstallation());
map.insert(forceProbesKey(), m_forceProbes); map.insert(forceProbesKey(), m_forceProbes);
return map; return map;
@@ -389,7 +389,7 @@ void QbsBuildStep::handleProcessResultReport(const qbs::ProcessResult &result)
m_parser->setWorkingDirectory(result.workingDirectory()); m_parser->setWorkingDirectory(result.workingDirectory());
QString commandline = result.executableFilePath() + QLatin1Char(' ') QString commandline = result.executableFilePath() + ' '
+ Utils::QtcProcess::joinArgs(result.arguments()); + Utils::QtcProcess::joinArgs(result.arguments());
addOutput(commandline, OutputFormat::Stdout); addOutput(commandline, OutputFormat::Stdout);
@@ -422,15 +422,15 @@ QString QbsBuildStep::buildVariant() const
bool QbsBuildStep::isQmlDebuggingEnabled() const bool QbsBuildStep::isQmlDebuggingEnabled() const
{ {
QVariantMap data = qbsConfiguration(PreserveVariables); QVariantMap data = qbsConfiguration(PreserveVariables);
return data.value(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY), false).toBool() return data.value(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, false).toBool()
|| data.value(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY), false).toBool(); || data.value(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, false).toBool();
} }
void QbsBuildStep::setBuildVariant(const QString &variant) void QbsBuildStep::setBuildVariant(const QString &variant)
{ {
if (m_qbsConfiguration.value(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY)).toString() == variant) if (m_qbsConfiguration.value(Constants::QBS_CONFIG_VARIANT_KEY).toString() == variant)
return; return;
m_qbsConfiguration.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY), variant); m_qbsConfiguration.insert(Constants::QBS_CONFIG_VARIANT_KEY, variant);
emit qbsConfigurationChanged(); emit qbsConfigurationChanged();
QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); QbsBuildConfiguration *bc = static_cast<QbsBuildConfiguration *>(buildConfiguration());
if (bc) if (bc)
@@ -629,18 +629,17 @@ void QbsBuildStepConfigWidget::updateState()
updateQmlDebuggingOption(); updateQmlDebuggingOption();
const QString buildVariant = m_step->buildVariant(); const QString buildVariant = m_step->buildVariant();
const int idx = (buildVariant == QLatin1String(Constants::QBS_VARIANT_DEBUG)) ? 0 : 1; const int idx = (buildVariant == Constants::QBS_VARIANT_DEBUG) ? 0 : 1;
m_ui->buildVariantComboBox->setCurrentIndex(idx); m_ui->buildVariantComboBox->setCurrentIndex(idx);
QString command = static_cast<QbsBuildConfiguration *>(m_step->buildConfiguration()) QString command = static_cast<QbsBuildConfiguration *>(m_step->buildConfiguration())
->equivalentCommandLine(m_step); ->equivalentCommandLine(m_step);
for (int i = 0; i < m_propertyCache.count(); ++i) { for (int i = 0; i < m_propertyCache.count(); ++i) {
command += QLatin1Char(' ') + m_propertyCache.at(i).name command += ' ' + m_propertyCache.at(i).name + ':' + m_propertyCache.at(i).effectiveValue;
+ QLatin1Char(':') + m_propertyCache.at(i).effectiveValue;
} }
if (m_step->isQmlDebuggingEnabled()) if (m_step->isQmlDebuggingEnabled())
command += QLatin1String(" Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true"); command += " Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true";
m_ui->commandLineTextEdit->setPlainText(command); m_ui->commandLineTextEdit->setPlainText(command);
QString summary = tr("<b>Qbs:</b> %1").arg(command); QString summary = tr("<b>Qbs:</b> %1").arg(command);
@@ -670,16 +669,16 @@ void QbsBuildStepConfigWidget::updatePropertyEdit(const QVariantMap &data)
QVariantMap editable = data; QVariantMap editable = data;
// remove data that is edited with special UIs: // remove data that is edited with special UIs:
editable.remove(QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY)); editable.remove(Constants::QBS_CONFIG_PROFILE_KEY);
editable.remove(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY)); editable.remove(Constants::QBS_CONFIG_VARIANT_KEY);
editable.remove(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY)); editable.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY);
editable.remove(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY)); editable.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY);
editable.remove(QLatin1String(Constants::QBS_FORCE_PROBES_KEY)); editable.remove(Constants::QBS_FORCE_PROBES_KEY);
editable.remove(QLatin1String(Constants::QBS_INSTALL_ROOT_KEY)); editable.remove(Constants::QBS_INSTALL_ROOT_KEY);
QStringList propertyList; QStringList propertyList;
for (QVariantMap::const_iterator i = editable.constBegin(); i != editable.constEnd(); ++i) for (QVariantMap::const_iterator i = editable.constBegin(); i != editable.constEnd(); ++i)
propertyList.append(i.key() + QLatin1Char(':') + i.value().toString()); propertyList.append(i.key() + ':' + i.value().toString());
m_ui->propertyEdit->setText(Utils::QtcProcess::joinArgs(propertyList)); m_ui->propertyEdit->setText(Utils::QtcProcess::joinArgs(propertyList));
} }
@@ -688,9 +687,9 @@ void QbsBuildStepConfigWidget::changeBuildVariant(int idx)
{ {
QString variant; QString variant;
if (idx == 1) if (idx == 1)
variant = QLatin1String(Constants::QBS_VARIANT_RELEASE); variant = Constants::QBS_VARIANT_RELEASE;
else else
variant = QLatin1String(Constants::QBS_VARIANT_DEBUG); variant = Constants::QBS_VARIANT_DEBUG;
m_ignoreChange = true; m_ignoreChange = true;
m_step->setBuildVariant(variant); m_step->setBuildVariant(variant);
m_ignoreChange = false; m_ignoreChange = false;
@@ -768,16 +767,16 @@ void QbsBuildStepConfigWidget::applyCachedProperties()
const QVariantMap tmp = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables); const QVariantMap tmp = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables);
// Insert values set up with special UIs: // Insert values set up with special UIs:
data.insert(QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY), data.insert(Constants::QBS_CONFIG_PROFILE_KEY,
tmp.value(QLatin1String(Constants::QBS_CONFIG_PROFILE_KEY))); tmp.value(Constants::QBS_CONFIG_PROFILE_KEY));
data.insert(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY), data.insert(Constants::QBS_CONFIG_VARIANT_KEY,
tmp.value(QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY))); tmp.value(Constants::QBS_CONFIG_VARIANT_KEY));
if (tmp.contains(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY))) if (tmp.contains(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY))
data.insert(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY), data.insert(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY,
tmp.value(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY))); tmp.value(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY));
if (tmp.contains(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY))) if (tmp.contains(Constants::QBS_CONFIG_QUICK_DEBUG_KEY))
data.insert(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY), data.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY,
tmp.value(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY))); tmp.value(Constants::QBS_CONFIG_QUICK_DEBUG_KEY));
for (int i = 0; i < m_propertyCache.count(); ++i) { for (int i = 0; i < m_propertyCache.count(); ++i) {
const Property &property = m_propertyCache.at(i); const Property &property = m_propertyCache.at(i);
@@ -793,11 +792,11 @@ void QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
{ {
QVariantMap data = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables); QVariantMap data = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables);
if (checked) { if (checked) {
data.insert(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY), checked); data.insert(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, checked);
data.insert(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY), checked); data.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, checked);
} else { } else {
data.remove(QLatin1String(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY)); data.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY);
data.remove(QLatin1String(Constants::QBS_CONFIG_QUICK_DEBUG_KEY)); data.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY);
} }
m_ignoreChange = true; m_ignoreChange = true;
@@ -819,7 +818,7 @@ bool QbsBuildStepConfigWidget::validateProperties(Utils::FancyLineEdit *edit, QS
QList<Property> properties; QList<Property> properties;
const Utils::MacroExpander *expander = Utils::globalMacroExpander(); const Utils::MacroExpander *expander = Utils::globalMacroExpander();
foreach (const QString &rawArg, argList) { foreach (const QString &rawArg, argList) {
int pos = rawArg.indexOf(QLatin1Char(':')); int pos = rawArg.indexOf(':');
if (pos > 0) { if (pos > 0) {
const QString rawValue = rawArg.mid(pos + 1); const QString rawValue = rawArg.mid(pos + 1);
Property property(rawArg.left(pos), rawValue, expander->expand(rawValue)); Property property(rawArg.left(pos), rawValue, expander->expand(rawValue));

View File

@@ -46,6 +46,7 @@
#include <cpptools/cppprojectupdater.h> #include <cpptools/cppprojectupdater.h>
#include <extensionsystem/pluginmanager.h> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildenvironmentwidget.h> #include <projectexplorer/buildenvironmentwidget.h>
#include <projectexplorer/buildinfo.h>
#include <projectexplorer/buildmanager.h> #include <projectexplorer/buildmanager.h>
#include <projectexplorer/buildtargetinfo.h> #include <projectexplorer/buildtargetinfo.h>
#include <projectexplorer/deploymentdata.h> #include <projectexplorer/deploymentdata.h>
@@ -688,6 +689,30 @@ QString QbsProject::uniqueProductName(const qbs::ProductData &product)
return product.name() + QLatin1Char('.') + product.profile(); return product.name() + QLatin1Char('.') + product.profile();
} }
void QbsProject::configureAsExampleProject(const QSet<Id> &platforms)
{
QList<const BuildInfo *> infoList;
QList<Kit *> kits = KitManager::kits();
const auto qtVersionMatchesPlatform = [platforms](const QtSupport::BaseQtVersion *version) {
return platforms.isEmpty() || platforms.intersects(version->targetDeviceTypes());
};
foreach (Kit *k, kits) {
const QtSupport::BaseQtVersion * const qtVersion
= QtSupport::QtKitInformation::qtVersion(k);
if (!qtVersion || !qtVersionMatchesPlatform(qtVersion))
continue;
const IBuildConfigurationFactory * const factory
= IBuildConfigurationFactory::find(k, projectFilePath().toString());
if (!factory)
continue;
for (BuildInfo * const info : factory->availableSetups(k, projectFilePath().toString()))
infoList << info;
}
setup(infoList);
qDeleteAll(infoList);
prepareForParsing();
}
void QbsProject::parse(const QVariantMap &config, const Environment &env, const QString &dir, void QbsProject::parse(const QVariantMap &config, const Environment &env, const QString &dir,
const QString &configName) const QString &configName)
{ {

View File

@@ -108,6 +108,8 @@ public:
const qbs::ProductData &product); const qbs::ProductData &product);
static QString uniqueProductName(const qbs::ProductData &product); static QString uniqueProductName(const qbs::ProductData &product);
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;
void invalidate(); void invalidate();
void delayParsing(); void delayParsing();

View File

@@ -60,19 +60,19 @@ const char QBS_CLEANSTEP_ID[] = "Qbs.CleanStep";
const char QBS_INSTALLSTEP_ID[] = "Qbs.InstallStep"; const char QBS_INSTALLSTEP_ID[] = "Qbs.InstallStep";
// QBS strings: // QBS strings:
static const char QBS_VARIANT_DEBUG[] = "debug"; const char QBS_VARIANT_DEBUG[] = "debug";
static const char QBS_VARIANT_RELEASE[] = "release"; const char QBS_VARIANT_RELEASE[] = "release";
static const char QBS_CONFIG_VARIANT_KEY[] = "qbs.buildVariant"; const char QBS_CONFIG_VARIANT_KEY[] = "qbs.buildVariant";
static const char QBS_CONFIG_PROFILE_KEY[] = "qbs.profile"; const char QBS_CONFIG_PROFILE_KEY[] = "qbs.profile";
static const char QBS_INSTALL_ROOT_KEY[] = "qbs.installRoot"; const char QBS_INSTALL_ROOT_KEY[] = "qbs.installRoot";
static const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "Qt.declarative.qmlDebugging"; const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "Qt.declarative.qmlDebugging";
static const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "Qt.quick.qmlDebugging"; const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "Qt.quick.qmlDebugging";
const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes"; const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes";
// Icons: // Icons:
static const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png"; const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png"; const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
// Toolchain related settings: // Toolchain related settings:
const char QBS_TARGETOS[] = "qbs.targetOS"; const char QBS_TARGETOS[] = "qbs.targetOS";

View File

@@ -244,7 +244,6 @@ void MakeFileParse::parseAssignments(QList<QMakeAssignment> *assignments)
static FileName findQMakeBinaryFromMakefile(const QString &makefile) static FileName findQMakeBinaryFromMakefile(const QString &makefile)
{ {
bool debugAdding = false;
QFile fi(makefile); QFile fi(makefile);
if (fi.exists() && fi.open(QFile::ReadOnly)) { if (fi.exists() && fi.open(QFile::ReadOnly)) {
QTextStream ts(&fi); QTextStream ts(&fi);
@@ -252,8 +251,6 @@ static FileName findQMakeBinaryFromMakefile(const QString &makefile)
while (!ts.atEnd()) { while (!ts.atEnd()) {
QString line = ts.readLine(); QString line = ts.readLine();
if (r1.exactMatch(line)) { if (r1.exactMatch(line)) {
if (debugAdding)
qDebug()<<"#~~ QMAKE is:"<<r1.cap(1).trimmed();
QFileInfo qmake(r1.cap(1).trimmed()); QFileInfo qmake(r1.cap(1).trimmed());
QString qmakePath = qmake.filePath(); QString qmakePath = qmake.filePath();
if (!QString::fromLatin1(QTC_HOST_EXE_SUFFIX).isEmpty() if (!QString::fromLatin1(QTC_HOST_EXE_SUFFIX).isEmpty()

View File

@@ -24,330 +24,282 @@
****************************************************************************/ ****************************************************************************/
#include "profilecompletionassist.h" #include "profilecompletionassist.h"
#include "qmakeprojectmanagerconstants.h"
#include <texteditor/codeassist/assistinterface.h> #include "texteditor/codeassist/keywordscompletionassist.h"
#include <texteditor/codeassist/keywordscompletionassist.h>
#include <texteditor/texteditorconstants.h>
#include <coreplugin/id.h> const TextEditor::Keywords &QmakeProjectManager::Internal::qmakeKeywords()
using namespace QmakeProjectManager::Internal;
using namespace TextEditor;
static const char *const variableKeywords[] = {
"CCFLAG",
"CLEAN_DEPS",
"CONFIG",
"DEFINES",
"DEF_FILE",
"DEPENDPATH",
"DEPLOYMENT",
"DEPLOYMENT_PLUGIN",
"DESTDIR",
"DESTDIR_TARGET",
"DISTFILES",
"DLLDESTDIR",
"DSP_TEMPLATE",
"FORMS",
"FORMS3",
"GUID",
"HEADERS",
"ICON",
"INCLUDEPATH",
"INSTALLS",
"LEXIMPLS",
"LEXOBJECTS",
"LEXSOURCES",
"LIBS",
"LITERAL_HASH",
"MAKEFILE",
"MAKEFILE_GENERATOR",
"MOBILITY",
"MOC_DIR",
"OBJECTIVE_HEADERS",
"OBJECTIVE_SOURCES",
"OBJECTS",
"OBJECTS_DIR",
"OBJMOC",
"OTHER_FILES",
"OUT_PWD",
"PKGCONFIG",
"POST_TARGETDEPS",
"PRECOMPILED_HEADER",
"PRE_TARGETDEPS",
"PWD",
"QMAKE",
"QMAKESPEC",
"QMAKE_APP_FLAG",
"QMAKE_APP_OR_DLL",
"QMAKE_AR_CMD",
"QMAKE_BUNDLE_DATA",
"QMAKE_BUNDLE_EXTENSION",
"QMAKE_CC",
"QMAKE_CFLAGS",
"QMAKE_CFLAGS_DEBUG",
"QMAKE_CFLAGS_MT",
"QMAKE_CFLAGS_MT_DBG",
"QMAKE_CFLAGS_MT_DLL",
"QMAKE_CFLAGS_MT_DLLDBG",
"QMAKE_CFLAGS_RELEASE",
"QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO",
"QMAKE_CFLAGS_SHLIB",
"QMAKE_CFLAGS_THREAD",
"QMAKE_CFLAGS_WARN_OFF",
"QMAKE_CFLAGS_WARN_ON",
"QMAKE_CLEAN",
"QMAKE_CXX",
"QMAKE_CXXFLAGS",
"QMAKE_CXXFLAGS_DEBUG",
"QMAKE_CXXFLAGS_MT",
"QMAKE_CXXFLAGS_MT_DBG",
"QMAKE_CXXFLAGS_MT_DLL",
"QMAKE_CXXFLAGS_MT_DLLDBG",
"QMAKE_CXXFLAGS_RELEASE",
"QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO",
"QMAKE_CXXFLAGS_SHLIB",
"QMAKE_CXXFLAGS_THREAD",
"QMAKE_CXXFLAGS_WARN_OFF",
"QMAKE_CXXFLAGS_WARN_ON",
"QMAKE_DISTCLEAN",
"QMAKE_EXTENSION_SHLIB",
"QMAKE_EXTRA_COMPILERS",
"QMAKE_EXTRA_TARGETS",
"QMAKE_EXT_CPP",
"QMAKE_EXT_H",
"QMAKE_EXT_LEX",
"QMAKE_EXT_MOC",
"QMAKE_EXT_OBJ",
"QMAKE_EXT_PRL",
"QMAKE_EXT_UI",
"QMAKE_EXT_YACC",
"QMAKE_FAILED_REQUIREMENTS",
"QMAKE_FRAMEWORK_BUNDLE_NAME",
"QMAKE_FRAMEWORK_VERSION",
"QMAKE_INCDIR",
"QMAKE_INCDIR_EGL",
"QMAKE_INCDIR_OPENGL",
"QMAKE_INCDIR_OPENGL_ES1",
"QMAKE_INCDIR_OPENGL_ES2",
"QMAKE_INCDIR_OPENVG",
"QMAKE_INCDIR_QT",
"QMAKE_INCDIR_THREAD",
"QMAKE_INCDIR_X11",
"QMAKE_INFO_PLIST",
"QMAKE_LFLAGS",
"QMAKE_LFLAGS_CONSOLE",
"QMAKE_LFLAGS_CONSOLE_DLL",
"QMAKE_LFLAGS_DEBUG",
"QMAKE_LFLAGS_PLUGIN",
"QMAKE_LFLAGS_QT_DLL",
"QMAKE_LFLAGS_RELEASE",
"QMAKE_LFLAGS_RPATH",
"QMAKE_LFLAGS_SHAPP",
"QMAKE_LFLAGS_SHLIB",
"QMAKE_LFLAGS_SONAME",
"QMAKE_LFLAGS_THREAD",
"QMAKE_LFLAGS_WINDOWS",
"QMAKE_LFLAGS_WINDOWS_DLL",
"QMAKE_LIBDIR",
"QMAKE_LIBDIR_EGL",
"QMAKE_LIBDIR_FLAGS",
"QMAKE_LIBDIR_OPENGL",
"QMAKE_LIBDIR_OPENVG",
"QMAKE_LIBDIR_QT",
"QMAKE_LIBDIR_X11",
"QMAKE_LIBS",
"QMAKE_LIBS_CONSOLE",
"QMAKE_LIBS_EGL",
"QMAKE_LIBS_OPENGL",
"QMAKE_LIBS_OPENGL_ES1",
"QMAKE_LIBS_OPENGL_ES2",
"QMAKE_LIBS_OPENGL_QT",
"QMAKE_LIBS_OPENVG",
"QMAKE_LIBS_QT",
"QMAKE_LIBS_QT_DLL",
"QMAKE_LIBS_QT_OPENGL",
"QMAKE_LIBS_QT_THREAD",
"QMAKE_LIBS_RT",
"QMAKE_LIBS_RTMT",
"QMAKE_LIBS_THREAD",
"QMAKE_LIBS_WINDOWS",
"QMAKE_LIBS_X11",
"QMAKE_LIBS_X11SM",
"QMAKE_LIB_FLAG",
"QMAKE_LINK",
"QMAKE_LINK_SHLIB_CMD",
"QMAKE_LN_SHLIB",
"QMAKE_MACOSX_DEPLOYMENT_TARGET",
"QMAKE_MAC_SDK",
"QMAKE_MAKEFILE",
"QMAKE_MOC_SRC",
"QMAKE_POST_LINK",
"QMAKE_PRE_LINK",
"QMAKE_PROJECT_NAME",
"QMAKE_QMAKE",
"QMAKE_QT_DLL",
"QMAKE_RESOURCE_FLAGS",
"QMAKE_RPATH",
"QMAKE_RPATHDIR",
"QMAKE_RUN_CC",
"QMAKE_RUN_CC_IMP",
"QMAKE_RUN_CXX",
"QMAKE_RUN_CXX_IMP",
"QMAKE_TARGET",
"QMAKE_UIC",
"QT",
"QTPLUGIN",
"QT_MAJOR_VERSION",
"QT_MINOR_VERSION",
"QT_PATCH_VERSION",
"QT_VERSION",
"RCC_DIR",
"RC_FILE",
"REQUIRES",
"RESOURCES",
"RES_FILE",
"RSS_RULES",
"SIGNATURE_FILE",
"SOURCES",
"SRCMOC",
"STATECHARTS",
"SUBDIRS",
"TARGET",
"TEMPLATE",
"TRANSLATIONS",
"UICIMPLS",
"UICOBJECTS",
"UI_DIR",
"UI_HEADERS_DIR",
"UI_SOURCES_DIR",
"VERSION",
"VERSION_PE_HEADER",
"VER_MAJ",
"VER_MIN",
"VER_PAT",
"VPATH",
"YACCIMPLS",
"YACCOBJECTS",
"YACCSOURCES",
"_PRO_FILE_",
"_PRO_FILE_PWD_",
0
};
static const char *const functionKeywords[] = {
"CONFIG",
"absolute_path",
"basename",
"cache",
"cat",
"clean_path",
"clear",
"contains",
"count",
"debug",
"defined",
"dirname",
"enumerate_vars",
"equals",
"error",
"escape_expand",
"eval",
"exists",
"export",
"files",
"find",
"first",
"for",
"format_number",
"fromfile",
"getenv",
"greaterThan",
"if",
"include",
"infile",
"isActiveConfig",
"isEmpty",
"isEqual",
"join",
"last",
"lessThan",
"list",
"load",
"log",
"lower",
"member",
"message",
"mkpath",
"packagesExist",
"parseJson",
"prompt",
"quote",
"re_escape",
"relative_path",
"replace",
"requires",
"resolve_depends",
"reverse",
"section",
"shadowed",
"shell_path",
"shell_quote",
"size",
"sort_depends",
"split",
"sprintf",
"system",
"system_path",
"system_quote",
"title",
"touch",
"unique",
"unset",
"upper",
"val_escape",
"warning",
"write_file",
0
};
// -------------------------------
// ProFileCompletionAssistProvider
// -------------------------------
void ProFileCompletionAssistProvider::init()
{ {
for (uint i = 0; i < sizeof variableKeywords / sizeof variableKeywords[0] - 1; i++) static TextEditor::Keywords keywords(
m_variables.append(QLatin1String(variableKeywords[i])); QStringList{ // variables
for (uint i = 0; i < sizeof functionKeywords / sizeof functionKeywords[0] - 1; i++) "CCFLAG",
m_functions.append(QLatin1String(functionKeywords[i])); "CLEAN_DEPS",
} "CONFIG",
"DEFINES",
ProFileCompletionAssistProvider::~ProFileCompletionAssistProvider() "DEF_FILE",
{ "DEPENDPATH",
} "DEPLOYMENT",
"DEPLOYMENT_PLUGIN",
IAssistProcessor *ProFileCompletionAssistProvider::createProcessor() const "DESTDIR",
{ "DESTDIR_TARGET",
if (m_variables.isEmpty()) "DISTFILES",
const_cast<ProFileCompletionAssistProvider *>(this)->init(); "DLLDESTDIR",
TextEditor::Keywords keywords = TextEditor::Keywords(m_variables, m_functions, QMap<QString, QStringList>()); "DSP_TEMPLATE",
auto processor = new KeywordsCompletionAssistProcessor(keywords); "FORMS",
processor->setSnippetGroup(TextEditor::Constants::TEXT_SNIPPET_GROUP_ID); "FORMS3",
return processor; "GUID",
} "HEADERS",
"ICON",
QStringList ProFileCompletionAssistProvider::variables() const "INCLUDEPATH",
{ "INSTALLS",
if (m_variables.isEmpty()) "LEXIMPLS",
const_cast<ProFileCompletionAssistProvider *>(this)->init(); "LEXOBJECTS",
return m_variables; "LEXSOURCES",
} "LIBS",
"LITERAL_HASH",
QStringList ProFileCompletionAssistProvider::functions() const "MAKEFILE",
{ "MAKEFILE_GENERATOR",
if (m_functions.isEmpty()) "MOBILITY",
const_cast<ProFileCompletionAssistProvider *>(this)->init(); "MOC_DIR",
return m_functions; "OBJECTIVE_HEADERS",
"OBJECTIVE_SOURCES",
"OBJECTS",
"OBJECTS_DIR",
"OBJMOC",
"OTHER_FILES",
"OUT_PWD",
"PKGCONFIG",
"POST_TARGETDEPS",
"PRECOMPILED_HEADER",
"PRE_TARGETDEPS",
"PWD",
"QMAKE",
"QMAKESPEC",
"QMAKE_APP_FLAG",
"QMAKE_APP_OR_DLL",
"QMAKE_AR_CMD",
"QMAKE_BUNDLE_DATA",
"QMAKE_BUNDLE_EXTENSION",
"QMAKE_CC",
"QMAKE_CFLAGS",
"QMAKE_CFLAGS_DEBUG",
"QMAKE_CFLAGS_MT",
"QMAKE_CFLAGS_MT_DBG",
"QMAKE_CFLAGS_MT_DLL",
"QMAKE_CFLAGS_MT_DLLDBG",
"QMAKE_CFLAGS_RELEASE",
"QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO",
"QMAKE_CFLAGS_SHLIB",
"QMAKE_CFLAGS_THREAD",
"QMAKE_CFLAGS_WARN_OFF",
"QMAKE_CFLAGS_WARN_ON",
"QMAKE_CLEAN",
"QMAKE_CXX",
"QMAKE_CXXFLAGS",
"QMAKE_CXXFLAGS_DEBUG",
"QMAKE_CXXFLAGS_MT",
"QMAKE_CXXFLAGS_MT_DBG",
"QMAKE_CXXFLAGS_MT_DLL",
"QMAKE_CXXFLAGS_MT_DLLDBG",
"QMAKE_CXXFLAGS_RELEASE",
"QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO",
"QMAKE_CXXFLAGS_SHLIB",
"QMAKE_CXXFLAGS_THREAD",
"QMAKE_CXXFLAGS_WARN_OFF",
"QMAKE_CXXFLAGS_WARN_ON",
"QMAKE_DISTCLEAN",
"QMAKE_EXTENSION_SHLIB",
"QMAKE_EXTRA_COMPILERS",
"QMAKE_EXTRA_TARGETS",
"QMAKE_EXT_CPP",
"QMAKE_EXT_H",
"QMAKE_EXT_LEX",
"QMAKE_EXT_MOC",
"QMAKE_EXT_OBJ",
"QMAKE_EXT_PRL",
"QMAKE_EXT_UI",
"QMAKE_EXT_YACC",
"QMAKE_FAILED_REQUIREMENTS",
"QMAKE_FRAMEWORK_BUNDLE_NAME",
"QMAKE_FRAMEWORK_VERSION",
"QMAKE_INCDIR",
"QMAKE_INCDIR_EGL",
"QMAKE_INCDIR_OPENGL",
"QMAKE_INCDIR_OPENGL_ES1",
"QMAKE_INCDIR_OPENGL_ES2",
"QMAKE_INCDIR_OPENVG",
"QMAKE_INCDIR_QT",
"QMAKE_INCDIR_THREAD",
"QMAKE_INCDIR_X11",
"QMAKE_INFO_PLIST",
"QMAKE_LFLAGS",
"QMAKE_LFLAGS_CONSOLE",
"QMAKE_LFLAGS_CONSOLE_DLL",
"QMAKE_LFLAGS_DEBUG",
"QMAKE_LFLAGS_PLUGIN",
"QMAKE_LFLAGS_QT_DLL",
"QMAKE_LFLAGS_RELEASE",
"QMAKE_LFLAGS_RPATH",
"QMAKE_LFLAGS_SHAPP",
"QMAKE_LFLAGS_SHLIB",
"QMAKE_LFLAGS_SONAME",
"QMAKE_LFLAGS_THREAD",
"QMAKE_LFLAGS_WINDOWS",
"QMAKE_LFLAGS_WINDOWS_DLL",
"QMAKE_LIBDIR",
"QMAKE_LIBDIR_EGL",
"QMAKE_LIBDIR_FLAGS",
"QMAKE_LIBDIR_OPENGL",
"QMAKE_LIBDIR_OPENVG",
"QMAKE_LIBDIR_QT",
"QMAKE_LIBDIR_X11",
"QMAKE_LIBS",
"QMAKE_LIBS_CONSOLE",
"QMAKE_LIBS_EGL",
"QMAKE_LIBS_OPENGL",
"QMAKE_LIBS_OPENGL_ES1",
"QMAKE_LIBS_OPENGL_ES2",
"QMAKE_LIBS_OPENGL_QT",
"QMAKE_LIBS_OPENVG",
"QMAKE_LIBS_QT",
"QMAKE_LIBS_QT_DLL",
"QMAKE_LIBS_QT_OPENGL",
"QMAKE_LIBS_QT_THREAD",
"QMAKE_LIBS_RT",
"QMAKE_LIBS_RTMT",
"QMAKE_LIBS_THREAD",
"QMAKE_LIBS_WINDOWS",
"QMAKE_LIBS_X11",
"QMAKE_LIBS_X11SM",
"QMAKE_LIB_FLAG",
"QMAKE_LINK",
"QMAKE_LINK_SHLIB_CMD",
"QMAKE_LN_SHLIB",
"QMAKE_MACOSX_DEPLOYMENT_TARGET",
"QMAKE_MAC_SDK",
"QMAKE_MAKEFILE",
"QMAKE_MOC_SRC",
"QMAKE_POST_LINK",
"QMAKE_PRE_LINK",
"QMAKE_PROJECT_NAME",
"QMAKE_QMAKE",
"QMAKE_QT_DLL",
"QMAKE_RESOURCE_FLAGS",
"QMAKE_RPATH",
"QMAKE_RPATHDIR",
"QMAKE_RUN_CC",
"QMAKE_RUN_CC_IMP",
"QMAKE_RUN_CXX",
"QMAKE_RUN_CXX_IMP",
"QMAKE_TARGET",
"QMAKE_UIC",
"QT",
"QTPLUGIN",
"QT_MAJOR_VERSION",
"QT_MINOR_VERSION",
"QT_PATCH_VERSION",
"QT_VERSION",
"RCC_DIR",
"RC_FILE",
"REQUIRES",
"RESOURCES",
"RES_FILE",
"RSS_RULES",
"SIGNATURE_FILE",
"SOURCES",
"SRCMOC",
"STATECHARTS",
"SUBDIRS",
"TARGET",
"TEMPLATE",
"TRANSLATIONS",
"UICIMPLS",
"UICOBJECTS",
"UI_DIR",
"UI_HEADERS_DIR",
"UI_SOURCES_DIR",
"VERSION",
"VERSION_PE_HEADER",
"VER_MAJ",
"VER_MIN",
"VER_PAT",
"VPATH",
"YACCIMPLS",
"YACCOBJECTS",
"YACCSOURCES",
"_PRO_FILE_",
"_PRO_FILE_PWD_"},
QStringList{ // functions
"CONFIG",
"absolute_path",
"basename",
"cache",
"cat",
"clean_path",
"clear",
"contains",
"count",
"debug",
"defined",
"dirname",
"enumerate_vars",
"equals",
"error",
"escape_expand",
"eval",
"exists",
"export",
"files",
"find",
"first",
"for",
"format_number",
"fromfile",
"getenv",
"greaterThan",
"if",
"include",
"infile",
"isActiveConfig",
"isEmpty",
"isEqual",
"join",
"last",
"lessThan",
"list",
"load",
"log",
"lower",
"member",
"message",
"mkpath",
"packagesExist",
"parseJson",
"prompt",
"quote",
"re_escape",
"relative_path",
"replace",
"requires",
"resolve_depends",
"reverse",
"section",
"shadowed",
"shell_path",
"shell_quote",
"size",
"sort_depends",
"split",
"sprintf",
"system",
"system_path",
"system_quote",
"title",
"touch",
"unique",
"unset",
"upper",
"val_escape",
"warning",
"write_file"});
return keywords;
} }

View File

@@ -25,29 +25,11 @@
#pragma once #pragma once
#include <texteditor/codeassist/completionassistprovider.h> namespace TextEditor { class Keywords; }
#include <QStringList>
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
class ProFileCompletionAssistProvider : public TextEditor::CompletionAssistProvider const TextEditor::Keywords &qmakeKeywords();
{
Q_OBJECT
public:
void init();
~ProFileCompletionAssistProvider();
TextEditor::IAssistProcessor *createProcessor() const override;
QStringList variables() const;
QStringList functions() const;
private:
QStringList m_variables;
QStringList m_functions;
};
} // namespace Internal } // namespace Internal
} // namespace QmakeProjectManager } // namespace QmakeProjectManager

View File

@@ -182,16 +182,14 @@ ProFileEditorFactory::ProFileEditorFactory()
setDocumentCreator(createProFileDocument); setDocumentCreator(createProFileDocument);
setEditorWidgetCreator([]() { return new ProFileEditorWidget; }); setEditorWidgetCreator([]() { return new ProFileEditorWidget; });
ProFileCompletionAssistProvider *pcap = new ProFileCompletionAssistProvider; setCompletionAssistProvider(new KeywordsCompletionAssistProvider(qmakeKeywords()));
setCompletionAssistProvider(pcap);
setCommentDefinition(Utils::CommentDefinition::HashStyle); setCommentDefinition(Utils::CommentDefinition::HashStyle);
setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection setEditorActionHandlers(TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::JumpToFileUnderCursor); | TextEditorActionHandler::JumpToFileUnderCursor);
Keywords keywords(pcap->variables(), pcap->functions(), QMap<QString, QStringList>()); addHoverHandler(new ProFileHoverHandler);
addHoverHandler(new ProFileHoverHandler(keywords)); setSyntaxHighlighterCreator([]() { return new ProFileHighlighter; });
setSyntaxHighlighterCreator([keywords]() { return new ProFileHighlighter(keywords); });
const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT); const QString defaultOverlay = QLatin1String(ProjectExplorer::Constants::FILEOVERLAY_QT);
Core::FileIconProvider::registerIconOverlayForSuffix( Core::FileIconProvider::registerIconOverlayForSuffix(

View File

@@ -52,8 +52,8 @@ static TextStyle styleForFormat(int format)
return C_TEXT; return C_TEXT;
} }
ProFileHighlighter::ProFileHighlighter(const Keywords &keywords) ProFileHighlighter::ProFileHighlighter()
: m_keywords(keywords) : m_keywords(qmakeKeywords())
{ {
setTextFormatCategories(NumProfileFormats, styleForFormat); setTextFormatCategories(NumProfileFormats, styleForFormat);
} }

View File

@@ -42,7 +42,7 @@ public:
NumProfileFormats NumProfileFormats
}; };
explicit ProFileHighlighter(const TextEditor::Keywords &keywords); ProFileHighlighter();
void highlightBlock(const QString &text); void highlightBlock(const QString &text);
private: private:

View File

@@ -39,8 +39,8 @@ using namespace Core;
namespace QmakeProjectManager { namespace QmakeProjectManager {
namespace Internal { namespace Internal {
ProFileHoverHandler::ProFileHoverHandler(const TextEditor::Keywords &keywords) ProFileHoverHandler::ProFileHoverHandler()
: m_keywords(keywords) : m_keywords(qmakeKeywords())
{ {
} }

View File

@@ -38,7 +38,7 @@ namespace Internal {
class ProFileHoverHandler : public TextEditor::BaseHoverHandler class ProFileHoverHandler : public TextEditor::BaseHoverHandler
{ {
public: public:
explicit ProFileHoverHandler(const TextEditor::Keywords &keywords); ProFileHoverHandler();
private: private:
void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) override; void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) override;

View File

@@ -140,9 +140,9 @@ void SelectionTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
} }
if ((topSelectedItemIsMovable(itemList) && !view()->hasSingleSelectedModelNode()) if ((topSelectedItemIsMovable(itemList) && !view()->hasSingleSelectedModelNode())
|| selectedItemCursorInMovableArea(event->scenePos()) || (selectedItemCursorInMovableArea(event->scenePos())
&& !event->modifiers().testFlag(Qt::ControlModifier) && !event->modifiers().testFlag(Qt::ControlModifier)
&& !event->modifiers().testFlag(Qt::ShiftModifier)) { && !event->modifiers().testFlag(Qt::ShiftModifier))) {
view()->changeToMoveTool(); view()->changeToMoveTool();
return; return;
} }

View File

@@ -23,8 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef DesignDocument_h #pragma once
#define DesignDocument_h
#include <model.h> #include <model.h>
#include <rewriterview.h> #include <rewriterview.h>
@@ -155,6 +154,3 @@ private: // variables
}; };
} // namespace QmlDesigner } // namespace QmlDesigner
#endif // DesignDocument_h

View File

@@ -23,8 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef StackedUtilityPanelController_h #pragma once
#define StackedUtilityPanelController_h
#include "utilitypanelcontroller.h" #include "utilitypanelcontroller.h"
@@ -55,5 +54,3 @@ private:
}; };
} // namespace QmlDesigner } // namespace QmlDesigner
#endif // StackedUtilityPanelController_h

View File

@@ -23,8 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef UtilityPanelController_h #pragma once
#define UtilityPanelController_h
#include <QObject> #include <QObject>
@@ -47,5 +46,3 @@ protected:
}; };
} // namespace QmlDesigner } // namespace QmlDesigner
#endif // UtilityPanelController_h

View File

@@ -23,8 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#ifndef QmlAnchorBindingProxy_h #pragma once
#define QmlAnchorBindingProxy_h
#include <QObject> #include <QObject>
#include <modelnode.h> #include <modelnode.h>
@@ -248,6 +247,3 @@ private:
} // namespace Internal } // namespace Internal
} // namespace QmlDesigner } // namespace QmlDesigner
#endif //QmlAnchorBindingProxy

View File

@@ -95,7 +95,7 @@ void MetaInfoReader::elementStart(const QString &name)
case ParsingHints: case ParsingHints:
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing"), currentSourceLocation()); addError(tr("Illegal state while parsing."), currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }
@@ -113,7 +113,7 @@ void MetaInfoReader::elementEnd()
case ParsingDocument: case ParsingDocument:
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing"), currentSourceLocation()); addError(tr("Illegal state while parsing."), currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }
@@ -126,12 +126,12 @@ void MetaInfoReader::propertyDefinition(const QString &name, const QVariant &val
case ParsingItemLibrary: readItemLibraryEntryProperty(name, value); break; case ParsingItemLibrary: readItemLibraryEntryProperty(name, value); break;
case ParsingProperty: readPropertyProperty(name, value); break; case ParsingProperty: readPropertyProperty(name, value); break;
case ParsingQmlSource: readQmlSourceProperty(name, value); break; case ParsingQmlSource: readQmlSourceProperty(name, value); break;
case ParsingMetaInfo: addError(tr("No property definition allowed"), currentSourceLocation()); break; case ParsingMetaInfo: addError(tr("No property definition allowed."), currentSourceLocation()); break;
case ParsingDocument: case ParsingDocument:
case ParsingHints: readHint(name, value); break; case ParsingHints: readHint(name, value); break;
case Finished: case Finished:
case Undefined: setParserState(Error); case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing"), currentSourceLocation()); addError(tr("Illegal state while parsing."), currentSourceLocation());
case Error: case Error:
default: return; default: return;
} }

View File

@@ -66,7 +66,7 @@ static IWidgetPlugin *instance(WidgetPluginData &p)
p.failed = true; p.failed = true;
p.errorMessage = QCoreApplication::translate("WidgetPluginManager", p.errorMessage = QCoreApplication::translate("WidgetPluginManager",
"Failed to create instance of file " "Failed to create instance of file "
"'%1': %2").arg(p.path).arg(p.errorMessage); "\"%1\": %2").arg(p.path).arg(p.errorMessage);
qWarning() << p.errorMessage; qWarning() << p.errorMessage;
return 0; return 0;
} }
@@ -74,7 +74,7 @@ static IWidgetPlugin *instance(WidgetPluginData &p)
if (!object) { if (!object) {
p.failed = true; p.failed = true;
p.errorMessage = QCoreApplication::translate("WidgetPluginManager", p.errorMessage = QCoreApplication::translate("WidgetPluginManager",
"Failed to create instance of file '%1'." "Failed to create instance of file \"%1\"."
).arg(p.path); ).arg(p.path);
qWarning() << p.errorMessage; qWarning() << p.errorMessage;
return 0; return 0;
@@ -83,7 +83,7 @@ static IWidgetPlugin *instance(WidgetPluginData &p)
if (!iplugin) { if (!iplugin) {
p.failed = true; p.failed = true;
p.errorMessage = QCoreApplication::translate("WidgetPluginManager", p.errorMessage = QCoreApplication::translate("WidgetPluginManager",
"File '%1' is not a QmlDesigner plugin." "File \"%1\" is not a Qt Quick Designer plugin."
).arg(p.path); ).arg(p.path);
qWarning() << p.errorMessage; qWarning() << p.errorMessage;
delete object; delete object;

View File

@@ -397,6 +397,7 @@ Project {
"componentcore/selectioncontext.h", "componentcore/selectioncontext.h",
"componentcore/qmldesignericonprovider.cpp", "componentcore/qmldesignericonprovider.cpp",
"componentcore/qmldesignericonprovider.h", "componentcore/qmldesignericonprovider.h",
"componentcore/componentcore.qrc",
"texteditor/texteditorstatusbar.cpp", "texteditor/texteditorstatusbar.cpp",
"texteditor/texteditorstatusbar.h", "texteditor/texteditorstatusbar.h",
"componentcore/changestyleaction.cpp", "componentcore/changestyleaction.cpp",

View File

@@ -146,7 +146,7 @@ FindInFilesSilverSearcher::FindInFilesSilverSearcher()
if (!isEnabled()) { if (!isEnabled()) {
auto layout = new QHBoxLayout(m_widget); auto layout = new QHBoxLayout(m_widget);
layout->setMargin(0); layout->setMargin(0);
QLabel *label = new QLabel(tr("SilverSearcher is not available on system")); QLabel *label = new QLabel(tr("Silver Searcher is not available on the system."));
label->setStyleSheet("QLabel { color : red; }"); label->setStyleSheet("QLabel { color : red; }");
layout->addWidget(label); layout->addWidget(label);
} }

View File

@@ -589,7 +589,7 @@ CountingLabel::CountingLabel()
void CountingLabel::updateCount(int count) void CountingLabel::updateCount(int count)
{ {
setText(BaseFileFind::tr("%n found", nullptr, count)); setText(BaseFileFind::tr("%n found.", nullptr, count));
} }
} // namespace Internal } // namespace Internal

View File

@@ -31,6 +31,7 @@
#include <texteditor/codeassist/genericproposalmodel.h> #include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/completionsettings.h> #include <texteditor/completionsettings.h>
#include <texteditor/texteditorsettings.h> #include <texteditor/texteditorsettings.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
@@ -243,4 +244,22 @@ KeywordsCompletionAssistProcessor::generateProposalList(const QStringList &words
}); });
} }
KeywordsCompletionAssistProvider::KeywordsCompletionAssistProvider(const Keywords &keyWords,
const QString &snippetGroup)
: m_keyWords(keyWords)
, m_snippetGroup(snippetGroup)
{ }
IAssistProvider::RunType KeywordsCompletionAssistProvider::runType() const
{
return Synchronous;
}
IAssistProcessor *KeywordsCompletionAssistProvider::createProcessor() const
{
auto processor = new KeywordsCompletionAssistProcessor(m_keyWords);
processor->setSnippetGroup(m_snippetGroup);
return processor;
}
} // namespace TextEditor } // namespace TextEditor

View File

@@ -28,8 +28,11 @@
#include "iassistprocessor.h" #include "iassistprocessor.h"
#include "assistproposalitem.h" #include "assistproposalitem.h"
#include "ifunctionhintproposalmodel.h" #include "ifunctionhintproposalmodel.h"
#include "completionassistprovider.h"
#include "../snippets/snippetassistcollector.h" #include "../snippets/snippetassistcollector.h"
#include "texteditor/texteditorconstants.h"
namespace TextEditor { namespace TextEditor {
class AssistInterface; class AssistInterface;
@@ -38,8 +41,8 @@ class TEXTEDITOR_EXPORT Keywords
{ {
public: public:
Keywords() = default; Keywords() = default;
Keywords(const QStringList &variables, const QStringList &functions, Keywords(const QStringList &variables, const QStringList &functions = QStringList(),
const QMap<QString, QStringList> &functionArgs); const QMap<QString, QStringList> &functionArgs = QMap<QString, QStringList>());
bool isVariable(const QString &word) const; bool isVariable(const QString &word) const;
bool isFunction(const QString &word) const; bool isFunction(const QString &word) const;
@@ -79,6 +82,21 @@ private:
QStringList m_functionSymbols; QStringList m_functionSymbols;
}; };
class TEXTEDITOR_EXPORT KeywordsCompletionAssistProvider : public CompletionAssistProvider
{
public:
KeywordsCompletionAssistProvider(const Keywords &keyWords = Keywords(),
const QString &snippetGroup = QString(Constants::TEXT_SNIPPET_GROUP_ID));
// IAssistProvider interface
RunType runType() const override;
IAssistProcessor *createProcessor() const override;
private:
Keywords m_keyWords;
QString m_snippetGroup;
};
class TEXTEDITOR_EXPORT KeywordsCompletionAssistProcessor : public IAssistProcessor class TEXTEDITOR_EXPORT KeywordsCompletionAssistProcessor : public IAssistProcessor
{ {
public: public:

View File

@@ -25,6 +25,12 @@
#include "displaysettings.h" #include "displaysettings.h"
#include "texteditorconstants.h"
#include <coreplugin/icore.h>
#include <utils/tooltip/tooltip.h>
#include <QLabel>
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
@@ -131,7 +137,17 @@ bool DisplaySettings::equals(const DisplaySettings &ds) const
&& m_displayAnnotations == ds.m_displayAnnotations && m_displayAnnotations == ds.m_displayAnnotations
&& m_annotationAlignment == ds.m_annotationAlignment && m_annotationAlignment == ds.m_annotationAlignment
&& m_minimalAnnotationContent == ds.m_minimalAnnotationContent && m_minimalAnnotationContent == ds.m_minimalAnnotationContent
; ;
}
QLabel *DisplaySettings::createAnnotationSettingsLink()
{
auto *label = new QLabel("<i><a href>Annotation Settings</a></i>", Core::ICore::mainWindow());
QObject::connect(label, &QLabel::linkActivated, []() {
Utils::ToolTip::hideImmediately();
Core::ICore::showOptionsDialog(Constants::TEXT_EDITOR_DISPLAY_SETTINGS);
});
return label;
} }
} // namespace TextEditor } // namespace TextEditor

View File

@@ -31,6 +31,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QSettings; class QSettings;
class QLabel;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace TextEditor { namespace TextEditor {
@@ -72,6 +73,8 @@ public:
int m_minimalAnnotationContent = 15; int m_minimalAnnotationContent = 15;
bool equals(const DisplaySettings &ds) const; bool equals(const DisplaySettings &ds) const;
static QLabel *createAnnotationSettingsLink();
}; };
inline bool operator==(const DisplaySettings &t1, const DisplaySettings &t2) { return t1.equals(t2); } inline bool operator==(const DisplaySettings &t1, const DisplaySettings &t2) { return t1.equals(t2); }

View File

@@ -46,6 +46,7 @@
#include "tabsettings.h" #include "tabsettings.h"
#include "textdocument.h" #include "textdocument.h"
#include "textdocumentlayout.h" #include "textdocumentlayout.h"
#include "texteditorconstants.h"
#include "texteditoroverlay.h" #include "texteditoroverlay.h"
#include "refactoroverlay.h" #include "refactoroverlay.h"
#include "texteditorsettings.h" #include "texteditorsettings.h"
@@ -56,6 +57,7 @@
#include <texteditor/codeassist/assistinterface.h> #include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/codeassistant.h> #include <texteditor/codeassist/codeassistant.h>
#include <texteditor/codeassist/completionassistprovider.h> #include <texteditor/codeassist/completionassistprovider.h>
#include <texteditor/codeassist/keywordscompletionassist.h>
#include <texteditor/generichighlighter/context.h> #include <texteditor/generichighlighter/context.h>
#include <texteditor/generichighlighter/highlightdefinition.h> #include <texteditor/generichighlighter/highlightdefinition.h>
#include <texteditor/generichighlighter/highlighter.h> #include <texteditor/generichighlighter/highlighter.h>
@@ -3291,30 +3293,32 @@ bool TextEditorWidgetPrivate::processAnnotaionTooltipRequest(const QTextBlock &b
return false; return false;
for (const AnnotationRect &annotationRect : m_annotationRects[block.blockNumber()]) { for (const AnnotationRect &annotationRect : m_annotationRects[block.blockNumber()]) {
if (annotationRect.rect.contains(pos)) { if (!annotationRect.rect.contains(pos))
auto layout = new QGridLayout; continue;
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(2);
annotationRect.mark->addToToolTipLayout(layout);
TextMarks marks = blockUserData->marks();
if (marks.size() > 1) {
QFrame* separator = new QFrame();
separator->setFrameShape(QFrame::HLine);
layout->addWidget(separator, 2, 0, 1, layout->columnCount());
layout->addWidget(new QLabel(tr("Other annotations:")), 3, 0, 1,
layout->columnCount());
Utils::sort(marks, [](const TextMark* mark1, const TextMark* mark2){ auto layout = new QGridLayout;
return mark1->priority() > mark2->priority(); layout->setContentsMargins(0, 0, 0, 0);
}); layout->setSpacing(2);
for (const TextMark *mark : Utils::asConst(marks)) { annotationRect.mark->addToToolTipLayout(layout);
if (mark != annotationRect.mark) TextMarks marks = blockUserData->marks();
mark->addToToolTipLayout(layout); if (marks.size() > 1) {
} QFrame* separator = new QFrame();
separator->setFrameShape(QFrame::HLine);
layout->addWidget(separator, layout->rowCount(), 0, 1, -1);
layout->addWidget(new QLabel(tr("Other annotations:")), layout->rowCount(), 0, 1, -1);
Utils::sort(marks, [](const TextMark* mark1, const TextMark* mark2){
return mark1->priority() > mark2->priority();
});
for (const TextMark *mark : Utils::asConst(marks)) {
if (mark != annotationRect.mark)
mark->addToToolTipLayout(layout);
} }
ToolTip::show(q->mapToGlobal(pos), layout, q);
return true;
} }
layout->addWidget(DisplaySettings::createAnnotationSettingsLink(),
layout->rowCount(), 0, 1, -1, Qt::AlignRight);
ToolTip::show(q->mapToGlobal(pos), layout, q);
return true;
} }
return false; return false;
} }
@@ -8136,13 +8140,7 @@ public:
TextEditorFactoryPrivate(TextEditorFactory *parent) : TextEditorFactoryPrivate(TextEditorFactory *parent) :
q(parent), q(parent),
m_widgetCreator([]() { return new TextEditorWidget; }), m_widgetCreator([]() { return new TextEditorWidget; }),
m_editorCreator([]() { return new BaseTextEditor; }), m_editorCreator([]() { return new BaseTextEditor; })
m_completionAssistProvider(0),
m_useGenericHighlighter(false),
m_duplicatedSupported(true),
m_codeFoldingSupported(false),
m_paranthesesMatchinEnabled(false),
m_marksVisible(false)
{} {}
BaseTextEditor *duplicateTextEditor(BaseTextEditor *other) BaseTextEditor *duplicateTextEditor(BaseTextEditor *other)
@@ -8163,12 +8161,12 @@ public:
TextEditorFactory::SyntaxHighLighterCreator m_syntaxHighlighterCreator; TextEditorFactory::SyntaxHighLighterCreator m_syntaxHighlighterCreator;
CommentDefinition m_commentDefinition; CommentDefinition m_commentDefinition;
QList<BaseHoverHandler *> m_hoverHandlers; // owned QList<BaseHoverHandler *> m_hoverHandlers; // owned
CompletionAssistProvider * m_completionAssistProvider; // owned CompletionAssistProvider * m_completionAssistProvider = nullptr; // owned
bool m_useGenericHighlighter; bool m_useGenericHighlighter = false;
bool m_duplicatedSupported; bool m_duplicatedSupported = true;
bool m_codeFoldingSupported; bool m_codeFoldingSupported = false;
bool m_paranthesesMatchinEnabled; bool m_paranthesesMatchinEnabled = false;
bool m_marksVisible; bool m_marksVisible = false;
}; };
} /// namespace Internal } /// namespace Internal
@@ -8266,6 +8264,7 @@ void TextEditorFactory::setParenthesesMatchingEnabled(bool on)
IEditor *TextEditorFactory::createEditor() IEditor *TextEditorFactory::createEditor()
{ {
static KeywordsCompletionAssistProvider basicSnippetProvider;
TextDocumentPtr doc(d->m_documentCreator()); TextDocumentPtr doc(d->m_documentCreator());
if (d->m_indenterCreator) if (d->m_indenterCreator)
@@ -8274,7 +8273,8 @@ IEditor *TextEditorFactory::createEditor()
if (d->m_syntaxHighlighterCreator) if (d->m_syntaxHighlighterCreator)
doc->setSyntaxHighlighter(d->m_syntaxHighlighterCreator()); doc->setSyntaxHighlighter(d->m_syntaxHighlighterCreator());
doc->setCompletionAssistProvider(d->m_completionAssistProvider); doc->setCompletionAssistProvider(d->m_completionAssistProvider ? d->m_completionAssistProvider
: &basicSnippetProvider);
return d->createEditorHelper(doc); return d->createEditorHelper(doc);
} }

View File

@@ -1,68 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"> <!DOCTYPE language SYSTEM "language.dtd">
<!-- <language version="5" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhaumann@kde.org)" license="MIT" hidden="true">
This file is part of KDE's kate project.
copyright : (C) 2004 by Dominik Haumann
email : dhdev at gmx dot de
**********************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; if not, write to the *
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
**********************************************************************
This file is included in every file that highlights the "alerts" keywords.
That's why extensions and mimetype are empty.
Changes by Alex Turbov:
Introduce 3 alert levels and sort keywords according importance.
Few more keywords has been added.
-->
<language version="3" kateversion="3.1" name="Alerts" section="Other" extensions="" mimetype="" author="Dominik Haumann (dhdev@gmx.de)" license="LGPLv2+" hidden="true">
<highlighting> <highlighting>
<list name="alerts_hi"> <list name="alerts_hi">
<item> ALERT </item> <item>ALERT</item>
<item> ATTENTION </item> <item>ATTENTION</item>
<item> DANGER </item> <item>DANGER</item>
<item> HACK </item> <item>HACK</item>
<item> SECURITY </item> <item>SECURITY</item>
</list> </list>
<list name="alerts_mid"> <list name="alerts_mid">
<item> BUG </item> <item>BUG</item>
<item> FIXME </item> <item>FIXME</item>
<item> DEPRECATED </item> <item>DEPRECATED</item>
<item> TASK </item> <item>TASK</item>
<item> TODO </item> <item>TODO</item>
<item> TBD </item> <item>TBD</item>
<item> WARNING </item> <item>WARNING</item>
<item> CAUTION </item> <item>CAUTION</item>
<item> NOLINT </item> <item>NOLINT</item>
</list> </list>
<list name="alerts_lo"> <list name="alerts_lo">
<item> ### </item> <item>###</item>
<item> NOTE </item> <item>NOTE</item>
<item> NOTICE </item> <item>NOTICE</item>
<item> TEST </item> <item>TEST</item>
<item> TESTING </item> <item>TESTING</item>
</list> </list>
<contexts> <contexts>
<context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" > <context attribute="Normal Text" lineEndContext="#pop" name="Normal Text" >
<StringDetect attribute="Region Marker" context="#stay" String="{{{" beginRegion="AlertRegion1" /> <StringDetect attribute="Region Marker" context="#stay" String="{{{" beginRegion="AlertRegion1" />
<StringDetect attribute="Region Marker" context="#stay" String="}}}" endRegion="AlertRegion1" /> <StringDetect attribute="Region Marker" context="#stay" String="}}}" endRegion="AlertRegion1" />
<StringDetect attribute="Region Marker" context="#stay" String="BEGIN" beginRegion="AlertRegion2" /> <WordDetect attribute="Region Marker" context="#stay" String="BEGIN" beginRegion="AlertRegion2" />
<StringDetect attribute="Region Marker" context="#stay" String="END" endRegion="AlertRegion2" /> <WordDetect attribute="Region Marker" context="#stay" String="END" endRegion="AlertRegion2" />
<keyword attribute="Alert Level 1" context="#stay" String="alerts_hi" /> <keyword attribute="Alert Level 1" context="#stay" String="alerts_hi" />
<keyword attribute="Alert Level 2" context="#stay" String="alerts_mid" /> <keyword attribute="Alert Level 2" context="#stay" String="alerts_mid" />
<keyword attribute="Alert Level 3" context="#stay" String="alerts_lo" /> <keyword attribute="Alert Level 3" context="#stay" String="alerts_lo" />

View File

@@ -8,7 +8,7 @@
<!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following --> <!ENTITY noword "(?![\w$+-])"> <!-- no word, $, + or - following -->
<!ENTITY pathpart "([\w_@.&#37;*?+-]|\\ )"> <!-- valid character in a file name --> <!ENTITY pathpart "([\w_@.&#37;*?+-]|\\ )"> <!-- valid character in a file name -->
]> ]>
<language name="Bash" version="3" kateversion="5.0" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL"> <language name="Bash" version="4" kateversion="5.0" section="Scripts" extensions="*.sh;*.bash;*.ebuild;*.eclass;*.nix;.bashrc;.bash_profile;.bash_login;.profile" mimetype="application/x-shellscript" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl) <!-- (c) 2004 by Wilbert Berendsen (wilbert@kde.nl)
Changes by Matthew Woehlke (mw_triad@users.sourceforge.net) Changes by Matthew Woehlke (mw_triad@users.sourceforge.net)
@@ -18,440 +18,440 @@
<highlighting> <highlighting>
<list name="keywords"> <list name="keywords">
<item> else </item> <item>else</item>
<item> for </item> <item>for</item>
<item> function </item> <item>function</item>
<item> in </item> <item>in</item>
<item> select </item> <item>select</item>
<item> until </item> <item>until</item>
<item> while </item> <item>while</item>
<item> elif </item> <item>elif</item>
<item> then </item> <item>then</item>
<item> set </item> <item>set</item>
</list> </list>
<list name="builtins"> <list name="builtins">
<item> : </item> <item>:</item>
<item> source </item> <item>source</item>
<item> alias </item> <item>alias</item>
<item> bg </item> <item>bg</item>
<item> bind </item> <item>bind</item>
<item> break </item> <item>break</item>
<item> builtin </item> <item>builtin</item>
<item> cd </item> <item>cd</item>
<item> caller </item> <item>caller</item>
<item> command </item> <item>command</item>
<item> compgen </item> <item>compgen</item>
<item> complete </item> <item>complete</item>
<item> continue </item> <item>continue</item>
<item> dirs </item> <item>dirs</item>
<item> disown </item> <item>disown</item>
<item> echo </item> <item>echo</item>
<item> enable </item> <item>enable</item>
<item> eval </item> <item>eval</item>
<item> exec </item> <item>exec</item>
<item> exit </item> <item>exit</item>
<item> fc </item> <item>fc</item>
<item> fg </item> <item>fg</item>
<item> getopts </item> <item>getopts</item>
<item> hash </item> <item>hash</item>
<item> help </item> <item>help</item>
<item> history </item> <item>history</item>
<item> jobs </item> <item>jobs</item>
<item> kill </item> <item>kill</item>
<item> let </item> <item>let</item>
<item> logout </item> <item>logout</item>
<item> popd </item> <item>popd</item>
<item> printf </item> <item>printf</item>
<item> pushd </item> <item>pushd</item>
<item> pwd </item> <item>pwd</item>
<item> return </item> <item>return</item>
<item> set </item> <item>set</item>
<item> shift </item> <item>shift</item>
<item> shopt </item> <item>shopt</item>
<item> suspend </item> <item>suspend</item>
<item> test </item> <item>test</item>
<item> time </item> <item>time</item>
<item> times </item> <item>times</item>
<item> trap </item> <item>trap</item>
<item> type </item> <item>type</item>
<item> ulimit </item> <item>ulimit</item>
<item> umask </item> <item>umask</item>
<item> unalias </item> <item>unalias</item>
<item> wait </item> <item>wait</item>
</list> </list>
<list name="builtins_var"> <list name="builtins_var">
<item> export </item> <item>export</item>
<item> unset </item> <item>unset</item>
<item> declare </item> <item>declare</item>
<item> typeset </item> <item>typeset</item>
<item> local </item> <item>local</item>
<item> read </item> <item>read</item>
<item> readonly </item> <item>readonly</item>
</list> </list>
<list name="unixcommands"> <list name="unixcommands">
<!-- /bin --> <!-- /bin -->
<item> arch </item> <item>arch</item>
<item> awk </item> <item>awk</item>
<item> bash </item> <item>bash</item>
<item> bunzip2 </item> <item>bunzip2</item>
<item> bzcat </item> <item>bzcat</item>
<item> bzcmp </item> <item>bzcmp</item>
<item> bzdiff </item> <item>bzdiff</item>
<item> bzegrep </item> <item>bzegrep</item>
<item> bzfgrep </item> <item>bzfgrep</item>
<item> bzgrep </item> <item>bzgrep</item>
<item> bzip2 </item> <item>bzip2</item>
<item> bzip2recover </item> <item>bzip2recover</item>
<item> bzless </item> <item>bzless</item>
<item> bzmore </item> <item>bzmore</item>
<item> cat </item> <item>cat</item>
<item> chattr </item> <item>chattr</item>
<item> chgrp </item> <item>chgrp</item>
<item> chmod </item> <item>chmod</item>
<item> chown </item> <item>chown</item>
<item> chvt </item> <item>chvt</item>
<item> cp </item> <item>cp</item>
<item> date </item> <item>date</item>
<item> dd </item> <item>dd</item>
<item> deallocvt </item> <item>deallocvt</item>
<item> df </item> <item>df</item>
<item> dir </item> <item>dir</item>
<item> dircolors </item> <item>dircolors</item>
<item> dmesg </item> <item>dmesg</item>
<item> dnsdomainname </item> <item>dnsdomainname</item>
<item> domainname </item> <item>domainname</item>
<item> du </item> <item>du</item>
<item> dumpkeys </item> <item>dumpkeys</item>
<item> echo </item> <item>echo</item>
<item> ed </item> <item>ed</item>
<item> egrep </item> <item>egrep</item>
<item> false </item> <item>false</item>
<item> fgconsole </item> <item>fgconsole</item>
<item> fgrep </item> <item>fgrep</item>
<item> fuser </item> <item>fuser</item>
<item> gawk </item> <item>gawk</item>
<item> getkeycodes </item> <item>getkeycodes</item>
<item> gocr </item> <item>gocr</item>
<item> grep </item> <item>grep</item>
<item> groff </item> <item>groff</item>
<item> groups </item> <item>groups</item>
<item> gunzip </item> <item>gunzip</item>
<item> gzexe </item> <item>gzexe</item>
<item> gzip </item> <item>gzip</item>
<item> hostname </item> <item>hostname</item>
<item> igawk </item> <item>igawk</item>
<item> install </item> <item>install</item>
<item> kbd_mode </item> <item>kbd_mode</item>
<item> kbdrate </item> <item>kbdrate</item>
<item> killall </item> <item>killall</item>
<item> last </item> <item>last</item>
<item> lastb </item> <item>lastb</item>
<item> link </item> <item>link</item>
<item> ln </item> <item>ln</item>
<item> loadkeys </item> <item>loadkeys</item>
<item> loadunimap </item> <item>loadunimap</item>
<item> login </item> <item>login</item>
<item> ls </item> <item>ls</item>
<item> lsattr </item> <item>lsattr</item>
<item> lsmod </item> <item>lsmod</item>
<item> lsmod.old </item> <item>lsmod.old</item>
<item> lzcat </item> <item>lzcat</item>
<item> lzcmp </item> <item>lzcmp</item>
<item> lzdiff </item> <item>lzdiff</item>
<item> lzegrep </item> <item>lzegrep</item>
<item> lzfgrep </item> <item>lzfgrep</item>
<item> lzgrep </item> <item>lzgrep</item>
<item> lzless </item> <item>lzless</item>
<item> lzcat </item> <item>lzcat</item>
<item> lzma </item> <item>lzma</item>
<item> lzmainfo </item> <item>lzmainfo</item>
<item> lzmore </item> <item>lzmore</item>
<item> mapscrn </item> <item>mapscrn</item>
<item> mesg </item> <item>mesg</item>
<item> mkdir </item> <item>mkdir</item>
<item> mkfifo </item> <item>mkfifo</item>
<item> mknod </item> <item>mknod</item>
<item> mktemp </item> <item>mktemp</item>
<item> more </item> <item>more</item>
<item> mount </item> <item>mount</item>
<item> mv </item> <item>mv</item>
<item> nano </item> <item>nano</item>
<item> netstat </item> <item>netstat</item>
<item> nisdomainname </item> <item>nisdomainname</item>
<item> nroff </item> <item>nroff</item>
<item> openvt </item> <item>openvt</item>
<item> pgawk </item> <item>pgawk</item>
<item> pidof </item> <item>pidof</item>
<item> ping </item> <item>ping</item>
<item> ps </item> <item>ps</item>
<item> pstree </item> <item>pstree</item>
<item> pwd </item> <item>pwd</item>
<item> rbash </item> <item>rbash</item>
<item> readlink </item> <item>readlink</item>
<item> red </item> <item>red</item>
<item> resizecons </item> <item>resizecons</item>
<item> rm </item> <item>rm</item>
<item> rmdir </item> <item>rmdir</item>
<item> run-parts </item> <item>run-parts</item>
<item> sash </item> <item>sash</item>
<item> sed </item> <item>sed</item>
<item> setfont </item> <item>setfont</item>
<item> setkeycodes </item> <item>setkeycodes</item>
<item> setleds </item> <item>setleds</item>
<item> setmetamode </item> <item>setmetamode</item>
<item> setserial </item> <item>setserial</item>
<item> sh </item> <item>sh</item>
<item> showkey </item> <item>showkey</item>
<item> shred </item> <item>shred</item>
<item> sleep </item> <item>sleep</item>
<item> ssed </item> <item>ssed</item>
<item> stat </item> <item>stat</item>
<item> stty </item> <item>stty</item>
<item> su </item> <item>su</item>
<item> sync </item> <item>sync</item>
<item> tar </item> <item>tar</item>
<item> tempfile </item> <item>tempfile</item>
<item> touch </item> <item>touch</item>
<item> troff </item> <item>troff</item>
<item> true </item> <item>true</item>
<item> umount </item> <item>umount</item>
<item> uname </item> <item>uname</item>
<item> unicode_start </item> <item>unicode_start</item>
<item> unicode_stop </item> <item>unicode_stop</item>
<item> unlink </item> <item>unlink</item>
<item> unlzma </item> <item>unlzma</item>
<item> unxz </item> <item>unxz</item>
<item> utmpdump </item> <item>utmpdump</item>
<item> uuidgen </item> <item>uuidgen</item>
<item> vdir </item> <item>vdir</item>
<item> wall </item> <item>wall</item>
<item> wc </item> <item>wc</item>
<item> xz </item> <item>xz</item>
<item> xzcat </item> <item>xzcat</item>
<item> ypdomainname </item> <item>ypdomainname</item>
<item> zcat </item> <item>zcat</item>
<item> zcmp </item> <item>zcmp</item>
<item> zdiff </item> <item>zdiff</item>
<item> zegrep </item> <item>zegrep</item>
<item> zfgrep </item> <item>zfgrep</item>
<item> zforce </item> <item>zforce</item>
<item> zgrep </item> <item>zgrep</item>
<item> zless </item> <item>zless</item>
<item> zmore </item> <item>zmore</item>
<item> znew </item> <item>znew</item>
<item> zsh </item> <item>zsh</item>
<!-- some from /usr/bin --> <!-- some from /usr/bin -->
<item> aclocal </item> <item>aclocal</item>
<item> aconnect </item> <item>aconnect</item>
<item> aplay </item> <item>aplay</item>
<item> apm </item> <item>apm</item>
<item> apmsleep </item> <item>apmsleep</item>
<item> apropos </item> <item>apropos</item>
<item> ar </item> <item>ar</item>
<item> arecord </item> <item>arecord</item>
<item> as </item> <item>as</item>
<item> as86 </item> <item>as86</item>
<item> autoconf </item> <item>autoconf</item>
<item> autoheader </item> <item>autoheader</item>
<item> automake </item> <item>automake</item>
<item> awk </item> <item>awk</item>
<item> basename </item> <item>basename</item>
<item> bc </item> <item>bc</item>
<item> bison </item> <item>bison</item>
<item> c++ </item> <item>c++</item>
<item> cal </item> <item>cal</item>
<item> cat </item> <item>cat</item>
<item> cc </item> <item>cc</item>
<item> cdda2wav </item> <item>cdda2wav</item>
<item> cdparanoia </item> <item>cdparanoia</item>
<item> cdrdao </item> <item>cdrdao</item>
<item> cd-read </item> <item>cd-read</item>
<item> cdrecord </item> <item>cdrecord</item>
<item> chfn </item> <item>chfn</item>
<item> chgrp </item> <item>chgrp</item>
<item> chmod </item> <item>chmod</item>
<item> chown </item> <item>chown</item>
<item> chroot </item> <item>chroot</item>
<item> chsh </item> <item>chsh</item>
<item> clear </item> <item>clear</item>
<item> cmp </item> <item>cmp</item>
<item> co </item> <item>co</item>
<item> col </item> <item>col</item>
<item> comm </item> <item>comm</item>
<item> cp </item> <item>cp</item>
<item> cpio </item> <item>cpio</item>
<item> cpp </item> <item>cpp</item>
<item> cut </item> <item>cut</item>
<item> dc </item> <item>dc</item>
<item> dd </item> <item>dd</item>
<item> df </item> <item>df</item>
<item> diff </item> <item>diff</item>
<item> diff3 </item> <item>diff3</item>
<item> dir </item> <item>dir</item>
<item> dircolors </item> <item>dircolors</item>
<item> directomatic </item> <item>directomatic</item>
<item> dirname </item> <item>dirname</item>
<item> du </item> <item>du</item>
<item> env </item> <item>env</item>
<item> expr </item> <item>expr</item>
<item> fbset </item> <item>fbset</item>
<item> file </item> <item>file</item>
<item> find </item> <item>find</item>
<item> flex </item> <item>flex</item>
<item> flex++ </item> <item>flex++</item>
<item> fmt </item> <item>fmt</item>
<item> free </item> <item>free</item>
<item> ftp </item> <item>ftp</item>
<item> funzip </item> <item>funzip</item>
<item> fuser </item> <item>fuser</item>
<item> g++ </item> <item>g++</item>
<item> gawk </item> <item>gawk</item>
<item> gc </item> <item>gc</item>
<item> gcc </item> <item>gcc</item>
<item> clang </item> <item>clang</item>
<item> valgrind </item> <item>valgrind</item>
<item> xdg-open </item> <item>xdg-open</item>
<item> cmake </item> <item>cmake</item>
<item> qmake </item> <item>qmake</item>
<item> svn </item> <item>svn</item>
<item> git </item> <item>git</item>
<item> rsync </item> <item>rsync</item>
<item> gdb </item> <item>gdb</item>
<item> getent </item> <item>getent</item>
<item> getopt </item> <item>getopt</item>
<item> gettext </item> <item>gettext</item>
<item> gettextize </item> <item>gettextize</item>
<item> gimp </item> <item>gimp</item>
<item> gimp-remote </item> <item>gimp-remote</item>
<item> gimptool </item> <item>gimptool</item>
<item> gmake </item> <item>gmake</item>
<item> gs </item> <item>gs</item>
<item> head </item> <item>head</item>
<item> hexdump </item> <item>hexdump</item>
<item> id </item> <item>id</item>
<item> install </item> <item>install</item>
<item> join </item> <item>join</item>
<item> kill </item> <item>kill</item>
<item> killall </item> <item>killall</item>
<item> ld </item> <item>ld</item>
<item> ld86 </item> <item>ld86</item>
<item> ldd </item> <item>ldd</item>
<item> less </item> <item>less</item>
<item> lex </item> <item>lex</item>
<item> ln </item> <item>ln</item>
<item> locate </item> <item>locate</item>
<item> lockfile </item> <item>lockfile</item>
<item> logname </item> <item>logname</item>
<item> lp </item> <item>lp</item>
<item> lpr </item> <item>lpr</item>
<item> ls </item> <item>ls</item>
<item> lynx </item> <item>lynx</item>
<item> m4 </item> <item>m4</item>
<item> make </item> <item>make</item>
<item> man </item> <item>man</item>
<item> mkdir </item> <item>mkdir</item>
<item> mknod </item> <item>mknod</item>
<item> msgfmt </item> <item>msgfmt</item>
<item> mv </item> <item>mv</item>
<item> namei </item> <item>namei</item>
<item> nasm </item> <item>nasm</item>
<item> nawk </item> <item>nawk</item>
<item> nice </item> <item>nice</item>
<item> nl </item> <item>nl</item>
<item> nm </item> <item>nm</item>
<item> nm86 </item> <item>nm86</item>
<item> nmap </item> <item>nmap</item>
<item> nohup </item> <item>nohup</item>
<item> nop </item> <item>nop</item>
<item> od </item> <item>od</item>
<item> passwd </item> <item>passwd</item>
<item> patch </item> <item>patch</item>
<item> pcregrep </item> <item>pcregrep</item>
<item> pcretest </item> <item>pcretest</item>
<item> perl </item> <item>perl</item>
<item> perror </item> <item>perror</item>
<item> pidof </item> <item>pidof</item>
<item> pr </item> <item>pr</item>
<item> printf </item> <item>printf</item>
<item> procmail </item> <item>procmail</item>
<item> prune </item> <item>prune</item>
<item> ps2ascii </item> <item>ps2ascii</item>
<item> ps2epsi </item> <item>ps2epsi</item>
<item> ps2frag </item> <item>ps2frag</item>
<item> ps2pdf </item> <item>ps2pdf</item>
<item> ps2ps </item> <item>ps2ps</item>
<item> psbook </item> <item>psbook</item>
<item> psmerge </item> <item>psmerge</item>
<item> psnup </item> <item>psnup</item>
<item> psresize </item> <item>psresize</item>
<item> psselect </item> <item>psselect</item>
<item> pstops </item> <item>pstops</item>
<item> rcs </item> <item>rcs</item>
<item> rev </item> <item>rev</item>
<item> rm </item> <item>rm</item>
<item> scp </item> <item>scp</item>
<item> sed </item> <item>sed</item>
<item> seq </item> <item>seq</item>
<item> setterm </item> <item>setterm</item>
<item> shred </item> <item>shred</item>
<item> size </item> <item>size</item>
<item> size86 </item> <item>size86</item>
<item> skill </item> <item>skill</item>
<item> slogin </item> <item>slogin</item>
<item> snice </item> <item>snice</item>
<item> sort </item> <item>sort</item>
<item> sox </item> <item>sox</item>
<item> split </item> <item>split</item>
<item> ssh </item> <item>ssh</item>
<item> ssh-add </item> <item>ssh-add</item>
<item> ssh-agent </item> <item>ssh-agent</item>
<item> ssh-keygen </item> <item>ssh-keygen</item>
<item> ssh-keyscan </item> <item>ssh-keyscan</item>
<item> stat </item> <item>stat</item>
<item> strings </item> <item>strings</item>
<item> strip </item> <item>strip</item>
<item> sudo </item> <item>sudo</item>
<item> suidperl </item> <item>suidperl</item>
<item> sum </item> <item>sum</item>
<item> tac </item> <item>tac</item>
<item> tail </item> <item>tail</item>
<item> tee </item> <item>tee</item>
<item> test </item> <item>test</item>
<item> tr </item> <item>tr</item>
<item> uniq </item> <item>uniq</item>
<item> unlink </item> <item>unlink</item>
<item> unzip </item> <item>unzip</item>
<item> updatedb </item> <item>updatedb</item>
<item> updmap </item> <item>updmap</item>
<item> uptime </item> <item>uptime</item>
<item> users </item> <item>users</item>
<item> vmstat </item> <item>vmstat</item>
<item> w </item> <item>w</item>
<item> wc </item> <item>wc</item>
<item> wget </item> <item>wget</item>
<item> whatis </item> <item>whatis</item>
<item> whereis </item> <item>whereis</item>
<item> which </item> <item>which</item>
<item> who </item> <item>who</item>
<item> whoami </item> <item>whoami</item>
<item> write </item> <item>write</item>
<item> xargs </item> <item>xargs</item>
<item> yacc </item> <item>yacc</item>
<item> yes </item> <item>yes</item>
<item> zip </item> <item>zip</item>
<item> zsoelim </item> <item>zsoelim</item>
<!-- others --> <!-- others -->
<item> dcop </item> <item>dcop</item>
<item> kdialog </item> <item>kdialog</item>
<item> kfile </item> <item>kfile</item>
<item> xhost </item> <item>xhost</item>
<item> xmodmap </item> <item>xmodmap</item>
<item> xset </item> <item>xset</item>
</list> </list>
@@ -587,7 +587,8 @@
<RegExpr attribute="Redirection" context="#stay" String="([0-9]*(&gt;{1,2}|&lt;)(&amp;[0-9]+-?)?|&amp;&gt;|&gt;&amp;|[0-9]*&lt;&gt;)" /> <RegExpr attribute="Redirection" context="#stay" String="([0-9]*(&gt;{1,2}|&lt;)(&amp;[0-9]+-?)?|&amp;&gt;|&gt;&amp;|[0-9]*&lt;&gt;)" />
<!-- handle &, &&, | and || --> <!-- handle &, &&, | and || -->
<RegExpr attribute="Control" context="#pop" String="([|&amp;;])\1?" /> <RegExpr attribute="Control" context="#pop" String="([|&amp;;])\1?" />
<RegExpr attribute="Option" context="#stay" String="-?-[a-z][A-Za-z0-9_-]*" /> <RegExpr attribute="Normal Text" context="#stay" String="[a-zA-Z_]+-[A-Za-z0-9_-]*" />
<RegExpr attribute="Option" context="#stay" String="-?-[a-zA-Z_][A-Za-z0-9_-]*" />
<keyword attribute="Option" context="#stay" String="keywords" /> <keyword attribute="Option" context="#stay" String="keywords" />
<AnyChar String=")}" context="#pop" lookAhead="true"/> <AnyChar String=")}" context="#pop" lookAhead="true"/>
</context> </context>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,39 +3,14 @@
[ [
<!ENTITY wordsep "([][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord --> <!ENTITY wordsep "([][,?;()]|\.$|\.?\s)"> <!-- things that end a TagWord -->
]> ]>
<!--
This file is part of KDE's kate project.
Copyright 2004 Dominik Haumann (dhdev@gmx.de)
Copyright 2007 Matthew Woehlke (mw_triad@users.sourceforge.net)
Copyright 2009-2013 Alex Turbov (I.zaufi@gmail.com)
**********************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the *
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301, USA. *
**********************************************************************
-->
<language name="Doxygen" <language name="Doxygen"
version="3" version="4"
kateversion="5.0" kateversion="5.0"
section="Markup" section="Markup"
extensions="*.dox;*.doxygen" extensions="*.dox;*.doxygen"
mimetype="text/x-doxygen" mimetype="text/x-doxygen"
author="Dominik Haumann (dhdev@gmx.de)" author="Dominik Haumann (dhaumann@kde.org)"
license="LGPLv2+" license="MIT"
priority="9"> priority="9">
<highlighting> <highlighting>
<!-- NOTE: all tags may begin with a \ or @ char <!-- NOTE: all tags may begin with a \ or @ char
@@ -44,201 +19,201 @@
do not present in keywords due separate handle rules... do not present in keywords due separate handle rules...
--> -->
<list name="TagOnly"> <list name="TagOnly">
<item> \arg </item> <item> @arg </item> <item>\arg</item> <item>@arg</item>
<item> \author </item> <item> @author </item> <item>\author</item> <item>@author</item>
<item> \authors </item> <item> @authors </item> <item>\authors</item> <item>@authors</item>
<item> \brief </item> <item> @brief </item> <item>\brief</item> <item>@brief</item>
<item> \callgraph </item> <item> @callgraph </item> <item>\callgraph</item> <item>@callgraph</item>
<item> \callergraph </item> <item> @callergraph </item> <item>\callergraph</item> <item>@callergraph</item>
<item> \date </item> <item> @date </item> <item>\date</item> <item>@date</item>
<item> \deprecated </item> <item> @deprecated </item> <item>\deprecated</item> <item>@deprecated</item>
<item> \details </item> <item> @details </item> <item>\details</item> <item>@details</item>
<item> \docbookonly </item> <item> @docbookonly </item> <item>\docbookonly</item> <item>@docbookonly</item>
<item> \else </item> <item> @else </item> <item>\else</item> <item>@else</item>
<item> \endcond </item> <item> @endcond </item> <item>\endcond</item> <item>@endcond</item>
<item> \enddocbookonly </item> <item> @enddocbookonly </item> <item>\enddocbookonly</item> <item>@enddocbookonly</item>
<item> \endhtmlonly </item> <item> @endhtmlonly </item> <item>\endhtmlonly</item> <item>@endhtmlonly</item>
<item> \endif </item> <item> @endif </item> <item>\endif</item> <item>@endif</item>
<item> \endinternal </item> <item> @endinternal </item> <item>\endinternal</item> <item>@endinternal</item>
<item> \endlatexonly </item> <item> @endlatexonly </item> <item>\endlatexonly</item> <item>@endlatexonly</item>
<item> \endlink </item> <item> @endlink </item> <item>\endlink</item> <item>@endlink</item>
<item> \endmanonly </item> <item> @endmanonly </item> <item>\endmanonly</item> <item>@endmanonly</item>
<item> \endparblock </item> <item> @endparblock </item> <item>\endparblock</item> <item>@endparblock</item>
<item> \endrtfonly </item> <item> @endrtfonly </item> <item>\endrtfonly</item> <item>@endrtfonly</item>
<item> \endsecreflist </item> <item> @endsecreflist </item> <item>\endsecreflist</item> <item>@endsecreflist</item>
<item> \endxmlonly </item> <item> @endxmlonly </item> <item>\endxmlonly</item> <item>@endxmlonly</item>
<item> \f[ </item> <item> @f[ </item> <item>\f[</item> <item>@f[</item>
<item> \f] </item> <item> @f] </item> <item>\f]</item> <item>@f]</item>
<item> \f$ </item> <item> @f$ </item> <item>\f$</item> <item>@f$</item>
<!-- TODO Add @f{environment}{ and @f} --> <!-- TODO Add @f{environment}{ and @f} -->
<item> \hideinitializer </item> <item> @hideinitializer </item> <item>\hideinitializer</item> <item>@hideinitializer</item>
<item> \htmlonly </item> <item> @htmlonly </item> <item>\htmlonly</item> <item>@htmlonly</item>
<!-- TODO @internal is a candidate to be handled separately, cuz may introduce folding region --> <!-- TODO @internal is a candidate to be handled separately, cuz may introduce folding region -->
<item> \internal </item> <item> @internal </item> <item>\internal</item> <item>@internal</item>
<item> \invariant </item> <item> @invariant </item> <item>\invariant</item> <item>@invariant</item>
<item> \latexonly </item> <item> @latexonly </item> <item>\latexonly</item> <item>@latexonly</item>
<item> \li </item> <item> @li </item> <item>\li</item> <item>@li</item>
<item> \manonly </item> <item> @manonly </item> <item>\manonly</item> <item>@manonly</item>
<item> \n </item> <item> @n </item> <item>\n</item> <item>@n</item>
<item> \nosubgrouping </item> <item> @nosubgrouping </item> <item>\nosubgrouping</item> <item>@nosubgrouping</item>
<item> \only </item> <item> @only </item> <item>\only</item> <item>@only</item>
<item> \parblock </item> <item> @parblock </item> <item>\parblock</item> <item>@parblock</item>
<item> \post </item> <item> @post </item> <item>\post</item> <item>@post</item>
<item> \pre </item> <item> @pre </item> <item>\pre</item> <item>@pre</item>
<item> \private </item> <item> @pivate </item> <item>\private</item> <item>@pivate</item>
<item> \privatesection </item> <item> @pivatesection </item> <item>\privatesection</item> <item>@pivatesection</item>
<item> \protected </item> <item> @protected </item> <item>\protected</item> <item>@protected</item>
<item> \protectedsection </item> <item> @protectedsection </item> <item>\protectedsection</item> <item>@protectedsection</item>
<item> \public </item> <item> @public </item> <item>\public</item> <item>@public</item>
<item> \publicsection </item> <item> @publicsection </item> <item>\publicsection</item> <item>@publicsection</item>
<item> \pure </item> <item> @pure </item> <item>\pure</item> <item>@pure</item>
<item> \remark </item> <item> @remark </item> <item>\remark</item> <item>@remark</item>
<item> \remarks </item> <item> @remarks </item> <item>\remarks</item> <item>@remarks</item>
<item> \return </item> <item> @return </item> <item>\return</item> <item>@return</item>
<item> \returns </item> <item> @returns </item> <item>\returns</item> <item>@returns</item>
<item> \result </item> <item> @result </item> <item>\result</item> <item>@result</item>
<item> \rtfonly </item> <item> @rtfonly </item> <item>\rtfonly</item> <item>@rtfonly</item>
<item> \sa </item> <item> @sa </item> <item>\sa</item> <item>@sa</item>
<item> \secreflist </item> <item> @secreflist </item> <item>\secreflist</item> <item>@secreflist</item>
<item> \see </item> <item> @see </item> <item>\see</item> <item>@see</item>
<item> \short </item> <item> @short </item> <item>\short</item> <item>@short</item>
<item> \showinitializer </item> <item> @showinitializer </item> <item>\showinitializer</item> <item>@showinitializer</item>
<item> \since </item> <item> @since </item> <item>\since</item> <item>@since</item>
<item> \static </item> <item> @static </item> <item>\static</item> <item>@static</item>
<item> \tableofcontents </item> <item> @tableofcontents </item> <item>\tableofcontents</item> <item>@tableofcontents</item>
<item> \test </item> <item> @test </item> <item>\test</item> <item>@test</item>
<item> \version </item> <item> @version </item> <item>\version</item> <item>@version</item>
<item> \xmlonly </item> <item> @xmlonly </item> <item>\xmlonly</item> <item>@xmlonly</item>
<!-- TODO Introduce separate context for @~ ? --> <!-- TODO Introduce separate context for @~ ? -->
<item> \# </item> <item> @# </item> <item>\#</item> <item>@#</item>
<item> \$ </item> <item> @$ </item> <item>\$</item> <item>@$</item>
<item> \% </item> <item> @% </item> <item>\%</item> <item>@%</item>
<item> \&amp; </item> <item> @&amp; </item> <item>\&amp;</item> <item>@&amp;</item>
<item> \&gt; </item> <item> @&gt; </item> <item>\&gt;</item> <item>@&gt;</item>
<item> \&lt; </item> <item> @&lt; </item> <item>\&lt;</item> <item>@&lt;</item>
<item> \&quot; </item> <item> @&quot; </item> <item>\&quot;</item> <item>@&quot;</item>
<item> \:: </item> <item> @:: </item> <item>\::</item> <item>@::</item>
<item> \@ </item> <item> @@ </item> <item>\@</item> <item>@@</item>
<item> \\ </item> <item> @\ </item> <item>\\</item> <item>@\</item>
<item> \~ </item> <item> @~ </item> <item>\~</item> <item>@~</item>
<item> \. </item> <item> @. </item> <item>\.</item> <item>@.</item>
<item> \-- </item> <item> @-- </item> <item>\--</item> <item>@--</item>
<item> \--- </item> <item> @--- </item> <item>\---</item> <item>@---</item>
</list> </list>
<list name="TagWord"> <list name="TagWord">
<item> \a </item> <item> @a </item> <item>\a</item> <item>@a</item>
<item> \anchor </item> <item> @anchor </item> <item>\anchor</item> <item>@anchor</item>
<item> \b </item> <item> @b </item> <item>\b</item> <item>@b</item>
<item> \c </item> <item> @c </item> <item>\c</item> <item>@c</item>
<item> \cite </item> <item> @cite </item> <item>\cite</item> <item>@cite</item>
<item> \cond </item> <item> @cond </item> <item>\cond</item> <item>@cond</item>
<item> \copybrief </item> <item> @copybrief </item> <item>\copybrief</item> <item>@copybrief</item>
<item> \copydetails </item> <item> @copydetails </item> <item>\copydetails</item> <item>@copydetails</item>
<item> \copydoc </item> <item> @copydoc </item> <item>\copydoc</item> <item>@copydoc</item>
<item> \def </item> <item> @def </item> <item>\def</item> <item>@def</item>
<item> \dir </item> <item> @dir </item> <item>\dir</item> <item>@dir</item>
<item> \dontinclude </item> <item> @dontinclude </item> <item>\dontinclude</item> <item>@dontinclude</item>
<item> \e </item> <item> @e </item> <item>\e</item> <item>@e</item>
<item> \elseif </item> <item> @elseif </item> <item>\elseif</item> <item>@elseif</item>
<item> \em </item> <item> @em </item> <item>\em</item> <item>@em</item>
<item> \enum </item> <item> @enum </item> <item>\enum</item> <item>@enum</item>
<item> \example </item> <item> @example </item> <item>\example</item> <item>@example</item>
<item> \exception </item> <item> @exception </item> <item>\exception</item> <item>@exception</item>
<item> \exceptions </item> <item> @exceptions </item> <item>\exceptions</item> <item>@exceptions</item>
<item> \extends </item> <item> @extends </item> <item>\extends</item> <item>@extends</item>
<item> \file </item> <item> @file </item> <item>\file</item> <item>@file</item>
<item> \htmlinclude </item> <item> @htmlinclude </item> <item>\htmlinclude</item> <item>@htmlinclude</item>
<item> \idlexcept </item> <item> @idlexcept </item> <item>\idlexcept</item> <item>@idlexcept</item>
<item> \if </item> <item> @if </item> <item>\if</item> <item>@if</item>
<item> \ifnot </item> <item> @ifnot </item> <item>\ifnot</item> <item>@ifnot</item>
<item> \implements </item> <item> @implements </item> <item>\implements</item> <item>@implements</item>
<item> \include </item> <item> @include </item> <item>\include</item> <item>@include</item>
<item> \includelineno </item> <item> @includelineno </item> <item>\includelineno</item> <item>@includelineno</item>
<item> \latexinclude </item> <item> @latexinclude </item> <item>\latexinclude</item> <item>@latexinclude</item>
<item> \link </item> <item> @link </item> <item>\link</item> <item>@link</item>
<item> \memberof </item> <item> @memberof </item> <item>\memberof</item> <item>@memberof</item>
<item> \namespace </item> <item> @namespace </item> <item>\namespace</item> <item>@namespace</item>
<item> \p </item> <item> @p </item> <item>\p</item> <item>@p</item>
<item> \package </item> <item> @package </item> <item>\package</item> <item>@package</item>
<item> \property </item> <item> @property </item> <item>\property</item> <item>@property</item>
<item> \relatedalso </item> <item> @relatedalso </item> <item>\relatedalso</item> <item>@relatedalso</item>
<item> \relatesalso </item> <item> @relatesalso </item> <item>\relatesalso</item> <item>@relatesalso</item>
<item> \related </item> <item> @related </item> <item>\related</item> <item>@related</item>
<item> \relates </item> <item> @relates </item> <item>\relates</item> <item>@relates</item>
<item> \retval </item> <item> @retval </item> <item>\retval</item> <item>@retval</item>
<item> \throw </item> <item> @throw </item> <item>\throw</item> <item>@throw</item>
<item> \throws </item> <item> @throws </item> <item>\throws</item> <item>@throws</item>
<item> \verbinclude </item> <item> @verbinclude </item> <item>\verbinclude</item> <item>@verbinclude</item>
<item> \version </item> <item> @version </item> <item>\version</item> <item>@version</item>
<!-- TODO Introduce separate context for @xrefitem? --> <!-- TODO Introduce separate context for @xrefitem? -->
<item> \xrefitem </item> <item> @xrefitem </item> <item>\xrefitem</item> <item>@xrefitem</item>
</list> </list>
<list name="TagParam"> <list name="TagParam">
<item> \param </item> <item> @param </item> <item>\param</item> <item>@param</item>
<!-- TODO @tparam has no optional direction actually! --> <!-- TODO @tparam has no optional direction actually! -->
<item> \tparam </item> <item> @tparam </item> <item>\tparam</item> <item>@tparam</item>
</list> </list>
<!-- TODO Better (separate?) highlighting for @image required --> <!-- TODO Better (separate?) highlighting for @image required -->
<list name="TagWordWord"> <list name="TagWordWord">
<item> \image </item> <item> @image </item> <item>\image</item> <item>@image</item>
</list> </list>
<!-- TODO @union, @struct, @protocol, @interface, @class, @category <!-- TODO @union, @struct, @protocol, @interface, @class, @category
actually takes 3 params, 1 mandatory and 2 optional actually takes 3 params, 1 mandatory and 2 optional
--> -->
<!-- TODO @headerfile actually takes 2 params, where last one is optional --> <!-- TODO @headerfile actually takes 2 params, where last one is optional -->
<list name="TagWordString"> <list name="TagWordString">
<item> \addtogroup </item> <item> @addtogroup </item> <item>\addtogroup</item> <item>@addtogroup</item>
<item> \category </item> <item> @category </item> <item>\category</item> <item>@category</item>
<item> \class </item> <item> @class </item> <item>\class</item> <item>@class</item>
<item> \diafile </item> <item> @diafile </item> <item>\diafile</item> <item>@diafile</item>
<item> \dotfile </item> <item> @dotfile </item> <item>\dotfile</item> <item>@dotfile</item>
<item> \defgroup </item> <item> @defgroup </item> <item>\defgroup</item> <item>@defgroup</item>
<item> \interface </item> <item> @interface </item> <item>\interface</item> <item>@interface</item>
<item> \headerfile </item> <item> @headerfile </item> <item>\headerfile</item> <item>@headerfile</item>
<item> \mscfile </item> <item> @mscfile </item> <item>\mscfile</item> <item>@mscfile</item>
<item> \page </item> <item> @page </item> <item>\page</item> <item>@page</item>
<item> \paragraph </item> <item> @paragraph </item> <item>\paragraph</item> <item>@paragraph</item>
<item> \protocol </item> <item> @prtocol </item> <item>\protocol</item> <item>@prtocol</item>
<item> \ref </item> <item> @ref </item> <item>\ref</item> <item>@ref</item>
<item> \section </item> <item> @section </item> <item>\section</item> <item>@section</item>
<item> \snippet </item> <item> @snippet </item> <item>\snippet</item> <item>@snippet</item>
<item> \struct </item> <item> @struct </item> <item>\struct</item> <item>@struct</item>
<item> \subpage </item> <item> @subpage </item> <item>\subpage</item> <item>@subpage</item>
<item> \subsection </item> <item> @subsection </item> <item>\subsection</item> <item>@subsection</item>
<item> \subsubsection </item> <item> @subsubsection </item> <item>\subsubsection</item> <item>@subsubsection</item>
<item> \union </item> <item> @union </item> <item>\union</item> <item>@union</item>
<item> \weakgroup </item> <item> @weakgroup </item> <item>\weakgroup</item> <item>@weakgroup</item>
</list> </list>
<list name="TagString"> <list name="TagString">
<item> \addindex </item> <item> @addindex </item> <item>\addindex</item> <item>@addindex</item>
<item> \copyright </item> <item> @copyright </item> <item>\copyright</item> <item>@copyright</item>
<item> \fn </item> <item> @fn </item> <item>\fn</item> <item>@fn</item>
<item> \ingroup </item> <item> @ingroup </item> <item>\ingroup</item> <item>@ingroup</item>
<item> \line </item> <item> @line </item> <item>\line</item> <item>@line</item>
<item> \mainpage </item> <item> @mainpage </item> <item>\mainpage</item> <item>@mainpage</item>
<item> \name </item> <item> @name </item> <item>\name</item> <item>@name</item>
<item> \overload </item> <item> @overload </item> <item>\overload</item> <item>@overload</item>
<item> \par </item> <item> @par </item> <item>\par</item> <item>@par</item>
<item> \skip </item> <item> @skip </item> <item>\skip</item> <item>@skip</item>
<item> \skipline </item> <item> @skipline </item> <item>\skipline</item> <item>@skipline</item>
<item> \typedef </item> <item> @typedef </item> <item>\typedef</item> <item>@typedef</item>
<item> \until </item> <item> @until </item> <item>\until</item> <item>@until</item>
<item> \var </item> <item> @var </item> <item>\var</item> <item>@var</item>
<item> \vhdlflow </item> <item> @vhdlflow </item> <item>\vhdlflow</item> <item>@vhdlflow</item>
</list> </list>
<list name="Note"> <list name="Note">
<item> \note </item> <item> @note </item> <item>\note</item> <item>@note</item>
</list> </list>
<list name="Warning"> <list name="Warning">
<item> \warning </item> <item> @warning </item> <item>\warning</item> <item>@warning</item>
</list> </list>
<list name="Attention"> <list name="Attention">
<item> \attention </item> <item> @attention </item> <item>\attention</item> <item>@attention</item>
<item> \bug </item> <item> @bug </item> <item>\bug</item> <item>@bug</item>
</list> </list>
<list name="Todo"> <list name="Todo">
<item> \todo </item> <item> @todo </item> <item>\todo</item> <item>@todo</item>
</list> </list>
<contexts> <contexts>

File diff suppressed because it is too large Load Diff

View File

@@ -16,10 +16,10 @@
author="Per Wigren (wigren@home.se)" license=""> author="Per Wigren (wigren@home.se)" license="">
<highlighting> <highlighting>
<list name = "keywords" > <list name = "keywords" >
<item> include </item> <item>include</item>
<item> -include </item> <item>-include</item>
<item> define </item> <item>define</item>
<item> endef </item> <item>endef</item>
</list> </list>
<!-- https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html --> <!-- https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html -->
<list name="gmake_if_keywords"> <list name="gmake_if_keywords">
@@ -33,19 +33,19 @@
<list name="gmake_endif_keywords"><item>endif</item></list> <list name="gmake_endif_keywords"><item>endif</item></list>
<!-- bmake statements: https://www.freebsd.org/cgi/man.cgi?make(1)#INCLUDE_STATEMENTS,_CONDITIONALS_AND_FOR_LOOPS --> <!-- bmake statements: https://www.freebsd.org/cgi/man.cgi?make(1)#INCLUDE_STATEMENTS,_CONDITIONALS_AND_FOR_LOOPS -->
<list name="bmake_if_keywords"> <list name="bmake_if_keywords">
<item> .if </item> <item>.if</item>
<item> .ifdef </item> <item>.ifdef</item>
<item> .ifndef </item> <item>.ifndef</item>
<item> .ifmake </item> <item>.ifmake</item>
<item> .ifnmake </item> <item>.ifnmake</item>
</list> </list>
<list name="bmake_else_keywords"> <list name="bmake_else_keywords">
<item> .elif </item> <item>.elif</item>
<item> .elifdef </item> <item>.elifdef</item>
<item> .elifndef </item> <item>.elifndef</item>
<item> .elifmake </item> <item>.elifmake</item>
<item> .elifnmake </item> <item>.elifnmake</item>
<item> .else </item> <!-- TODO: anything following .else should be highlighted as an error --> <item>.else</item> <!-- TODO: anything following .else should be highlighted as an error -->
</list> </list>
<list name="bmake_endif_keywords"><item>.endif</item></list> <list name="bmake_endif_keywords"><item>.endif</item></list>
@@ -64,9 +64,9 @@
<!-- For compat bmake also handles include but this is already highlighted. <item>include</item> --> <!-- For compat bmake also handles include but this is already highlighted. <item>include</item> -->
</list> </list>
<list name="bmake_message_stmt"> <list name="bmake_message_stmt">
<item> .info </item> <item>.info</item>
<item> .warning </item> <item>.warning</item>
<item> .error </item> <item>.error</item>
</list> </list>
<!-- Use single element list here so that .for/.endfor also shows up in code completion --> <!-- Use single element list here so that .for/.endfor also shows up in code completion -->
<list name="bmake_for_stmt"><item>.for</item></list> <list name="bmake_for_stmt"><item>.for</item></list>
@@ -74,92 +74,92 @@
<!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_TARGETS --> <!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_TARGETS -->
<list name="bmake_special_targets"> <list name="bmake_special_targets">
<item> .BEGIN </item> <item>.BEGIN</item>
<item> .DEFAULT </item> <item>.DEFAULT</item>
<item> .END </item> <item>.END</item>
<item> .ERROR </item> <item>.ERROR</item>
<item> .IGNORE </item> <item>.IGNORE</item>
<item> .INTERRUPT </item> <item>.INTERRUPT</item>
<item> .MAIN </item> <item>.MAIN</item>
<item> .MAKEFLAGS </item> <item>.MAKEFLAGS</item>
<item> .NOPATH </item> <item>.NOPATH</item>
<item> .NOTPARALLEL </item> <item>.NOTPARALLEL</item>
<item> .NO_PARALLEL </item> <item>.NO_PARALLEL</item>
<item> .OBJDIR </item> <item>.OBJDIR</item>
<item> .ORDER </item> <item>.ORDER</item>
<item> .PATH </item> <item>.PATH</item>
<item> .PHONY </item> <item>.PHONY</item>
<item> .PRECIOUS </item> <item>.PRECIOUS</item>
<item> .SHELL </item> <item>.SHELL</item>
<item> .SILENT </item> <item>.SILENT</item>
<item> .STALE </item> <item>.STALE</item>
<item> .SUFFIXES </item> <item>.SUFFIXES</item>
</list> </list>
<!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_SOURCES_(ATTRIBUTES) --> <!-- https://www.freebsd.org/cgi/man.cgi?make(1)#SPECIAL_SOURCES_(ATTRIBUTES) -->
<list name="bmake_special_sources"> <list name="bmake_special_sources">
<item> .EXEC </item> <item>.EXEC</item>
<item> .IGNORE </item> <item>.IGNORE</item>
<item> .MADE </item> <item>.MADE</item>
<item> .MAKE </item> <item>.MAKE</item>
<item> .META </item> <item>.META</item>
<item> .NOMETA </item> <item>.NOMETA</item>
<item> .NOMETA_CMP </item> <item>.NOMETA_CMP</item>
<item> .NOPATH </item> <item>.NOPATH</item>
<item> .NOTMAIN </item> <item>.NOTMAIN</item>
<item> .OPTIONAL </item> <item>.OPTIONAL</item>
<item> .PHONY </item> <item>.PHONY</item>
<item> .PRECIOUS </item> <item>.PRECIOUS</item>
<item> .RECURSIVE </item> <item>.RECURSIVE</item>
<item> .SILENT </item> <item>.SILENT</item>
<item> .USE </item> <item>.USE</item>
<item> .USEBEFORE </item> <item>.USEBEFORE</item>
<item> .WAIT </item> <item>.WAIT</item>
</list> </list>
<list name="bmake_other_stmts"> <list name="bmake_other_stmts">
<item> .unexport-env </item> <item>.unexport-env</item>
<item> .unexport </item> <item>.unexport</item>
<item> .undef </item> <item>.undef</item>
<item> .export-env </item> <item>.export-env</item>
<item> .export </item> <item>.export</item>
</list> </list>
<list name = "functions"> <list name = "functions">
<item> call </item> <item>call</item>
<item> subst </item> <item>subst</item>
<item> patsubst </item> <item>patsubst</item>
<item> strip </item> <item>strip</item>
<item> findstring </item> <item>findstring</item>
<item> filter </item> <item>filter</item>
<item> filter-out </item> <item>filter-out</item>
<item> sort </item> <item>sort</item>
<item> word </item> <item>word</item>
<item> wordlist </item> <item>wordlist</item>
<item> words </item> <item>words</item>
<item> firstword </item> <item>firstword</item>
<item> lastword </item> <item>lastword</item>
<item> dir </item> <item>dir</item>
<item> notdir </item> <item>notdir</item>
<item> suffix </item> <item>suffix</item>
<item> basename </item> <item>basename</item>
<item> addsuffix </item> <item>addsuffix</item>
<item> addprefix </item> <item>addprefix</item>
<item> join </item> <item>join</item>
<item> wildcard </item> <item>wildcard</item>
<item> realpath </item> <item>realpath</item>
<item> abspath </item> <item>abspath</item>
<item> if </item> <item>if</item>
<item> or </item> <item>or</item>
<item> and </item> <item>and</item>
<item> foreach </item> <item>foreach</item>
<item> value </item> <item>value</item>
<item> eval </item> <item>eval</item>
<item> origin </item> <item>origin</item>
<item> flavor </item> <item>flavor</item>
<item> shell </item> <item>shell</item>
<item> error </item> <item>error</item>
<item> warning </item> <item>warning</item>
<item> info </item> <item>info</item>
</list> </list>
<contexts> <contexts>
<context name="normal" attribute="Normal" lineEndContext="#stay"> <context name="normal" attribute="Normal" lineEndContext="#stay">

View File

@@ -39,88 +39,88 @@
Enhance tr/// and y/// support. Enhance tr/// and y/// support.
--> -->
<language name="Perl" version="3" kateversion="2.4" 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="4" kateversion="2.4" section="Scripts" extensions="*.pl;*.PL;*.pm" mimetype="application/x-perl;text/x-perl" priority="5" author="Anders Lund (anders@alweb.dk)" license="LGPLv2">
<highlighting> <highlighting>
<list name="keywords"> <list name="keywords">
<item> if </item> <item>if</item>
<item> unless </item> <item>unless</item>
<item> else </item> <item>else</item>
<item> elsif </item> <item>elsif</item>
<item> while </item> <item>while</item>
<item> until </item> <item>until</item>
<item> for </item> <item>for</item>
<item> each </item> <item>each</item>
<item> foreach </item> <item>foreach</item>
<item> next </item> <item>next</item>
<item> last </item> <item>last</item>
<item> break </item> <item>break</item>
<item> continue </item> <item>continue</item>
<item> return </item> <item>return</item>
<item> my </item> <item>my</item>
<item> our </item> <item>our</item>
<item> local </item> <item>local</item>
<item> state </item> <item>state</item>
<item> BEGIN </item> <item>BEGIN</item>
<item> END </item> <item>END</item>
<item> package </item> <item>package</item>
<item> sub </item> <item>sub</item>
<item> do </item> <item>do</item>
<item> given </item> <item>given</item>
<item> when </item> <item>when</item>
<item> default </item> <item>default</item>
<item> __END__ </item> <item>__END__</item>
<item> __DATA__ </item> <item>__DATA__</item>
<item> __FILE__ </item> <item>__FILE__</item>
<item> __LINE__ </item> <item>__LINE__</item>
<item> __PACKAGE__ </item> <item>__PACKAGE__</item>
</list> </list>
<list name="operators"> <list name="operators">
<item> = </item> <item>=</item>
<item> != </item> <item>!=</item>
<item> ~= </item> <item>~=</item>
<item> += </item> <item>+=</item>
<item> -= </item> <item>-=</item>
<item> *= </item> <item>*=</item>
<item> /= </item> <item>/=</item>
<item> **= </item> <item>**=</item>
<item> |= </item> <item>|=</item>
<item> ||= </item> <item>||=</item>
<item> //= </item> <item>//=</item>
<item> &amp;= </item> <item>&amp;=</item>
<item> &amp;&amp;= </item> <item>&amp;&amp;=</item>
<item> ?= </item> <item>?=</item>
<item> + </item> <item>+</item>
<item> - </item> <item>-</item>
<item> * </item> <item>*</item>
<!-- <item> / </item>//--> <!-- <item>/</item>//-->
<item> % </item> <item>%</item>
<item> || </item> <item>||</item>
<item> // </item> <item>//</item>
<item> &amp;&amp; </item> <item>&amp;&amp;</item>
<item> | </item> <item>|</item>
<item> &amp; </item> <item>&amp;</item>
<item> &lt; </item> <item>&lt;</item>
<item> &lt;&lt; </item> <item>&lt;&lt;</item>
<item> &gt; </item> <item>&gt;</item>
<item> &gt;&gt; </item> <item>&gt;&gt;</item>
<item> ^ </item> <item>^</item>
<item> -&gt; </item> <item>-&gt;</item>
<item> =&gt; </item> <item>=&gt;</item>
<item> . </item> <item>.</item>
<item> , </item> <item>,</item>
<item> ; </item> <item>;</item>
<item> :: </item> <item>::</item>
<item> \ </item> <item>\</item>
<item> and </item> <item>and</item>
<item> or </item> <item>or</item>
<item> not </item> <item>not</item>
<item> eq </item> <item>eq</item>
<item> ne </item> <item>ne</item>
<item> lt </item> <item>lt</item>
<item> gt </item> <item>gt</item>
<item> le </item> <item>le</item>
<item> ge </item> <item>ge</item>
<item> cmp </item> <item>cmp</item>
</list> </list>
<list name="functions"> <list name="functions">
<item>abs</item> <item>abs</item>
@@ -744,14 +744,14 @@
<RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" /> <RegExpr attribute="Keyword" context="here_document_dumb" String="\s*'([^']+)'\s*;?" />
</context> </context>
<context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true"> <context name="here_document" attribute="String (interpolated)" lineEndContext="#stay" dynamic="true">
<DetectSpaces /> <RegExpr attribute="Keyword" context="#pop#pop" String="%1\b" column="0" dynamic="true" endRegion="HereDocument"/>
<RegExpr attribute="Keyword" context="#pop#pop" String="^%1\b" column="0" dynamic="true" endRegion="HereDocument"/>
<RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" /> <RegExpr attribute="Keyword" context="here_document" String="\=\s*&lt;&lt;\s*[&quot;']?([A-Z0-9_\-]+)[&quot;']?" beginRegion="HEREDoc" />
<IncludeRules context="ipstring_internal" /> <IncludeRules context="ipstring_internal" />
<DetectSpaces />
</context> </context>
<context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true"> <context name="here_document_dumb" attribute="Normal Text" lineEndContext="#stay" dynamic="true">
<DetectSpaces />
<RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/> <RegExpr attribute="Keyword" context="#pop#pop" String="%1" column="0" dynamic="true" endRegion="HereDocument"/>
<DetectSpaces />
<DetectIdentifier /> <DetectIdentifier />
</context> </context>

View File

@@ -31,7 +31,7 @@
<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
<language name="Ruby" section="Scripts" <language name="Ruby" section="Scripts"
version="3" kateversion="3.3" version="4" kateversion="3.3"
extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile" extensions="*.rb;*.rjs;*.rxml;*.xml.erb;*.js.erb;*.rake;Rakefile;Gemfile;*.gemspec;Vagrantfile"
mimetype="application/x-ruby" mimetype="application/x-ruby"
style="ruby" indenter="ruby" style="ruby" indenter="ruby"
@@ -40,74 +40,74 @@
<highlighting> <highlighting>
<list name="keywords"> <list name="keywords">
<item> BEGIN </item> <item>BEGIN</item>
<item> END </item> <item>END</item>
<item> and </item> <item>and</item>
<item> begin </item> <item>begin</item>
<item> break </item> <item>break</item>
<item> case </item> <item>case</item>
<item> defined? </item> <item>defined?</item>
<item> do </item> <item>do</item>
<item> else </item> <item>else</item>
<item> elsif </item> <item>elsif</item>
<item> end </item> <item>end</item>
<item> ensure </item> <item>ensure</item>
<item> for </item> <item>for</item>
<item> if </item> <item>if</item>
<item> in </item> <item>in</item>
<item> next </item> <item>next</item>
<item> not </item> <item>not</item>
<item> or </item> <item>or</item>
<item> redo </item> <item>redo</item>
<item> rescue </item> <item>rescue</item>
<item> retry </item> <item>retry</item>
<item> return </item> <item>return</item>
<item> then </item> <item>then</item>
<item> unless </item> <item>unless</item>
<item> until </item> <item>until</item>
<item> when </item> <item>when</item>
<item> yield </item> <item>yield</item>
</list> </list>
<list name="access-control"> <list name="access-control">
<item> private_class_method </item> <item>private_class_method</item>
<item> private </item> <item>private</item>
<item> protected </item> <item>protected</item>
<item> public_class_method </item> <item>public_class_method</item>
<item> public </item> <item>public</item>
</list> </list>
<list name="attribute-definitions"> <list name="attribute-definitions">
<item> attr_reader </item> <item>attr_reader</item>
<item> attr_writer </item> <item>attr_writer</item>
<item> attr_accessor </item> <item>attr_accessor</item>
</list> </list>
<list name="definitions"> <list name="definitions">
<item> alias </item> <item>alias</item>
<item> module </item> <item>module</item>
<item> class </item> <item>class</item>
<item> def </item> <item>def</item>
<item> undef </item> <item>undef</item>
</list> </list>
<list name="pseudo-variables"> <list name="pseudo-variables">
<item> self </item> <item>self</item>
<item> super </item> <item>super</item>
<item> nil </item> <item>nil</item>
<item> false </item> <item>false</item>
<item> true </item> <item>true</item>
<item> caller </item> <item>caller</item>
<item> __FILE__ </item> <item>__FILE__</item>
<item> __LINE__ </item> <item>__LINE__</item>
</list> </list>
<list name="default-globals"> <list name="default-globals">
<item> $stdout </item> <item>$stdout</item>
<item> $defout </item> <item>$defout</item>
<item> $stderr </item> <item>$stderr</item>
<item> $deferr </item> <item>$deferr</item>
<item> $stdin </item> <item>$stdin</item>
</list> </list>
<!-- Kernel module methods. <!-- Kernel module methods.
@@ -116,67 +116,67 @@
--> -->
<list name="kernel-methods"> <list name="kernel-methods">
<!-- backquote ` --> <!-- backquote ` -->
<item> abort </item> <item>abort</item>
<item> at_exit </item> <item>at_exit</item>
<item> autoload </item> <item>autoload</item>
<item> autoload? </item> <item>autoload?</item>
<item> binding </item> <item>binding</item>
<item> block_given? </item> <item>block_given?</item>
<item> callcc </item> <item>callcc</item>
<item> caller </item> <item>caller</item>
<item> catch </item> <item>catch</item>
<item> chomp </item> <item>chomp</item>
<item> chomp! </item> <item>chomp!</item>
<item> chop </item> <item>chop</item>
<item> chop! </item> <item>chop!</item>
<item> eval </item> <item>eval</item>
<item> exec </item> <item>exec</item>
<item> exit </item> <item>exit</item>
<item> exit! </item> <item>exit!</item>
<item> fail </item> <item>fail</item>
<item> fork </item> <item>fork</item>
<item> format </item> <item>format</item>
<item> getc </item> <item>getc</item>
<item> gets </item> <item>gets</item>
<item> global_variables </item> <item>global_variables</item>
<item> gsub </item> <item>gsub</item>
<item> gsub! </item> <item>gsub!</item>
<item> iterator? </item> <item>iterator?</item>
<item> lambda </item> <item>lambda</item>
<item> load </item> <item>load</item>
<item> local_variables </item> <item>local_variables</item>
<item> loop </item> <item>loop</item>
<item> method_missing </item> <item>method_missing</item>
<item> open </item> <item>open</item>
<item> p </item> <item>p</item>
<item> print </item> <item>print</item>
<item> printf </item> <item>printf</item>
<item> proc </item> <item>proc</item>
<item> putc </item> <item>putc</item>
<item> puts </item> <item>puts</item>
<item> raise </item> <item>raise</item>
<item> rand </item> <item>rand</item>
<item> readline </item> <item>readline</item>
<item> readlines </item> <item>readlines</item>
<item> require </item> <item>require</item>
<item> require_relative </item> <item>require_relative</item>
<item> scan </item> <item>scan</item>
<item> select </item> <item>select</item>
<item> set_trace_func </item> <item>set_trace_func</item>
<item> sleep </item> <item>sleep</item>
<item> split </item> <item>split</item>
<item> sprintf </item> <item>sprintf</item>
<item> srand </item> <item>srand</item>
<item> sub </item> <item>sub</item>
<item> sub! </item> <item>sub!</item>
<item> syscall </item> <item>syscall</item>
<item> system </item> <item>system</item>
<item> test </item> <item>test</item>
<item> throw </item> <item>throw</item>
<item> trace_var </item> <item>trace_var</item>
<item> trap </item> <item>trap</item>
<item> untrace_var </item> <item>untrace_var</item>
<item> warn </item> <item>warn</item>
</list> </list>
<list name="mixin-methods"> <list name="mixin-methods">
@@ -204,14 +204,14 @@
<RegExpr attribute="Keyword" String="\;\s*(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"/>
<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/> <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
<RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/> <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bclass\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="class" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bcase\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="case" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bdo\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="do" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/> <WordDetect attribute="Keyword" String="def" context="#stay" beginRegion="def block"/>
<RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/> <WordDetect attribute="Keyword" String="end" context="#stay" endRegion="def block"/>
<!-- elsif/else close the current block and start a new one --> <!-- elsif/else close the current block and start a new one -->
<RegExpr attribute="Keyword" String="\b(else|elsif|rescue|ensure)\b" context="#stay" endRegion="def block" beginRegion="def block"/> <RegExpr attribute="Keyword" String="\b(else|elsif|rescue|ensure)\b" context="#stay" endRegion="def block" beginRegion="def block"/>

View File

@@ -6,7 +6,7 @@
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*"> <!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);"> <!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]> ]>
<language name="XML" version="5" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/xml;application/scxml+xml" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL"> <language name="XML" version="6" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel" 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" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<highlighting> <highlighting>
<contexts> <contexts>

Some files were not shown because too many files have changed in this diff Show More