[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdev-ruby] /: Adapt to latest pre-5.3-beta kdevplatform API
From: Friedrich W. H. Kossebau <null () kde ! org>
Date: 2018-09-12 2:45:58
Message-ID: E1fzvAE-0005nt-Pz () code ! kde ! org
[Download RAW message or body]
Git commit 40b67cccf71476d2c52a895805e17d15bb084917 by Friedrich W. H. Kossebau.
Committed on 12/09/2018 at 02:35.
Pushed by kossebau into branch 'master'.
Adapt to latest pre-5.3-beta kdevplatform API
M +1 -1 completion/helpers.cpp
M +1 -1 completion/worker.cpp
M +4 -4 completion/worker.h
M +2 -1 duchain/builders/contextbuilder.cpp
M +1 -1 duchain/builders/contextbuilder.h
M +1 -1 duchain/builders/declarationbuilder.cpp
M +2 -2 duchain/navigation/declarationnavigationcontext.cpp
M +3 -3 duchain/navigation/declarationnavigationcontext.h
M +1 -1 duchain/navigation/includenavigationcontext.cpp
M +1 -1 duchain/navigation/includenavigationcontext.h
M +5 -5 duchain/tests/duchain.cpp
M +1 -1 duchain/tests/uses.cpp
M +6 -0 rails/dataprovider.h
https://commits.kde.org/kdev-ruby/40b67cccf71476d2c52a895805e17d15bb084917
diff --git a/completion/helpers.cpp b/completion/helpers.cpp
index b6f5ee9..682b87e 100644
--- a/completion/helpers.cpp
+++ b/completion/helpers.cpp
@@ -50,7 +50,7 @@ QString getArgumentList(Declaration *decl, QList<QVariant> \
*highlighting) QString ret("(");
QVector<Declaration *> params;
- if (DUContext *ctx = DUChainUtils::getArgumentContext(decl))
+ if (DUContext *ctx = DUChainUtils::argumentContext(decl))
params = ctx->localDeclarations();
// TODO: this is just too simplistic
diff --git a/completion/worker.cpp b/completion/worker.cpp
index c22028b..0b105b8 100644
--- a/completion/worker.cpp
+++ b/completion/worker.cpp
@@ -33,7 +33,7 @@ CodeCompletionWorker::CodeCompletionWorker(CodeCompletionModel \
*parent) /* There's nothing to do here */
}
-KDevelop::CodeCompletionContext* \
CodeCompletionWorker::createCompletionContext(KDevelop::DUContextPointer context, \
const QString &contextText, +KDevelop::CodeCompletionContext* \
CodeCompletionWorker::createCompletionContext(const KDevelop::DUContextPointer& \
context, const QString &contextText,
const \
QString &followingText, const KDevelop::CursorInRevision &position) const {
return new ruby::CodeCompletionContext(context, contextText, followingText, \
position);
diff --git a/completion/worker.h b/completion/worker.h
index d32d80a..b170fb6 100644
--- a/completion/worker.h
+++ b/completion/worker.h
@@ -44,10 +44,10 @@ public:
protected:
/// Re-implemented from KDevelop::CodeCompletionWorker
- virtual KDevelop::CodeCompletionContext \
*createCompletionContext(KDevelop::DUContextPointer context,
- const QString \
&contextText,
- const QString \
&followingText,
- const \
KDevelop::CursorInRevision &position) const override; + \
KDevelop::CodeCompletionContext *createCompletionContext(const \
KDevelop::DUContextPointer& context, + \
const QString &contextText, + \
const QString &followingText, + \
const KDevelop::CursorInRevision &position) const override; };
}
diff --git a/duchain/builders/contextbuilder.cpp \
b/duchain/builders/contextbuilder.cpp index c9d0226..67ec0cf 100644
--- a/duchain/builders/contextbuilder.cpp
+++ b/duchain/builders/contextbuilder.cpp
@@ -47,8 +47,9 @@ ContextBuilder::~ContextBuilder()
ReferencedTopDUContext ContextBuilder::build(const IndexedString &url,
Ast *node,
- ReferencedTopDUContext updateContext)
+ const ReferencedTopDUContext& \
updateContext_) {
+ ReferencedTopDUContext updateContext(updateContext_);
if (!updateContext) {
DUChainReadLocker lock;
updateContext = DUChain::self()->chainForDocument(url);
diff --git a/duchain/builders/contextbuilder.h b/duchain/builders/contextbuilder.h
index 38f62f6..eb9e8e5 100644
--- a/duchain/builders/contextbuilder.h
+++ b/duchain/builders/contextbuilder.h
@@ -51,7 +51,7 @@ public:
/// Re-implemented from KDevelop::AbstractContextBuilder.
virtual KDevelop::ReferencedTopDUContext build(const KDevelop::IndexedString \
&url, Ast *node,
- KDevelop::ReferencedTopDUContext \
updateContext = {}) override; + \
const KDevelop::ReferencedTopDUContext& updateContext = {}) override;
/// @returns a list of unresolved imports.
inline const QVector<KDevelop::IndexedString> unresolvedImports() const
diff --git a/duchain/builders/declarationbuilder.cpp \
b/duchain/builders/declarationbuilder.cpp index b869af0..32fe456 100644
--- a/duchain/builders/declarationbuilder.cpp
+++ b/duchain/builders/declarationbuilder.cpp
@@ -1010,7 +1010,7 @@ void DeclarationBuilder::visitMethodCallArgs(const Ast *mc, \
const DeclarationPoi
DUContext *argCtx = nullptr;
if (lastMethod.data())
- argCtx = DUChainUtils::getArgumentContext(lastMethod.data());
+ argCtx = DUChainUtils::argumentContext(lastMethod.data());
if (!argCtx || !lastMethod->type<FunctionType>()) {
/*
* We couldn't get enough info, visit the list of parameters as a
diff --git a/duchain/navigation/declarationnavigationcontext.cpp \
b/duchain/navigation/declarationnavigationcontext.cpp index 83afa97..4d23343 100644
--- a/duchain/navigation/declarationnavigationcontext.cpp
+++ b/duchain/navigation/declarationnavigationcontext.cpp
@@ -129,7 +129,7 @@ void DeclarationNavigationContext::htmlFunction()
if (type->arguments().size() > 0) {
bool first = true;
int nDef = 0;
- DUContext *ctx = DUChainUtils::getArgumentContext(declaration().data());
+ DUContext *ctx = DUChainUtils::argumentContext(declaration().data());
if (ctx) {
modifyHtml() += "( ";
@@ -184,7 +184,7 @@ void DeclarationNavigationContext::htmlClass()
}
}
-void DeclarationNavigationContext::makeLink(const QString &name, DeclarationPointer \
declaration, +void DeclarationNavigationContext::makeLink(const QString &name, const \
DeclarationPointer& declaration,
NavigationAction::Type actionType)
{
if (actionType == NavigationAction::JumpToSource
diff --git a/duchain/navigation/declarationnavigationcontext.h \
b/duchain/navigation/declarationnavigationcontext.h index 913dc99..5a7e065 100644
--- a/duchain/navigation/declarationnavigationcontext.h
+++ b/duchain/navigation/declarationnavigationcontext.h
@@ -78,9 +78,9 @@ protected:
* @param declaration The involved declaration.
* @param actionType Important if this is a JumpToSource action.
*/
- virtual void makeLink(const QString &name,
- KDevelop::DeclarationPointer declaration,
- KDevelop::NavigationAction::Type actionType) override;
+ void makeLink(const QString &name,
+ const KDevelop::DeclarationPointer& declaration,
+ KDevelop::NavigationAction::Type actionType) override;
private:
/**
diff --git a/duchain/navigation/includenavigationcontext.cpp \
b/duchain/navigation/includenavigationcontext.cpp index f429ab0..798ea32 100644
--- a/duchain/navigation/includenavigationcontext.cpp
+++ b/duchain/navigation/includenavigationcontext.cpp
@@ -48,7 +48,7 @@ bool \
IncludeNavigationContext::filterDeclaration(KDevelop::Declaration *decl) return !vd;
}
-QString IncludeNavigationContext::declarationKind(KDevelop::DeclarationPointer decl)
+QString IncludeNavigationContext::declarationKind(const \
KDevelop::DeclarationPointer& decl) {
const MethodDeclaration *md = dynamic_cast<const MethodDeclaration \
*>(decl.data()); if (md)
diff --git a/duchain/navigation/includenavigationcontext.h \
b/duchain/navigation/includenavigationcontext.h index 1e07279..647ab5a 100644
--- a/duchain/navigation/includenavigationcontext.h
+++ b/duchain/navigation/includenavigationcontext.h
@@ -60,7 +60,7 @@ protected:
* show to the user if this declaration has some special meaning for
* the Ruby interpreter.
*/
- QString declarationKind(KDevelop::DeclarationPointer decl) override;
+ QString declarationKind(const KDevelop::DeclarationPointer& decl) override;
};
}
diff --git a/duchain/tests/duchain.cpp b/duchain/tests/duchain.cpp
index a3d9f17..0c66422 100644
--- a/duchain/tests/duchain.cpp
+++ b/duchain/tests/duchain.cpp
@@ -1530,7 +1530,7 @@ void TestDUChain::guessArgumentsType1()
DUChainWriteLocker lock;
Declaration *d = top->localDeclarations().first();
- QVector<Declaration *> args = \
DUChainUtils::getArgumentContext(d)->localDeclarations(); + QVector<Declaration *> \
args = DUChainUtils::argumentContext(d)->localDeclarations(); QCOMPARE(args.size(), \
7);
// a, b and c are just Fixnum
@@ -1558,7 +1558,7 @@ void TestDUChain::guessArgumentsType2()
DUChainWriteLocker lock;
Declaration *d = top->localDeclarations().first();
- QVector<Declaration *> args = \
DUChainUtils::getArgumentContext(d)->localDeclarations(); + QVector<Declaration *> \
args = DUChainUtils::argumentContext(d)->localDeclarations(); QCOMPARE(args.size(), \
7);
// a is just a Fixnum
@@ -1593,7 +1593,7 @@ void TestDUChain::guessArgumentsType3()
DUChainWriteLocker lock;
Declaration *d = top->localDeclarations().first();
- QVector<Declaration *> args = \
DUChainUtils::getArgumentContext(d)->localDeclarations(); + QVector<Declaration *> \
args = DUChainUtils::argumentContext(d)->localDeclarations(); QCOMPARE(args.size(), \
7);
// a is just a Fixnum
@@ -1655,7 +1655,7 @@ void TestDUChain::hashArgument()
DUChainWriteLocker lock;
Declaration *d = top->localDeclarations().first();
- QVector<Declaration *> args = \
DUChainUtils::getArgumentContext(d)->localDeclarations(); + QVector<Declaration *> \
args = DUChainUtils::argumentContext(d)->localDeclarations(); QCOMPARE(args.size(), \
3);
// a
@@ -1685,7 +1685,7 @@ void TestDUChain::setUnsureArgument()
MethodDeclaration *md = dynamic_cast<MethodDeclaration \
*>(top->localDeclarations().first()); QVERIFY(md);
- QVector<Declaration *> args = \
DUChainUtils::getArgumentContext(md)->localDeclarations(); + QVector<Declaration \
*> args = DUChainUtils::argumentContext(md)->localDeclarations(); \
QVERIFY(args.size() == 2);
UnsureType::Ptr unsure = \
UnsureType::Ptr::dynamicCast(args.first()->indexedType().abstractType()); \
QStringList list;
diff --git a/duchain/tests/uses.cpp b/duchain/tests/uses.cpp
index 9093315..cb06f61 100644
--- a/duchain/tests/uses.cpp
+++ b/duchain/tests/uses.cpp
@@ -218,7 +218,7 @@ void TestUseBuilder::checkMethodArgumentsContext()
QCOMPARE(top->localDeclarations().count(), 1);
Declaration *d = dynamic_cast<Declaration *>(top->localDeclarations().first());
QVERIFY(d);
- DUContext *params = DUChainUtils::getArgumentContext(d);
+ DUContext *params = DUChainUtils::argumentContext(d);
QVERIFY(params);
QCOMPARE(params->range(), RangeInRevision(0, 8, 0, 12));
diff --git a/rails/dataprovider.h b/rails/dataprovider.h
index 446c833..031f437 100644
--- a/rails/dataprovider.h
+++ b/rails/dataprovider.h
@@ -55,6 +55,12 @@ public:
{
return KDevelop::Path(data.url);
}
+ inline KDevelop::Path itemPrefixPath(const QuickOpenItem& data) const
+ {
+#warning DataProvider::itemPrefixPath(QuickOpenItem) needs a sane implementation!
+ // FIXME: what should/could be returned here?
+ return KDevelop::Path();
+ }
/// @returns all scopes supported by this data-provider.
static QStringList scopes();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic