diff --git a/languages/clang/codegen/adaptsignatureassistant.h b/languages/clang/codegen/adaptsignatureassistant.h index 8b0bd2dc57..33886bbf53 100644 --- a/languages/clang/codegen/adaptsignatureassistant.h +++ b/languages/clang/codegen/adaptsignatureassistant.h @@ -1,76 +1,76 @@ /* Copyright 2009 David Nolden Copyright 2014 Kevin Funk This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SIGNATUREASSISTANT_H #define SIGNATUREASSISTANT_H #include "adaptsignatureaction.h" #include "clangprivateexport.h" #include #include #include #include #include namespace KTextEditor { class View; } class KDEVCLANGPRIVATE_EXPORT AdaptSignatureAssistant : public KDevelop::StaticAssistant { Q_OBJECT public: AdaptSignatureAssistant(KDevelop::ILanguageSupport* supportedLanguage); QString title() const override; void textChanged(KTextEditor::Document* doc, const KTextEditor::Range& invocationRange, const QString& removedText = QString()) override; bool isUseful() const override; KTextEditor::Range displayRange() const override; private: - ///Compare @param newSignature to m_oldSignature and put differences in oldPositions + ///Compare @a newSignature to m_oldSignature and put differences in @a oldPositions ///@returns whether or not there are any differences bool getSignatureChanges(const Signature &newSignature, QList &oldPositions) const; - ///Set default params in @param newSignature based on m_oldSignature's defaults and @param oldPositions + ///Set default params in @a newSignature based on m_oldSignature's defaults and @a oldPositions void setDefaultParams(Signature &newSignature, const QList &oldPositions) const; ///@returns RenameActions for each parameter in newSignature that has been renamed QList getRenameActions(const Signature &newSignature, const QList &oldPositions) const; // If this is true, the user is editing on the definition side, // and the declaration should be updated bool m_editingDefinition = false; KDevelop::Identifier m_declarationName; KDevelop::DeclarationId m_otherSideId; KDevelop::ReferencedTopDUContext m_otherSideTopContext; KDevelop::DUContextPointer m_otherSideContext; KTextEditor::Cursor m_lastEditPosition; //old signature of the _other_side Signature m_oldSignature; QPointer m_document; QPointer m_view; private slots: void updateReady(const KDevelop::IndexedString& document, const KDevelop::ReferencedTopDUContext& context) override; void reset(); }; #endif // SIGNATUREASSISTANT_H diff --git a/languages/clang/duchain/clanghelpers.h b/languages/clang/duchain/clanghelpers.h index cf29271acf..7c60d3d760 100644 --- a/languages/clang/duchain/clanghelpers.h +++ b/languages/clang/duchain/clanghelpers.h @@ -1,103 +1,103 @@ /* * Copyright 2014 Olivier de Gaalon * Copyright 2014 Milian Wolff * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef CLANGHELPERS_H #define CLANGHELPERS_H #include "clangprivateexport.h" #include #include #include #include class ParseSession; class ClangIndex; struct Import { CXFile file; KDevelop::CursorInRevision location; }; using Imports = QMultiHash; using IncludeFileContexts = QHash; namespace ClangHelpers { KDevelop::DeclarationPointer findDeclaration(CXSourceLocation cursor, KDevelop::QualifiedIdentifier id, const KDevelop::ReferencedTopDUContext& top); KDevelop::DeclarationPointer findDeclaration(CXCursor cursor, const IncludeFileContexts& includes); KDevelop::DeclarationPointer findDeclaration(CXType type, const IncludeFileContexts& includes); /** - * Try to look up the first reachable forward declaration for type @p type + * Try to look up the first reachable forward declaration for type @a type * * @param context The context where this search is happening * @param cursor The location from which we're searching */ KDevelop::DeclarationPointer findForwardDeclaration(CXType type, KDevelop::DUContext* context, CXCursor cursor); /** * Wrapper for @ref clang_Cursor_getSpellingNameRange which sometimes reports invalid ranges */ KDevelop::RangeInRevision cursorSpellingNameRange(CXCursor cursor, const KDevelop::Identifier& id); /** - * @returns all the Imports for each file in the @param tu + * @returns all the Imports for each file in the @a tu */ KDEVCLANGPRIVATE_EXPORT Imports tuImports(CXTranslationUnit tu); /** - * Recursively builds a duchain with the specified @param features for the - * @param file and each of its @param imports using the TU from @param session. - * The resulting contexts are placed in @param includedFiles. - * @returns the context created for @param file + * Recursively builds a duchain with the specified @a features for the + * @a file and each of its @a imports using the TU from @a session. + * The resulting contexts are placed in @a includedFiles. + * @returns the context created for @a file */ KDEVCLANGPRIVATE_EXPORT KDevelop::ReferencedTopDUContext buildDUChain( CXFile file, const Imports& imports, const ParseSession& session, KDevelop::TopDUContext::Features features, IncludeFileContexts& includedFiles, ClangIndex* index = nullptr, const std::function& abortFunction = {}); /** * @return List of possible header extensions used for definition/declaration fallback switching */ QStringList headerExtensions(); /** * @return List of possible source extensions used for definition/declaration fallback switching */ QStringList sourceExtensions(); /** - * @return True if the given file @p path has the extension of a C++ source file + * @return True if the given file @a path has the extension of a C++ source file */ KDEVCLANGPRIVATE_EXPORT bool isSource(const QString& path); /** - * @return True if the given file @p path has the extension of a C++ header file + * @return True if the given file @a path has the extension of a C++ header file */ KDEVCLANGPRIVATE_EXPORT bool isHeader(const QString& path); } #endif //CLANGHELPERS_H diff --git a/languages/qmljs/duchain/functiondeclaration.h b/languages/qmljs/duchain/functiondeclaration.h index 0b86626cbc..5cef445b24 100644 --- a/languages/qmljs/duchain/functiondeclaration.h +++ b/languages/qmljs/duchain/functiondeclaration.h @@ -1,96 +1,95 @@ /* * This file is part of qmljs, the QML/JS language support plugin for KDevelop * Copyright (c) 2014 Denis Steckelmacher * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef __FUNCTIONDECLARATION_H__ #define __FUNCTIONDECLARATION_H__ #include "duchainexport.h" #include #include #include namespace QmlJS { class KDEVQMLJSDUCHAIN_EXPORT FunctionDeclarationData : public KDevelop::FunctionDeclarationData { public: KDevelop::IndexedDUContext m_prototypeContext; }; /** * @brief Function declaration keeping track of a "prototype" context * * The prototype of a function can be used, in Javascript, to add methods and * members to the objects instantiated by calling the function. * * The prototype is also used to resolve "this". If a function is assigned to * an object member, its "prototype" becomes the internal context of the object. * This way, functions assigned to members of the prototype of a class can use * "this" to refer to the object on which they are called. * * @code * function Class() { this.name = "Me"; } * * Class.prototype.print = function() { console.log(this.name) } * @endcode */ class KDEVQMLJSDUCHAIN_EXPORT FunctionDeclaration : public KDevelop::FunctionDeclaration { public: FunctionDeclaration(const FunctionDeclaration &rhs); FunctionDeclaration(const KDevelop::RangeInRevision &range, KDevelop::DUContext *context); FunctionDeclaration(FunctionDeclarationData &data); ~FunctionDeclaration(); /** * @brief Return the context representing the prototype of this function * * The returned context, if not null, contains the declarations of the members * of the prototype. * * @note The DUChain must be read-locked */ KDevelop::DUContext* prototypeContext() const; /** * @brief Set the prototype context of this function - * @param own True if this function declaration must be set as the owner of context * * @note The DUChain must be write-locked */ void setPrototypeContext(KDevelop::DUContext* context); enum { Identity = 112 }; typedef KDevelop::DUChainPointer Ptr; private: DUCHAIN_DECLARE_DATA(FunctionDeclaration); }; } DUCHAIN_DECLARE_TYPE(QmlJS::FunctionDeclaration) -#endif \ No newline at end of file +#endif diff --git a/languages/qmljs/duchain/parsesession.h b/languages/qmljs/duchain/parsesession.h index 650a371196..b3b53fd00b 100644 --- a/languages/qmljs/duchain/parsesession.h +++ b/languages/qmljs/duchain/parsesession.h @@ -1,199 +1,196 @@ /************************************************************************************* * Copyright (C) 2012 by Milian Wolff * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ #ifndef PARSESESSION_H #define PARSESESSION_H #include #include #include #include #include #include "duchainexport.h" namespace KDevelop { class SimpleRange; class RangeInRevision; } typedef QPair SimpleUse; /** * This class wraps the qmljs parser and offers some helper functions * that make it simpler to use the parser in KDevelop. */ class KDEVQMLJSDUCHAIN_EXPORT ParseSession { public: /** * @return a unique identifier for QML/JS documents. */ static KDevelop::IndexedString languageString(); /** * @return the QML/JS language corresponding to a file suffix */ static QmlJS::Dialect guessLanguageFromSuffix(const QString& path); /** * Parse the given @p contents. * * @param url The url for the document you want to parse. * @param contents The contents of the document you want to parse. */ ParseSession(const KDevelop::IndexedString& url, const QString& contents, int priority); /** * @return the URL of this session */ KDevelop::IndexedString url() const; /** * @return The module name of this file ("/foo/QtQuick.qml" yields "QtQuick") */ QString moduleName() const; /** * @return true if the document was properly parsed, false otherwise. */ bool isParsedCorrectly() const; /** * @return the root AST node or null if it failed to parse. */ QmlJS::AST::Node* ast() const; /** * Add a problem concerning the given range */ void addProblem(QmlJS::AST::Node* node, const QString& message, KDevelop::IProblem::Severity severity = KDevelop::IProblem::Warning); /** * @return the problems encountered during parsing. */ QList problems() const; /** * @return the string representation of @p location. */ QString symbolAt(const QmlJS::AST::SourceLocation& location) const; /** * @return the language of the parsed document. */ QmlJS::Dialect language() const; /** * @return the comment related to the given source location or an empty string */ QString commentForLocation(const QmlJS::AST::SourceLocation& location) const; /** * Convert @p location to a KDevelop::RangeInRevision and return that. */ KDevelop::RangeInRevision locationToRange(const QmlJS::AST::SourceLocation& location) const; /** * Convert @p locationFrom and @p locationTo to a KDevelop::RangeInRevision and return that. */ KDevelop::RangeInRevision locationsToRange(const QmlJS::AST::SourceLocation& locationFrom, const QmlJS::AST::SourceLocation& locationTo) const; /** * Range that starts at the end of the first token, and ends at the beginning of the second token */ KDevelop::RangeInRevision locationsToInnerRange(const QmlJS::AST::SourceLocation& locationFrom, const QmlJS::AST::SourceLocation& locationTo) const; /** * @return a range that spans @p fromNode and @p toNode. */ KDevelop::RangeInRevision editorFindRange(QmlJS::AST::Node* fromNode, QmlJS::AST::Node* toNode) const; /** * Implemented to make the AbstractUseBuilder happy. */ void mapAstUse(QmlJS::AST::Node* node, const SimpleUse& use) { Q_UNUSED(node); Q_UNUSED(use); } void setContextOnNode(QmlJS::AST::Node* node, KDevelop::DUContext* context); KDevelop::DUContext* contextFromNode(QmlJS::AST::Node* node) const; /** * Return whether all the files included by this file were already present in * the DUChain. */ bool allDependenciesSatisfied() const; /** * Return the context of a given QML file, NULL if this file is not yet known * to the DUChain. * * When a file that exists is passed to this method and the file hasn't yet * been parsed, it is queued for parsing, and the current file will also be * re-parsed after it. */ KDevelop::ReferencedTopDUContext contextOfFile(const QString &fileName); /** * Static version of contextOfFile. The @p url parameter is used to trigger * a reparse of @p url if @p fileName was not yet in the DUChain */ static KDevelop::ReferencedTopDUContext contextOfFile(const QString& fileName, const KDevelop::IndexedString& url, int ownPriority); /** * Schedule for update all the files that depend on this file */ void reparseImporters(); /** * Schedule a document for update using the default flags of QML/JS - * - * @return The actual priority of the file being queued (this priority can - * only be lower then @p priority) */ static void scheduleForParsing(const KDevelop::IndexedString& url, int priority); /** * Dump AST tree to stdout. */ void dumpNode(QmlJS::AST::Node* node) const; private: KDevelop::IndexedString m_url; QString m_baseName; QmlJS::Document::MutablePtr m_doc; int m_ownPriority; bool m_allDependenciesSatisfied; QList m_problems; typedef QHash NodeToContextHash; NodeToContextHash m_astToContext; }; #endif // PARSESESSION_H diff --git a/projectmanagers/cmake/tests/manual/target_include_directories/libincludes/a.h b/projectmanagers/cmake/tests/manual/target_include_directories/libincludes/a.h index a36f31b1c6..719a1a747a 100644 --- a/projectmanagers/cmake/tests/manual/target_include_directories/libincludes/a.h +++ b/projectmanagers/cmake/tests/manual/target_include_directories/libincludes/a.h @@ -1 +1,6 @@ +#ifndef INCLUDE_A_H +#define INCLUDE_A_H + int fu(); + +#endif diff --git a/projectmanagers/cmake/tests/manual/unit_tests_kde/test.h b/projectmanagers/cmake/tests/manual/unit_tests_kde/test.h index 67f61186b5..1af12666c0 100644 --- a/projectmanagers/cmake/tests/manual/unit_tests_kde/test.h +++ b/projectmanagers/cmake/tests/manual/unit_tests_kde/test.h @@ -1,22 +1,22 @@ #ifndef KDETEST_H -#define KDETEST_h +#define KDETEST_H #include class KdeTest : public QObject { Q_OBJECT private slots: void initTestCase(); void passingTestCase(); void failingTestCase(); void expectedFailTestCase(); void unexpectedPassTestCase(); void skippedTestCase(); void cleanupTestCase(); }; #endif // KDETEST_H diff --git a/projectmanagers/custom-buildsystem/tests/projects/simpleproject/config.h b/projectmanagers/custom-buildsystem/tests/projects/simpleproject/config.h index 809a32d892..6f1c6cf01c 100644 --- a/projectmanagers/custom-buildsystem/tests/projects/simpleproject/config.h +++ b/projectmanagers/custom-buildsystem/tests/projects/simpleproject/config.h @@ -1 +1,6 @@ +#ifndef CONFIG_H +#define CONFIG_H + #define myvar + +#endif