forked from qt-creator/qt-creator
Changed the QScriptHighlighter & QScriptIndenter namespaces.
This commit is contained in:
@@ -5,7 +5,8 @@ contains(CONFIG, dll) {
|
||||
}
|
||||
|
||||
include(parser/parser.pri)
|
||||
include($$PWD/qscripthighlighter.pri)
|
||||
|
||||
DEFINES += QSCRIPTHIGHLIGHTER_BUILD_LIB
|
||||
|
||||
DEPENDPATH += $$PWD
|
||||
INCLUDEPATH += $$PWD/..
|
||||
@@ -17,7 +18,8 @@ HEADERS += \
|
||||
$$PWD/qmlpackageinfo.h \
|
||||
$$PWD/qmlsymbol.h \
|
||||
$$PWD/qmlmetatypebackend.h \
|
||||
$$PWD/qmltypesystem.h
|
||||
$$PWD/qmltypesystem.h \
|
||||
$$PWD/qscriptincrementalscanner.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qmlidcollector.cpp \
|
||||
@@ -25,7 +27,8 @@ SOURCES += \
|
||||
$$PWD/qmlsymbol.cpp \
|
||||
$$PWD/qmlpackageinfo.cpp \
|
||||
$$PWD/qmlmetatypebackend.cpp \
|
||||
$$PWD/qmltypesystem.cpp
|
||||
$$PWD/qmltypesystem.cpp \
|
||||
$$PWD/qscriptincrementalscanner.cpp
|
||||
|
||||
contains(QT_CONFIG, declarative) {
|
||||
QT += declarative
|
||||
@@ -39,3 +42,7 @@ contains(QT_CONFIG, declarative) {
|
||||
$$PWD/qtdeclarativemetatypebackend.cpp
|
||||
}
|
||||
|
||||
contains(QT, gui) {
|
||||
SOURCES += $$PWD/qscripthighlighter.cpp $$PWD/qscriptindenter.cpp
|
||||
HEADERS += $$PWD/qscripthighlighter.h $$PWD/qscriptindenter.h
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "qscripthighlighter.h"
|
||||
#include <qmljs/qscripthighlighter.h>
|
||||
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QtAlgorithms>
|
||||
|
||||
using namespace SharedTools;
|
||||
using namespace QmlJS;
|
||||
|
||||
QScriptHighlighter::QScriptHighlighter(bool duiEnabled, QTextDocument *parent):
|
||||
QSyntaxHighlighter(parent),
|
||||
|
||||
@@ -30,15 +30,15 @@
|
||||
#ifndef QSCRIPTSYNTAXHIGHLIGHTER_H
|
||||
#define QSCRIPTSYNTAXHIGHLIGHTER_H
|
||||
|
||||
#include <qscripthighlighter/qscriptincrementalscanner.h>
|
||||
#include <qmljs/qscriptincrementalscanner.h>
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtGui/QSyntaxHighlighter>
|
||||
|
||||
namespace SharedTools {
|
||||
namespace QmlJS {
|
||||
|
||||
class QScriptHighlighter : public QSyntaxHighlighter
|
||||
class QML_EXPORT QScriptHighlighter : public QSyntaxHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -79,6 +79,6 @@ private:
|
||||
QTextCharFormat m_formats[NumFormats];
|
||||
};
|
||||
|
||||
} // namespace SharedTools
|
||||
} // namespace QmlJS
|
||||
|
||||
#endif // QSCRIPTSYNTAXHIGHLIGHTER_H
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
INCLUDEPATH *= $$PWD $$PWD/..
|
||||
|
||||
DEFINES += QSCRIPTHIGHLIGHTER_BUILD_LIB
|
||||
|
||||
SOURCES += $$PWD/qscriptincrementalscanner.cpp
|
||||
HEADERS += $$PWD/qscriptincrementalscanner.h
|
||||
|
||||
contains(QT, gui) {
|
||||
SOURCES += $$PWD/qscripthighlighter.cpp $$PWD/qscriptindenter.cpp
|
||||
HEADERS += $$PWD/qscripthighlighter.h $$PWD/qscriptindenter.h
|
||||
}
|
||||
@@ -27,11 +27,11 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#include "qscriptincrementalscanner.h"
|
||||
#include <qmljs/qscriptincrementalscanner.h>
|
||||
|
||||
#include <QTextCharFormat>
|
||||
|
||||
using namespace SharedTools;
|
||||
using namespace QmlJS;
|
||||
|
||||
QScriptIncrementalScanner::QScriptIncrementalScanner()
|
||||
{
|
||||
|
||||
@@ -30,13 +30,15 @@
|
||||
#ifndef QSCRIPTINCREMENTALSCANNER_H
|
||||
#define QSCRIPTINCREMENTALSCANNER_H
|
||||
|
||||
#include <qmljs/qml_global.h>
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace SharedTools {
|
||||
namespace QmlJS {
|
||||
|
||||
class QScriptIncrementalScanner
|
||||
class QML_EXPORT QScriptIncrementalScanner
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -111,6 +113,6 @@ private:
|
||||
QList<QScriptIncrementalScanner::Token> m_tokens;
|
||||
};
|
||||
|
||||
} // namespace SharedTools
|
||||
} // namespace QmlJS
|
||||
|
||||
#endif // QSCRIPTINCREMENTALSCANNER_H
|
||||
|
||||
@@ -65,11 +65,12 @@
|
||||
as comments and string literals are removed beforehand.
|
||||
*/
|
||||
|
||||
#include "qscriptindenter.h"
|
||||
#include "qscriptincrementalscanner.h"
|
||||
#include <qmljs/qscriptindenter.h>
|
||||
#include <qmljs/qscriptincrementalscanner.h>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
using namespace SharedTools;
|
||||
using namespace QmlJS;
|
||||
|
||||
/*
|
||||
The indenter avoids getting stuck in almost infinite loops by
|
||||
|
||||
@@ -30,14 +30,16 @@
|
||||
#ifndef QTSCRIPTINDENTER_H
|
||||
#define QTSCRIPTINDENTER_H
|
||||
|
||||
#include <qscripthighlighter/qscriptincrementalscanner.h>
|
||||
#include <qmljs/qml_global.h>
|
||||
#include <qmljs/qscriptincrementalscanner.h>
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtGui/QTextBlock>
|
||||
|
||||
namespace SharedTools {
|
||||
namespace QmlJS {
|
||||
|
||||
class QScriptIndenter
|
||||
class QML_EXPORT QScriptIndenter
|
||||
{
|
||||
Q_DISABLE_COPY(QScriptIndenter)
|
||||
|
||||
@@ -132,7 +134,7 @@ private:
|
||||
QRegExp iflikeKeyword;
|
||||
};
|
||||
|
||||
} // namespace SharedTools
|
||||
} // namespace QmlJS
|
||||
|
||||
#endif // QTSCRIPTINDENTER_H
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ using namespace QmlJSEditor;
|
||||
using namespace QmlJSEditor::Internal;
|
||||
|
||||
QmlHighlighter::QmlHighlighter(QTextDocument *parent) :
|
||||
SharedTools::QScriptHighlighter(true, parent)
|
||||
QmlJS::QScriptHighlighter(true, parent)
|
||||
{
|
||||
m_currentBlockParentheses.reserve(20);
|
||||
m_braceDepth = 0;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#ifndef QMLSYNTAXHIGHLIGHTER_H
|
||||
#define QMLSYNTAXHIGHLIGHTER_H
|
||||
|
||||
#include <qscripthighlighter/qscripthighlighter.h>
|
||||
#include <qmljs/qscripthighlighter.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
|
||||
namespace QmlJSEditor {
|
||||
@@ -40,7 +40,7 @@ namespace Internal {
|
||||
// the parentheses encountered in the block data
|
||||
// for parentheses matching to work.
|
||||
|
||||
class QmlHighlighter : public SharedTools::QScriptHighlighter
|
||||
class QmlHighlighter : public QmlJS::QScriptHighlighter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "qmllookupcontext.h"
|
||||
#include "qmlresolveexpression.h"
|
||||
|
||||
#include <qscripthighlighter/qscriptindenter.h>
|
||||
#include <qmljs/qscriptindenter.h>
|
||||
|
||||
#include <qmljs/qmltypesystem.h>
|
||||
#include <qmljs/parser/qmljsastvisitor_p.h>
|
||||
@@ -77,7 +77,6 @@ enum {
|
||||
using namespace Qml;
|
||||
using namespace QmlJS;
|
||||
using namespace QmlJS::AST;
|
||||
using namespace SharedTools;
|
||||
|
||||
namespace {
|
||||
int blockBraceDepth(const QTextBlock &block)
|
||||
@@ -633,7 +632,7 @@ bool QmlJSTextEditor::isClosingBrace(const QList<QScriptIncrementalScanner::Toke
|
||||
void QmlJSTextEditor::indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar)
|
||||
{
|
||||
TextEditor::TabSettings ts = tabSettings();
|
||||
SharedTools::QScriptIndenter indenter;
|
||||
QScriptIndenter indenter;
|
||||
indenter.setTabSize(ts.m_tabSize);
|
||||
indenter.setIndentSize(ts.m_indentSize);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#define QMLJSEDITOR_H
|
||||
|
||||
#include <qmljs/qmldocument.h>
|
||||
#include <qscripthighlighter/qscriptincrementalscanner.h>
|
||||
#include <qmljs/qscriptincrementalscanner.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -145,7 +145,7 @@ protected:
|
||||
private:
|
||||
virtual bool isElectricCharacter(const QChar &ch) const;
|
||||
virtual void indentBlock(QTextDocument *doc, QTextBlock block, QChar typedChar);
|
||||
bool isClosingBrace(const QList<SharedTools::QScriptIncrementalScanner::Token> &tokens) const;
|
||||
bool isClosingBrace(const QList<QmlJS::QScriptIncrementalScanner::Token> &tokens) const;
|
||||
|
||||
QString wordUnderCursor() const;
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@ TARGET = QmlJSEditor
|
||||
include(../../qtcreatorplugin.pri)
|
||||
include(qmljseditor_dependencies.pri)
|
||||
|
||||
include(../../shared/qscripthighlighter/qscripthighlighter.pri)
|
||||
DEPENDPATH += ../../shared/qscripthighlighter
|
||||
|
||||
|
||||
CONFIG += help
|
||||
DEFINES += \
|
||||
QMLJSEDITOR_LIBRARY \
|
||||
|
||||
Reference in New Issue
Block a user