Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdevelop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rolf Eike Beer
kdevelop
Commits
14f0d26b
Commit
14f0d26b
authored
Jan 25, 2013
by
Andrea Scarpino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an EditorIntegrator class
parent
65f7ad7a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
4 deletions
+91
-4
duchain/CMakeLists.txt
duchain/CMakeLists.txt
+1
-0
duchain/contextbuilder.cpp
duchain/contextbuilder.cpp
+12
-2
duchain/contextbuilder.h
duchain/contextbuilder.h
+9
-2
duchain/editorintegrator.cpp
duchain/editorintegrator.cpp
+33
-0
duchain/editorintegrator.h
duchain/editorintegrator.h
+36
-0
No files found.
duchain/CMakeLists.txt
View file @
14f0d26b
kde4_add_library
(
kdevqmljsduchain SHARED
helper.cpp
parsesession.cpp
editorintegrator.cpp
debugvisitor.cpp
contextbuilder.cpp
declarationbuilder.cpp
...
...
duchain/contextbuilder.cpp
View file @
14f0d26b
...
...
@@ -19,13 +19,13 @@
#include "contextbuilder.h"
#include "parsesession.h"
using
namespace
KDevelop
;
ContextBuilder
::
ContextBuilder
()
:
ContextBuilderBase
()
,
m_session
()
,
m_editor
(
0
)
,
m_mapAst
(
false
)
{
}
...
...
@@ -34,6 +34,16 @@ RangeInRevision ContextBuilder::editorFindRange(QmlJS::AST::Node* fromNode, QmlJ
return
m_session
->
editorFindRange
(
fromNode
,
toNode
);
}
void
ContextBuilder
::
setEditor
(
EditorIntegrator
*
editor
)
{
m_editor
=
editor
;
}
EditorIntegrator
*
ContextBuilder
::
editor
()
const
{
return
m_editor
;
}
QualifiedIdentifier
ContextBuilder
::
identifierForNode
(
QmlJS
::
AST
::
IdentifierPropertyName
*
node
)
{
return
QualifiedIdentifier
(
node
->
id
.
toString
());
...
...
duchain/contextbuilder.h
View file @
14f0d26b
...
...
@@ -24,10 +24,10 @@
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsdocument.h>
#include "duchainexport.h"
#include "parsesession.h"
#include "editorintegrator.h"
class
ParseSession
;
class
EditorIntegrator
;
typedef
KDevelop
::
AbstractContextBuilder
<
QmlJS
::
AST
::
Node
,
QmlJS
::
AST
::
IdentifierPropertyName
>
ContextBuilderBase
;
...
...
@@ -48,11 +48,18 @@ public:
void
setParseSession
(
ParseSession
*
session
);
void
setEditor
(
EditorIntegrator
*
editor
);
EditorIntegrator
*
editor
()
const
;
using
Visitor
::
visit
;
virtual
bool
visit
(
QmlJS
::
AST
::
FunctionDeclaration
*
node
);
protected:
ParseSession
*
m_session
;
EditorIntegrator
*
m_editor
;
QHash
<
QmlJS
::
AST
::
Node
*
,
KDevelop
::
DUContext
*>
m_astToContext
;
bool
m_mapAst
;
// make KDevelop::AbstractContextBuilder happy
};
#endif // CONTEXTBUILDER_H
duchain/editorintegrator.cpp
0 → 100644
View file @
14f0d26b
/*************************************************************************************
* Copyright (C) 2013 by Andrea Scarpino <andrea@archlinux.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 "editorintegrator.h"
EditorIntegrator
::
EditorIntegrator
()
{
}
void
EditorIntegrator
::
setParseSession
(
ParseSession
*
session
)
{
m_session
=
session
;
}
ParseSession
*
EditorIntegrator
::
parseSession
()
const
{
return
m_session
;
}
duchain/editorintegrator.h
0 → 100644
View file @
14f0d26b
/*************************************************************************************
* Copyright (C) 2013 by Andrea Scarpino <andrea@archlinux.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 QMLJSEDITORINTEGRATOR_H
#define QMLJSEDITORINTEGRATOR_H
#include "parsesession.h"
class
KDEVQMLJSDUCHAIN_EXPORT
EditorIntegrator
{
public:
EditorIntegrator
();
void
setParseSession
(
ParseSession
*
session
);
ParseSession
*
parseSession
()
const
;
private:
ParseSession
*
m_session
;
};
#endif // QMLJSEDITORINTEGRATOR_H
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment