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
d0587367
Commit
d0587367
authored
Jan 09, 2013
by
Milian Wolff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend test, run context builder
parent
a7b6f3f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
duchain/contextbuilder.cpp
duchain/contextbuilder.cpp
+6
-1
duchain/contextbuilder.h
duchain/contextbuilder.h
+2
-0
duchain/tests/testcontexts.cpp
duchain/tests/testcontexts.cpp
+9
-1
No files found.
duchain/contextbuilder.cpp
View file @
d0587367
...
...
@@ -25,7 +25,7 @@ using namespace KDevelop;
ContextBuilder
::
ContextBuilder
()
:
ContextBuilderBase
()
,
m_session
(
0
)
,
m_session
()
{
}
...
...
@@ -63,3 +63,8 @@ TopDUContext* ContextBuilder::newTopContext(const RangeInRevision& range, Parsin
}
return
ContextBuilderBase
::
newTopContext
(
range
,
file
);
}
void
ContextBuilder
::
setParseSession
(
ParseSession
*
session
)
{
m_session
=
session
;
}
duchain/contextbuilder.h
View file @
d0587367
...
...
@@ -44,6 +44,8 @@ public:
virtual
KDevelop
::
TopDUContext
*
newTopContext
(
const
KDevelop
::
RangeInRevision
&
range
,
KDevelop
::
ParsingEnvironmentFile
*
file
=
0
);
void
setParseSession
(
ParseSession
*
session
);
protected:
ParseSession
*
m_session
;
QHash
<
QmlJS
::
AST
::
Node
*
,
KDevelop
::
DUContext
*>
m_astToContext
;
...
...
duchain/tests/testcontexts.cpp
View file @
d0587367
...
...
@@ -22,6 +22,7 @@
#include "testcontexts.h"
#include "../parsesession.h"
#include "../contextbuilder.h"
#include <qtest_kde.h>
...
...
@@ -45,10 +46,17 @@ void TestContexts::cleanupTestCase()
void
TestContexts
::
testFunctionContext
()
{
ParseSession
session
(
IndexedString
(
"functionContext.js"
),
"function foo() {}"
);
const
IndexedString
file
(
"functionContext.js"
);
ParseSession
session
(
file
,
"function foo() {}"
);
QVERIFY
(
session
.
ast
());
qDebug
()
<<
session
.
language
();
QCOMPARE
(
session
.
language
(),
QmlJS
::
Document
::
JavaScriptLanguage
);
ContextBuilder
builder
;
builder
.
setParseSession
(
&
session
);
ReferencedTopDUContext
top
=
builder
.
build
(
file
,
session
.
ast
());
QVERIFY
(
top
);
}
#include "testcontexts.moc"
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