summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolsplugin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-533/+0
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-271-2/+2
| | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppTools: Use test objects to group related test functionsChristian Kandeler2021-08-261-1/+46
| | | | | Change-Id: I9ed2ad222579f49c20c75a53c862bb7251cff28d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename FilePath::normalizePathName to normalizedPathNamehjk2021-08-231-1/+1
| | | | | Change-Id: Idf5faab1cf55d6f7cca493c8ad451825310f5d66 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CppTools: Some code cosmeticshjk2021-08-201-28/+28
| | | | | | | Namespaces, foreach. Change-Id: I0129ee1ed1f5d1625869e8b5cb6173e3f71166e1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-131-3/+3
| | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Clangd: Add per-project settingsChristian Kandeler2021-06-301-0/+9
| | | | | | | Users might want to use clangd for certain project, but not for others. Change-Id: Id29ce3349f0acd359cf7c824ece073b147ed2280 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Add dedicated settings and settings page for clangdChristian Kandeler2021-06-281-0/+4
| | | | | | | | We plan to add more clangd settings, and it makes sense to have a dedicated place for them both in the code and the UI. Change-Id: Ideb92935b7a5a6a98e07980f4011736fb82042d1 Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Change signature of MacroExpander::registerFileVariableshjk2021-06-031-1/+1
| | | | | | | | | ... to take a function returning a FilePath as base. Implementation is (not) yet changed. Change-Id: I624efab35cf38631c816b630be5296bdf696899e Reviewed-by: David Schulz <david.schulz@qt.io>
* "New Class" wizard: Check custom base class for QObject parentChristian Kandeler2021-01-251-3/+1
| | | | | | | | | | | | That is, if the user specifies a custom base class, we check whether its constructor takes a "QObject *parent" parameter, and if it does, we give the derived class one as well. This is technically a heuristic, but the pattern is pretty stable in the Qt world. Fixes: QTCREATORBUG-25156 Change-Id: Ie64440929df61cca7258d6d692c5de62970f9a65 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Don't access static functions/fields via instanceAlessandro Portale2020-11-191-1/+1
| | | | | | | Courtesy of readability-static-accessed-through-instance Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppTools: Consider .cu filesChristian Kandeler2020-10-021-6/+7
| | | | | | | | ... when switching via F4 from a .h file and vice versa. Fixes: QTCREATORBUG-24418 Change-Id: I121967dbec90125b3feed0a9d2aceb9826f925f3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Core/Utils: Migrate further to Utils::Idhjk2020-07-061-0/+1
| | | | | | | The coreplugin/id.h header is kept for downstream for now. Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Fix crash when loading pre 4.11 settingsEike Ziller2020-05-061-4/+4
| | | | | | | | | | | | | | If pre 4.11 settings are present, this might lead to updated settings being written at startup. The code that writes settings indirectly uses the CppToolsPluginPrivate instance via the "d" member of CppToolsPlugin. So this code path crashes if triggered in the constructor of CppToolsPluginPrivate, since at that point "d" cannot be assigned yet. Separate construction and initialization to avoid this. Fixes: QTCREATORBUG-23916 Change-Id: I0cb8a08bd9aa051679b71b06f569c44d2faab5a8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Make CppCodeStyleSettingsPage a plugin pimpl memberhjk2020-02-061-4/+1
| | | | | Change-Id: I75f90ddbb3cb1f2dbded16c8b6eb6d6c9bbc9f50 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Use a plugin pimpl data member for CppToolsSettingshjk2020-02-061-2/+1
| | | | | Change-Id: I05c2f8f34b88973fc916115f71c0557675396366 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Use a normal plugin pimpl member for CppModelManagerhjk2020-02-061-1/+1
| | | | | Change-Id: Id2c4b098084808070ef91de13c8338184e52141d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Use a normal plugin pimpl member for StringTablehjk2020-02-061-2/+1
| | | | | Change-Id: I2804b623b7ec03f6f4375452c9a422604468aafa Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Move CppFilesSettingsPage closer to new setuphjk2020-02-051-13/+16
| | | | | | | Including some drive-by cosmetics. Change-Id: Id9cdba68545907b099a70944c83fe17ad3c0b2a0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: Use unshared object for CppCodeModelSettingshjk2020-02-041-8/+5
| | | | | | | | | There's nothing shared here, only ever one copy. Ideally, this should be const outside CppToolsPlugin, but some settings are modified directly. Change-Id: I775b9151a244b3cc44d28bc992a041c42d234a18 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* GenericProject: Make dependency on CppTools optionalEike Ziller2019-09-131-7/+12
| | | | | | | | | | | | | Especially in the light of the language server, the generic project is currently the project one can use for language servers that require a "project workspace". Makes it possibly to run Qt Creator with "-noload CppTools" if you still want to use generic projects with some other language. Change-Id: Ib9059289a2db4c44c0c1060a02fcdafacb885fbd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-3/+3
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Export Wizard values to JavaScript macroEike Ziller2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | Registers a new function "value('name')", available to the wizard json files, which returns the value of the variable "name" as a JavaScript object. So, variables with a string value are actual JavaScript strings, booleans are booleans, lists are lists, and dictionaries are dictionaries. The patch also makes it actually possible to assign JSON lists and dictionaries to values. This removes some hacks involving creating complex JavaScript objects through string substitution. Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix quotation marksRobert Loehning2019-03-051-1/+1
| | | | | | | Change-Id: I26bd4b9e965a5313569b6e0ef6f606da57b31bff Reviewed-by: Filip Bucek <fbucek@atlas.cz> Reviewed-by: Rainer Keller <Rainer.Keller@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Wizards: Support using #pragma once instead of include guardsFilip Bucek2019-01-231-0/+10
| | | | | | | | | | | Allow users to choose #pragma once instead of #ifndef include guards in generated header files. Fixes: QTCREATORBUG-12166 Change-Id: I3ba41c7570beb9c5958e174b5581fcc25855050f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Filip Bucek <fbucek@atlas.cz>
* ClangFormat: Fix crash on exitIvan Donchevskii2018-11-121-2/+3
| | | | | | | | | Was introduced in 0e5c7f51fa with the page being deleted to remove it from the global list of pages. Change-Id: Ia13f7ab74d85b5b8c66f1b20e33d97c29ce3e8f1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppToolsPlugin: Simplify setup codehjk2018-09-101-2/+1
| | | | | Change-Id: I4d738638aa363f66b3bbfd44f866eb8fa48fa226 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* CppTools: Apply 'static' pattern to StringTablehjk2018-02-071-11/+8
| | | | | | | | This also fixes a crash on loading (some?) projects introduced in 577bf7c08a. Change-Id: Ie35d466fa3b84b183118fe93f55393a4c59755de Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppToolsPlugin: Partially pimpl and remove use of global object poolhjk2018-02-071-22/+38
| | | | | Change-Id: Iee09bf2fc7c945b8dcf950edfe94889d35c63735 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CppTools: move locators ownership to ModelManagerIvan Donchevskii2018-01-171-31/+1
| | | | | | | | | Move locator and find filters ownership and initialization to ModelManager. Initialize builtin filters by default and provide methods to set them from plugins. Change-Id: I4cc82ecff3415329a5f97b1be9dcc45e6103bf5a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Project: Make Project::files return a FileNameListTobias Hunger2017-12-081-1/+3
| | | | | Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* AutoTest: Try harder to find relevant build targetsChristian Stenger2017-09-261-9/+15
| | | | | | | | | If there are tests defined or registered inside libraries we ended up trying to execute the library or nothing at all. If possible try to find correct build targets for such cases. Change-Id: I58e9edb7f858e3e5407ece6fcb8782f5a129acd0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Drop unused variables and lambda capturesUlf Hermann2017-09-081-2/+2
| | | | | | | | | Also, add context to connect() expressions where we are or were capturing "this". Change-Id: I6e006ba6f83d532478018550d148ee93eca59605 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Utils: Wrap MimeDatabase into static functionshjk2017-03-031-7/+6
| | | | | | | | To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra all over the place. Change-Id: I4bfef62e73275a991455141671d6071162788e9d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Move mimetype definitions to plugin specsEike Ziller2017-02-271-2/+0
| | | | | | | | | | | | - Avoids the hassle of QRC files and manually registering mime types - Avoids performance regressions because of mime types that are registered after mime database has been used - Makes it technically possible to detect that a disabled plugin could handle a mime type if it was enabled Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
* CppTools: Distinguish between ProjectFile::{unclassified,unsupported}Nikolai Kosjar2017-02-021-1/+1
| | | | | | | | | There was no way to determine whether ProjectFile::classify() was run or not. Now, ProjectFile::classify() returns ProjectFile::Unsupported instead of ProjectFile::Unclassified. Change-Id: I660d0e42044bdefcac38058c6f4a3425983a6d93 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Classify ambiguous headers depending on other filesNikolai Kosjar2016-12-121-1/+1
| | | | | | | | | | | | | | This applies for all project managers, except qmake. The qmake project manager will make use of this in follow up changes. Before, "foo.h" was always recognized as a CXXHeader. Now, it depends on the other files. E.g. in a file list {"foo.h", "foo.c"} foo.h is now a CHeader. In {"foo.h", "foo.c", "bar.cpp"} the file "foo.h" is ambiguous and we will create two project parts, one where it is a CHeader, the other where it is a CXXHeader. Change-Id: I50505163368742584b1380c284d42cbe07cb4fc9 Reviewed-by: David Schulz <david.schulz@qt.io>
* CppTools: Use Qt5-style connectsOrgad Shaneh2016-05-231-2/+2
| | | | | | | Mostly done by clazy. Change-Id: I0fbbbe1a2d28b79bcb83093d608bca6e2f927ebb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Move C++ mime types from cppeditor to cpptoolsTobias Hunger2016-03-151-0/+2
| | | | | | | | Have the mimetypes and their registration in the same plugin as their constants. Change-Id: I350ab4eb0da3941ca9282ff98d8d0e158b568ef3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Remove cpptools/cppprojects.[h|cpp]Marco Bubke2016-01-131-0/+1
| | | | | Change-Id: Ida0e8552d371972c141cf561b28667f4428c6fff Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Add CppToolsBridgeMarco Bubke2016-01-121-0/+4
| | | | | | | | | | | | We broke the dependency of BaseEditorDocumentProcessor *BaseEditorDocumentProcessor::get(const QString &filePath) It's hiding static calls and it is much easier to do it that way than to provide a reference to every user. It's also possible to exchange it with different implementations for different test cases. Change-Id: Ic74699b45948e8b48f7efb6a1b295ba2641b8951 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: SwitchHeaderSource file name case sensitivityCristian Adam2015-09-231-5/+10
| | | | | | | | Make sure that on Windows the corresponding header /source file is searched using case insensitive comparisons. Change-Id: I66b06cd8a7c46b78e8ff24e11803287630f3914b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Properly delete plugins dependent on failed pluginJarek Kobus2015-06-171-1/+2
| | | | | | | | | | | | | | | | | | | Init all class member pointers to NULL. This fixes possible crash on exit when dependent plugin was not loaded (e.g. TextEditor was missing). In this case plugin's constructor gets called, initialize() method is _not_ called and destructor gets called -> crash. Properly delete dependent plugins on a plugin which failed to initialize properly. Fix labels of deleted plugins inside an error dialog after pressing "Error Details" from "Installed Plugins" dialog. Change-Id: Iddc029a0f07dcba2501d734d142fb0e69e9383d3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Clang: Use completion through backend processNikolai Kosjar2015-06-101-2/+2
| | | | | | | | | | | | | | | | This makes us independent of libclang crashes for completion. Re-parsing for highlighting still happens in the Qt Creator process. Run in verbose mode: qtc.clangcodemodel.ipc=true Run tests: -test "ClangCodeModel" Task-number: QTCREATORBUG-14108 Task-number: QTCREATORBUG-12819 Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* Clean exported headers of the CppTools plugin.Friedemann Kleint2015-03-051-0/+1
| | | | | Change-Id: I0144ac33e88980c431c54a6d69bbde28da4b1967 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Clean exported headers of the Core plugin.Friedemann Kleint2015-03-051-0/+1
| | | | | Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Clean exported headers of the TextEditor plugin.Friedemann Kleint2015-02-261-0/+1
| | | | | Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Use new mime databaseEike Ziller2015-02-171-6/+8
| | | | | Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-121-6/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6