diff --git a/duchain/contextbuilder.h b/duchain/contextbuilder.h index 83955aa..61a6d3b 100644 --- a/duchain/contextbuilder.h +++ b/duchain/contextbuilder.h @@ -1,42 +1,42 @@ #ifndef CONTEXTBUILDER_H #define CONTEXTBUILDER_H #include #include "rustnode.h" namespace Rust { using ContextBuilderBase = KDevelop::AbstractContextBuilder; class ContextBuilder : public ContextBuilderBase { public: ContextBuilder() = default; - virtual ~ContextBuilder() = default; + ~ContextBuilder() override = default; protected: KDevelop::RangeInRevision editorFindSpellingRange(RustNode *node, const QString &identifier); template KDevelop::DUContext *createContext(RSNode *node, const KDevelop::QualifiedIdentifier& scopeId); virtual RSVisitResult visitNode(RustNode *node, RustNode *parent) = 0; void visitChildren(RustNode *node); void startVisiting(RustNode *node) override; void setContextOnNode(RustNode *node, KDevelop::DUContext *context) override; KDevelop::DUContext *contextFromNode(RustNode *node) override; KDevelop::RangeInRevision editorFindRange(RustNode *fromNode, RustNode *toNode) override; KDevelop::QualifiedIdentifier identifierForNode(RustPath *node) override; KDevelop::DUContext *newContext(const KDevelop::RangeInRevision &range) override; KDevelop::TopDUContext *newTopContext(const KDevelop::RangeInRevision &range, KDevelop::ParsingEnvironmentFile *file) override; private: friend RSVisitResult visitCallback(RSNode *node, RSNode *parent, void *data); }; } #endif // CONTEXTBUILDER_H diff --git a/duchain/declarationbuilder.h b/duchain/declarationbuilder.h index bfc6ca3..8961c1a 100644 --- a/duchain/declarationbuilder.h +++ b/duchain/declarationbuilder.h @@ -1,70 +1,70 @@ #ifndef DECLARATIONBUILDER_H #define DECLARATIONBUILDER_H #include #include #include #include #include "duchain/types/declarationtypes.h" #include "duchain/contextbuilder.h" #include "duchain/nodetraits.h" #include "duchain/rustnode.h" #include "duchain/astredux.h" namespace Rust { using TypeBuilderBase = KDevelop::AbstractTypeBuilder; using DeclarationBuilderBase = KDevelop::AbstractDeclarationBuilder; namespace detail { enum class enabler {}; } constexpr detail::enabler dummy = {}; template using EnableIf = typename std::enable_if::type; class DeclarationBuilder : public DeclarationBuilderBase { public: DeclarationBuilder() = default; - virtual ~DeclarationBuilder() = default; + ~DeclarationBuilder() override = default; protected: - virtual RSVisitResult visitNode(RustNode *node, RustNode *parent); + RSVisitResult visitNode(RustNode *node, RustNode *parent) override; private: template RSVisitResult buildDeclaration(RustNode *node, RustNode *parent); template KDevelop::Declaration *createDeclaration(RustNode *node, RustPath *name, bool hasContext); template = dummy> typename IdType::Type::Ptr createType(RustNode *node); template = dummy> KDevelop::FunctionType::Ptr createType(RustNode *node); template = dummy> KDevelop::AbstractType::Ptr createType(RustNode *node); template void setDeclData(KDevelop::Declaration *decl); template = dummy> void setDeclData(KDevelop::ClassDeclaration *decl); template void setType(KDevelop::Declaration *decl, typename IdType::Type *type); template void setType(KDevelop::Declaration *decl, KDevelop::IdentifiedType *type); template void setType(KDevelop::Declaration *decl, KDevelop::AbstractType *type); }; } #endif // DECLARATIONBUILDER_H diff --git a/duchain/parsesession.h b/duchain/parsesession.h index 798905f..c164f88 100644 --- a/duchain/parsesession.h +++ b/duchain/parsesession.h @@ -1,54 +1,54 @@ #ifndef PARSESESSION_H #define PARSESESSION_H #include #include #include "astredux.h" namespace Rust { class ParseSessionData : public KDevelop::IAstContainer { public: typedef QExplicitlySharedDataPointer Ptr; ParseSessionData(const KDevelop::IndexedString &document, const QByteArray &contents); - virtual ~ParseSessionData(); + ~ParseSessionData() override; private: friend class ParseSession; void parse(); KDevelop::IndexedString m_document; QByteArray m_contents; RSCrate *m_crate; }; class ParseSession { public: explicit ParseSession(const ParseSessionData::Ptr &data); ~ParseSession(); void parse(); ParseSessionData::Ptr data() const; void setData(const ParseSessionData::Ptr data); KDevelop::IndexedString document() const; RSCrate *crate() const; private: Q_DISABLE_COPY(ParseSession) ParseSessionData::Ptr d; }; } #endif // PARSESESSION_H diff --git a/duchain/rustducontext.h b/duchain/rustducontext.h index 7e013df..9e42a4e 100644 --- a/duchain/rustducontext.h +++ b/duchain/rustducontext.h @@ -1,41 +1,41 @@ #ifndef RUSTDUCONTEXT_H #define RUSTDUCONTEXT_H #include #include #include namespace Rust { using namespace KDevelop; template class RustDUContext : public BaseContext { public: template explicit RustDUContext(Data& data) : BaseContext(data) { } ///Parameters will be reached to the base-class template explicit RustDUContext(Params... params) : BaseContext(params...) { static_cast(this)->d_func_dynamic()->setClassId(this); } - virtual QWidget *createNavigationWidget(KDevelop::Declaration* decl = 0, KDevelop::TopDUContext* topContext = 0, + QWidget *createNavigationWidget(KDevelop::Declaration* decl = 0, KDevelop::TopDUContext* topContext = 0, const QString& htmlPrefix = QString(), const QString& htmlSuffix = QString(), KDevelop::AbstractNavigationWidget::DisplayHints hints = KDevelop::AbstractNavigationWidget::NoHints) const override; enum { Identity = IdentityT }; }; using RustTopDUContext = RustDUContext; using RustNormalDUContext = RustDUContext; } #endif // RUSTDUCONTEXT_H diff --git a/duchain/usebuilder.h b/duchain/usebuilder.h index 796c68a..cf066a0 100644 --- a/duchain/usebuilder.h +++ b/duchain/usebuilder.h @@ -1,25 +1,25 @@ #ifndef USEBUILDER_H #define USEBUILDER_H #include #include "contextbuilder.h" #include "rustnode.h" namespace Rust { using UseBuilderBase = KDevelop::AbstractUseBuilder; class UseBuilder : public UseBuilderBase { public: UseBuilder() = default; - virtual ~UseBuilder() = default; + ~UseBuilder() override = default; - virtual RSVisitResult visitNode(RustNode *node, RustNode *parent); + RSVisitResult visitNode(RustNode *node, RustNode *parent) override; }; } #endif // USEBUILDER_H diff --git a/rusthighlighting.cpp b/rusthighlighting.cpp index 336d10e..7e44fc8 100644 --- a/rusthighlighting.cpp +++ b/rusthighlighting.cpp @@ -1,34 +1,34 @@ #include "rusthighlighting.h" using namespace KDevelop; namespace Rust { class HighlightingInstance : public CodeHighlightingInstance { public: HighlightingInstance(const Highlighting *highlighting); - virtual ~HighlightingInstance(); + ~HighlightingInstance() override; }; HighlightingInstance::HighlightingInstance(const Highlighting *highlighting) : CodeHighlightingInstance(highlighting) { } HighlightingInstance::~HighlightingInstance() { } Highlighting::Highlighting(QObject* parent) : CodeHighlighting(parent) { } CodeHighlightingInstance* Highlighting::createInstance() const { return new HighlightingInstance(this); } } diff --git a/rustlanguagesupport.h b/rustlanguagesupport.h index b521cfd..93f0c3f 100644 --- a/rustlanguagesupport.h +++ b/rustlanguagesupport.h @@ -1,40 +1,40 @@ #ifndef KDEVRUSTLANGUAGESUPPORT_H #define KDEVRUSTLANGUAGESUPPORT_H #include #include #include #include #include #include #include "rusthighlighting.h" #include "duchain/astredux.h" namespace Rust { class LanguageSupport : public KDevelop::IPlugin , public KDevelop::ILanguageSupport { Q_OBJECT Q_INTERFACES( KDevelop::ILanguageSupport ) public: LanguageSupport(QObject* parent, const QVariantList& args = QVariantList()); - ~LanguageSupport(); + ~LanguageSupport() override; QString name() const override; KDevelop::ParseJob* createParseJob(const KDevelop::IndexedString &url) override; - virtual KDevelop::ICodeHighlighting *codeHighlighting() const; + KDevelop::ICodeHighlighting *codeHighlighting() const override; private: Highlighting* m_highlighting; }; } #endif // KDEVRUSTLANGUAGESUPPORT_H