1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
/*
SPDX-FileCopyrightText: 2011-2013 Sven Brauch <svenbrauch@googlemail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "pythonducontext.h"
#include <language/duchain/topducontext.h>
#include <language/duchain/topducontextdata.h>
#include <language/duchain/duchainregister.h>
#include <language/duchain/duchainpointer.h>
#include "navigation/navigationwidget.h"
#include <QDebug>
#include "duchaindebug.h"
using namespace KDevelop;
namespace Python {
REGISTER_DUCHAIN_ITEM_WITH_DATA(PythonTopDUContext, TopDUContextData);
REGISTER_DUCHAIN_ITEM_WITH_DATA(PythonNormalDUContext, DUContextData);
template<>
KDevelop::AbstractNavigationWidget* PythonTopDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext,
KDevelop::AbstractNavigationWidget::DisplayHints hints) const {
if ( ! decl ) {
qCDebug(KDEV_PYTHON_DUCHAIN) << "no declaration, not returning navigationwidget";
return nullptr;
}
return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext), hints);
}
template<>
KDevelop::AbstractNavigationWidget* PythonNormalDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext,
KDevelop::AbstractNavigationWidget::DisplayHints hints) const {
if ( ! decl ) {
qCDebug(KDEV_PYTHON_DUCHAIN) << "no declaration, not returning navigationwidget";
return nullptr;
}
return new NavigationWidget(DeclarationPointer(decl), TopDUContextPointer(topContext), hints);
}
}
|