2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-10-10 21:00:48 +02:00
|
|
|
#include "cpptools_global.h"
|
|
|
|
|
|
2013-03-27 18:54:03 +01:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
namespace Utils { class FilePath; }
|
2014-07-15 11:50:42 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace CppTools {
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2015-06-02 17:25:41 +02:00
|
|
|
class CppCodeModelSettings;
|
2011-02-03 15:48:14 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2009-04-29 09:04:59 +02:00
|
|
|
struct CppFileSettings;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-01-29 04:15:25 +03:00
|
|
|
class CppToolsPlugin final : public ExtensionSystem::IPlugin
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2012-02-21 16:52:28 +01:00
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CppTools.json")
|
2011-07-13 18:02:35 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
|
|
|
|
CppToolsPlugin();
|
2018-02-07 11:05:48 +01:00
|
|
|
~CppToolsPlugin() final;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-03-19 11:51:36 +01:00
|
|
|
static CppToolsPlugin *instance();
|
2013-08-25 22:42:37 +03:00
|
|
|
static const QStringList &headerSearchPaths();
|
|
|
|
|
static const QStringList &sourceSearchPaths();
|
2014-01-20 09:15:50 +02:00
|
|
|
static const QStringList &headerPrefixes();
|
|
|
|
|
static const QStringList &sourcePrefixes();
|
2013-08-25 22:42:37 +03:00
|
|
|
static void clearHeaderSourceCache();
|
2019-05-28 13:49:26 +02:00
|
|
|
static Utils::FilePath licenseTemplatePath();
|
2014-07-15 11:50:42 +02:00
|
|
|
static QString licenseTemplate();
|
2019-01-03 10:56:36 +01:00
|
|
|
static bool usePragmaOnce();
|
2013-03-19 11:51:36 +01:00
|
|
|
|
2018-02-07 11:05:48 +01:00
|
|
|
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
|
|
|
|
void extensionsInitialized() final;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2020-02-03 11:13:27 +01:00
|
|
|
CppCodeModelSettings *codeModelSettings();
|
2013-09-06 13:14:15 +02:00
|
|
|
|
2013-03-19 11:51:36 +01:00
|
|
|
public slots:
|
2008-12-02 12:01:29 +01:00
|
|
|
void switchHeaderSource();
|
2013-02-05 14:14:33 +01:00
|
|
|
void switchHeaderSourceInNextSplit();
|
2012-09-22 14:24:43 +02:00
|
|
|
|
2013-01-14 14:45:36 +01:00
|
|
|
#ifdef WITH_TESTS
|
2014-05-19 11:17:39 -04:00
|
|
|
private slots:
|
2014-01-20 09:20:08 +02:00
|
|
|
// Init/Cleanup methods implemented in cppheadersource_test.cpp
|
|
|
|
|
void initTestCase();
|
|
|
|
|
void cleanupTestCase();
|
|
|
|
|
|
2011-11-14 15:08:25 +01:00
|
|
|
void test_codegen_public_in_empty_class();
|
|
|
|
|
void test_codegen_public_in_nonempty_class();
|
|
|
|
|
void test_codegen_public_before_protected();
|
|
|
|
|
void test_codegen_private_after_protected();
|
|
|
|
|
void test_codegen_protected_in_nonempty_class();
|
|
|
|
|
void test_codegen_protected_between_public_and_private();
|
|
|
|
|
void test_codegen_qtdesigner_integration();
|
|
|
|
|
void test_codegen_definition_empty_class();
|
|
|
|
|
void test_codegen_definition_first_member();
|
|
|
|
|
void test_codegen_definition_last_member();
|
|
|
|
|
void test_codegen_definition_middle_member();
|
2013-06-07 16:44:08 +02:00
|
|
|
void test_codegen_definition_middle_member_surrounded_by_undefined();
|
|
|
|
|
void test_codegen_definition_member_specific_file();
|
2012-07-19 14:25:37 +02:00
|
|
|
|
|
|
|
|
void test_completion_basic_1();
|
2013-12-17 20:17:41 +02:00
|
|
|
|
2013-04-04 11:27:06 +04:00
|
|
|
void test_completion_template_function_data();
|
2013-12-17 20:17:41 +02:00
|
|
|
void test_completion_template_function();
|
|
|
|
|
|
|
|
|
|
void test_completion_data();
|
|
|
|
|
void test_completion();
|
|
|
|
|
|
2015-04-07 16:12:57 +02:00
|
|
|
void test_global_completion_data();
|
|
|
|
|
void test_global_completion();
|
|
|
|
|
|
2016-03-29 12:26:25 +02:00
|
|
|
void test_doxygen_tag_completion_data();
|
|
|
|
|
void test_doxygen_tag_completion();
|
|
|
|
|
|
2013-12-17 20:17:41 +02:00
|
|
|
void test_completion_member_access_operator_data();
|
|
|
|
|
void test_completion_member_access_operator();
|
|
|
|
|
|
2013-08-28 01:02:26 +04:00
|
|
|
void test_completion_prefix_first_QTCREATORBUG_8737();
|
|
|
|
|
void test_completion_prefix_first_QTCREATORBUG_9236();
|
2013-06-03 11:03:48 +02:00
|
|
|
|
2013-01-14 14:45:36 +01:00
|
|
|
void test_format_pointerdeclaration_in_simpledeclarations();
|
|
|
|
|
void test_format_pointerdeclaration_in_simpledeclarations_data();
|
|
|
|
|
void test_format_pointerdeclaration_in_controlflowstatements();
|
|
|
|
|
void test_format_pointerdeclaration_in_controlflowstatements_data();
|
|
|
|
|
void test_format_pointerdeclaration_multiple_declarators();
|
|
|
|
|
void test_format_pointerdeclaration_multiple_declarators_data();
|
|
|
|
|
void test_format_pointerdeclaration_multiple_matches();
|
|
|
|
|
void test_format_pointerdeclaration_multiple_matches_data();
|
2013-02-07 09:02:56 +01:00
|
|
|
void test_format_pointerdeclaration_macros();
|
|
|
|
|
void test_format_pointerdeclaration_macros_data();
|
2013-01-14 14:45:36 +01:00
|
|
|
|
2014-05-16 15:51:04 -04:00
|
|
|
void test_cppsourceprocessor_includes_resolvedUnresolved();
|
|
|
|
|
void test_cppsourceprocessor_includes_cyclic();
|
|
|
|
|
void test_cppsourceprocessor_includes_allDiagnostics();
|
|
|
|
|
void test_cppsourceprocessor_macroUses();
|
2014-12-05 11:56:06 +01:00
|
|
|
void test_cppsourceprocessor_includeNext();
|
2013-07-25 11:21:31 +02:00
|
|
|
|
2013-12-10 11:38:16 +01:00
|
|
|
void test_functionutils_virtualFunctions();
|
|
|
|
|
void test_functionutils_virtualFunctions_data();
|
|
|
|
|
|
2013-07-11 12:37:44 +02:00
|
|
|
void test_modelmanager_paths_are_clean();
|
2012-12-20 15:53:12 +01:00
|
|
|
void test_modelmanager_framework_headers();
|
2013-07-11 12:37:44 +02:00
|
|
|
void test_modelmanager_refresh_also_includes_of_project_files();
|
|
|
|
|
void test_modelmanager_refresh_several_times();
|
2013-07-16 12:08:39 +02:00
|
|
|
void test_modelmanager_refresh_test_for_changes();
|
2013-07-10 14:46:08 +02:00
|
|
|
void test_modelmanager_refresh_added_and_purge_removed();
|
|
|
|
|
void test_modelmanager_refresh_timeStampModified_if_sourcefiles_change();
|
|
|
|
|
void test_modelmanager_refresh_timeStampModified_if_sourcefiles_change_data();
|
2013-06-28 11:26:02 +02:00
|
|
|
void test_modelmanager_snapshot_after_two_projects();
|
2013-07-01 10:25:03 +02:00
|
|
|
void test_modelmanager_extraeditorsupport_uiFiles();
|
2013-07-16 16:20:46 +02:00
|
|
|
void test_modelmanager_gc_if_last_cppeditor_closed();
|
2013-07-17 13:50:38 +02:00
|
|
|
void test_modelmanager_dont_gc_opened_files();
|
2013-08-19 16:05:29 +02:00
|
|
|
void test_modelmanager_defines_per_project();
|
2013-09-30 14:37:50 +02:00
|
|
|
void test_modelmanager_defines_per_editor();
|
2014-12-02 12:11:05 +01:00
|
|
|
void test_modelmanager_updateEditorsAfterProjectUpdate();
|
2014-07-16 11:25:15 +02:00
|
|
|
void test_modelmanager_precompiled_headers();
|
2014-09-24 13:42:17 +02:00
|
|
|
void test_modelmanager_renameIncludes();
|
2015-10-01 14:54:31 +02:00
|
|
|
void test_modelmanager_renameIncludesInEditor();
|
2015-01-19 13:14:45 +01:00
|
|
|
void test_modelmanager_documentsAndRevisions();
|
2012-12-20 14:07:27 +01:00
|
|
|
|
2013-08-16 11:31:59 +02:00
|
|
|
void test_cpplocatorfilters_CppLocatorFilter();
|
|
|
|
|
void test_cpplocatorfilters_CppLocatorFilter_data();
|
|
|
|
|
void test_cpplocatorfilters_CppCurrentDocumentFilter();
|
2019-08-11 12:40:48 +02:00
|
|
|
void test_cpplocatorfilters_CppCurrentDocumentHighlighting();
|
|
|
|
|
void test_cpplocatorfilters_CppFunctionsFilterHighlighting();
|
2013-08-16 11:31:59 +02:00
|
|
|
|
2013-08-16 16:37:16 +02:00
|
|
|
void test_builtinsymbolsearcher();
|
|
|
|
|
void test_builtinsymbolsearcher_data();
|
|
|
|
|
|
2013-08-25 22:42:37 +03:00
|
|
|
void test_headersource_data();
|
|
|
|
|
void test_headersource();
|
|
|
|
|
|
2013-11-12 12:27:36 +01:00
|
|
|
void test_typehierarchy_data();
|
|
|
|
|
void test_typehierarchy();
|
2014-05-19 09:58:01 -04:00
|
|
|
|
2014-06-26 15:01:42 -04:00
|
|
|
void test_cpplocalsymbols_data();
|
|
|
|
|
void test_cpplocalsymbols();
|
|
|
|
|
|
2014-05-19 09:58:01 -04:00
|
|
|
void test_includeGroups_detectIncludeGroupsByNewLines();
|
|
|
|
|
void test_includeGroups_detectIncludeGroupsByIncludeDir();
|
|
|
|
|
void test_includeGroups_detectIncludeGroupsByIncludeType();
|
2021-06-30 17:44:22 +02:00
|
|
|
|
|
|
|
|
void test_optionsBuilder_addProjectMacros();
|
|
|
|
|
void test_optionsBuilder_unknownFlagsAreForwarded();
|
|
|
|
|
void test_optionsBuilder_warningsFlagsAreNotFilteredIfRequested();
|
|
|
|
|
void test_optionsBuilder_diagnosticOptionsAreRemoved();
|
|
|
|
|
void test_optionsBuilder_cLanguageVersionIsRewritten();
|
|
|
|
|
void test_optionsBuilder_languageVersionIsExplicitlySetIfNotProvided();
|
|
|
|
|
void test_optionsBuilder_LanguageVersionIsExplicitlySetIfNotProvidedMsvc();
|
|
|
|
|
void test_optionsBuilder_addWordWidth();
|
|
|
|
|
void test_optionsBuilder_headerPathOptionsOrder();
|
|
|
|
|
void test_optionsBuilder_HeaderPathOptionsOrderMsvc();
|
|
|
|
|
void test_optionsBuilder_useSystemHeader();
|
|
|
|
|
void test_optionsBuilder_noClangHeadersPath();
|
|
|
|
|
void test_optionsBuilder_clangHeadersAndCppIncludePathsOrderMacOs();
|
|
|
|
|
void test_optionsBuilder_clangHeadersAndCppIncludePathsOrderLinux();
|
|
|
|
|
void test_optionsBuilder_clangHeadersAndCppIncludePathsOrderNoVersion();
|
|
|
|
|
void test_optionsBuilder_clangHeadersAndCppIncludePathsOrderAndroidClang();
|
|
|
|
|
void test_optionsBuilder_noPrecompiledHeader();
|
|
|
|
|
void test_optionsBuilder_usePrecompiledHeader();
|
|
|
|
|
void test_optionsBuilder_usePrecompiledHeaderMsvc();
|
|
|
|
|
void test_optionsBuilder_addMacros();
|
|
|
|
|
void test_optionsBuilder_addTargetTriple();
|
|
|
|
|
void test_optionsBuilder_enableCExceptions();
|
|
|
|
|
void test_optionsBuilder_enableCxxExceptions();
|
|
|
|
|
void test_optionsBuilder_insertWrappedQtHeaders();
|
|
|
|
|
void test_optionsBuilder_insertWrappedMingwHeadersWithNonMingwToolchain();
|
|
|
|
|
void test_optionsBuilder_insertWrappedMingwHeadersWithMingwToolchain();
|
|
|
|
|
void test_optionsBuilder_setLanguageVersion();
|
|
|
|
|
void test_optionsBuilder_setLanguageVersionMsvc();
|
|
|
|
|
void test_optionsBuilder_handleLanguageExtension();
|
|
|
|
|
void test_optionsBuilder_updateLanguageVersion();
|
|
|
|
|
void test_optionsBuilder_updateLanguageVersionMsvc();
|
|
|
|
|
void test_optionsBuilder_addMsvcCompatibilityVersion();
|
|
|
|
|
void test_optionsBuilder_undefineCppLanguageFeatureMacrosForMsvc2015();
|
|
|
|
|
void test_optionsBuilder_addDefineFunctionMacrosMsvc();
|
|
|
|
|
void test_optionsBuilder_addProjectConfigFileInclude();
|
|
|
|
|
void test_optionsBuilder_addProjectConfigFileIncludeMsvc();
|
|
|
|
|
void test_optionsBuilder_noUndefineClangVersionMacrosForNewMsvc();
|
|
|
|
|
void test_optionsBuilder_undefineClangVersionMacrosForOldMsvc();
|
|
|
|
|
void test_optionsBuilder_buildAllOptions();
|
|
|
|
|
void test_optionsBuilder_buildAllOptionsMsvc();
|
|
|
|
|
void test_optionsBuilder_buildAllOptionsMsvcWithExceptions();
|
2021-07-02 16:52:13 +02:00
|
|
|
|
|
|
|
|
void test_projectPartChooser_chooseManuallySet();
|
|
|
|
|
void test_projectPartChooser_indicateManuallySet();
|
|
|
|
|
void test_projectPartChooser_indicateManuallySetForFallbackToProjectPartFromDependencies();
|
|
|
|
|
void test_projectPartChooser_doNotIndicateNotManuallySet();
|
|
|
|
|
void test_projectPartChooser_forMultipleChooseFromActiveProject();
|
|
|
|
|
void test_projectPartChooser_forMultiplePreferSelectedForBuilding();
|
|
|
|
|
void test_projectPartChooser_forMultipleFromDependenciesChooseFromActiveProject();
|
|
|
|
|
void test_projectPartChooser_forMultipleCheckIfActiveProjectChanged();
|
|
|
|
|
void test_projectPartChooser_forMultipleAndAmbigiousHeaderPreferCProjectPart();
|
|
|
|
|
void test_projectPartChooser_forMultipleAndAmbigiousHeaderPreferCxxProjectPart();
|
|
|
|
|
void test_projectPartChooser_indicateMultiple();
|
|
|
|
|
void test_projectPartChooser_indicateMultipleForFallbackToProjectPartFromDependencies();
|
|
|
|
|
void test_projectPartChooser_forMultipleChooseNewIfPreviousIsGone();
|
|
|
|
|
void test_projectPartChooser_fallbackToProjectPartFromDependencies();
|
|
|
|
|
void test_projectPartChooser_fallbackToProjectPartFromModelManager();
|
|
|
|
|
void test_projectPartChooser_continueUsingFallbackFromModelManagerIfProjectDoesNotChange();
|
|
|
|
|
void test_projectPartChooser_stopUsingFallbackFromModelManagerIfProjectChanges1();
|
|
|
|
|
void test_projectPartChooser_stopUsingFallbackFromModelManagerIfProjectChanges2();
|
|
|
|
|
void test_projectPartChooser_indicateFallbacktoProjectPartFromModelManager();
|
|
|
|
|
void test_projectPartChooser_indicateFromDependencies();
|
|
|
|
|
void test_projectPartChooser_doNotIndicateFromDependencies();
|
2021-07-14 14:44:08 +02:00
|
|
|
|
|
|
|
|
void test_projectInfoGenerator_createNoProjectPartsForEmptyFileList();
|
|
|
|
|
void test_projectInfoGenerator_createSingleProjectPart();
|
|
|
|
|
void test_projectInfoGenerator_createMultipleProjectParts();
|
|
|
|
|
void test_projectInfoGenerator_projectPartIndicatesObjectiveCExtensionsByDefault();
|
|
|
|
|
void test_projectInfoGenerator_projectPartHasLatestLanguageVersionByDefault();
|
|
|
|
|
void test_projectInfoGenerator_useMacroInspectionReportForLanguageVersion();
|
|
|
|
|
void test_projectInfoGenerator_useCompilerFlagsForLanguageExtensions();
|
|
|
|
|
void test_projectInfoGenerator_projectFileKindsMatchProjectPartVersion();
|
2021-07-19 14:03:58 +02:00
|
|
|
void test_headerPathFilter_builtin();
|
|
|
|
|
void test_headerPathFilter_system();
|
|
|
|
|
void test_headerPathFilter_user();
|
|
|
|
|
void test_headerPathFilter_noProjectPathSet();
|
|
|
|
|
void test_headerPathFilter_dontAddInvalidPath();
|
|
|
|
|
void test_headerPathFilter_clangHeadersPath();
|
|
|
|
|
void test_headerPathFilter_clangHeadersPathWitoutClangVersion();
|
|
|
|
|
void test_headerPathFilter_clangHeadersAndCppIncludesPathsOrderMacOs();
|
|
|
|
|
void test_headerPathFilter_clangHeadersAndCppIncludesPathsOrderLinux();
|
|
|
|
|
void test_headerPathFilter_removeGccInternalPaths();
|
|
|
|
|
void test_headerPathFilter_removeGccInternalPathsExceptForStandardPaths();
|
|
|
|
|
void test_headerPathFilter_clangHeadersAndCppIncludesPathsOrderNoVersion();
|
|
|
|
|
void test_headerPathFilter_clangHeadersAndCppIncludesPathsOrderAndroidClang();
|
2011-11-14 15:08:25 +01:00
|
|
|
#endif
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
2020-02-04 16:24:37 +01:00
|
|
|
CppFileSettings *fileSettings();
|
|
|
|
|
class CppToolsPluginPrivate *d = nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CppTools
|