diff --git a/buildsystem/buildsystem.h b/buildsystem/buildsystem.h --- a/buildsystem/buildsystem.h +++ b/buildsystem/buildsystem.h @@ -37,6 +37,7 @@ bool removeTarget(KDevelop::ProjectTargetItem *target) override; bool removeFilesFromTargets(const QList&) override; bool hasBuildInfo(KDevelop::ProjectBaseItem* item) const override; + KDevelop::Path compiler(KDevelop::ProjectTargetItem* p) const override; KDevelop::Path buildDirectory(KDevelop::ProjectBaseItem*) const override; QList targets(KDevelop::ProjectFolderItem*) const override; KDevelop::ProjectFolderItem* createFolderItem(KDevelop::IProject * project, const KDevelop::Path & path, KDevelop::ProjectBaseItem * parent) override; diff --git a/buildsystem/buildsystem.cpp b/buildsystem/buildsystem.cpp --- a/buildsystem/buildsystem.cpp +++ b/buildsystem/buildsystem.cpp @@ -95,6 +95,12 @@ return false; } +Path GoBuildSystem::compiler(KDevelop::ProjectTargetItem* p) const +{ + Q_UNUSED(p); + return Path("go"); +} + Path GoBuildSystem::buildDirectory(KDevelop::ProjectBaseItem* item) const { auto project = item->project(); diff --git a/codecompletion/CMakeLists.txt b/codecompletion/CMakeLists.txt --- a/codecompletion/CMakeLists.txt +++ b/codecompletion/CMakeLists.txt @@ -21,4 +21,6 @@ install(TARGETS kdevgocompletion DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/duchain/CMakeLists.txt b/duchain/CMakeLists.txt --- a/duchain/CMakeLists.txt +++ b/duchain/CMakeLists.txt @@ -33,4 +33,6 @@ install(TARGETS kdevgoduchain DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) -add_subdirectory(tests) \ No newline at end of file +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/duchain/goducontext.h b/duchain/goducontext.h --- a/duchain/goducontext.h +++ b/duchain/goducontext.h @@ -46,8 +46,9 @@ static_cast(this)->d_func_dynamic()->setClassId(this); } - QWidget* createNavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, - const QString& htmlPrefix, const QString& htmlSuffix, const KDevelop::AbstractNavigationWidget::DisplayHints hints) const override; + KDevelop::AbstractNavigationWidget* + createNavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, + KDevelop::AbstractNavigationWidget::DisplayHints hints) const override; enum { Identity = BaseContext::Identity + 51 diff --git a/duchain/goducontext.cpp b/duchain/goducontext.cpp --- a/duchain/goducontext.cpp +++ b/duchain/goducontext.cpp @@ -37,26 +37,26 @@ typedef GoDUContext GoNormalDUContext; REGISTER_DUCHAIN_ITEM_WITH_DATA(GoNormalDUContext, DUContextData); -template<> -QWidget* GoTopDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, - const QString& htmlPrefix, const QString& htmlSuffix, - const KDevelop::AbstractNavigationWidget::DisplayHints hints) const { +template <> +AbstractNavigationWidget* +GoTopDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, + AbstractNavigationWidget::DisplayHints hints) const { if (!decl) { qCDebug(DUCHAIN) << "no declaration, not returning navigationwidget"; return 0; } - return new NavigationWidget(decl, topContext, htmlPrefix, htmlSuffix, hints); + return new NavigationWidget(decl, topContext, hints); } -template<> -QWidget* GoNormalDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, - const QString& htmlPrefix, const QString& htmlSuffix, - const KDevelop::AbstractNavigationWidget::DisplayHints hints) const { +template <> +AbstractNavigationWidget* +GoNormalDUContext::createNavigationWidget(Declaration* decl, TopDUContext* topContext, + AbstractNavigationWidget::DisplayHints hints) const { if (!decl) { qCDebug(DUCHAIN) << "no declaration, not returning navigationwidget"; return 0; } - return new NavigationWidget(decl, topContext, htmlPrefix, htmlSuffix, hints); + return new NavigationWidget(decl, topContext, hints); } } diff --git a/duchain/navigation/declarationnavigationcontext.cpp b/duchain/navigation/declarationnavigationcontext.cpp --- a/duchain/navigation/declarationnavigationcontext.cpp +++ b/duchain/navigation/declarationnavigationcontext.cpp @@ -71,9 +71,7 @@ { clear(); AbstractNavigationContext::html(shorten); - modifyHtml() += "

" + fontSizePrefix(shorten); - - addExternalHtml(prefix()); + modifyHtml() += "

" + shorten; if(!declaration().data()) { modifyHtml() += i18n("
lost declaration
"); @@ -291,9 +289,8 @@ //modifyHtml() += "
"; - addExternalHtml(suffix()); - modifyHtml() += fontSizeSuffix(shorten) + "

"; + modifyHtml() += shorten + "

"; return currentHtml(); } diff --git a/duchain/navigation/navigationwidget.h b/duchain/navigation/navigationwidget.h --- a/duchain/navigation/navigationwidget.h +++ b/duchain/navigation/navigationwidget.h @@ -27,7 +27,7 @@ { public: NavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, - const QString& htmlPrefix, const QString& htmlSuffix, const KDevelop::AbstractNavigationWidget::DisplayHints hints); + const KDevelop::AbstractNavigationWidget::DisplayHints hints); }; diff --git a/duchain/navigation/navigationwidget.cpp b/duchain/navigation/navigationwidget.cpp --- a/duchain/navigation/navigationwidget.cpp +++ b/duchain/navigation/navigationwidget.cpp @@ -24,12 +24,10 @@ using namespace KDevelop; NavigationWidget::NavigationWidget(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, - const QString& htmlPrefix, const QString& htmlSuffix, const KDevelop::AbstractNavigationWidget::DisplayHints hints) { auto context = NavigationContextPointer(new DeclarationNavigationContext(DeclarationPointer(decl), TopDUContextPointer(topContext), nullptr)); - context->setPrefixSuffix(htmlPrefix, htmlSuffix); setDisplayHints(hints); setContext(context); } diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -20,4 +20,6 @@ ) install(TARGETS kdevgoparser DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) -add_subdirectory(test) +if(BUILD_TESTING) + add_subdirectory(test) +endif()