Merge remote-tracking branch 'origin/master' into 4.5

Change-Id: I9fff4705cd5a7c92ddb18318cd87d0fe6f263f7e
This commit is contained in:
Orgad Shaneh
2017-09-25 20:17:07 +03:00
47 changed files with 700 additions and 341 deletions

View File

@@ -44,12 +44,6 @@ void ClangCodeModelClientInterface::dispatch(const MessageEnvelop &messageEnvelo
case MessageType::CodeCompletedMessage: case MessageType::CodeCompletedMessage:
codeCompleted(messageEnvelop.message<CodeCompletedMessage>()); codeCompleted(messageEnvelop.message<CodeCompletedMessage>());
break; break;
case MessageType::TranslationUnitDoesNotExistMessage:
translationUnitDoesNotExist(messageEnvelop.message<TranslationUnitDoesNotExistMessage>());
break;
case MessageType::ProjectPartsDoNotExistMessage:
projectPartsDoNotExist(messageEnvelop.message<ProjectPartsDoNotExistMessage>());
break;
case MessageType::DocumentAnnotationsChangedMessage: case MessageType::DocumentAnnotationsChangedMessage:
documentAnnotationsChanged(messageEnvelop.message<DocumentAnnotationsChangedMessage>()); documentAnnotationsChanged(messageEnvelop.message<DocumentAnnotationsChangedMessage>());
break; break;

View File

@@ -35,7 +35,6 @@ class CodeCompletedMessage;
class CompleteCodeMessage; class CompleteCodeMessage;
class DocumentAnnotationsChangedMessage; class DocumentAnnotationsChangedMessage;
class EchoMessage; class EchoMessage;
class ProjectPartsDoNotExistMessage;
class ReferencesMessage; class ReferencesMessage;
class FollowSymbolMessage; class FollowSymbolMessage;
class RegisterProjectPartsForEditorMessage; class RegisterProjectPartsForEditorMessage;
@@ -44,7 +43,6 @@ class RegisterUnsavedFilesForEditorMessage;
class RequestDocumentAnnotationsMessage; class RequestDocumentAnnotationsMessage;
class RequestReferencesMessage; class RequestReferencesMessage;
class RequestFollowSymbolMessage; class RequestFollowSymbolMessage;
class TranslationUnitDoesNotExistMessage;
class UnregisterProjectPartsForEditorMessage; class UnregisterProjectPartsForEditorMessage;
class UnregisterTranslationUnitsForEditorMessage; class UnregisterTranslationUnitsForEditorMessage;
class UnregisterUnsavedFilesForEditorMessage; class UnregisterUnsavedFilesForEditorMessage;
@@ -59,8 +57,6 @@ public:
virtual void alive() = 0; virtual void alive() = 0;
virtual void echo(const EchoMessage &message) = 0; virtual void echo(const EchoMessage &message) = 0;
virtual void codeCompleted(const CodeCompletedMessage &message) = 0; virtual void codeCompleted(const CodeCompletedMessage &message) = 0;
virtual void translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message) = 0;
virtual void projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message) = 0;
virtual void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) = 0; virtual void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) = 0;
virtual void references(const ReferencesMessage &message) = 0; virtual void references(const ReferencesMessage &message) = 0;
virtual void followSymbol(const FollowSymbolMessage &message) = 0; virtual void followSymbol(const FollowSymbolMessage &message) = 0;

View File

@@ -29,7 +29,5 @@
#include "cmbcodecompletedmessage.h" #include "cmbcodecompletedmessage.h"
#include "cmbechomessage.h" #include "cmbechomessage.h"
#include "documentannotationschangedmessage.h" #include "documentannotationschangedmessage.h"
#include "projectpartsdonotexistmessage.h"
#include "referencesmessage.h" #include "referencesmessage.h"
#include "followsymbolmessage.h" #include "followsymbolmessage.h"
#include "translationunitdoesnotexistmessage.h"

View File

@@ -80,16 +80,6 @@ void ClangCodeModelClientProxy::codeCompleted(const CodeCompletedMessage &messag
m_writeMessageBlock.write(message); m_writeMessageBlock.write(message);
} }
void ClangCodeModelClientProxy::translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message)
{
m_writeMessageBlock.write(message);
}
void ClangCodeModelClientProxy::projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message)
{
m_writeMessageBlock.write(message);
}
void ClangCodeModelClientProxy::documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) void ClangCodeModelClientProxy::documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message)
{ {
m_writeMessageBlock.write(message); m_writeMessageBlock.write(message);

View File

@@ -54,8 +54,6 @@ public:
void alive() override; void alive() override;
void echo(const EchoMessage &message) override; void echo(const EchoMessage &message) override;
void codeCompleted(const CodeCompletedMessage &message) override; void codeCompleted(const CodeCompletedMessage &message) override;
void translationUnitDoesNotExist(const TranslationUnitDoesNotExistMessage &message) override;
void projectPartsDoNotExist(const ProjectPartsDoNotExistMessage &message) override;
void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) override; void documentAnnotationsChanged(const DocumentAnnotationsChangedMessage &message) override;
void references(const ReferencesMessage &message) override; void references(const ReferencesMessage &message) override;
void followSymbol(const FollowSymbolMessage &message) override; void followSymbol(const FollowSymbolMessage &message) override;

View File

@@ -53,7 +53,6 @@ SOURCES += \
$$PWD/projectpartcontainer.cpp \ $$PWD/projectpartcontainer.cpp \
$$PWD/projectpartcontainerv2.cpp \ $$PWD/projectpartcontainerv2.cpp \
$$PWD/projectpartpch.cpp \ $$PWD/projectpartpch.cpp \
$$PWD/projectpartsdonotexistmessage.cpp \
$$PWD/readmessageblock.cpp \ $$PWD/readmessageblock.cpp \
$$PWD/refactoringclientinterface.cpp \ $$PWD/refactoringclientinterface.cpp \
$$PWD/refactoringclientproxy.cpp \ $$PWD/refactoringclientproxy.cpp \
@@ -79,7 +78,6 @@ SOURCES += \
$$PWD/sourcerangescontainer.cpp \ $$PWD/sourcerangescontainer.cpp \
$$PWD/sourcerangesforquerymessage.cpp \ $$PWD/sourcerangesforquerymessage.cpp \
$$PWD/sourcerangewithtextcontainer.cpp \ $$PWD/sourcerangewithtextcontainer.cpp \
$$PWD/translationunitdoesnotexistmessage.cpp \
$$PWD/unregisterunsavedfilesforeditormessage.cpp \ $$PWD/unregisterunsavedfilesforeditormessage.cpp \
$$PWD/updatepchprojectpartsmessage.cpp \ $$PWD/updatepchprojectpartsmessage.cpp \
$$PWD/updatetranslationunitsforeditormessage.cpp \ $$PWD/updatetranslationunitsforeditormessage.cpp \
@@ -138,7 +136,6 @@ HEADERS += \
$$PWD/projectpartcontainer.h \ $$PWD/projectpartcontainer.h \
$$PWD/projectpartcontainerv2.h \ $$PWD/projectpartcontainerv2.h \
$$PWD/projectpartpch.h \ $$PWD/projectpartpch.h \
$$PWD/projectpartsdonotexistmessage.h \
$$PWD/readmessageblock.h \ $$PWD/readmessageblock.h \
$$PWD/refactoringclientinterface.h \ $$PWD/refactoringclientinterface.h \
$$PWD/refactoringclientproxy.h \ $$PWD/refactoringclientproxy.h \
@@ -165,7 +162,6 @@ HEADERS += \
$$PWD/sourcerangesforquerymessage.h \ $$PWD/sourcerangesforquerymessage.h \
$$PWD/sourcerangewithtextcontainer.h \ $$PWD/sourcerangewithtextcontainer.h \
$$PWD/stringcache.h \ $$PWD/stringcache.h \
$$PWD/translationunitdoesnotexistmessage.h \
$$PWD/unregisterunsavedfilesforeditormessage.h \ $$PWD/unregisterunsavedfilesforeditormessage.h \
$$PWD/updatepchprojectpartsmessage.h \ $$PWD/updatepchprojectpartsmessage.h \
$$PWD/updatetranslationunitsforeditormessage.h \ $$PWD/updatetranslationunitsforeditormessage.h \

View File

@@ -124,9 +124,6 @@ enum class MessageType : quint8 {
CompleteCodeMessage, CompleteCodeMessage,
CodeCompletedMessage, CodeCompletedMessage,
TranslationUnitDoesNotExistMessage,
ProjectPartsDoNotExistMessage,
SourceLocationsForRenamingMessage, SourceLocationsForRenamingMessage,
RequestSourceLocationsForRenamingMessage, RequestSourceLocationsForRenamingMessage,

View File

@@ -83,12 +83,6 @@ QDebug operator<<(QDebug debug, const MessageEnvelop &messageEnvelop)
case MessageType::ReferencesMessage: case MessageType::ReferencesMessage:
qDebug() << messageEnvelop.message<ReferencesMessage>(); qDebug() << messageEnvelop.message<ReferencesMessage>();
break; break;
case MessageType::TranslationUnitDoesNotExistMessage:
qDebug() << messageEnvelop.message<TranslationUnitDoesNotExistMessage>();
break;
case MessageType::ProjectPartsDoNotExistMessage:
qDebug() << messageEnvelop.message<ProjectPartsDoNotExistMessage>();
break;
case MessageType::DocumentAnnotationsChangedMessage: case MessageType::DocumentAnnotationsChangedMessage:
qDebug() << messageEnvelop.message<DocumentAnnotationsChangedMessage>(); qDebug() << messageEnvelop.message<DocumentAnnotationsChangedMessage>();
break; break;

View File

@@ -1,77 +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.
**
****************************************************************************/
#pragma once
#include "clangsupport_global.h"
#include <utf8stringvector.h>
#include <QDataStream>
namespace ClangBackEnd {
class ProjectPartsDoNotExistMessage
{
public:
ProjectPartsDoNotExistMessage() = default;
ProjectPartsDoNotExistMessage(const Utf8StringVector &projectPartIds)
: m_projectPartIds(projectPartIds)
{
}
const Utf8StringVector &projectPartIds() const
{
return m_projectPartIds;
}
friend QDataStream &operator<<(QDataStream &out, const ProjectPartsDoNotExistMessage &message)
{
out << message.m_projectPartIds;
return out;
}
friend QDataStream &operator>>(QDataStream &in, ProjectPartsDoNotExistMessage &message)
{
in >> message.m_projectPartIds;
return in;
}
friend bool operator==(const ProjectPartsDoNotExistMessage &first, const ProjectPartsDoNotExistMessage &second)
{
return first.m_projectPartIds == second.m_projectPartIds;
}
private:
Utf8StringVector m_projectPartIds;
};
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const ProjectPartsDoNotExistMessage &message);
std::ostream &operator<<(std::ostream &os, const ProjectPartsDoNotExistMessage &message);
DECLARE_MESSAGE(ProjectPartsDoNotExistMessage)
} // namespace ClangBackEnd

View File

@@ -1,88 +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.
**
****************************************************************************/
#pragma once
#include "filecontainer.h"
namespace ClangBackEnd {
class TranslationUnitDoesNotExistMessage
{
public:
TranslationUnitDoesNotExistMessage() = default;
TranslationUnitDoesNotExistMessage(const FileContainer &fileContainer)
: m_fileContainer(fileContainer)
{
}
TranslationUnitDoesNotExistMessage(const Utf8String &filePath, const Utf8String &projectPartId)
: m_fileContainer(filePath, projectPartId)
{
}
const FileContainer &fileContainer() const
{
return m_fileContainer;
}
const Utf8String &filePath() const
{
return m_fileContainer.filePath();
}
const Utf8String &projectPartId() const
{
return m_fileContainer.projectPartId();
}
friend QDataStream &operator<<(QDataStream &out, const TranslationUnitDoesNotExistMessage &message)
{
out << message.m_fileContainer;
return out;
}
friend QDataStream &operator>>(QDataStream &in, TranslationUnitDoesNotExistMessage &message)
{
in >> message.m_fileContainer;
return in;
}
friend bool operator==(const TranslationUnitDoesNotExistMessage &first, const TranslationUnitDoesNotExistMessage &second)
{
return first.m_fileContainer == second.m_fileContainer;
}
private:
FileContainer m_fileContainer;
};
CMBIPC_EXPORT QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message);
std::ostream &operator<<(std::ostream &os, const TranslationUnitDoesNotExistMessage &message);
DECLARE_MESSAGE(TranslationUnitDoesNotExistMessage)
} // namespace ClangBackEnd

View File

@@ -47,6 +47,7 @@
#include <QSysInfo> #include <QSysInfo>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/benchmarker.h>
#include <utils/executeondestruction.h> #include <utils/executeondestruction.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/mimetypes/mimedatabase.h> #include <utils/mimetypes/mimedatabase.h>
@@ -1559,6 +1560,13 @@ void PluginManagerPrivate::profilingReport(const char *what, const PluginSpec *s
qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS); qDebug("%-22s %-22s %8dms (%8dms)", what, qPrintable(spec->name()), absoluteElapsedMS, elapsedMS);
else else
qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS); qDebug("%-45s %8dms (%8dms)", what, absoluteElapsedMS, elapsedMS);
if (what && *what == '<') {
QString tc;
if (spec)
tc = spec->name() + '_';
tc += QString::fromUtf8(QByteArray(what + 1));
Utils::Benchmarker::report("loadPlugins", tc, elapsedMS);
}
} }
} }
@@ -1579,6 +1587,7 @@ void PluginManagerPrivate::profilingSummary() const
qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it.value()->name()), qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it.value()->name()),
it.key(), 100.0 * it.key() / total); it.key(), 100.0 * it.key() / total);
qDebug("Total: %8dms", total); qDebug("Total: %8dms", total);
Utils::Benchmarker::report("loadPlugins", "Total", total);
} }
} }

View File

@@ -0,0 +1,67 @@
/****************************************************************************
**
** 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 "benchmarker.h"
#include <QLoggingCategory>
static Q_LOGGING_CATEGORY(benchmarksLog, "qtc.benchmark");
namespace Utils {
Benchmarker::Benchmarker(const QString &testsuite, const QString &testcase,
const QString &tagData) :
m_tagData(tagData),
m_testsuite(testsuite),
m_testcase(testcase)
{
m_timer.start();
}
Benchmarker::~Benchmarker()
{
if (m_timer.isValid())
report(m_timer.elapsed());
}
void Benchmarker::report(qint64 ms)
{
m_timer.invalidate();
report(m_testsuite, m_testcase, ms, m_tagData);
}
void Benchmarker::report(const QString &testsuite, const QString &testcase, qint64 ms,
const QString &tags)
{
QString t = "unit=ms";
if (!tags.isEmpty())
t += "," + tags;
qCDebug(benchmarksLog, "%s::%s: %lld { %s }",
testsuite.toUtf8().data(), testcase.toUtf8().data(), ms, t.toUtf8().data());
}
} // 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.
@@ -23,33 +23,31 @@
** **
****************************************************************************/ ****************************************************************************/
#include "projectpartsdonotexistmessage.h" #pragma once
#include <QDebug> #include "utils_global.h"
#include <ostream> #include <QString>
#include <QElapsedTimer>
namespace ClangBackEnd { namespace Utils {
QDebug operator<<(QDebug debug, const ProjectPartsDoNotExistMessage &message) class QTCREATOR_UTILS_EXPORT Benchmarker
{ {
debug.nospace() << "ProjectPartDoesNotExistMessage("; public:
Benchmarker(const QString &testsuite, const QString &testcase,
const QString &tags = QString());
~Benchmarker();
debug.nospace() << message.projectPartIds(); void report(qint64 ms);
static void report(const QString &testsuite, const QString &testcase, qint64 ms,
const QString &tags = QString());
debug.nospace() << ")"; private:
QElapsedTimer m_timer;
return debug; QString m_tagData;
} QString m_testsuite;
QString m_testcase;
std::ostream &operator<<(std::ostream &os, const ProjectPartsDoNotExistMessage &message) };
{
os << "("
<< message.projectPartIds()
<< ")";
return os;
}
} // namespace ClangBackEnd
} // namespace Utils

View File

@@ -21,7 +21,9 @@ win32: LIBS += -luser32 -lshell32
# PortsGatherer # PortsGatherer
win32: LIBS += -liphlpapi -lws2_32 win32: LIBS += -liphlpapi -lws2_32
SOURCES += $$PWD/environment.cpp \ SOURCES += \
$$PWD/benchmarker.cpp \
$$PWD/environment.cpp \
$$PWD/environmentmodel.cpp \ $$PWD/environmentmodel.cpp \
$$PWD/environmentdialog.cpp \ $$PWD/environmentdialog.cpp \
$$PWD/qtcprocess.cpp \ $$PWD/qtcprocess.cpp \
@@ -122,6 +124,7 @@ win32:SOURCES += $$PWD/consoleprocess_win.cpp
else:SOURCES += $$PWD/consoleprocess_unix.cpp else:SOURCES += $$PWD/consoleprocess_unix.cpp
HEADERS += \ HEADERS += \
$$PWD/benchmarker.h \
$$PWD/environment.h \ $$PWD/environment.h \
$$PWD/environmentmodel.h \ $$PWD/environmentmodel.h \
$$PWD/environmentdialog.h \ $$PWD/environmentdialog.h \

View File

@@ -48,6 +48,8 @@ Project {
"appmainwindow.h", "appmainwindow.h",
"basetreeview.cpp", "basetreeview.cpp",
"basetreeview.h", "basetreeview.h",
"benchmarker.cpp",
"benchmarker.h",
"bracematcher.cpp", "bracematcher.cpp",
"bracematcher.h", "bracematcher.h",
"buildablehelperlibrary.cpp", "buildablehelperlibrary.cpp",

View File

@@ -94,9 +94,6 @@ private:
void references(const ClangBackEnd::ReferencesMessage &message) override; void references(const ClangBackEnd::ReferencesMessage &message) override;
void followSymbol(const ClangBackEnd::FollowSymbolMessage &message) override; void followSymbol(const ClangBackEnd::FollowSymbolMessage &message) override;
void translationUnitDoesNotExist(const ClangBackEnd::TranslationUnitDoesNotExistMessage &) override {}
void projectPartsDoNotExist(const ClangBackEnd::ProjectPartsDoNotExistMessage &) override {}
private: private:
AliveHandler m_aliveHandler; AliveHandler m_aliveHandler;
QHash<quint64, ClangCompletionAssistProcessor *> m_assistProcessorsTable; QHash<quint64, ClangCompletionAssistProcessor *> m_assistProcessorsTable;

View File

@@ -50,7 +50,9 @@ std::unique_ptr<SearchHandle> QtCreatorSearch::startNewSearch(const QString &sea
QObject::connect(searchResult, QObject::connect(searchResult,
&Core::SearchResult::activated, &Core::SearchResult::activated,
&QtCreatorSearch::openEditor); [](const Core::SearchResultItem& item) {
Core::EditorManager::openEditorAtSearchResult(item);
});
auto searchHandle = std::unique_ptr<SearchHandle>(new QtCreatorSearchHandle(searchResult)); auto searchHandle = std::unique_ptr<SearchHandle>(new QtCreatorSearchHandle(searchResult));
@@ -61,11 +63,4 @@ std::unique_ptr<SearchHandle> QtCreatorSearch::startNewSearch(const QString &sea
return searchHandle; return searchHandle;
} }
void QtCreatorSearch::openEditor(const Core::SearchResultItem &item)
{
Core::EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
item.mainRange.begin.line,
item.mainRange.begin.column);
}
} // namespace ClangRefactoring } // namespace ClangRefactoring

View File

@@ -43,9 +43,6 @@ public:
std::unique_ptr<SearchHandle> startNewSearch(const QString &searchLabel, std::unique_ptr<SearchHandle> startNewSearch(const QString &searchLabel,
const QString &searchTerm); const QString &searchTerm);
private:
static void openEditor(const Core::SearchResultItem &item);
private: private:
Core::SearchResultWindow &searchResultWindow; Core::SearchResultWindow &searchResultWindow;
}; };

View File

@@ -48,6 +48,7 @@
#include <coreplugin/editortoolbar.h> #include <coreplugin/editortoolbar.h>
#include <coreplugin/fileutils.h> #include <coreplugin/fileutils.h>
#include <coreplugin/findplaceholder.h> #include <coreplugin/findplaceholder.h>
#include <coreplugin/find/searchresultitem.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/imode.h> #include <coreplugin/imode.h>
#include <coreplugin/infobar.h> #include <coreplugin/infobar.h>
@@ -2646,6 +2647,17 @@ IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int colu
fileName, line, column, editorId, flags, newEditor); fileName, line, column, editorId, flags, newEditor);
} }
void EditorManager::openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags)
{
if (item.path.empty()) {
openEditor(QDir::fromNativeSeparators(item.text), Id(), flags);
return;
}
openEditorAt(QDir::fromNativeSeparators(item.path.first()), item.mainRange.begin.line,
item.mainRange.begin.column, Id(), flags);
}
EditorManager::FilePathInfo EditorManager::splitLineAndColumnNumber(const QString &fullFilePath) EditorManager::FilePathInfo EditorManager::splitLineAndColumnNumber(const QString &fullFilePath)
{ {
// :10:2 GCC/Clang-style // :10:2 GCC/Clang-style

View File

@@ -50,6 +50,7 @@ class IMode;
class IVersionControl; class IVersionControl;
class EditorToolBar; class EditorToolBar;
class SearchResultItem;
enum MakeWritableResult { enum MakeWritableResult {
OpenedWithVersionControl, OpenedWithVersionControl,
@@ -114,6 +115,7 @@ public:
static IEditor *openEditorAt(const QString &fileName, int line, int column = 0, static IEditor *openEditorAt(const QString &fileName, int line, int column = 0,
Id editorId = Id(), OpenEditorFlags flags = NoFlags, Id editorId = Id(), OpenEditorFlags flags = NoFlags,
bool *newEditor = 0); bool *newEditor = 0);
static void openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags = NoFlags);
static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0, static IEditor *openEditorWithContents(Id editorId, QString *titlePattern = 0,
const QByteArray &contents = QByteArray(), const QByteArray &contents = QByteArray(),
const QString &uniqueId = QString(), const QString &uniqueId = QString(),

View File

@@ -370,7 +370,9 @@ void CppFindReferences::findAll_helper(SearchResult *search, Symbol *symbol,
return; return;
} }
connect(search, &SearchResult::activated, connect(search, &SearchResult::activated,
this, &CppFindReferences::openEditor); [](const SearchResultItem& item) {
Core::EditorManager::openEditorAtSearchResult(item);
});
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus); SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
const WorkingCopy workingCopy = m_modelManager->workingCopy(); const WorkingCopy workingCopy = m_modelManager->workingCopy();
@@ -589,18 +591,6 @@ static void searchFinished(SearchResult *search, QFutureWatcher<Usage> *watcher)
watcher->deleteLater(); watcher->deleteLater();
} }
void CppFindReferences::openEditor(const SearchResultItem &item)
{
if (item.path.size() > 0) {
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
item.mainRange.begin.line,
item.mainRange.begin.column);
} else {
EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
}
}
namespace { namespace {
class FindMacroUsesInFile: public std::unary_function<QString, QList<Usage> > class FindMacroUsesInFile: public std::unary_function<QString, QList<Usage> >
@@ -728,7 +718,9 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro &macro, const QStri
SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus); SearchResultWindow::instance()->popup(IOutputPane::ModeSwitch | IOutputPane::WithFocus);
connect(search, &SearchResult::activated, connect(search, &SearchResult::activated,
this, &CppFindReferences::openEditor); [](const Core::SearchResultItem& item) {
Core::EditorManager::openEditorAtSearchResult(item);
});
const Snapshot snapshot = m_modelManager->snapshot(); const Snapshot snapshot = m_modelManager->snapshot();
const WorkingCopy workingCopy = m_modelManager->workingCopy(); const WorkingCopy workingCopy = m_modelManager->workingCopy();

View File

@@ -77,7 +77,6 @@ public:
void renameMacroUses(const CPlusPlus::Macro &macro, const QString &replacement = QString()); void renameMacroUses(const CPlusPlus::Macro &macro, const QString &replacement = QString());
private: private:
void openEditor(const Core::SearchResultItem &item);
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase); void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
void searchAgain(); void searchAgain();

View File

@@ -78,7 +78,9 @@ SOURCES += $$PWD/model/abstractview.cpp \
$$PWD/model/signalhandlerproperty.cpp \ $$PWD/model/signalhandlerproperty.cpp \
$$PWD/model/internalsignalhandlerproperty.cpp \ $$PWD/model/internalsignalhandlerproperty.cpp \
$$PWD/model/anchorline.cpp \ $$PWD/model/anchorline.cpp \
$$PWD/instances/puppetdialog.cpp $$PWD/instances/puppetdialog.cpp \
$$PWD/model/qmltimelinemutator.cpp \
$$PWD/model/qmltimelinekeyframes.cpp
HEADERS += $$PWD/include/qmldesignercorelib_global.h \ HEADERS += $$PWD/include/qmldesignercorelib_global.h \
$$PWD/include/abstractview.h \ $$PWD/include/abstractview.h \
@@ -152,7 +154,9 @@ HEADERS += $$PWD/include/qmldesignercorelib_global.h \
$$PWD/include/signalhandlerproperty.h \ $$PWD/include/signalhandlerproperty.h \
$$PWD/model/internalsignalhandlerproperty.h \ $$PWD/model/internalsignalhandlerproperty.h \
$$PWD/include/anchorline.h \ $$PWD/include/anchorline.h \
$$PWD/instances/puppetdialog.h $$PWD/instances/puppetdialog.h \
$$PWD/include/qmltimelinemutator.h \
$$PWD/include/qmltimelinekeyframes.h \
FORMS += \ FORMS += \
$$PWD/instances/puppetdialog.ui $$PWD/instances/puppetdialog.ui

View File

@@ -55,6 +55,7 @@ namespace QmlDesigner {
class NodeInstanceView; class NodeInstanceView;
class RewriterView; class RewriterView;
class QmlModelState; class QmlModelState;
class QmlTimelineMutator;
enum DesignerWidgetFlags { enum DesignerWidgetFlags {
DisableOnError, DisableOnError,
@@ -232,6 +233,8 @@ public:
virtual void documentMessagesChanged(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings); virtual void documentMessagesChanged(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings);
virtual void currentTimelineChanged(const ModelNode &node);
void changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion); void changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion);
NodeInstanceView *nodeInstanceView() const; NodeInstanceView *nodeInstanceView() const;
@@ -240,6 +243,7 @@ public:
void setCurrentStateNode(const ModelNode &node); void setCurrentStateNode(const ModelNode &node);
ModelNode currentStateNode() const; ModelNode currentStateNode() const;
QmlModelState currentState() const; QmlModelState currentState() const;
QmlTimelineMutator currentTimeline() const;
int majorQtQuickVersion() const; int majorQtQuickVersion() const;
int minorQtQuickVersion() const; int minorQtQuickVersion() const;
@@ -253,6 +257,9 @@ public:
virtual QString contextHelpId() const; virtual QString contextHelpId() const;
void activateTimelineRecording(const ModelNode &mutator);
void deactivateTimelineRecording();
protected: protected:
void setModel(Model * model); void setModel(Model * model);
void removeModel(); void removeModel();

View File

@@ -28,6 +28,7 @@
#include <qmldesignercorelib_global.h> #include <qmldesignercorelib_global.h>
#include "qmlmodelnodefacade.h" #include "qmlmodelnodefacade.h"
#include "qmlstate.h" #include "qmlstate.h"
#include "qmltimelinemutator.h"
#include "qmlchangeset.h" #include "qmlchangeset.h"
#include <nodeinstance.h> #include <nodeinstance.h>
@@ -63,6 +64,7 @@ public:
QString validId(); QString validId();
QmlModelState currentState() const; QmlModelState currentState() const;
QmlTimelineMutator currentTimeline() const;
void setVariantProperty(const PropertyName &name, const QVariant &value); void setVariantProperty(const PropertyName &name, const QVariant &value);
void setBindingProperty(const PropertyName &name, const QString &expression); void setBindingProperty(const PropertyName &name, const QString &expression);
NodeAbstractProperty nodeAbstractProperty(const PropertyName &name) const; NodeAbstractProperty nodeAbstractProperty(const PropertyName &name) const;
@@ -83,6 +85,7 @@ public:
QString stripedTranslatableText(const PropertyName &name) const; QString stripedTranslatableText(const PropertyName &name) const;
QString expression(const PropertyName &name) const; QString expression(const PropertyName &name) const;
bool isInBaseState() const; bool isInBaseState() const;
bool timelineIsActive() const;
QmlPropertyChanges propertyChangeForCurrentState() const; QmlPropertyChanges propertyChangeForCurrentState() const;
virtual bool instanceCanReparent() const; virtual bool instanceCanReparent() const;

View File

@@ -72,7 +72,6 @@ public:
protected: protected:
void addChangeSetIfNotExists(const ModelNode &node); void addChangeSetIfNotExists(const ModelNode &node);
static QmlModelState createBaseState(const AbstractView *view); static QmlModelState createBaseState(const AbstractView *view);
}; };
} //QmlDesigner } //QmlDesigner

View File

@@ -23,33 +23,43 @@
** **
****************************************************************************/ ****************************************************************************/
#include "translationunitdoesnotexistmessage.h" #pragma once
#include <QDebug> #include <qmldesignercorelib_global.h>
#include "qmlmodelnodefacade.h"
#include "qmlchangeset.h"
#include <ostream> namespace QmlDesigner {
namespace ClangBackEnd { class AbstractViewAbstractVieweGroup;
class QmlObjectNode;
QDebug operator<<(QDebug debug, const TranslationUnitDoesNotExistMessage &message) class QMLDESIGNERCORE_EXPORT QmlTimelineFrames : public QmlModelNodeFacade
{ {
debug.nospace() << "TranslationUnitDoesNotExistMessage(";
debug.nospace() << message.fileContainer(); public:
QmlTimelineFrames();
QmlTimelineFrames(const ModelNode &modelNode);
debug.nospace() << ")"; bool isValid() const;
static bool isValidQmlTimelineFrames(const ModelNode &modelNode);
void destroy();
return debug; ModelNode target() const;
} void setTarget(const ModelNode &target);
std::ostream &operator<<(std::ostream &os, const TranslationUnitDoesNotExistMessage &message) PropertyName propertyName() const;
{ void setPropertyName(const PropertyName &propertyName);
os << "("
<< message.fileContainer()
<< ")";
return os; void setValue(const QVariant &value, qreal frame);
} QVariant value(qreal frame) const;
} // namespace ClangBackEnd qreal currentFrame() const;
bool hasKeyframe(qreal frame);
static bool isValidKeyframe(const ModelNode &node);
static QmlTimelineFrames keyframesForKeyframe(const ModelNode &node);
};
} //QmlDesigner

View File

@@ -0,0 +1,62 @@
/****************************************************************************
**
** 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.
**
****************************************************************************/
#pragma once
#include <qmldesignercorelib_global.h>
#include "qmlmodelnodefacade.h"
namespace QmlDesigner {
class AbstractViewAbstractVieweGroup;
class QmlObjectNode;
class QmlModelStateGroup;
class QmlTimelineFrames;
class QMLDESIGNERCORE_EXPORT QmlTimelineMutator : public QmlModelNodeFacade
{
public:
QmlTimelineMutator();
QmlTimelineMutator(const ModelNode &modelNode);
bool isValid() const;
static bool isValidQmlTimelineMutator(const ModelNode &modelNode);
void destroy();
QmlTimelineFrames timelineFrames(const ModelNode &modelNode, const PropertyName &propertyName);
bool hasTimeline(const ModelNode &modelNode, const PropertyName &propertyName);
qreal startFrame() const;
qreal endFrame() const;
qreal currentFrame() const;
private:
void addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName);
bool hasFrames(const ModelNode &node, const PropertyName &propertyName) const;
QList<QmlTimelineFrames> frames() const;
};
} //QmlDesigner

View File

@@ -43,6 +43,9 @@
#include "nodelistproperty.h" #include "nodelistproperty.h"
#include "nodeproperty.h" #include "nodeproperty.h"
#include "qmlchangeset.h" #include "qmlchangeset.h"
#include "qmlstate.h"
#include "qmltimelinemutator.h"
#include "qmltimelinekeyframes.h"
#include "createscenecommand.h" #include "createscenecommand.h"
#include "createinstancescommand.h" #include "createinstancescommand.h"
@@ -651,13 +654,13 @@ void NodeInstanceView::updateChildren(const NodeAbstractProperty &newPropertyPar
void setXValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash) void setXValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash)
{ {
instance.setX(variantProperty.value().toDouble()); instance.setX(variantProperty.value().toDouble());
informationChangeHash.insert(variantProperty.parentModelNode(), Transform); informationChangeHash.insert(instance.modelNode(), Transform);
} }
void setYValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash) void setYValue(NodeInstance &instance, const VariantProperty &variantProperty, QMultiHash<ModelNode, InformationName> &informationChangeHash)
{ {
instance.setY(variantProperty.value().toDouble()); instance.setY(variantProperty.value().toDouble());
informationChangeHash.insert(variantProperty.parentModelNode(), Transform); informationChangeHash.insert(instance.modelNode(), Transform);
} }
@@ -668,7 +671,7 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
foreach (const VariantProperty &variantProperty, propertyList) { foreach (const VariantProperty &variantProperty, propertyList) {
if (variantProperty.name() == "x") { if (variantProperty.name() == "x") {
const ModelNode modelNode = variantProperty.parentModelNode(); const ModelNode modelNode = variantProperty.parentModelNode();
if (QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) { if (!currentState().isBaseState() && QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
ModelNode targetModelNode = QmlPropertyChanges(modelNode).target(); ModelNode targetModelNode = QmlPropertyChanges(modelNode).target();
if (targetModelNode.isValid()) { if (targetModelNode.isValid()) {
NodeInstance instance = instanceForModelNode(targetModelNode); NodeInstance instance = instanceForModelNode(targetModelNode);
@@ -680,7 +683,7 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
} }
} else if (variantProperty.name() == "y") { } else if (variantProperty.name() == "y") {
const ModelNode modelNode = variantProperty.parentModelNode(); const ModelNode modelNode = variantProperty.parentModelNode();
if (QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) { if (!currentState().isBaseState() && QmlPropertyChanges::isValidQmlPropertyChanges(modelNode)) {
ModelNode targetModelNode = QmlPropertyChanges(modelNode).target(); ModelNode targetModelNode = QmlPropertyChanges(modelNode).target();
if (targetModelNode.isValid()) { if (targetModelNode.isValid()) {
NodeInstance instance = instanceForModelNode(targetModelNode); NodeInstance instance = instanceForModelNode(targetModelNode);
@@ -690,6 +693,21 @@ void NodeInstanceView::updatePosition(const QList<VariantProperty> &propertyList
NodeInstance instance = instanceForModelNode(modelNode); NodeInstance instance = instanceForModelNode(modelNode);
setYValue(instance, variantProperty, informationChangeHash); setYValue(instance, variantProperty, informationChangeHash);
} }
} else if (currentTimeline().isValid()
&& variantProperty.name() == "value"
&& QmlTimelineFrames::isValidKeyframe(variantProperty.parentModelNode())) {
QmlTimelineFrames frames = QmlTimelineFrames::keyframesForKeyframe(variantProperty.parentModelNode());
if (frames.isValid() && frames.propertyName() == "x" && frames.target().isValid()) {
NodeInstance instance = instanceForModelNode(frames.target());
setXValue(instance, variantProperty, informationChangeHash);
} else if (frames.isValid() && frames.propertyName() == "y" && frames.target().isValid()) {
NodeInstance instance = instanceForModelNode(frames.target());
setYValue(instance, variantProperty, informationChangeHash);
}
} }
} }

View File

@@ -30,6 +30,7 @@
#include "internalnode_p.h" #include "internalnode_p.h"
#include "nodeinstanceview.h" #include "nodeinstanceview.h"
#include <qmlstate.h> #include <qmlstate.h>
#include <qmltimelinemutator.h>
#ifndef QMLDESIGNER_TEST #ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h> #include <qmldesignerplugin.h>
@@ -359,6 +360,11 @@ void AbstractView::documentMessagesChanged(const QList<DocumentMessage> &/*error
{ {
} }
void AbstractView::currentTimelineChanged(const ModelNode & /*node*/)
{
}
QList<ModelNode> AbstractView::toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList) const QList<ModelNode> AbstractView::toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList) const
{ {
return QmlDesigner::toModelNodeList(nodeList, const_cast<AbstractView*>(this)); return QmlDesigner::toModelNodeList(nodeList, const_cast<AbstractView*>(this));
@@ -565,6 +571,21 @@ QString AbstractView::contextHelpId() const
return helpId; return helpId;
} }
void AbstractView::activateTimelineRecording(const ModelNode &mutator)
{
Internal::WriteLocker locker(m_model.data());
if (model())
model()->d->notifyCurrentTimelineChanged(mutator);
}
void AbstractView::deactivateTimelineRecording()
{
Internal::WriteLocker locker(m_model.data());
if (model())
model()->d->notifyCurrentTimelineChanged(ModelNode());
}
QList<ModelNode> AbstractView::allModelNodes() const QList<ModelNode> AbstractView::allModelNodes() const
{ {
return toModelNodeList(model()->d->allNodes()); return toModelNodeList(model()->d->allNodes());
@@ -688,6 +709,16 @@ QmlModelState AbstractView::currentState() const
return QmlModelState(currentStateNode()); return QmlModelState(currentStateNode());
} }
QmlTimelineMutator AbstractView::currentTimeline() const
{
if (model())
return QmlTimelineMutator(ModelNode(m_model.data()->d->currentTimelineNode(),
m_model.data(),
const_cast<AbstractView*>(this)));
return QmlTimelineMutator();
}
static int getMinorVersionFromImport(const Model *model) static int getMinorVersionFromImport(const Model *model)
{ {
foreach (const Import &import, model->imports()) { foreach (const Import &import, model->imports()) {

View File

@@ -85,6 +85,7 @@ ModelPrivate::ModelPrivate(Model *model) :
{ {
m_rootInternalNode = createNode("QtQuick.Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true); m_rootInternalNode = createNode("QtQuick.Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true);
m_currentStateNode = m_rootInternalNode; m_currentStateNode = m_rootInternalNode;
m_currentTimelineMutatorNode = m_rootInternalNode;
} }
ModelPrivate::~ModelPrivate() ModelPrivate::~ModelPrivate()
@@ -641,6 +642,33 @@ void ModelPrivate::notifyCurrentStateChanged(const ModelNode &node)
resetModelByRewriter(description); resetModelByRewriter(description);
} }
void ModelPrivate::notifyCurrentTimelineChanged(const ModelNode &node)
{
bool resetModel = false;
QString description;
m_currentTimelineMutatorNode = node.internalNode();
try {
if (rewriterView())
rewriterView()->currentTimelineChanged(ModelNode(node.internalNode(), model(), rewriterView()));
} catch (const RewritingException &e) {
description = e.description();
resetModel = true;
}
for (const QPointer<AbstractView> &view : m_viewList) {
Q_ASSERT(view != 0);
view->currentTimelineChanged(ModelNode(node.internalNode(), model(), view.data()));
}
if (nodeInstanceView())
nodeInstanceView()->currentTimelineChanged(ModelNode(node.internalNode(), model(), nodeInstanceView()));
if (resetModel)
resetModelByRewriter(description);
}
void ModelPrivate::notifyRewriterBeginTransaction() void ModelPrivate::notifyRewriterBeginTransaction()
{ {
bool resetModel = false; bool resetModel = false;
@@ -1707,6 +1735,11 @@ NodeInstanceView *ModelPrivate::nodeInstanceView() const
return m_nodeInstanceView.data(); return m_nodeInstanceView.data();
} }
InternalNodePointer ModelPrivate::currentTimelineNode() const
{
return m_currentTimelineMutatorNode;
}
InternalNodePointer ModelPrivate::nodeForId(const QString &id) const InternalNodePointer ModelPrivate::nodeForId(const QString &id) const
{ {
return m_idNodeHash.value(id); return m_idNodeHash.value(id);

View File

@@ -157,6 +157,7 @@ public:
void notifyInstanceToken(const QString &token, int number, const QVector<ModelNode> &nodeVector); void notifyInstanceToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
void notifyCurrentStateChanged(const ModelNode &node); void notifyCurrentStateChanged(const ModelNode &node);
void notifyCurrentTimelineChanged(const ModelNode &node);
void setDocumentMessages(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings); void setDocumentMessages(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings);
@@ -226,6 +227,7 @@ public:
NodeInstanceView *nodeInstanceView() const; NodeInstanceView *nodeInstanceView() const;
InternalNodePointer currentStateNode() const; InternalNodePointer currentStateNode() const;
InternalNodePointer currentTimelineNode() const;
private: //functions private: //functions
void removePropertyWithoutNotification(const InternalPropertyPointer &property); void removePropertyWithoutNotification(const InternalPropertyPointer &property);
@@ -249,6 +251,7 @@ private:
QSet<InternalNodePointer> m_nodeSet; QSet<InternalNodePointer> m_nodeSet;
InternalNodePointer m_currentStateNode; InternalNodePointer m_currentStateNode;
InternalNodePointer m_rootInternalNode; InternalNodePointer m_rootInternalNode;
InternalNodePointer m_currentTimelineMutatorNode;
QUrl m_fileUrl; QUrl m_fileUrl;
QPointer<RewriterView> m_rewriterView; QPointer<RewriterView> m_rewriterView;
QPointer<NodeInstanceView> m_nodeInstanceView; QPointer<NodeInstanceView> m_nodeInstanceView;

View File

@@ -26,6 +26,7 @@
#include "qmlobjectnode.h" #include "qmlobjectnode.h"
#include "qmlitemnode.h" #include "qmlitemnode.h"
#include "qmlstate.h" #include "qmlstate.h"
#include "qmltimelinekeyframes.h"
#include "variantproperty.h" #include "variantproperty.h"
#include "nodeproperty.h" #include "nodeproperty.h"
#include <invalidmodelnodeexception.h> #include <invalidmodelnodeexception.h>
@@ -48,6 +49,19 @@ void QmlObjectNode::setVariantProperty(const PropertyName &name, const QVariant
if (!isValid()) if (!isValid())
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (timelineIsActive()) {
modelNode().validId();
QmlTimelineFrames timelineFrames(currentTimeline().timelineFrames(modelNode(), name));
Q_ASSERT(timelineFrames.isValid());
qreal frame = currentTimeline().modelNode().auxiliaryData("currentFrame@NodeInstance").toReal();
timelineFrames.setValue(value, frame);
return;
}
if (isInBaseState()) { if (isInBaseState()) {
modelNode().variantProperty(name).setValue(value); //basestate modelNode().variantProperty(name).setValue(value); //basestate
} else { } else {
@@ -83,6 +97,14 @@ QmlModelState QmlObjectNode::currentState() const
return QmlModelState(); return QmlModelState();
} }
QmlTimelineMutator QmlObjectNode::currentTimeline() const
{
if (isValid())
return view()->currentTimeline();
else
return QmlTimelineMutator();
}
bool QmlObjectNode::isRootModelNode() const bool QmlObjectNode::isRootModelNode() const
{ {
return modelNode().isRootNode(); return modelNode().isRootNode();
@@ -161,6 +183,9 @@ bool QmlObjectNode::propertyAffectedByCurrentState(const PropertyName &name) con
if (currentState().isBaseState()) if (currentState().isBaseState())
return modelNode().hasProperty(name); return modelNode().hasProperty(name);
if (timelineIsActive() && currentTimeline().hasTimeline(modelNode(), name))
return true;
if (!currentState().hasPropertyChanges(modelNode())) if (!currentState().hasPropertyChanges(modelNode()))
return false; return false;
@@ -172,6 +197,21 @@ QVariant QmlObjectNode::modelValue(const PropertyName &name) const
if (!isValid()) if (!isValid())
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (timelineIsActive() && currentTimeline().hasTimeline(modelNode(), name)) {
QmlTimelineFrames timelineFrames(currentTimeline().timelineFrames(modelNode(), name));
Q_ASSERT(timelineFrames.isValid());
qreal frame = currentTimeline().modelNode().auxiliaryData("currentFrame@NodeInstance").toReal();
QVariant value = timelineFrames.value(frame);
if (!value.isValid()) //interpolation is not done in the model
value = instanceValue(name);
return value;
}
if (currentState().isBaseState()) if (currentState().isBaseState())
return modelNode().variantProperty(name).value(); return modelNode().variantProperty(name).value();
@@ -239,6 +279,11 @@ bool QmlObjectNode::isInBaseState() const
return currentState().isBaseState(); return currentState().isBaseState();
} }
bool QmlObjectNode::timelineIsActive() const
{
return currentTimeline().isValid();
}
bool QmlObjectNode::instanceCanReparent() const bool QmlObjectNode::instanceCanReparent() const
{ {
return isInBaseState(); return isInBaseState();

View File

@@ -0,0 +1,147 @@
/****************************************************************************
**
** 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 "qmltimelinekeyframes.h"
#include "abstractview.h"
#include <nodelistproperty.h>
#include <variantproperty.h>
#include <metainfo.h>
#include <invalidmodelnodeexception.h>
#include "bindingproperty.h"
#include "qmlitemnode.h"
#include <utils/qtcassert.h>
namespace QmlDesigner {
QmlTimelineFrames::QmlTimelineFrames()
{
}
QmlTimelineFrames::QmlTimelineFrames(const ModelNode &modelNode) : QmlModelNodeFacade(modelNode)
{
}
bool QmlTimelineFrames::isValid() const
{
return isValidQmlTimelineFrames(modelNode());
}
bool QmlTimelineFrames::isValidQmlTimelineFrames(const ModelNode &modelNode)
{
return isValidQmlModelNodeFacade(modelNode)
&& modelNode.metaInfo().isValid()
&& modelNode.metaInfo().isSubclassOf("QtQuick.Timeline.Keyframes");
}
void QmlTimelineFrames::destroy()
{
Q_ASSERT(isValid());
modelNode().destroy();
}
ModelNode QmlTimelineFrames::target() const
{
if (modelNode().property("target").isBindingProperty())
return modelNode().bindingProperty("target").resolveToModelNode();
else
return ModelNode(); //exception?
}
void QmlTimelineFrames::setTarget(const ModelNode &target)
{
modelNode().bindingProperty("target").setExpression(target.id());
}
PropertyName QmlTimelineFrames::propertyName() const
{
return modelNode().variantProperty("property").value().toString().toUtf8();
}
void QmlTimelineFrames::setPropertyName(const PropertyName &propertyName)
{
modelNode().variantProperty("property").setValue(QString::fromUtf8(propertyName));
}
void QmlTimelineFrames::setValue(const QVariant &value, qreal currentFrame)
{
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), currentFrame)) {
childNode.variantProperty("value").setValue(value);
return;
}
}
const QList<QPair<PropertyName, QVariant> > propertyPairList{{PropertyName("frame"), QVariant(currentFrame)},
{PropertyName("value"), value}};
ModelNode frame = modelNode().view()->createModelNode("QtQuick.Timeline.Keyframe", 1, 0, propertyPairList);
modelNode().defaultNodeListProperty().reparentHere(frame);
}
QVariant QmlTimelineFrames::value(qreal frame) const
{
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), frame)) {
return childNode.variantProperty("value").value();
}
}
return QVariant();
}
bool QmlTimelineFrames::hasKeyframe(qreal frame)
{
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (qFuzzyCompare(childNode.variantProperty("frame").value().toReal(), frame))
return true;
}
return false;
}
bool QmlTimelineFrames::isValidKeyframe(const ModelNode &node)
{
return isValidQmlModelNodeFacade(node)
&& node.metaInfo().isValid()
&& node.metaInfo().isSubclassOf("QtQuick.Timeline.Keyframe");
}
QmlTimelineFrames QmlTimelineFrames::keyframesForKeyframe(const ModelNode &node)
{
if (isValidKeyframe(node) && node.hasParentProperty()) {
const QmlTimelineFrames timeline(node.parentProperty().parentModelNode());
if (timeline.isValid())
return timeline;
}
return QmlTimelineFrames();
}
} // QmlDesigner

View File

@@ -0,0 +1,167 @@
/****************************************************************************
**
** 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 "qmltimelinemutator.h"
#include "qmltimelinekeyframes.h"
#include "abstractview.h"
#include <nodelistproperty.h>
#include <variantproperty.h>
#include <nodelistproperty.h>
#include <metainfo.h>
#include <invalidmodelnodeexception.h>
#include "bindingproperty.h"
#include "qmlitemnode.h"
#include <utils/qtcassert.h>
namespace QmlDesigner {
QmlTimelineMutator::QmlTimelineMutator()
{
}
QmlTimelineMutator::QmlTimelineMutator(const ModelNode &modelNode) : QmlModelNodeFacade(modelNode)
{
}
bool QmlTimelineMutator::isValid() const
{
return isValidQmlTimelineMutator(modelNode());
}
bool QmlTimelineMutator::isValidQmlTimelineMutator(const ModelNode &modelNode)
{
return isValidQmlModelNodeFacade(modelNode)
&& modelNode.metaInfo().isValid()
&& modelNode.metaInfo().isSubclassOf("QtQuick.Timeline.KeyframeMutator");
}
void QmlTimelineMutator::destroy()
{
Q_ASSERT(isValid());
modelNode().destroy();
}
QmlTimelineFrames QmlTimelineMutator::timelineFrames(const ModelNode &node, const PropertyName &propertyName)
{
if (isValid()) {
addFramesIfNotExists(node, propertyName);
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
const QmlTimelineFrames frames(childNode);
if (frames.target().isValid()
&& frames.target() == node
&& frames.propertyName() == propertyName)
return frames;
}
}
}
return QmlTimelineFrames(); //not found
}
bool QmlTimelineMutator::hasTimeline(const ModelNode &node, const PropertyName &propertyName)
{
if (isValid()) {
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode)) {
const QmlTimelineFrames frames(childNode);
if (frames.target().isValid()
&& frames.target() == node
&& frames.propertyName() == propertyName)
return true;
}
}
}
return false;
}
qreal QmlTimelineMutator::startFrame() const
{
if (isValid())
return QmlObjectNode(modelNode()).instanceValue("startFrame").toReal();
return 0;
}
qreal QmlTimelineMutator::endFrame() const
{
if (isValid())
return QmlObjectNode(modelNode()).instanceValue("endFrame").toReal();
return 0;
}
qreal QmlTimelineMutator::currentFrame() const
{
if (isValid())
return QmlObjectNode(modelNode()).instanceValue("currentFrame").toReal();
return 0;
}
void QmlTimelineMutator::addFramesIfNotExists(const ModelNode &node, const PropertyName &propertyName)
{
if (!isValid())
throw new InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (!hasFrames(node, propertyName)) {
ModelNode frames = modelNode().view()->createModelNode("QtQuick.Timeline.Keyframes", 1, 0);
modelNode().defaultNodeListProperty().reparentHere(frames);
QmlTimelineFrames(frames).setTarget(node);
QmlTimelineFrames(frames).setPropertyName(propertyName);
Q_ASSERT(QmlTimelineFrames::isValidQmlTimelineFrames(frames));
}
}
bool QmlTimelineMutator::hasFrames(const ModelNode &node, const PropertyName &propertyName) const
{
for (const QmlTimelineFrames &frames : frames()) {
if (frames.target().isValid()
&& frames.target() == node
&& frames.propertyName() == propertyName)
return true;
}
return false;
}
QList<QmlTimelineFrames> QmlTimelineMutator::frames() const
{
QList<QmlTimelineFrames> returnList;
for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) {
if (QmlTimelineFrames::isValidQmlTimelineFrames(childNode))
returnList.append(QmlTimelineFrames(childNode));
}
return returnList;
}
} // QmlDesigner

View File

@@ -181,6 +181,8 @@ bool ChangePropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNode
{ {
if (m_sheduledInHierarchy) { if (m_sheduledInHierarchy) {
const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode()); const int nodeLocation = positionStore.nodeOffset(m_property.parentModelNode());
if (nodeLocation < 0)
return true;
bool result = false; bool result = false;
if (m_property.isDefaultProperty()) { if (m_property.isDefaultProperty()) {

View File

@@ -280,6 +280,8 @@ Project {
"include/subcomponentmanager.h", "include/subcomponentmanager.h",
"include/textmodifier.h", "include/textmodifier.h",
"include/variantproperty.h", "include/variantproperty.h",
"include/qmltimelinekeyframes.h",
"include/qmltimelinemutator.h",
"instances/nodeinstance.cpp", "instances/nodeinstance.cpp",
"instances/nodeinstanceserverproxy.cpp", "instances/nodeinstanceserverproxy.cpp",
"instances/nodeinstanceserverproxy.h", "instances/nodeinstanceserverproxy.h",
@@ -357,6 +359,8 @@ Project {
"model/texttomodelmerger.h", "model/texttomodelmerger.h",
"model/variantproperty.cpp", "model/variantproperty.cpp",
"model/viewmanager.cpp", "model/viewmanager.cpp",
"model/qmltimelinekeyframes.cpp",
"model/qmltimelinemutator.cpp",
"pluginmanager/widgetpluginmanager.cpp", "pluginmanager/widgetpluginmanager.cpp",
"pluginmanager/widgetpluginmanager.h", "pluginmanager/widgetpluginmanager.h",
"pluginmanager/widgetpluginpath.cpp", "pluginmanager/widgetpluginpath.cpp",

View File

@@ -959,7 +959,9 @@ void FindReferences::displayResults(int first, int last)
this, &FindReferences::onReplaceButtonClicked); this, &FindReferences::onReplaceButtonClicked);
} }
connect(m_currentSearch.data(), &SearchResult::activated, connect(m_currentSearch.data(), &SearchResult::activated,
this, &FindReferences::openEditor); [](const Core::SearchResultItem& item) {
Core::EditorManager::openEditorAtSearchResult(item);
});
connect(m_currentSearch.data(), &SearchResult::cancelled, this, &FindReferences::cancel); connect(m_currentSearch.data(), &SearchResult::cancelled, this, &FindReferences::cancel);
connect(m_currentSearch.data(), &SearchResult::paused, this, &FindReferences::setPaused); connect(m_currentSearch.data(), &SearchResult::paused, this, &FindReferences::setPaused);
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus)); SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
@@ -1005,17 +1007,6 @@ void FindReferences::setPaused(bool paused)
m_watcher.setPaused(paused); m_watcher.setPaused(paused);
} }
void FindReferences::openEditor(const SearchResultItem &item)
{
if (item.path.size() > 0) {
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
item.mainRange.begin.line,
item.mainRange.begin.column);
} else {
EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
}
}
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase) void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase)
{ {
const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase); const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);

View File

@@ -82,7 +82,6 @@ private:
void searchFinished(); void searchFinished();
void cancel(); void cancel();
void setPaused(bool paused); void setPaused(bool paused);
void openEditor(const Core::SearchResultItem &item);
void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase); void onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase);
QPointer<Core::SearchResult> m_currentSearch; QPointer<Core::SearchResult> m_currentSearch;

View File

@@ -448,16 +448,8 @@ void BaseFileFind::openEditor(const SearchResultItem &item)
FileFindParameters parameters = result->userData().value<FileFindParameters>(); FileFindParameters parameters = result->userData().value<FileFindParameters>();
IEditor *openedEditor = IEditor *openedEditor =
d->m_searchEngines[parameters.searchEngineIndex]->openEditor(item, parameters); d->m_searchEngines[parameters.searchEngineIndex]->openEditor(item, parameters);
if (!openedEditor) { if (!openedEditor)
if (item.path.size() > 0) { EditorManager::openEditorAtSearchResult(item, EditorManager::DoNotSwitchToDesignMode);
openedEditor = EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
item.mainRange.begin.line,
item.mainRange.begin.column, Id(),
EditorManager::DoNotSwitchToDesignMode);
} else {
openedEditor = EditorManager::openEditor(QDir::fromNativeSeparators(item.text));
}
}
if (d->m_currentFindSupport) if (d->m_currentFindSupport)
d->m_currentFindSupport->clearHighlights(); d->m_currentFindSupport->clearHighlights();
d->m_currentFindSupport = 0; d->m_currentFindSupport = 0;

View File

@@ -3,10 +3,11 @@ LLVM_INSTALL_DIR = $$clean_path($$LLVM_INSTALL_DIR)
isEmpty(LLVM_INSTALL_DIR): error("No LLVM_INSTALL_DIR provided") isEmpty(LLVM_INSTALL_DIR): error("No LLVM_INSTALL_DIR provided")
!exists($$LLVM_INSTALL_DIR): error("LLVM_INSTALL_DIR does not exist: $$LLVM_INSTALL_DIR") !exists($$LLVM_INSTALL_DIR): error("LLVM_INSTALL_DIR does not exist: $$LLVM_INSTALL_DIR")
defineReplace(extractVersion) { return($$replace(1, ^(\\d+\\.\\d+\\.\\d+)\\w*$, \\1)) } # Expected input: "3.9.1", "5.0.0svn", "5.0.1git-81029f14223"
defineReplace(extractMajorVersion) { return($$replace(1, ^(\\d+)\\.\\d+\\.\\d+\\w*$, \\1)) } defineReplace(extractVersion) { return($$replace(1, ^(\\d+\\.\\d+\\.\\d+).*$, \\1)) }
defineReplace(extractMinorVersion) { return($$replace(1, ^\\d+\\.(\\d+)\\.\\d+\\w*$, \\1)) } defineReplace(extractMajorVersion) { return($$replace(1, ^(\\d+)\\.\\d+\\.\\d+.*$, \\1)) }
defineReplace(extractPatchVersion) { return($$replace(1, ^\\d+\\.\\d+\\.(\\d+)\\w*$, \\1)) } defineReplace(extractMinorVersion) { return($$replace(1, ^\\d+\\.(\\d+)\\.\\d+.*$, \\1)) }
defineReplace(extractPatchVersion) { return($$replace(1, ^\\d+\\.\\d+\\.(\\d+).*$, \\1)) }
defineTest(versionIsAtLeast) { defineTest(versionIsAtLeast) {
actual_major_version = $$extractMajorVersion($$1) actual_major_version = $$extractMajorVersion($$1)

View File

@@ -41,7 +41,7 @@ IAsyncJob::AsyncPrepareResult CreateInitialDocumentPreambleJob::prepareAsyncRun(
const TranslationUnitUpdateInput updateInput = m_pinnedDocument.createUpdateInput(); const TranslationUnitUpdateInput updateInput = m_pinnedDocument.createUpdateInput();
setRunner([translationUnit, updateInput]() { setRunner([translationUnit, updateInput]() {
TIME_SCOPE_DURATION("CreateInitialDocumentPreambleJobRunner"); TIME_SCOPE_DURATION("CreateInitialDocumentPreambleJobRunner");
return translationUnit.reparse(updateInput); translationUnit.reparse(updateInput);
}); });
return AsyncPrepareResult{translationUnit.id()}; return AsyncPrepareResult{translationUnit.id()};

View File

@@ -35,7 +35,7 @@ def main():
createNewQtQuickApplication(tempDir(), "SampleApp") createNewQtQuickApplication(tempDir(), "SampleApp")
# create syntax error in qml file # create syntax error in qml file
openDocument("SampleApp.Resources.qml\.qrc./.main\\.qml") openDocument("SampleApp.Resources.qml\.qrc./.main\\.qml")
if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "TextEdit {", "SyntaxError"): if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "Window {", "SyntaxError"):
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
return return
# save all to invoke qml parsing # save all to invoke qml parsing

View File

@@ -20,7 +20,7 @@ win32 {
LIBS += $$LIBTOOLING_LIBS $$LIBCLANG_LIBS LIBS += $$LIBTOOLING_LIBS $$LIBCLANG_LIBS
QMAKE_RPATHDIR += $$LLVM_LIBDIR QMAKE_RPATHDIR += $$LLVM_LIBDIR
LLVM_CXXFLAGS ~= s,-g, LLVM_CXXFLAGS ~= s,-g\d?,
QMAKE_CXXFLAGS += $$LLVM_CXXFLAGS QMAKE_CXXFLAGS += $$LLVM_CXXFLAGS
} }

View File

@@ -30,7 +30,6 @@
#include <clangcodemodelclientproxy.h> #include <clangcodemodelclientproxy.h>
#include <clangcodemodelserverproxy.h> #include <clangcodemodelserverproxy.h>
#include <projectpartsdonotexistmessage.h>
#include <clangcodemodelservermessages.h> #include <clangcodemodelservermessages.h>
@@ -226,29 +225,6 @@ TEST_F(ClientServerInProcess, UpdateVisibleTranslationUnitsMessage)
scheduleServerMessages(); scheduleServerMessages();
} }
TEST_F(ClientServerInProcess, SendTranslationUnitDoesNotExistMessage)
{
ClangBackEnd::TranslationUnitDoesNotExistMessage message(fileContainer);
EXPECT_CALL(mockClangCodeModelClient, translationUnitDoesNotExist(message))
.Times(1);
clientProxy.translationUnitDoesNotExist(message);
scheduleClientMessages();
}
TEST_F(ClientServerInProcess, SendProjectPartDoesNotExistMessage)
{
ClangBackEnd::ProjectPartsDoNotExistMessage message({Utf8StringLiteral("projectId")});
EXPECT_CALL(mockClangCodeModelClient, projectPartsDoNotExist(message))
.Times(1);
clientProxy.projectPartsDoNotExist(message);
scheduleClientMessages();
}
TEST_F(ClientServerInProcess, SendDocumentAnnotationsChangedMessage) TEST_F(ClientServerInProcess, SendDocumentAnnotationsChangedMessage)
{ {
ClangBackEnd::HighlightingMarkContainer highlightingMark(1, 1, 1, ClangBackEnd::HighlightingType::Keyword); ClangBackEnd::HighlightingMarkContainer highlightingMark(1, 1, 1, ClangBackEnd::HighlightingType::Keyword);

View File

@@ -35,8 +35,6 @@ public:
void alive() override {} void alive() override {}
void echo(const ClangBackEnd::EchoMessage &) override {} void echo(const ClangBackEnd::EchoMessage &) override {}
void codeCompleted(const ClangBackEnd::CodeCompletedMessage &) override {} void codeCompleted(const ClangBackEnd::CodeCompletedMessage &) override {}
void translationUnitDoesNotExist(const ClangBackEnd::TranslationUnitDoesNotExistMessage &) override {}
void projectPartsDoNotExist(const ClangBackEnd::ProjectPartsDoNotExistMessage &) override {}
void documentAnnotationsChanged(const ClangBackEnd::DocumentAnnotationsChangedMessage &) override {} void documentAnnotationsChanged(const ClangBackEnd::DocumentAnnotationsChangedMessage &) override {}
void references(const ClangBackEnd::ReferencesMessage &) override {} void references(const ClangBackEnd::ReferencesMessage &) override {}
void followSymbol(const ClangBackEnd::FollowSymbolMessage &) override {} void followSymbol(const ClangBackEnd::FollowSymbolMessage &) override {}

View File

@@ -39,10 +39,6 @@ public:
void(const ClangBackEnd::EchoMessage &message)); void(const ClangBackEnd::EchoMessage &message));
MOCK_METHOD1(codeCompleted, MOCK_METHOD1(codeCompleted,
void(const ClangBackEnd::CodeCompletedMessage &message)); void(const ClangBackEnd::CodeCompletedMessage &message));
MOCK_METHOD1(translationUnitDoesNotExist,
void(const ClangBackEnd::TranslationUnitDoesNotExistMessage &message));
MOCK_METHOD1(projectPartsDoNotExist,
void(const ClangBackEnd::ProjectPartsDoNotExistMessage &message));
MOCK_METHOD1(documentAnnotationsChanged, MOCK_METHOD1(documentAnnotationsChanged,
void(const ClangBackEnd::DocumentAnnotationsChangedMessage &message)); void(const ClangBackEnd::DocumentAnnotationsChangedMessage &message));
MOCK_METHOD1(references, MOCK_METHOD1(references,