Commit 9be0f780 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

initial checkout

with a bunch of forked code :D
parent 555f5c3f
......@@ -5,9 +5,17 @@ find_package(KDevPlatform REQUIRED)
include_directories(
${KDE4_INCLUDES}
${KDEVPLATFORM_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/libs
)
add_definitions(-DQT_CREATOR) # :D
add_definitions(-DQML_BUILD_STATIC_LIB=0 -DQMLJS_BUILD_DIR)
add_subdirectory(libs)
add_subdirectory(tests)
kde4_add_plugin(kdev-qmljsplugin duchain/contextbuilder.cpp duchain/typebuilder.cpp duchain/declarationbuilder.cpp parseqmljsjob.cpp kdevqmljsplugin.cpp)
target_link_libraries(kdev-qmljsplugin qtc-qmlsupport
${QT_QTCORE_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDEVPLATFORM_LANGUAGE_LIBRARIES} ${KDE4_THREADWEAVER_LIBS})
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#include "contextbuilder.h"
KDevelop::DUContext* ContextBuilder::contextFromNode(QmlJS::AST::Node* node)
{
return 0;
}
void ContextBuilder::setContextOnNode(QmlJS::AST::Node* node, KDevelop::DUContext* context)
{
}
void ContextBuilder::startVisiting(QmlJS::AST::Node* node)
{
}
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#ifndef CONTEXTBUILDER_H
#define CONTEXTBUILDER_H
#include <language/duchain/builders/abstractcontextbuilder.h>
#include <qmljs/parser/qmljsast_p.h>
class ContextBuilder : public KDevelop::AbstractContextBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName>
, public QmlJS::AST::Visitor
{
public:
virtual KDevelop::DUContext* contextFromNode(QmlJS::AST::Node* node);
virtual void setContextOnNode(QmlJS::AST::Node* node, KDevelop::DUContext* context);
virtual void startVisiting(QmlJS::AST::Node* node);
};
#endif // CONTEXTBUILDER_H
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#include "declarationbuilder.h"
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#ifndef DECLARATIONBUILDER_H
#define DECLARATIONBUILDER_H
#include <language/duchain/builders/abstractdeclarationbuilder.h>
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsdocument.h>
#include "typebuilder.h"
class DeclarationBuilder : public KDevelop::AbstractDeclarationBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName, TypeBuilder>
{
public:
DeclarationBuilder(QmlJS::Document::MutablePtr ptr);
virtual KDevelop::QualifiedIdentifier identifierForNode(QmlJS::AST::IdentifierPropertyName* node);
virtual KDevelop::RangeInRevision editorFindRange(QmlJS::AST::Node* fromNode, QmlJS::AST::Node* toNode);
};
#endif // DECLARATIONBUILDER_H
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#include "typebuilder.h"
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#ifndef TYPEBUILDER_H
#define TYPEBUILDER_H
#include <language/duchain/builders/abstracttypebuilder.h>
#include <qmljs/parser/qmljsast_p.h>
#include "contextbuilder.h"
class TypeBuilder : public KDevelop::AbstractTypeBuilder<QmlJS::AST::Node, QmlJS::AST::IdentifierPropertyName, ContextBuilder>
{
};
#endif // TYPEBUILDER_H
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#include "kdevqmljsplugin.h"
#include <KPluginFactory>
#include <KAboutData>
K_PLUGIN_FACTORY(KDevQmlJsSupportFactory, registerPlugin<KDevQmlJsPlugin>(); )
K_EXPORT_PLUGIN(KDevQmlJsSupportFactory(KAboutData("kdevqmljsplugin","kdevqmljs", ki18n("QML/JS Support"), "0.1", ki18n("Support for QML and JS Languages"), KAboutData::License_GPL)))
KDevQmlJsPlugin::KDevQmlJsPlugin(QObject* parent, const QVariantList& )
: KDevelop::IPlugin( KDevQmlJsSupportFactory::componentData(), parent )
, KDevelop::ILanguageSupport()
{}
KDevelop::ParseJob* KDevQmlJsPlugin::createParseJob(const KUrl& url)
{
return 0;
}
QString KDevQmlJsPlugin::name() const
{
return "qml/js";
}
/*************************************************************************************
* Copyright (C) 2012 by Aleix Pol <aleixpol@kde.org> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* *
* This program 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 General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#ifndef KDEVQMLJSPLUGIN_H
#define KDEVQMLJSPLUGIN_H
#include <interfaces/iplugin.h>
#include <language/interfaces/ilanguagesupport.h>
class KDevQmlJsPlugin : public KDevelop::IPlugin, public KDevelop::ILanguageSupport
{
Q_OBJECT
Q_INTERFACES( KDevelop::ILanguageSupport )
public:
explicit KDevQmlJsPlugin( QObject* parent, const QVariantList& args = QVariantList() );
virtual KDevelop::ParseJob* createParseJob(const KUrl& url);
virtual QString name() const;
};
#endif // KDEVQMLJSPLUGIN_H
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
add_definitions(-DQT_CREATOR) # :D
add_definitions(-DQML_BUILD_STATIC_LIB=1)
kde4_add_ui_files(uifiles_SRCS
utils/projectintropage.ui
utils/filewizardpage.ui
......
contains(CONFIG, dll) {
DEFINES += LANGUAGEUTILS_BUILD_DIR
} else {
DEFINES += LANGUAGEUTILS_BUILD_STATIC_LIB
}
INCLUDEPATH += $$PWD/..
HEADERS += \
$$PWD/languageutils_global.h \
$$PWD/fakemetaobject.h \
$$PWD/componentversion.h
SOURCES += \
$$PWD/fakemetaobject.cpp \
$$PWD/componentversion.cpp
LIBS *= -l$$qtLibraryName(LanguageUtils)
DEFINES *= QT_CREATOR
TEMPLATE = lib
TARGET = LanguageUtils
DEFINES += QT_CREATOR
unix:QMAKE_CXXFLAGS_DEBUG += -O3
include(../../qtcreatorlibrary.pri)
include(languageutils-lib.pri)
include(../utils/utils.pri)
import qbs.base 1.0
import "../QtcLibrary.qbs" as QtcLibrary
QtcLibrary {
name: "LanguageUtils"
cpp.includePaths: base.concat("../3rdparty/cplusplus")
cpp.defines: base.concat([
"QT_CREATOR",
"LANGUAGEUTILS_BUILD_DIR"
])
cpp.optimization: "fast"
Depends { name: "cpp" }
Depends { name: "Qt.core" }
files: [
"componentversion.cpp",
"componentversion.h",
"fakemetaobject.cpp",
"fakemetaobject.h",
"languageutils_global.h",
]
}
contains(CONFIG, dll) {
DEFINES += QMLJS_BUILD_DIR
} else {
DEFINES += QML_BUILD_STATIC_LIB
}
include(parser/parser.pri)
INCLUDEPATH += $$PWD/..
HEADERS += \
$$PWD/qmljs_global.h \
$$PWD/qmljsbind.h \
$$PWD/qmljsevaluate.h \
$$PWD/qmljsdocument.h \
$$PWD/qmljsscanner.h \
$$PWD/qmljsinterpreter.h \
$$PWD/qmljslink.h \
$$PWD/qmljscheck.h \
$$PWD/qmljsscopebuilder.h \
$$PWD/qmljslineinfo.h \
$$PWD/qmljscompletioncontextfinder.h \
$$PWD/qmljsmodelmanagerinterface.h \
$$PWD/qmljsicontextpane.h \
$$PWD/qmljspropertyreader.h \
$$PWD/qmljsrewriter.h \
$$PWD/qmljsicons.h \
$$PWD/qmljsdelta.h \
$$PWD/qmljstypedescriptionreader.h \
$$PWD/qmljsscopeastpath.h \
$$PWD/qmljsvalueowner.h \
$$PWD/qmljscontext.h \
$$PWD/qmljsscopechain.h \
$$PWD/qmljsutils.h \
$$PWD/qmljsstaticanalysismessage.h \
$$PWD/jsoncheck.h \
$$PWD/consolemanagerinterface.h \
$$PWD/consoleitem.h \
$$PWD/iscriptevaluator.h
SOURCES += \
$$PWD/qmljsbind.cpp \
$$PWD/qmljsevaluate.cpp \
$$PWD/qmljsdocument.cpp \
$$PWD/qmljsscanner.cpp \
$$PWD/qmljsinterpreter.cpp \
$$PWD/qmljslink.cpp \
$$PWD/qmljscheck.cpp \
$$PWD/qmljsscopebuilder.cpp \
$$PWD/qmljslineinfo.cpp \
$$PWD/qmljscompletioncontextfinder.cpp \
$$PWD/qmljsmodelmanagerinterface.cpp \
$$PWD/qmljspropertyreader.cpp \
$$PWD/qmljsrewriter.cpp \
$$PWD/qmljsicons.cpp \
$$PWD/qmljsdelta.cpp \
$$PWD/qmljstypedescriptionreader.cpp \
$$PWD/qmljsscopeastpath.cpp \
$$PWD/qmljsvalueowner.cpp \
$$PWD/qmljscontext.cpp \
$$PWD/qmljsscopechain.cpp \
$$PWD/qmljsutils.cpp \
$$PWD/qmljsstaticanalysismessage.cpp \
$$PWD/jsoncheck.cpp \
$$PWD/consolemanagerinterface.cpp \
$$PWD/consoleitem.cpp
RESOURCES += \
$$PWD/qmljs.qrc
OTHER_FILES += \
$$PWD/parser/qmljs.g
contains(QT, gui) {
SOURCES += \
$$PWD/qmljsindenter.cpp \
$$PWD/qmljscodeformatter.cpp \
$$PWD/qmljsreformatter.cpp
HEADERS += \
$$PWD/qmljsindenter.h \
$$PWD/qmljscodeformatter.h \
$$PWD/qmljsreformatter.h
}
INCLUDEPATH *= $$PWD/../../shared
INCLUDEPATH *= $$PWD/../../shared/qmljs
INCLUDEPATH *= $$PWD/../../shared/qmljs/parser
LIBS *= -l$$qtLibraryName(QmlJS)
DEFINES *= QT_CREATOR
TEMPLATE = lib
TARGET = QmlJS
DEFINES += QMLJS_BUILD_DIR QT_CREATOR
QT +=script
include(../../qtcreatorlibrary.pri)
include(qmljs-lib.pri)
include(../utils/utils.pri)
include(../languageutils/languageutils.pri)
import qbs.base 1.0
import "../QtcLibrary.qbs" as QtcLibrary
QtcLibrary {
name: "QmlJS"
cpp.includePaths: base.concat("parser")
cpp.defines: base.concat([
"QMLJS_BUILD_DIR",
"QT_CREATOR"
])
cpp.optimization: "fast"
Depends { name: "Utils" }
Depends { name: "LanguageUtils" }
Depends { name: "cpp" }
Depends { name: "Qt"; submodules: ["widgets", "script"] }
files: [
"jsoncheck.cpp",
"jsoncheck.h",
"qmljs.qrc",
"qmljs_global.h",
"qmljsbind.cpp",
"qmljsbind.h",
"qmljscheck.cpp",
"qmljscheck.h",
"qmljscodeformatter.cpp",
"qmljscodeformatter.h",
"qmljscompletioncontextfinder.cpp",
"qmljscompletioncontextfinder.h",
"qmljscontext.cpp",
"qmljscontext.h",
"qmljsdelta.cpp",
"qmljsdelta.h",
"qmljsdocument.cpp",
"qmljsdocument.h",
"qmljsevaluate.cpp",
"qmljsevaluate.h",
"qmljsicons.cpp",
"qmljsicons.h",
"qmljsicontextpane.h",
"qmljsindenter.cpp",
"qmljsindenter.h",
"qmljsinterpreter.cpp",
"qmljsinterpreter.h",
"qmljslineinfo.cpp",
"qmljslineinfo.h",
"qmljslink.cpp",
"qmljslink.h",
"qmljsmodelmanagerinterface.cpp",
"qmljsmodelmanagerinterface.h",
"qmljspropertyreader.cpp",
"qmljspropertyreader.h",
"qmljsreformatter.cpp",
"qmljsreformatter.h",
"qmljsrewriter.cpp",
"qmljsrewriter.h",
"qmljsscanner.cpp",
"qmljsscanner.h",
"qmljsscopeastpath.cpp",
"qmljsscopeastpath.h",
"qmljsscopebuilder.cpp",
"qmljsscopebuilder.h",
"qmljsscopechain.cpp",
"qmljsscopechain.h",
"qmljsstaticanalysismessage.cpp",
"qmljsstaticanalysismessage.h",
"qmljstypedescriptionreader.cpp",
"qmljstypedescriptionreader.h",
"qmljsutils.cpp",
"qmljsutils.h",
"qmljsvalueowner.cpp",
"qmljsvalueowner.h",
"images/element.png",
"images/func.png",
"images/property.png",
"images/publicmember.png",
"parser/qmldirparser.cpp",
"parser/qmldirparser_p.h",
"parser/qmlerror.cpp",
"parser/qmlerror.h",
"parser/qmljsast.cpp",
"parser/qmljsast_p.h",
"parser/qmljsastfwd_p.h",
"parser/qmljsastvisitor.cpp",
"parser/qmljsastvisitor_p.h",
"parser/qmljsengine_p.cpp",
"parser/qmljsengine_p.h",
"parser/qmljsglobal_p.h",
"parser/qmljsgrammar.cpp",
"parser/qmljsgrammar_p.h",
"parser/qmljskeywords_p.h",
"parser/qmljslexer.cpp",
"parser/qmljslexer_p.h",
"parser/qmljsmemorypool_p.h",
"parser/qmljsparser.cpp",
"parser/qmljsparser_p.h",
"consolemanagerinterface.cpp",
"consolemanagerinterface.h",
"consoleitem.cpp",
"consoleitem.h",
"iscriptevaluator.h"
]
ProductModule {
Depends { name: "cpp" }
Depends { name: "LanguageUtils" }
cpp.defines: [
"QT_CREATOR"
]
}
}
<RCC>
<qresource prefix="/qmljs">
<file>images/element.png</file>
<file>images/property.png</file>
<file>images/publicmember.png</file>
<file>images/func.png</file>
</qresource>
</RCC>
......@@ -34,7 +34,7 @@
#if defined(QMLJS_BUILD_DIR)
# define QMLJS_EXPORT Q_DECL_EXPORT
#elif defined(QML_BUILD_STATIC_LIB)
#elif QML_BUILD_STATIC_LIB==1
# define QMLJS_EXPORT
#else
# define QMLJS_EXPORT Q_DECL_IMPORT
......
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**